@meldgrove/ui 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -1
- package/dist/standalone/meldgrove-updates.js +3 -3
- package/dist/updates/controller.d.ts +41 -2
- package/dist/updates/controller.js +72 -7
- package/dist/updates/state.d.ts +10 -0
- package/dist/updates/state.js +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -100,7 +100,8 @@ palette the apps used so far.
|
|
|
100
100
|
The app serves the four admin routes of the updater contract (status,
|
|
101
101
|
`check`, `install`, `channel`). The components do the rest: polling, the
|
|
102
102
|
popover, the confirmation, following an installation through the restart,
|
|
103
|
-
reloading when the new version answers, and stopping
|
|
103
|
+
reloading every page of the app when the new version answers, and stopping
|
|
104
|
+
when the session ends.
|
|
104
105
|
|
|
105
106
|
```tsx
|
|
106
107
|
import { UpdateButton, UpdatesProvider, UpdatesSettingsCard } from "@meldgrove/ui/updates";
|
|
@@ -121,6 +122,14 @@ import { UpdateButton, UpdatesProvider, UpdatesSettingsCard } from "@meldgrove/u
|
|
|
121
122
|
and `<url>/channel` (a trailing slash carries over).
|
|
122
123
|
- `project` names the updater's systemd unit in the hint after 15 minutes
|
|
123
124
|
(`journalctl -u meldgrove-updater-<project>`).
|
|
125
|
+
- No page keeps old code after an update. The page that followed the
|
|
126
|
+
installation tells the app's other pages in the browser
|
|
127
|
+
(`BroadcastChannel` `meldgrove.updates.<project>`), and they reload with
|
|
128
|
+
it. A page that missed it (asleep, in another browser, an automatic
|
|
129
|
+
install) reloads once the update service answers without an installation
|
|
130
|
+
and the app names another version than in the page's first status.
|
|
131
|
+
Unsaved input is lost on that reload, unless the app guards it with a
|
|
132
|
+
`beforeunload` handler.
|
|
124
133
|
- 401, 403, 404 (what the routes answer non-admins) and sign-in pages end
|
|
125
134
|
the session for the page: no more automatic requests. `onSignedOut(reason)`
|
|
126
135
|
lets the app react: `"signed-out"` (401 or a sign-in page; for example,
|
|
@@ -52,6 +52,6 @@ function Ln(e){let t=e+`CollectionProvider`,[n,r]=/* @__PURE__ */ En(t),[i,a]=n(
|
|
|
52
52
|
`},U=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},na=function(){_.useEffect(function(){return document.body.setAttribute(ea,(U()+1).toString()),function(){var e=U()-1;e<=0?document.body.removeAttribute(ea):document.body.setAttribute(ea,e.toString())}},[])},ra=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;na();var a=_.useMemo(function(){return Qi(i)},[i]);return _.createElement($i,{styles:ta(a,!t,i,n?``:`!important`)})},ia=!1;if(typeof window<`u`)try{var aa=Object.defineProperty({},"passive",{get:function(){return ia=!0,!0}});window.addEventListener(`test`,aa,aa),window.removeEventListener(`test`,aa,aa)}catch{ia=!1}var oa=ia?{passive:!1}:!1,sa=function(e){return e.tagName===`TEXTAREA`},ca=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!sa(e)&&n[t]===`visible`)},la=function(e){return ca(e,`overflowY`)},ua=function(e){return ca(e,`overflowX`)},da=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ma(e,r)){var i=ha(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fa=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},pa=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ma=function(e,t){return e===`v`?la(t):ua(t)},ha=function(e,t){return e===`v`?fa(t):pa(t)},ga=function(e,t){return e===`h`&&t===`rtl`?-1:1},_a=function(e,t,n,r,i){var a=ga(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=ha(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ma(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},va=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ya=function(e){return[e.deltaX,e.deltaY]},ba=function(e){return e&&`current`in e?e.current:e},xa=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Sa=function(e){return`
|
|
53
53
|
.block-interactivity-${e} {pointer-events: none;}
|
|
54
54
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
55
|
-
`},Ca=0,wa=[];function Ta(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Ca++)[0],a=_.useState(Ji)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=wi([e.lockRef.current],(e.shards||[]).map(ba),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=va(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=da(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=da(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 _a(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(wa.length&&wa[wa.length-1]===a){var r=`deltaY`in n?ya(n):va(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&xa(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(ba).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ea(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=va(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,ya(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,va(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return wa.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,oa),document.addEventListener(`touchmove`,c,oa),document.addEventListener(`touchstart`,u,oa),function(){wa=wa.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,oa),document.removeEventListener(`touchmove`,c,oa),document.removeEventListener(`touchstart`,u,oa)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Sa(i)}):null,p?_.createElement(ra,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ea(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Da=Ri(zi,Ta),Oa=_.forwardRef(function(e,t){return _.createElement(Vi,Si({},e,{ref:t,sideCar:Da}))});Oa.classNames=Vi.classNames;var ka=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Aa=/* @__PURE__ */ new WeakMap,ja=/* @__PURE__ */ new WeakMap,Ma={},Na=0,Pa=function(e){return e&&(e.host||Pa(e.parentNode))},Fa=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Pa(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})},Ia=function(e,t,n,r){var i=Fa(t,Array.isArray(e)?e:[e]);Ma[n]||(Ma[n]=/* @__PURE__ */ new WeakMap);var a=Ma[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=(Aa.get(e)||0)+1,l=(a.get(e)||0)+1;Aa.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ja.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(),Na++,function(){o.forEach(function(e){var t=Aa.get(e)-1,i=a.get(e)-1;Aa.set(e,t),a.set(e,i),t||(ja.has(e)||e.removeAttribute(r),ja.delete(e)),i||e.removeAttribute(n)}),Na--,Na||(Aa=/* @__PURE__ */ new WeakMap,Aa=/* @__PURE__ */ new WeakMap,ja=/* @__PURE__ */ new WeakMap,Ma={})}},La=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ka(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ia(r,i,n,`aria-hidden`)):function(){return null}},Ra=Object.defineProperty,za=(e,t)=>Ra(e,`name`,{value:t,configurable:!0}),Ba=`Dialog`,[Va,Ha]=/* @__PURE__ */ En(Ba),[Ua,Wa]=Va(Ba),Ga=/* @__PURE__ */ za(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),{nodes:l,registry:u}=ei(),[d,f]=ir({prop:r,defaultProp:i??!1,onChange:a,caller:Ba}),[p,m]=_.useState(0),[h,g]=_.useState(0);return/* @__PURE__ */ (0,F.jsx)(Ua,{scope:t,triggerRef:s,contentRef:c,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Ka=`DialogTrigger`,qa=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(Ka,n),a=Yt(t,i.triggerRef);return/* @__PURE__ */ (0,F.jsx)(_n.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":po(i.open),...r,ref:a,onClick:H(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Ja=`DialogPortal`,[Ya,Xa]=Va(Ja,{forceMount:void 0}),Za=/* @__PURE__ */ za(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Wa(Ja,t);return/* @__PURE__ */ (0,F.jsx)(Ya,{scope:t,forceMount:n,children:_.Children.map(r,e=>/* @__PURE__ */ (0,F.jsx)(fr,{present:n||a.open,children:/* @__PURE__ */ (0,F.jsx)(mi,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Qa=`DialogOverlay`,$a=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let n=Xa(Qa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wa(Qa,e.__scopeDialog);return a.modal?/* @__PURE__ */ (0,F.jsx)(fr,{present:r||a.open,children:/* @__PURE__ */ (0,F.jsx)(to,{...i,ref:t})}):null},`DialogOverlay`)),eo=/* @__PURE__ */ Qt(`DialogOverlay.RemoveScroll`),to=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(Qa,n),a=Yt(t,Br());return/* @__PURE__ */ (0,F.jsx)(Oa,{as:eo,allowPinchZoom:!0,shards:_.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:/* @__PURE__ */ (0,F.jsx)(_n.div,{"data-state":po(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),no=`DialogContent`,ro=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let n=Xa(no,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wa(no,e.__scopeDialog);return/* @__PURE__ */ (0,F.jsx)(fr,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,F.jsx)(io,{...i,ref:t}):/* @__PURE__ */ (0,F.jsx)(ao,{...i,ref:t})})},`DialogContent`)),io=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let n=Wa(no,e.__scopeDialog),r=_.useRef(null),i=Yt(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return La(e)},[]),/* @__PURE__ */ (0,F.jsx)(oo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:H(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:H(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ao=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let n=Wa(no,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return/* @__PURE__ */ (0,F.jsx)(oo,{...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`)),oo=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Wa(no,n);return bi(),/* @__PURE__ */ (0,F.jsx)($r,{registry:l.branchRegistry,children:/* @__PURE__ */ (0,F.jsx)(Zr,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,F.jsx)(zr,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?fo(o,l.descriptionId):o,"data-state":po(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),so=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(`DialogTitle`,n),{setTitleCount:a}=i;return On(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,F.jsx)(_n.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),co=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(`DialogDescription`,n),{setDescriptionCount:a}=i;return On(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,F.jsx)(_n.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),lo=`DialogClose`,uo=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(lo,n);return/* @__PURE__ */ (0,F.jsx)(_n.button,{type:`button`,...r,ref:t,onClick:H(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function fo(...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}za(fo,`concatAriaDescribedby`);function po(e){return e?`open`:`closed`}za(po,`getState`);var mo=Object.defineProperty,ho=(e,t)=>mo(e,`name`,{value:t,configurable:!0}),[go,_o]=/* @__PURE__ */ En(`AlertDialog`,[Ha]),vo=Ha(),yo=/* @__PURE__ */ ho(e=>{let{__scopeAlertDialog:t,...n}=e,r=vo(t);return/* @__PURE__ */ (0,F.jsx)(Ga,{...r,...n,modal:!0})},`AlertDialog`);_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)(qa,{...i,...r,ref:t})},`AlertDialogTrigger`));var bo=/* @__PURE__ */ ho(e=>{let{__scopeAlertDialog:t,...n}=e,r=vo(t);return/* @__PURE__ */ (0,F.jsx)(Za,{...r,...n})},`AlertDialogPortal`),xo=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)($a,{...i,...r,ref:t})},`AlertDialogOverlay`)),[So,Co]=go(`AlertDialogContent`),wo=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=vo(n),o=Yt(t,_.useRef(null)),s=_.useRef(null);return/* @__PURE__ */ (0,F.jsx)(So,{scope:n,cancelRef:s,children:/* @__PURE__ */ (0,F.jsx)(ro,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:H(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),To=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)(so,{...i,...r,ref:t})},`AlertDialogTitle`)),Eo=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)(co,{...i,...r,ref:t})},`AlertDialogDescription`)),Do=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)(uo,{...i,...r,ref:t})},`AlertDialogAction`)),Oo=`AlertDialogCancel`,ko=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Co(Oo,n),a=vo(n),o=Yt(t,i);return/* @__PURE__ */ (0,F.jsx)(uo,{...a,...r,ref:o})},`AlertDialogCancel`)),Ao=Object.defineProperty,jo=(e,t)=>Ao(e,`name`,{value:t,configurable:!0});function Mo(e){let[t,n]=_.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}jo(Mo,`useSize`);var No=[`top`,`right`,`bottom`,`left`],Po=Math.min,Fo=Math.max,Io=Math.round,Lo=Math.floor,Ro=e=>({x:e,y:e}),zo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function W(e,t,n){return Fo(e,Po(t,n))}function G(e,t){return typeof e==`function`?e(t):e}function Bo(e){return e.split(`-`)[0]}function Vo(e){return e.split(`-`)[1]}function Ho(e){return e===`x`?`y`:`x`}function Uo(e){return e===`y`?`height`:`width`}function Wo(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Go(e){return Ho(Wo(e))}function Ko(e,t,n){n===void 0&&(n=!1);let r=Vo(e),i=Go(e),a=Uo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ts(o)),[o,ts(o)]}function qo(e){let t=ts(e);return[Jo(e),t,Jo(t)]}function Jo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Yo=[`left`,`right`],Xo=[`right`,`left`],Zo=[`top`,`bottom`],Qo=[`bottom`,`top`];function $o(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xo:Yo:t?Yo:Xo;case`left`:case`right`:return t?Zo:Qo;default:return[]}}function es(e,t,n,r){let i=Vo(e),a=$o(Bo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Jo)))),a}function ts(e){let t=Bo(e);return zo[t]+e.slice(t.length)}function ns(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ns(e)}function is(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function as(e,t,n){let{reference:r,floating:i}=e,a=Wo(t),o=Go(t),s=Uo(o),c=Bo(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Vo(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function os(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=G(t,e),p=rs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=is(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=is(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ss=50,cs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:os},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=as(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ss&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=as(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ls=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=G(e,t)||{};if(l==null)return{};let d=rs(u),f={x:n,y:r},p=Go(i),m=Uo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Po(d[_],T),E=Po(d[v],T),D=C-h[m]-E,O=C/2-h[m]/2+w,te=W(ee,O,D),k=!c.arrow&&Vo(i)!=null&&O!==te&&a.reference[m]/2-(O<ee?ee:E)-h[m]/2<0,A=k?O<ee?O-ee:O-D:0;return{[p]:f[p]+A,data:{[p]:te,centerOffset:O-te-A,...k&&{alignmentOffset:A}},reset:k}}}),us=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=G(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bo(r),_=Wo(o),v=Bo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ts(o)]:qo(o)),x=p!==`none`;!d&&x&&b.push(...es(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ko(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wo(t)||T.every(e=>Wo(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ds(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fs(e){return No.some(t=>e[t]>=0)}var ps=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=G(e,t);switch(i){case`referenceHidden`:{let e=ds(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fs(e)}}}case`escaped`:{let e=ds(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:fs(e)}}}default:return{}}}}},ms=/*#__PURE__*/ new Set([`left`,`top`]);async function hs(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bo(n),s=Vo(n),c=Wo(n)===`y`,l=ms.has(o)?-1:1,u=a&&c?-1:1,d=G(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var gs=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await hs(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_s=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=G(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wo(i),p=Ho(f),m=u[p],h=u[f],g=(e,t)=>W(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},vs=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=G(e,t),u={x:n,y:r},d=Wo(i),f=Ho(d),p=u[f],m=u[d],h=G(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ms.has(Bo(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ys=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=G(e,t),c=await i.detectOverflow(t,s),l=Bo(n),u=Vo(n),d=Wo(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Po(p-c[m],g),y=Po(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Fo(c.left,c.right):S=p-2*Fo(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function bs(){return typeof window<`u`}function xs(e){return ws(e)?(e.nodeName||``).toLowerCase():`#document`}function Ss(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cs(e){return((ws(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ws(e){return bs()?e instanceof Node||e instanceof Ss(e).Node:!1}function Ts(e){return bs()?e instanceof Element||e instanceof Ss(e).Element:!1}function Es(e){return bs()?e instanceof HTMLElement||e instanceof Ss(e).HTMLElement:!1}function Ds(e){return!bs()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ss(e).ShadowRoot}function Os(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=zs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ks(e){return/^(table|td|th)$/.test(xs(e))}function As(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var js=/transform|translate|scale|rotate|perspective|filter/,Ms=/paint|layout|strict|content/,Ns=e=>!!e&&e!==`none`,Ps;function Fs(e){let t=Ts(e)?zs(e):e;return Ns(t.transform)||Ns(t.translate)||Ns(t.scale)||Ns(t.rotate)||Ns(t.perspective)||!Ls()&&(Ns(t.backdropFilter)||Ns(t.filter))||js.test(t.willChange||``)||Ms.test(t.contain||``)}function Is(e){let t=Vs(e);for(;Es(t)&&!Rs(t);){if(Fs(t))return t;if(As(t))return null;t=Vs(t)}return null}function Ls(){return Ps??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ps}function Rs(e){return/^(html|body|#document)$/.test(xs(e))}function zs(e){return Ss(e).getComputedStyle(e)}function Bs(e){return Ts(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vs(e){if(xs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ds(e)&&e.host||Cs(e);return Ds(t)?t.host:t}function Hs(e){let t=Vs(e);return Rs(t)?(e.ownerDocument||e).body:Es(t)&&Os(t)?t:Hs(t)}function Us(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Hs(e),i=r===e.ownerDocument?.body,a=Ss(r);if(i){let e=Ws(a);return t.concat(a,a.visualViewport||[],Os(r)?r:[],e&&n?Us(e):[])}return t.concat(r,Us(r,[],n))}function Ws(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(e){let t=zs(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Es(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Io(n)!==a||Io(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ks(e){return Ts(e)?e:e.contextElement}function qs(e){let t=Ks(e);if(!Es(t))return Ro(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gs(t),o=(a?Io(n.width):n.width)/r,s=(a?Io(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Js=/*#__PURE__*/ Ro(0);function Ys(e){let t=Ss(e);return!Ls()||!t.visualViewport?Js:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ss(e)}function Zs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ks(e),o=Ro(1);t&&(r?Ts(r)&&(o=qs(r)):o=qs(e));let s=Xs(a,n,r)?Ys(a):Ro(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ss(a),t=Ts(r)?Ss(r):r,n=e,i=Ws(n);for(;i&&t!==n;){let e=qs(i),t=i.getBoundingClientRect(),r=zs(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ss(i),i=Ws(n)}}return is({width:u,height:d,x:c,y:l})}function Qs(e,t){let n=Bs(e).scrollLeft;return t?t.left+n:Zs(Cs(e)).left+n}function $s(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qs(e,n),y:n.top+t.scrollTop}}function ec(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Cs(r),s=t?As(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ro(1),u=Ro(0),d=Es(r);if((d||!a)&&((xs(r)!==`body`||Os(o))&&(c=Bs(r)),d)){let e=Zs(r);l=qs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$s(o,c):Ro(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function tc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function nc(e){let t=Bs(e),n=e.ownerDocument.body,r=Fo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Fo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Qs(e),o=-t.scrollTop;return zs(n).direction===`rtl`&&(a+=Fo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var rc=25;function ic(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ss(e),a=Cs(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ls()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Qs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=rc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ac(e,t){let n=Zs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=qs(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function oc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ic(e,n,t);else if(t===`document`)r=nc(Cs(e));else if(Ts(t))r=ac(t,n);else{let n=Ys(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return is(r)}function sc(e,t){let n=t.get(e);if(n)return n;let r=Us(e,[],!1).filter(e=>Ts(e)&&xs(e)!==`body`),i=null,a=zs(e).position===`fixed`,o=a?Vs(e):e;for(;Ts(o)&&!Rs(o);){let e=zs(o),t=Fs(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Vs(o)}return t.set(e,r),r}function cc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?As(t)?[]:sc(t,this._c):[].concat(n),r],o=oc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=oc(t,a[e],i);s=Fo(n.top,s),c=Po(n.right,c),l=Po(n.bottom,l),u=Fo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function lc(e){let{width:t,height:n}=Gs(e);return{width:t,height:n}}function uc(e,t,n){let r=Es(t),i=Cs(t),a=n===`fixed`,o=Zs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ro(0);if((r||!a)&&((xs(t)!==`body`||Os(i))&&(s=Bs(t)),r)){let e=Zs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Qs(i));let l=i&&!r&&!a?$s(i,s):Ro(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function dc(e){return zs(e).position===`static`}function fc(e,t){if(!Es(e)||zs(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Cs(e)===n&&(n=n.ownerDocument.body),n}function pc(e,t){let n=Ss(e);if(As(e))return n;if(!Es(e)){let t=Vs(e);for(;t&&!Rs(t);){if(Ts(t)&&!dc(t))return t;t=Vs(t)}return n}let r=fc(e,t);for(;r&&ks(r)&&dc(r);)r=fc(r,t);return r&&Rs(r)&&dc(r)&&!Fs(r)?n:r||Is(e)||n}var mc=async function(e){let t=this.getOffsetParent||pc,n=this.getDimensions,r=await n(e.floating);return{reference:uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hc(e){return zs(e).direction===`rtl`}var gc={convertOffsetParentRelativeRectToViewportRelativeRect:ec,getDocumentElement:Cs,getClippingRect:cc,getOffsetParent:pc,getElementRects:mc,getClientRects:tc,getDimensions:lc,getScale:qs,isElement:Ts,isRTL:hc};function _c(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vc(e,t,n){let r=null,i,a=Cs(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Lo(d),h=Lo(a.clientWidth-(u+f)),g=Lo(a.clientHeight-(d+p)),_=Lo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fo(0,Po(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_c(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ss(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ks(e),u=i||a?[...l?Us(l):[],...t?Us(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zs(e):null;c&&g();function g(){let t=Zs(e);h&&!_c(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bc=gs,xc=_s,Sc=us,Cc=ys,wc=ps,Tc=ls,Ec=vs,Dc=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i=n??{},a={...gc,...i.platform,_c:r};return cs(e,t,{...i,platform:a})},Oc=typeof document<`u`?_.useLayoutEffect:function(){};function kc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!kc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!kc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ac(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jc(e,t){let n=Ac(e);return Math.round(t*n)/n}function Mc(e){let t=_.useRef(e);return Oc(()=>{t.current=e}),t}function Nc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);kc(f,r)||p(r);let[m,h]=_.useState(null),[g,y]=_.useState(null),b=_.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=_.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||m,C=o||g,w=_.useRef(null),T=_.useRef(null),ee=_.useRef(u),E=c!=null,D=Mc(c),O=Mc(i),te=Mc(l),k=_.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Dc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};A.current&&!kc(ee.current,t)&&(ee.current=t,v.flushSync(()=>{d(t)}))})},[f,t,n,O,te]);Oc(()=>{l===!1&&ee.current.isPositioned&&(ee.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=_.useRef(!1);Oc(()=>(A.current=!0,()=>{A.current=!1}),[]),Oc(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(D.current)return D.current(S,C,k);k()}},[S,C,k,D,E]);let ne=_.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),re=_.useMemo(()=>({reference:S,floating:C}),[S,C]),j=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!re.floating)return e;let t=jc(re.floating,u.x),r=jc(re.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ac(re.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,re.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:k,refs:ne,elements:re,floatingStyles:j}),[u,k,ne,re,j])}var Pc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Tc({element:r.current,padding:i}).fn(n):r?Tc({element:r,padding:i}).fn(n):{}}}},Fc=(e,t)=>{let n=bc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ic=(e,t)=>{let n=xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lc=(e,t)=>({fn:Ec(e).fn,options:[e,t]}),Rc=(e,t)=>{let n=Sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},zc=(e,t)=>{let n=Cc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bc=(e,t)=>{let n=wc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vc=(e,t)=>{let n=Pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hc=Object.defineProperty,Uc=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ ((e,t)=>Hc(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return/* @__PURE__ */ (0,F.jsx)(_n.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:/* @__PURE__ */ (0,F.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Wc=Object.defineProperty,Gc=(e,t)=>Wc(e,`name`,{value:t,configurable:!0}),Kc={Partial:`partial`,Always:`always`},qc={Optimized:`optimized`,Always:`always`},Jc=`Popper`,[Yc,Xc]=/* @__PURE__ */ En(Jc),[Zc,Qc]=Yc(Jc),$c=/* @__PURE__ */ Gc(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return/* @__PURE__ */ (0,F.jsx)(Zc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),el=`PopperAnchor`,tl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Gc(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Qc(el,n),o=_.useRef(null),s=a.onAnchorChange,c=Yt(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&dl(a.placementState),d=u?.[0],f=u?.[1];return r?null:/* @__PURE__ */ (0,F.jsx)(_n.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),nl=`PopperContent`,[rl,il]=Yc(nl),al=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Gc(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=Kc.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=qc.Optimized,onPlaced:m,...h}=e,g=Qc(nl,n),[v,y]=_.useState(null),b=Yt(t,y),[x,S]=_.useState(null),C=Mo(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,te={padding:E,boundary:D.filter(ll),altBoundary:O},{refs:k,floatingStyles:A,placement:ne,isPositioned:re,middlewareData:j}=Nc({strategy:`fixed`,placement:ee,whileElementsMounted:/* @__PURE__ */ Gc((...e)=>yc(...e,{animationFrame:p===qc.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Fc({mainAxis:i+T,alignmentAxis:o}),c&&Ic({mainAxis:!0,crossAxis:!1,...d===Kc.Partial?{limiter:Lc()}:{},...te}),c&&Rc({...te}),zc({...te,apply:/* @__PURE__ */ Gc(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Vc({element:x,padding:s}),ul({arrowWidth:w,arrowHeight:T}),f&&Bc(O?{strategy:`referenceHidden`,...te}:{strategy:`referenceHidden`,padding:te.padding,altBoundary:te.altBoundary})]}),M=g.setPlacementState;On(()=>(M(ne),()=>{M(void 0)}),[ne,M]);let[ie,ae]=dl(ne),oe=jr(m);On(()=>{re&&oe?.()},[re,oe]);let se=j.arrow?.x,ce=j.arrow?.y,le=j.arrow?.centerOffset!==0,[ue,de]=_.useState();return On(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),/* @__PURE__ */ (0,F.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...A,transform:re?A.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(` `),...j.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:/* @__PURE__ */ (0,F.jsx)(rl,{scope:n,placedSide:ie,placedAlign:ae,onArrowChange:S,arrowX:se,arrowY:ce,shouldHideArrow:le,children:/* @__PURE__ */ (0,F.jsx)(_n.div,{"data-side":ie,"data-align":ae,...h,ref:b,style:{...h.style,animation:re?h.style?.animation:`none`}})})})},`PopperContent`)),ol=`PopperArrow`,sl={top:`bottom`,right:`left`,bottom:`top`,left:`right`},cl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Gc(function(e,t){let{__scopePopper:n,...r}=e,i=il(ol,n),a=sl[i.placedSide];return/* @__PURE__ */ (0,F.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:/* @__PURE__ */ (0,F.jsx)(Uc,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function ll(e){return e!==null}Gc(ll,`isNotNull`);var ul=/* @__PURE__ */ Gc(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=dl(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function dl(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Gc(dl,`getSideAndAlignFromPlacement`);var fl=Object.defineProperty,pl=(e,t)=>fl(e,`name`,{value:t,configurable:!0}),ml=!1;function hl(){let[e,t]=_.useState(ml);return _.useEffect(()=>{ml||(ml=!0,t(!0))},[]),e}pl(hl,`useIsHydrated`);var gl=_.useSyncExternalStore;function _l(){return()=>{}}pl(_l,`subscribe`);function vl(){return gl(_l,()=>!0,()=>!1)}pl(vl,`useIsHydratedModern`);var yl=typeof gl==`function`?vl:hl,bl=Object.defineProperty,xl=(e,t)=>bl(e,`name`,{value:t,configurable:!0}),Sl=`rovingFocusGroup.onEntryFocus`,Cl={bubbles:!1,cancelable:!0},wl=`RovingFocusGroup`,[Tl,El,Dl]=/* @__PURE__ */ jn(wl),[Ol,kl]=/* @__PURE__ */ En(wl,[Dl]),Al={Vertical:`vertical`,Horizontal:`horizontal`},jl={LTR:`ltr`,RTL:`rtl`},[Ml,Nl]=Ol(wl),Pl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ xl(function(e,t){return/* @__PURE__ */ (0,F.jsx)(Tl.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,F.jsx)(Tl.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,F.jsx)(Fl,{...e,ref:t})})})},`RovingFocusGroup`)),Fl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ xl(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=_.useRef(null),p=Yt(t,f),m=Dr(a),[h,g]=ir({prop:o,defaultProp:s??null,onChange:c,caller:wl}),[v,y]=_.useState(!1),b=jr(l),x=El(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Sl,b),()=>e.removeEventListener(Sl,b)},[b]),/* @__PURE__ */ (0,F.jsx)(Ml,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:/* @__PURE__ */ (0,F.jsx)(_n.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:H(e.onMouseDown,()=>{S.current=!0}),onFocus:H(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Sl,Cl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Vl([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Il=`RovingFocusGroupItem`,Ll=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ xl(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Sr(),l=a||c,u=Nl(Il,n),d=u.currentTabStopId===l,f=El(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=yl();return On(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),_.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),/* @__PURE__ */ (0,F.jsx)(Tl.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:/* @__PURE__ */ (0,F.jsx)(_n.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:H(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:H(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bl(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().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?Hl(n,r+1):n.slice(r+1)}setTimeout(()=>Vl(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Rl={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zl(e,t){return t===jl.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}xl(zl,`getDirectionAwareKey`);function Bl(e,t,n){let r=zl(e.key,n);if(!(t===Al.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Al.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rl[r]}xl(Bl,`getFocusIntent`);function Vl(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}xl(Vl,`focusFirst`);function Hl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xl(Hl,`wrapArray`);var Ul=Object.defineProperty,Wl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ ((e,t)=>Ul(e,`name`,{value:t,configurable:!0}))(function(e,t){return/* @__PURE__ */ (0,F.jsx)(_n.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Gl=Object.defineProperty,Kl=(e,t)=>Gl(e,`name`,{value:t,configurable:!0}),ql=`Popover`,[Jl,Yl]=/* @__PURE__ */ En(ql,[Xc]),Xl=Xc(),[Zl,Ql]=Jl(ql),$l=/* @__PURE__ */ Kl(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Xl(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=_.useState(0),[p,m]=_.useState(0),[h,g]=ir({prop:r,defaultProp:i??!1,onChange:a,caller:ql});return/* @__PURE__ */ (0,F.jsx)($c,{...s,children:/* @__PURE__ */ (0,F.jsx)(Zl,{scope:t,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:_.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),eu=`PopoverTrigger`,tu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(function(e,t){let{__scopePopover:n,...r}=e,i=Ql(eu,n),a=Xl(n),o=Yt(t,i.triggerRef),s=/* @__PURE__ */ (0,F.jsx)(_n.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":du(i.open),...r,ref:o,onClick:H(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:/* @__PURE__ */ (0,F.jsx)(tl,{asChild:!0,...a,children:s})},`PopoverTrigger`)),nu=`PopoverPortal`,[ru,K]=Jl(nu,{forceMount:void 0}),iu=/* @__PURE__ */ Kl(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Ql(nu,t);return/* @__PURE__ */ (0,F.jsx)(ru,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,F.jsx)(fr,{present:n||a.open,children:/* @__PURE__ */ (0,F.jsx)(mi,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),au=`PopoverContent`,ou=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(function(e,t){let n=K(au,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Ql(au,e.__scopePopover);return/* @__PURE__ */ (0,F.jsx)(fr,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,F.jsx)(cu,{...i,ref:t}):/* @__PURE__ */ (0,F.jsx)(lu,{...i,ref:t})})},`PopoverContent`)),su=/* @__PURE__ */ Qt(`PopoverContent.RemoveScroll`),cu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(function(e,t){let n=Ql(au,e.__scopePopover),r=_.useRef(null),i=Yt(t,r),a=_.useRef(!1),{nodes:o,registry:s}=ei();return _.useEffect(()=>{let e=r.current;if(e)return La(e)},[]),/* @__PURE__ */ (0,F.jsx)(Oa,{as:su,allowPinchZoom:!0,shards:_.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:/* @__PURE__ */ (0,F.jsx)(uu,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:H(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:H(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),lu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(function(e,t){let n=Ql(au,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return/* @__PURE__ */ (0,F.jsx)(uu,{...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`)),uu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(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=Ql(au,n),g=Xl(n),[v,y]=_.useState(null),b=Yt(t,y);return ti(v),bi(),/* @__PURE__ */ (0,F.jsx)($r,{registry:p,children:/* @__PURE__ */ (0,F.jsx)(Zr,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,F.jsx)(zr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ (0,F.jsx)(al,{"data-state":du(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?fu(d,h.descriptionId):d,...g,...m,ref:b,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 du(e){return e?`open`:`closed`}Kl(du,`getState`);function fu(...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}Kl(fu,`concatAriaDescribedby`);var pu=Object.defineProperty,mu=(e,t)=>pu(e,`name`,{value:t,configurable:!0}),hu=`Radio`,[gu,_u]=/* @__PURE__ */ En(hu),[vu,yu]=gu(hu);function bu(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:i,form:a,name:o,onCheck:s,required:c,value:l=`on`,internal_do_not_use_render:u}=e,[d,f]=_.useState(null),[p,m]=_.useState(null),[h,g]=_.useState(null),v={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:f,userClick:h,onUserClick:g,isFormControl:!d||!!a||!!d.closest(`form`),bubbleInput:p,setBubbleInput:m,onCheck:/* @__PURE__ */ mu(()=>s?.(),`onCheck`)};return/* @__PURE__ */ (0,F.jsx)(vu,{scope:t,...v,children:Du(u)?u(v):r})}mu(bu,`RadioProvider`);var xu=`RadioTrigger`,Su=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function({__scopeRadio:e,onClick:t,...n},r){let{checked:i,disabled:a,value:o,setControl:s,onCheck:c,onUserClick:l,isFormControl:u,bubbleInput:d}=yu(xu,e),f=Yt(r,s);return/* @__PURE__ */ (0,F.jsx)(_n.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":Ou(i),"data-disabled":a?``:void 0,disabled:a,value:o,...n,ref:f,onClick:H(t,e=>{let t=e.isPropagationStopped();i||(l({hasConsumerStoppedPropagation:t}),c()),d&&u&&(t||e.stopPropagation())})})},`RadioTrigger`)),Cu=`RadioIndicator`,wu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadio:n,forceMount:r,...i}=e,a=yu(Cu,n);return/* @__PURE__ */ (0,F.jsx)(fr,{present:r||a.checked,children:/* @__PURE__ */ (0,F.jsx)(_n.span,{"data-state":Ou(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})},`RadioIndicator`)),Tu=`RadioBubbleInput`,Eu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function({__scopeRadio:e,onClick:t,...n},r){let{control:i,checked:a,required:o,disabled:s,name:c,value:l,form:u,bubbleInput:d,setBubbleInput:f,userClick:p}=yu(Tu,e),m=Yt(r,f),h=Mo(i),g=_.useRef(!1),v=_.useRef(a),y=_.useRef(p),b=_.useRef(null);_.useEffect(()=>{let e=d;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=v.current!==a;v.current=a;let i=p!==null&&p!==y.current;if(y.current=p,i)b.current=r?null:p,r&&n.call(e,a),e.dispatchEvent(new Event(`click`,{bubbles:!p.hasConsumerStoppedPropagation}));else if(r){let t=b.current;b.current=null;let r=a&&t!==null;g.current=!0,n.call(e,a),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),g.current=!1}},[d,a,p]);let x=_.useRef(a);return/* @__PURE__ */ (0,F.jsx)(_n.input,{type:`radio`,"aria-hidden":!0,defaultChecked:x.current,required:o,disabled:s,name:c,value:l,form:u,...n,tabIndex:-1,ref:m,onClick:H(t,e=>{g.current&&e.stopPropagation()}),style:{...n.style,...h,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function Du(e){return typeof e==`function`}mu(Du,`isFunction`);function Ou(e){return e?`checked`:`unchecked`}mu(Ou,`getState`);var ku=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Au=`RadioGroup`,[ju,Mu]=/* @__PURE__ */ En(Au,[kl,_u]),Nu=kl(),Pu=_u(),[Fu,Iu]=ju(Au),Lu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,name:r,form:i,defaultValue:a,value:o,required:s=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,m=Nu(n),h=Dr(u),[g,v]=ir({prop:o,defaultProp:a??null,onChange:f,caller:Au}),[y,b]=_.useState(null),x=Yt(t,b),S=_.useRef(g);return _.useEffect(()=>{let e=i?y?.ownerDocument.getElementById(i):y?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ mu(()=>v(S.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[y,i,v]),/* @__PURE__ */ (0,F.jsx)(Fu,{scope:n,name:r,form:i,required:s,disabled:c,value:g,onValueChange:v,children:/* @__PURE__ */ (0,F.jsx)(Pl,{asChild:!0,...m,orientation:l,dir:h,loop:d,children:/* @__PURE__ */ (0,F.jsx)(_n.div,{role:`radiogroup`,"aria-required":s,"aria-orientation":l,"data-disabled":c?``:void 0,dir:h,...p,ref:x})})})},`RadioGroup`)),Ru=`RadioGroupItemProvider`,zu=`RadioGroupItemTrigger`;function Bu(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=Iu(Ru,t),s=Pu(t),c=o.disabled||r;return/* @__PURE__ */ (0,F.jsx)(bu,{...s,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:a,children:i})}mu(Bu,`RadioGroupItemProvider`);var Vu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=Nu(n),a=Pu(n),{checked:o,disabled:s}=yu(zu,a.__scopeRadio),c=_.useRef(null),l=Yt(t,c),u=_.useRef(!1);return _.useEffect(()=>{let e=/* @__PURE__ */ mu(e=>{ku.includes(e.key)&&(u.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ mu(()=>u.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ (0,F.jsx)(Ll,{asChild:!0,...i,focusable:!s,active:o,children:/* @__PURE__ */ (0,F.jsx)(Su,{...a,...r,ref:l,onKeyDown:H(r.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:H(r.onFocus,()=>{u.current&&c.current?.click()})})})},`RadioGroupItemTrigger`)),Hu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return/* @__PURE__ */ (0,F.jsx)(Bu,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Vu,{...a,ref:t,__scopeRadioGroup:n}),e&&/* @__PURE__ */ (0,F.jsx)(Uu,{__scopeRadioGroup:n})]})})},`RadioGroupItem`)),Uu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=Pu(n);return/* @__PURE__ */ (0,F.jsx)(Eu,{...i,...r,ref:t})},`RadioGroupItemBubbleInput`)),Wu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=Pu(n);return/* @__PURE__ */ (0,F.jsx)(wu,{...i,...r,ref:t})},`RadioGroupIndicator`)),Gu=Object.defineProperty,Ku=(e,t)=>Gu(e,`name`,{value:t,configurable:!0}),[qu,Ju]=/* @__PURE__ */ En(`Tooltip`,[Xc]),Yu=Xc(),Xu=`TooltipProvider`,Zu=700,Qu=`tooltip.open`,[q,J]=qu(Xu),Y=/* @__PURE__ */ Ku(e=>{let{__scopeTooltip:t,delayDuration:n=Zu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),/* @__PURE__ */ (0,F.jsx)(q,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),X=`Tooltip`,[Z,$u]=qu(X),ed=/* @__PURE__ */ Ku(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=J(X,e.__scopeTooltip),l=Yu(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=Sr(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=ir({prop:r,defaultProp:i??!1,onChange:/* @__PURE__ */ Ku(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Qu))):c.onClose(),a?.(e)},`onChange`),caller:X}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let ee=f??m;return/* @__PURE__ */ (0,F.jsx)($c,{...l,children:/* @__PURE__ */ (0,F.jsx)(Z,{scope:t,contentId:ee,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),td=`TooltipTrigger`,nd=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=$u(td,n),o=J(td,n),s=Yu(n),c=Yt(t,_.useRef(null),a.onTriggerChange),l=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),/* @__PURE__ */ (0,F.jsx)(tl,{asChild:!0,...s,children:/* @__PURE__ */ (0,F.jsx)(_n.button,{"aria-describedby":a.open?yd(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:H(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:H(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:H(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:H(e.onBlur,a.onClose),onClick:H(e.onClick,a.onClose)})})},`TooltipTrigger`)),rd=`TooltipPortal`,[id,ad]=qu(rd,{forceMount:void 0}),od=/* @__PURE__ */ Ku(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=$u(rd,t);return/* @__PURE__ */ (0,F.jsx)(id,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,F.jsx)(fr,{present:n||a.open,children:/* @__PURE__ */ (0,F.jsx)(mi,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),sd=`TooltipContent`,cd=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let n=ad(sd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=$u(sd,e.__scopeTooltip);return/* @__PURE__ */ (0,F.jsx)(fr,{present:r||o.open,children:o.disableHoverableContent?/* @__PURE__ */ (0,F.jsx)(dd,{side:i,...a,ref:t}):/* @__PURE__ */ (0,F.jsx)(ld,{side:i,...a,ref:t})})},`TooltipContent`)),ld=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let n=$u(sd,e.__scopeTooltip),r=J(sd,e.__scopeTooltip),i=_.useRef(null),a=Yt(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=md(r,pd(r,n.getBoundingClientRect())),a=hd(t.getBoundingClientRect()),o=_d([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=/* @__PURE__ */ Ku(e=>p(e,u),`handleTriggerLeave`),t=/* @__PURE__ */ Ku(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=/* @__PURE__ */ Ku(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!gd(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),/* @__PURE__ */ (0,F.jsx)(dd,{...e,ref:a})},`TooltipContentHoverable`)),ud=/* @__PURE__ */ tn(`TooltipContent`),dd=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=$u(sd,n),u=Yu(n),{onClose:d}=l,[f,p]=_.useState(null),m=Yt(t,p);ti(f),_.useEffect(()=>(document.addEventListener(Qu,d),()=>document.removeEventListener(Qu,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=/* @__PURE__ */ Ku(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return On(()=>(h(a),()=>{h(void 0)}),[a,h]),/* @__PURE__ */ (0,F.jsx)(zr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:/* @__PURE__ */ (0,F.jsxs)(al,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[/* @__PURE__ */ (0,F.jsx)(ud,{children:r}),i?/* @__PURE__ */ (0,F.jsx)(Sn,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),fd=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let{__scopeTooltip:n,...r}=e,i=Yu(n);return/* @__PURE__ */ (0,F.jsx)(cl,{...i,...r,ref:t})},`TooltipArrow`));function pd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Ku(pd,`getExitSideFromRect`);function md(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Ku(md,`getPaddedExitPoints`);function hd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Ku(hd,`getPointsFromRect`);function gd(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}Ku(gd,`isPointInPolygon`);function _d(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),vd(t)}Ku(_d,`getHull`);function vd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ku(vd,`getHullPresorted`);function yd(...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}Ku(yd,`concatAriaDescribedby`);var bd=(0,_.createContext)(null);function xd(e){return/* @__PURE__ */ (0,F.jsx)(bd.Provider,{value:e.container,children:e.children})}function Sd(){return(0,_.useContext)(bd)??void 0}function Cd({delayDuration:e=0,...t}){return/* @__PURE__ */ (0,F.jsx)(Y,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function wd({...e}){return/* @__PURE__ */ (0,F.jsx)(ed,{"data-slot":`tooltip`,...e})}function Td({...e}){return/* @__PURE__ */ (0,F.jsx)(nd,{"data-slot":`tooltip-trigger`,...e})}function Ed({className:e,sideOffset:t=0,children:n,...r}){return/* @__PURE__ */ (0,F.jsx)(od,{container:Sd(),children:/* @__PURE__ */ (0,F.jsxs)(cd,{"data-slot":`tooltip-content`,sideOffset:t,className:V(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,/* @__PURE__ */ (0,F.jsx)(fd,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function Dd(e){return e}function Od(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e):e}function kd(e,t){let n=e[t],r=e.en;return(e,t)=>{let i=t!==void 0&&Number(t.count)===1?`${e}_one`:null;return Od((i?n[i]??r[i]:void 0)??n[e]??r[e]??e,t)}}var Ad=Dd({en:{cancel:`Cancel`,confirm:`Confirm`,back:`Back`,next:`Next`,loading:`Loading…`,retry:`Retry`,copy:`Copy`,copied:`Copied`,error:`Something went wrong`,page:`Page {page} of {pages}`,total:`{count} entries`,total_one:`1 entry`},de:{cancel:`Abbrechen`,confirm:`Bestätigen`,back:`Zurück`,next:`Weiter`,loading:`Wird geladen…`,retry:`Erneut versuchen`,copy:`Kopieren`,copied:`Kopiert`,error:`Etwas ist schiefgelaufen`,page:`Seite {page} von {pages}`,total:`{count} Einträge`,total_one:`1 Eintrag`}});function jd(e){if(e instanceof Error)return e.message;if(typeof e==`string`&&e!==``)return e;let t=e?.message;return typeof t==`string`&&t!==``?t:`Something went wrong`}var Md=(0,_.createContext)(`en`);function Nd(e){return/* @__PURE__ */ (0,F.jsx)(Md.Provider,{value:e.locale,children:e.children})}function Pd(){return(0,_.useContext)(Md)}function Fd(e){let t=Pd();return(0,_.useCallback)(kd(e,t),[e,t])}var Id=Dd({en:{updates:`Updates`,checkForUpdates:`Check for updates`,checking:`Checking for updates…`,upToDate:`Up to date`,upToDateVersion:`Up to date · {version}`,available:`Update available`,releaseNotes:`Release notes`,changes:`Changes`,opensInNewTab:`(opens in a new tab)`,moreChanges:`and {n} more changes`,moreChanges_one:`and 1 more change`,installNow:`Install now`,installAnyway:`Install anyway…`,installsOn:`Installs automatically on {date}`,installsNextCheck:`Installs automatically at the next check`,attention:`{version} needs upgrade steps`,attentionText:`This release changes the setup. Take the upgrade steps from its release notes on the server first.`,attentionLocked:`The image tag set where {app} is deployed does not reach {version}. Take the upgrade steps, then change the tag there.`,failed:`Update to {version} failed`,stillRunning:`{version} is still running.`,tryAgain:`Try again`,installing:`Installing {version}…`,stage_pulling:`Downloading`,stage_starting:`Starting`,"stage_rolling-back":`Going back to {version}`,stage_deploying:`Deploying`,restarts:`{app} restarts. This page reloads when it is back.`,confirmTitle:`Install {version} now?`,confirmText:`{app} restarts and is unavailable for a moment. Database changes run automatically.`,confirmAnywayTitle:`Install {version} without its upgrade steps?`,confirmAnywayText:`The release notes name the steps this release needs on the server. Without them, {app} may not start again.`,install:`Install`,updated:`Updated to {version}`,restarting:`Restarting…`,slow:`This takes longer than expected. Check the server (journalctl -u meldgrove-updater-{project}).`,stopWaiting:`Stop waiting`,notStarted:`The installation did not start`,notConfirmed:`The installation could not be confirmed`,noAnswer:`{app} did not answer in time.`,failedLine:`{version} failed: {message}`,installed:`Installed`,installedFooter:`Installed: {version} · {channel}`,checked:`Checked {time}`,notChecked:`Not checked yet`,checkNow:`Check now`,checkFailed:`Last check failed: {error}`,stable:`Stable`,preview:`Preview`,off:`Automatic updates are off on this server`,offText:`Automatic updates are off on this server, so it cannot install from here. See the {guide}.`,deploymentGuide:`deployment guide`,unreachable:`No update service. See the deployment guide.`,development:`development`,sectionText:`New versions of {app} and how they install.`,installedVersion:`Installed version`,channel:`Channel`,recommended:`recommended`,stableText:`Releases. Updates that need no action install automatically after {cooldown}.`,stableTextNoCooldown:`Releases. Updates that need no action install automatically.`,previewText:`Unstable: every change on main as soon as its checks pass, before it is released. New features first, and now and then a new bug. Previews have no release notes.`,switchBack:`Switching back to Stable keeps this version until a release is newer.`,saveChannel:`Save channel`,channelSaved:`Channel saved`,channelNotSaved:`The update service did not switch the channel.`,automatic:`Automatic installs`,autoReleases:`On: releases install automatically after {cooldown}.`,autoReleasesWindow:`On: releases install automatically after {cooldown}, between {start} and {end} ({timezone}).`,autoNextCheck:`On: updates install automatically at the next check.`,autoNextCheckWindow:`On: updates install automatically at the next check, between {start} and {end} ({timezone}).`,autoOff:`Off on this server: nothing installs automatically.`,autoPlatform:`The platform installs them (deploy link).`,sectionUnreachable:`The update service is not reachable.`,sectionUnreachableHelp:`Automatic updates need the updater service from compose.yaml ({guide}).`,lastCheck:`Last check`,updaterVersion:`Updater {version}`,signedOut:`Sign in again as an admin to manage updates.`,days:`{count} days`,days_one:`1 day`,hours:`{count} hours`,hours_one:`1 hour`,minutes:`{count} minutes`,minutes_one:`1 minute`,seconds:`{count} seconds`,seconds_one:`1 second`},de:{updates:`Updates`,checkForUpdates:`Nach Updates suchen`,checking:`Suche nach Updates …`,upToDate:`Aktuell`,upToDateVersion:`Aktuell · {version}`,available:`Update verfügbar`,releaseNotes:`Versionshinweise`,changes:`Änderungen`,opensInNewTab:`(öffnet in neuem Tab)`,moreChanges:`und {n} weitere Änderungen`,moreChanges_one:`und 1 weitere Änderung`,installNow:`Jetzt installieren`,installAnyway:`Trotzdem installieren …`,installsOn:`Wird am {date} automatisch installiert`,installsNextCheck:`Wird bei der nächsten Prüfung automatisch installiert`,attention:`{version} braucht Schritte beim Upgrade`,attentionText:`Diese Version ändert die Einrichtung. Führe zuerst die Upgrade-Schritte aus den Versionshinweisen auf dem Server aus.`,attentionLocked:`Das Image-Tag, mit dem {app} deployt ist, erreicht {version} nicht. Führe die Upgrade-Schritte aus und ändere dann dort das Tag.`,failed:`Update auf {version} fehlgeschlagen`,stillRunning:`{version} läuft weiter.`,tryAgain:`Erneut versuchen`,installing:`{version} wird installiert …`,stage_pulling:`Download`,stage_starting:`Start`,"stage_rolling-back":`Zurück zu {version}`,stage_deploying:`Deployment`,restarts:`{app} startet neu. Diese Seite lädt neu, sobald sie wieder da ist.`,confirmTitle:`{version} jetzt installieren?`,confirmText:`{app} startet neu und ist kurz nicht erreichbar. Änderungen an der Datenbank laufen automatisch.`,confirmAnywayTitle:`{version} ohne Upgrade-Schritte installieren?`,confirmAnywayText:`Die Versionshinweise nennen die Schritte, die diese Version auf dem Server braucht. Ohne sie startet {app} vielleicht nicht wieder.`,install:`Installieren`,updated:`Auf {version} aktualisiert`,restarting:`Neustart …`,slow:`Das dauert länger als erwartet. Prüfe den Server (journalctl -u meldgrove-updater-{project}).`,stopWaiting:`Nicht mehr warten`,notStarted:`Die Installation hat nicht begonnen`,notConfirmed:`Die Installation ließ sich nicht bestätigen`,noAnswer:`{app} hat nicht rechtzeitig geantwortet.`,failedLine:`{version} fehlgeschlagen: {message}`,installed:`Installiert`,installedFooter:`Installiert: {version} · {channel}`,checked:`Geprüft {time}`,notChecked:`Noch nicht geprüft`,checkNow:`Jetzt prüfen`,checkFailed:`Letzte Prüfung fehlgeschlagen: {error}`,stable:`Stabil`,preview:`Vorschau`,off:`Automatische Updates sind auf diesem Server aus`,offText:`Automatische Updates sind auf diesem Server aus, daher kann es hier nicht installiert werden. Siehe {guide}.`,deploymentGuide:`Anleitung zum Deployment`,unreachable:`Kein Update-Dienst. Siehe Anleitung zum Deployment.`,development:`Entwicklung`,sectionText:`Neue Versionen von {app} und wie sie installiert werden.`,installedVersion:`Installierte Version`,channel:`Kanal`,recommended:`empfohlen`,stableText:`Veröffentlichte Versionen. Updates ohne nötige Schritte werden nach {cooldown} automatisch installiert.`,stableTextNoCooldown:`Veröffentlichte Versionen. Updates ohne nötige Schritte werden automatisch installiert.`,previewText:`Instabil: jede Änderung auf main, sobald ihre Prüfungen bestanden sind, noch vor der Veröffentlichung. Neues zuerst, und ab und zu ein neuer Fehler. Vorschauen haben keine Versionshinweise.`,switchBack:`Zurück auf Stabil bleibt diese Version, bis eine Veröffentlichung neuer ist.`,saveChannel:`Kanal speichern`,channelSaved:`Kanal gespeichert`,channelNotSaved:`Der Update-Dienst hat den Kanal nicht gewechselt.`,automatic:`Automatische Installation`,autoReleases:`An: Veröffentlichte Versionen werden nach {cooldown} automatisch installiert.`,autoReleasesWindow:`An: Veröffentlichte Versionen werden nach {cooldown} automatisch installiert, zwischen {start} und {end} ({timezone}).`,autoNextCheck:`An: Updates werden bei der nächsten Prüfung automatisch installiert.`,autoNextCheckWindow:`An: Updates werden bei der nächsten Prüfung automatisch installiert, zwischen {start} und {end} ({timezone}).`,autoOff:`Aus auf diesem Server: Nichts wird automatisch installiert.`,autoPlatform:`Die Plattform installiert sie (Deploy-Link).`,sectionUnreachable:`Der Update-Dienst ist nicht erreichbar.`,sectionUnreachableHelp:`Automatische Updates brauchen den Dienst updater aus compose.yaml ({guide}).`,lastCheck:`Letzte Prüfung`,updaterVersion:`Updater {version}`,signedOut:`Melde dich erneut als Admin an, um Updates zu verwalten.`,days:`{count} Tagen`,days_one:`1 Tag`,hours:`{count} Stunden`,hours_one:`1 Stunde`,minutes:`{count} Minuten`,minutes_one:`1 Minute`,seconds:`{count} Sekunden`,seconds_one:`1 Sekunde`}}),Ld=9e5,Rd=6e4,zd=1e4,Bd=/* @__PURE__ */ new Set([`failed`,`rolled-back`]);function Vd(e){return[e.available,e.attention].filter(e=>e!==null)}function Hd(e,t=null){let n=e?.updater,r=n?.last;if(!n||!r||!Bd.has(r.result))return null;if(t&&t.version===r.version&&t.finishedAt===r.finishedAt){let e=Vd(n),t=e.find(e=>e.version===r.version)??null;return!t&&e.length>0?null:{version:r.version,message:r.message??t?.failed??null,offer:t}}return n.available?.failed?{version:n.available.version,message:n.available.failed,offer:n.available}:n.attention&&n.attention.version===r.version?{version:r.version,message:n.attention.failed??r.message,offer:n.attention}:null}function Ud(e,t=null){let n=e?.updater,r=n?.last;return!n||!r||!Bd.has(r.result)||Hd(e,t)||Vd(n).length===0?null:{version:r.version,message:r.message}}function Wd(e,t,n=null){if(t)return`installing`;if(!e)return`loading`;let r=e.updater;return!e.reachable||!r?`unreachable`:r.installing?`installing`:Hd(e,n)?`failed`:r.available?`available`:r.attention?`attention`:r.mode===`off`?`off`:`current`}function Gd(e,t){let n=Wd(e,t.pending,t.recent??null);return n===`loading`||n===`unreachable`||n===`installing`?n:t.checking||e?.updater?.checking?`checking`:n}function Kd(e,t,n=null){return n?!0:t?.updater?e===`available`||e===`attention`||e===`failed`||e===`installing`:!1}function qd(e,t){return e.mode===`off`?!1:t!==e.attention||e.channelLocked===null}function Jd(e,t,n){return{version:e,from:t?.app.version??null,startedAt:n,confirmed:!1,earlier:t?.updater?.last??null,installStartedAt:null,answeredAt:null,reason:null,lastError:null,unreported:!1,outage:!1}}function Yd(e,t,n){return{...Jd(e.version,t,n),confirmed:!0,installStartedAt:e.startedAt}}function Xd(e){return{version:e.version,installStartedAt:e.installStartedAt,startedAt:e.startedAt}}function Zd(e){return Math.floor(e/1e3)*1e3}function Qd(e,t){return!t||e.version!==t.version?!1:t.installStartedAt===null?Date.parse(e.startedAt)>=Zd(t.startedAt):e.startedAt===t.installStartedAt}function $d(e,t){return e.version===t.version&&e.result===t.result&&e.finishedAt===t.finishedAt}function ef(e,t){let n=t?.last;if(!n||n.version!==e.version||e.earlier&&$d(n,e.earlier))return null;let r=e.installStartedAt===null?Zd(e.startedAt):Date.parse(e.installStartedAt);return Date.parse(n.finishedAt)>=r?n:null}function tf(e,t,n,r=null,i=n){let a=t.updater,o=a?.installing??null,s=o!==null&&!Qd(o,r);if(!e)return s?Yd(o,t,n):null;if(!a)return nf(e,t.error);if(o&&o.version===e.version)return e.confirmed&&e.installStartedAt===o.startedAt?e:{...e,confirmed:!0,installStartedAt:o.startedAt};if(e.confirmed)return e;if(s)return Yd(o,t,n);if(ef(e,a))return{...e,confirmed:!0};let c=e.answeredAt!==null&&i>=e.answeredAt;return e.unreported||!c?e:{...e,unreported:!0}}function nf(e,t){let n=t??e.lastError;return e.outage&&e.lastError===n?e:{...e,outage:!0,lastError:n}}function rf(e,t,n){let r={...e,answeredAt:n};if(t.kind===`accepted`)return{pending:{...(t.response?.updater?tf(r,t.response,n):r)??r,confirmed:!0},error:null};if(t.kind===`unclear`)return{pending:{...r,reason:t.error,lastError:t.error??e.lastError},error:null};let i=t.response?.updater?.installing;return!t.response||!i?{pending:null,error:t.error}:{pending:tf({...r,confirmed:!1},t.response,n),error:null}}function af(e,t,n){let r=t?.updater??null;if(t&&r){let n=ef(e,r),i=t.app.version;if(n&&Bd.has(n.result))return`failed`;if(r.installing?.version!==e.version){if(n?.result===`installed`)return`done`;if(n?.result===`accepted`){if(i===e.version)return`done`;let t=i!==null&&!e.version.startsWith(`sha256:`),n=i!==null&&e.from!==null&&i!==e.from;if(!t&&(e.outage||n))return`done`}else if(i===e.version)return`done`}}return n-e.startedAt>9e5?`slow`:`waiting`}var of=1e4;function sf(e,t){let n=e===null?of:e-t;return n>0?Math.min(of,n):of}function cf(e,t){return!e||e.confirmed?null:Math.max(e.startedAt+Rd,t+zd)}function lf(e){return e.unreported?{message:`notStarted`,detail:e.reason??e.lastError}:{message:`notConfirmed`,detail:e.lastError??e.reason}}function uf(e){let t=`${e}.install`,n=`${e}.ignored`;return{loadPending(){try{let e=JSON.parse(sessionStorage.getItem(t)??`null`);return!e||typeof e.version!=`string`||typeof e.startedAt!=`number`?null:{...Jd(e.version,void 0,e.startedAt),...e}}catch{return null}},savePending(e){try{e?sessionStorage.setItem(t,JSON.stringify(e)):sessionStorage.removeItem(t)}catch{}},loadIgnored(){try{let e=JSON.parse(sessionStorage.getItem(n)??`null`);return!e||typeof e.version!=`string`||typeof e.startedAt!=`number`?null:{version:e.version,installStartedAt:e.installStartedAt??null,startedAt:e.startedAt}}catch{return null}},saveIgnored(e){try{e?sessionStorage.setItem(n,JSON.stringify(e)):sessionStorage.removeItem(n)}catch{}}}}function df(e){let t=e?.trim().match(/^(\d+)\s*([dhms]?)$/);if(!t)return null;let n=Number(t[1]);return n===0?null:t[2]===`d`?{unit:`days`,count:n}:t[2]===`h`?{unit:`hours`,count:n}:t[2]===`m`?{unit:`minutes`,count:n}:t[2]===`s`||n%60!=0?{unit:`seconds`,count:n}:n%86400==0?{unit:`days`,count:n/86400}:n%3600==0?{unit:`hours`,count:n/3600}:{unit:`minutes`,count:n/60}}function ff(e){let t=e?.trim().match(/^(\d{1,2}:\d{2})\s*-\s*(\d{1,2}:\d{2})$/);return t?{start:t[1],end:t[2]}:null}function pf(e){let t=e.notes.slice(0,8);return{notes:t,more:Math.max(e.changes,e.notes.length)-t.length}}var mf=class extends Error{constructor(e=`Sign in again to continue.`){super(e),this.name=`SignedOutError`}};function hf(e,t){if(t===`status`)return e;let n=e.endsWith(`/`);return`${n?e.slice(0,-1):e}/${t}${n?`/`:``}`}async function gf(e){let t=await e.text();try{return{text:t,data:t?JSON.parse(t):null}}catch{return{text:t,data:null}}}function _f(e){return{async request({action:t,body:n,signal:r}){let i=await fetch(hf(e.url,t),{method:t===`status`?`GET`:`POST`,credentials:`same-origin`,headers:{accept:`application/json`,...n===void 0?{}:{"content-type":`application/json`},...e.headers?.()},body:n===void 0?void 0:JSON.stringify(n),redirect:`manual`,signal:r});if(i.type===`opaqueredirect`||i.redirected||i.status>=300&&i.status<400)throw new mf;let{text:a,data:o}=await gf(i).catch(e=>{if(i.status!==202)throw e;return{text:``,data:null}}),s=/html/i.test(i.headers.get(`content-type`)??``)||/^\s*</.test(a);if(i.status===200&&o===null&&s)throw new mf;return{status:i.status,data:o}}}}function vf(e){for(let t of document.cookie.split(`;`)){let[n,...r]=t.trim().split(`=`);if(n===e)return decodeURIComponent(r.join(`=`))}return null}var yf=[`stable`,`preview`],bf=e=>typeof e==`string`,xf=e=>typeof e==`boolean`,Sf=e=>typeof e==`number`&&Number.isFinite(e),Cf=e=>t=>t===null||e(t),wf=(...e)=>t=>typeof t==`string`&&e.includes(t),Tf=e=>t=>typeof t==`object`&&!!t&&!Array.isArray(t)&&Object.entries(e).every(([e,n])=>n(t[e])),Ef=Tf({version:bf,preview:xf,publishedAt:Cf(bf),url:Cf(bf),notes:e=>Array.isArray(e)&&e.every(bf),changes:Sf,installsAt:Cf(bf),failed:Cf(bf)}),Df=Tf({updater:bf,mode:bf,channel:wf(...yf),channelLocked:Cf(bf),installed:Cf(bf),available:Cf(Ef),attention:Cf(Ef),installing:Cf(Tf({version:bf,startedAt:bf,manual:xf,stage:bf})),last:Cf(Tf({version:bf,result:bf,message:Cf(bf),finishedAt:bf})),checking:xf,checkedAt:Cf(bf),error:Cf(bf),automatic:xf,cooldown:Cf(bf),window:Cf(bf),timezone:bf}),Of=Tf({app:Tf({version:Cf(bf)}),reachable:xf,updater:Cf(Df),error:Cf(bf)});function kf(e){return Of(e)?e:null}var Af=3e5,jf=2e3,Mf=15e3,Nf=45e3,Pf=1500,Ff=3e4;function If(e){return e===`de`?`de-DE`:`en-GB`}function Lf(e){return{app:{version:null},reachable:!1,updater:null,error:e}}function Rf(e){return e?.app.version??e?.updater?.installed??null}function zf(e){let t=kf(e.data);if(t?.error)return t.error;let n=e.data;if(typeof n?.error==`string`)return n.error;if(typeof n?.error==`object`&&n.error!==null){let e=n.error.message;if(typeof e==`string`)return e}return typeof n?.message==`string`?n.message:`Request failed (${e.status})`}var Bf=e=>e===401||e===403||e===404,Vf=e=>e===401?`signed-out`:`forbidden`,Q=class{appName;project;locale;dateLocale;timeZone;t;transport;storage;notifyFn;onSignedOutFn;reloadFn;clock;fixedDateLocale;pageStart;restored=!1;listeners=/* @__PURE__ */ new Set;statusAbort=null;response;lastPoll=null;pending=null;ignored=null;recent=null;checkRunning=!1;savingChannel=!1;open=!1;stopped=!1;reloading=!1;statusRunning=!1;lastStatusAt=0;started=!1;pollTimer=null;deadlineTimer=null;slowTimer=null;reloadTimer=null;tickTimer=null;snapshot;initialSnapshot;constructor(e){this.transport=e.transport,this.appName=e.appName,this.project=e.project,this.locale=e.locale??`en`,this.fixedDateLocale=e.dateLocale??null,this.dateLocale=this.fixedDateLocale??If(this.locale),this.timeZone=e.timeZone,this.t=kd(Id,this.locale),this.storage=e.storage??uf(`meldgrove.updates.${e.project}`),this.notifyFn=e.notify??(()=>void 0),this.onSignedOutFn=e.onSignedOut??null,this.reloadFn=e.reload??(()=>window.location.reload()),this.clock=e.now??Date.now,this.pageStart=this.clock(),this.response=e.initialResponse,this.snapshot=this.compute(),this.initialSnapshot=this.snapshot}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;getServerSnapshot=()=>this.initialSnapshot;emit(){this.snapshot=this.compute();for(let e of this.listeners)e()}compute(){let e=this.clock(),t=this.pending,n=this.response??(this.lastPoll?.failed&&!this.stopped?Lf(this.lastPoll.error):void 0),r=n?.updater??null,i=this.checkRunning||!!r?.checking,a=Gd(n,{checking:i,pending:t,recent:this.recent}),o=Wd(n,t,this.recent),s=Kd(o,n,t);s||(this.open=!1);let c=t!==null&&this.lastPoll!==null&&this.lastPoll.at>=t.startedAt&&this.lastPoll.failed;return{response:n,status:r,pending:t,recent:this.recent,checking:i,state:a,shown:o,panel:s,open:this.open&&s,restarting:c,slow:t!==null&&af(t,void 0,e)===`slow`,waiting:t!==null&&!this.stopped,stopped:this.stopped,savingChannel:this.savingChannel,now:e}}setLocale(e){e!==this.locale&&(this.locale=e,this.dateLocale=this.fixedDateLocale??If(e),this.t=kd(Id,e),this.emit())}configure(e){e.notify&&(this.notifyFn=e.notify),e.onSignedOut!==void 0&&(this.onSignedOutFn=e.onSignedOut);let t=!1;if(e.appName&&e.appName!==this.appName&&(this.appName=e.appName,t=!0),e.dateLocale!==void 0){this.fixedDateLocale=e.dateLocale;let n=this.fixedDateLocale??If(this.locale);n!==this.dateLocale&&(this.dateLocale=n,t=!0)}e.timeZone!==void 0&&(e.timeZone??void 0)!==this.timeZone&&(this.timeZone=e.timeZone??void 0,t=!0),t&&this.emit()}start(){this.started||(this.started=!0,this.restored||(this.restored=!0,this.pageStart=this.clock(),this.pending=this.storage.loadPending(),this.ignored=this.storage.loadIgnored(),this.emit()),this.armTimers(),window.addEventListener(`focus`,this.onFocus),window.addEventListener(`online`,this.onFocus),document.addEventListener(`visibilitychange`,this.onVisibility),this.tickTimer=setInterval(()=>this.emit(),Ff),this.fetchStatus())}dispose(){this.started=!1,window.removeEventListener(`focus`,this.onFocus),window.removeEventListener(`online`,this.onFocus),document.removeEventListener(`visibilitychange`,this.onVisibility);for(let e of[this.pollTimer,this.deadlineTimer,this.slowTimer,this.reloadTimer])e!==null&&clearTimeout(e);this.tickTimer!==null&&clearInterval(this.tickTimer),this.pollTimer=this.deadlineTimer=this.slowTimer=this.reloadTimer=this.tickTimer=null}onFocus=()=>{this.pending||this.clock()-this.lastStatusAt<6e4||this.fetchStatus()};onVisibility=()=>{document.visibilityState===`visible`&&this.onFocus()};notify(e){this.notifyFn(e)}schedule(){if(this.pollTimer!==null&&clearTimeout(this.pollTimer),this.pollTimer=null,!this.started||this.stopped)return;let e=this.pending!==null;this.pollTimer=setTimeout(()=>{if(this.pollTimer=null,!e&&document.visibilityState===`hidden`)return this.schedule();this.fetchStatus()},e?jf:Af)}armTimers(){this.deadlineTimer!==null&&clearTimeout(this.deadlineTimer),this.slowTimer!==null&&clearTimeout(this.slowTimer),this.deadlineTimer=this.slowTimer=null;let e=this.pending;if(!this.started||!e)return;let t=cf(e,this.pageStart);t!==null&&!this.stopped&&(this.deadlineTimer=setTimeout(()=>{this.deadlineTimer=null;let e=this.pending;if(!e||cf(e,this.pageStart)!==t)return;this.setPending(null);let n=lf(e);this.notify({kind:`error`,title:this.t(n.message),description:n.detail??void 0})},Math.max(0,t-this.clock())));let n=e.startedAt+Ld+1;n>this.clock()&&(this.slowTimer=setTimeout(()=>{this.slowTimer=null,this.emit()},n-this.clock()))}setPending(e){let t=e!==this.pending;this.pending=e,t&&(this.storage.savePending(e),this.armTimers(),this.schedule(),this.emit())}signOut(e){this.stopped||(this.stopped=!0,this.pollTimer!==null&&clearTimeout(this.pollTimer),this.deadlineTimer!==null&&clearTimeout(this.deadlineTimer),this.pollTimer=this.deadlineTimer=null,this.emit(),this.onSignedOutFn?.(e))}async send(e,t,n,r=new AbortController){let i=!1,a=setTimeout(()=>{i=!0,r.abort()},n);try{return await this.transport.request({action:e,body:t,signal:r.signal})}catch(e){throw i?Error(this.t(`noAnswer`,{app:this.appName}),{cause:e}):e}finally{clearTimeout(a)}}async fetchStatus(){if(this.stopped||this.statusRunning)return;this.statusRunning=!0;let e=this.clock(),t=sf(cf(this.pending,this.pageStart),e),n=new AbortController;this.statusAbort=n;try{let r=await this.send(`status`,void 0,t,n);if(n.signal.aborted)return;if(Bf(r.status))return this.signOut(Vf(r.status));let i=kf(r.data);if(r.status!==200||!i)throw Error(zf(r));this.lastStatusAt=this.clock(),this.receive(i,e)}catch(e){if(n.signal.aborted&&this.statusAbort!==n)return;if(e instanceof mf)return this.signOut(`signed-out`);this.pollFailed(jd(e))}finally{this.statusAbort===n&&(this.statusAbort=null,this.statusRunning=!1,this.pollTimer===null&&this.schedule())}}cancelStatus(){let e=this.statusAbort;e&&(this.statusAbort=null,this.statusRunning=!1,e.abort())}pollFailed(e){let t=this.clock();this.lastPoll={at:t,failed:!0,error:e};let n=this.pending;if(n&&t>=n.startedAt){let t=nf(n,e);if(t!==n)return this.setPending(t)}this.emit()}receive(e,t){this.response=e,this.lastPoll={at:this.clock(),failed:!e.updater,error:e.error},this.follow(e,t),this.emit()}follow(e,t){if(this.reloading)return;let n=this.clock(),r=this.pending,i=tf(r,e,n,this.ignored,t);if(!i)return;let a=af(i,e,n);a===`done`?(this.reloading=!0,this.setPending(null),this.notify({kind:`success`,title:this.t(`updated`,{version:i.version})}),this.reloadTimer=setTimeout(()=>this.reloadFn(),Pf)):a===`failed`?(this.recent=e.updater?.last??null,this.open=!0,this.setPending(null)):i!==r&&this.setPending(i)}async post(e,t){let n=this.clock(),r;try{r=await this.send(e,t,Nf)}catch(e){throw e instanceof mf&&this.signOut(`signed-out`),e}Bf(r.status)&&this.signOut(Vf(r.status));let i=kf(r.data);if(r.status>=200&&r.status<300&&i)return this.receive(i,n),i;throw r.status===409&&i&&this.receive(i,n),Error(zf(r))}setOpen=e=>{let t=this.snapshot;if(!e)this.open=!1;else if(t.panel)this.open=!0;else{(t.state===`current`||t.state===`off`||t.state===`unreachable`)&&this.check();return}this.emit()};check=async()=>{if(!this.checkRunning){this.checkRunning=!0,this.emit();try{let e=await this.post(`check`,{}),t=Wd(e,null);if(t===`available`||t===`attention`||t===`failed`||t===`installing`)this.open=!0;else if(e.updater?.error)this.notify({kind:`error`,title:this.t(`checkFailed`,{error:e.updater.error})});else if(t===`current`){let t=Rf(e);this.notify({kind:`success`,title:t?this.t(`upToDateVersion`,{version:t}):this.t(`upToDate`)})}else t===`unreachable`&&this.notify({kind:`error`,title:e.error??this.t(`unreachable`)})}catch(e){this.notify({kind:`error`,title:jd(e)})}finally{this.checkRunning=!1,this.emit()}}};install=async e=>{this.recent=null,this.cancelStatus();let t=Jd(e.version,this.response,this.clock());this.open=!0,this.setPending(t);let n=this.clock(),{answer:r,response:i}=await this.requestInstall(e.version),a=this.pending;if(a?.version!==t.version||a.startedAt!==t.startedAt){i&&this.receive(i,n);return}let o=rf(a,r,this.clock());this.setPending(o.pending),o.error&&this.notify({kind:`error`,title:o.error}),i&&this.receive(i,n)};async requestInstall(e){let t;try{t=await this.send(`install`,{version:e},Mf)}catch(e){return e instanceof mf&&this.signOut(`signed-out`),{answer:{kind:`unclear`,error:jd(e)},response:null}}let n=kf(t.data),r=n?.updater?n:null;return t.status===202?{answer:{kind:`accepted`,response:r},response:r}:t.status>=400&&t.status<500?(Bf(t.status)&&this.signOut(Vf(t.status)),{answer:{kind:`refused`,error:zf(t),response:r},response:r}):{answer:{kind:`unclear`,error:n?.error??zf(t)},response:t.status===200?n:null}}stopWaiting=()=>{let e=this.pending;e&&(this.ignored=Xd(e),this.storage.saveIgnored(this.ignored)),this.setPending(null)};setChannel=async e=>{this.savingChannel=!0,this.emit();try{let t=await this.post(`channel`,{channel:e});return t.reachable&&t.updater?.channel===e}finally{this.savingChannel=!1,this.emit()}}};function Hf(e){(e.kind===`success`?re.success:re.error)(e.title,e.description?{description:e.description}:void 0)}var Uf=(0,_.createContext)(null);function Wf(e){let t=(0,_.useMemo)(()=>({controller:e.controller,guideUrl:e.guideUrl}),[e.controller,e.guideUrl]);return/* @__PURE__ */ (0,F.jsx)(Uf.Provider,{value:t,children:e.children})}function Gf(){let e=(0,_.useContext)(Uf);if(!e)throw Error(`Render the update button and settings inside UpdatesProvider.`);return e}function Kf(){return Gf().controller}function qf(){return Gf().guideUrl}function Jf(){let e=Kf();return(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot)}var Yf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Xf(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Yf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Zf=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Qf=e=>{let t=Zf(e);return t.charAt(0).toUpperCase()+t.slice(1)},$f=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ep={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function $(e){return e!=null}function tp(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??ep.width,a=e.size??e.height??ep.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?$f(...c):$f(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??ep[`stroke-width`])*Number(e.size??e.width??ep.width)/Number(t.size??t.width??ep.width):t.strokeWidth??ep[`stroke-width`];return[`svg`,{...Object.entries(ep).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&$(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&$(t.width)&&{[r(`width`)]:t.width},...`height`in t&&$(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function np(e,t={}){return tp(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var rp=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ip=(0,_.createContext)({}),ap=()=>(0,_.useContext)(ip),op=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=ap()??{},b=!!c||rp(d),[x,S,C=[]]=np(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:$f(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function sp(e,t=[],n=[]){let r=typeof e==`string`?Xf(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(op,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Qf(r.name)),i}var cp={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};cp.node;var lp=sp(cp),up={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`}]]};up.node;var dp=sp(up),fp={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};fp.node;var pp=sp(fp),mp={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};mp.node;var hp=sp(mp),gp={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};gp.node;var _p=sp(gp),vp={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};vp.node;var yp=sp(vp),bp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,xp=xe,Sp=(e,t)=>n=>{if(t?.variants==null)return xp(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=bp(t)||bp(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return xp(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Cp=Sp(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function wp({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?$t:`button`;return/* @__PURE__ */ (0,F.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:V(Cp({variant:t,size:n,className:e})),...i})}function Tp({...e}){return/* @__PURE__ */ (0,F.jsx)(yo,{"data-slot":`alert-dialog`,...e})}function Ep({...e}){return/* @__PURE__ */ (0,F.jsx)(bo,{"data-slot":`alert-dialog-portal`,container:Sd(),...e})}function Dp({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(xo,{"data-slot":`alert-dialog-overlay`,className:V(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Op({className:e,size:t=`default`,...n}){return/* @__PURE__ */ (0,F.jsxs)(Ep,{children:[/* @__PURE__ */ (0,F.jsx)(Dp,{}),/* @__PURE__ */ (0,F.jsx)(wo,{"data-slot":`alert-dialog-content`,"data-size":t,className:V(`group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg`,e),...n})]})}function kp({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:V(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Ap({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:V(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function jp({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(To,{"data-slot":`alert-dialog-title`,className:V(`text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Mp({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(Eo,{"data-slot":`alert-dialog-description`,className:V(`text-sm text-muted-foreground`,e),...t})}function Np({className:e,variant:t=`default`,size:n=`default`,...r}){return/* @__PURE__ */ (0,F.jsx)(wp,{variant:t,size:n,asChild:!0,children:/* @__PURE__ */ (0,F.jsx)(Do,{"data-slot":`alert-dialog-action`,className:V(e),...r})})}function Pp({className:e,variant:t=`outline`,size:n=`default`,...r}){return/* @__PURE__ */ (0,F.jsx)(wp,{variant:t,size:n,asChild:!0,children:/* @__PURE__ */ (0,F.jsx)(ko,{"data-slot":`alert-dialog-cancel`,className:V(e),...r})})}var Fp=Sp(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function Ip({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?$t:`span`;return/* @__PURE__ */ (0,F.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:V(Fp({variant:t}),e),...r})}function Lp({...e}){return/* @__PURE__ */ (0,F.jsx)($l,{"data-slot":`popover`,...e})}function Rp({...e}){return/* @__PURE__ */ (0,F.jsx)(tu,{"data-slot":`popover-trigger`,...e})}function zp({className:e,align:t=`center`,sideOffset:n=4,...r}){return/* @__PURE__ */ (0,F.jsx)(iu,{container:Sd(),children:/* @__PURE__ */ (0,F.jsx)(ou,{"data-slot":`popover-content`,align:t,sideOffset:n,className:V(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...r})})}var Bp=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function Vp(e,t,n){let r=new Date(e);if(Number.isNaN(r.getTime()))return String(e);let i={dateStyle:`medium`,timeStyle:`short`};try{return new Intl.DateTimeFormat(t,{...i,timeZone:n}).format(r)}catch{return new Intl.DateTimeFormat(t,i).format(r)}}function Hp(e,t,n=Date.now()){let r=new Date(e).getTime();if(Number.isNaN(r))return String(e);let i=r-n,a=new Intl.RelativeTimeFormat(t,{numeric:`auto`});for(let[e,t]of Bp)if(Math.abs(i)>=t)return a.format(Math.round(i/t),e);return a.format(0,`second`)}function Up({state:e}){switch(e){case`checking`:return/* @__PURE__ */ (0,F.jsx)(_p,{className:`motion-safe:animate-spin`});case`installing`:return/* @__PURE__ */ (0,F.jsx)(hp,{className:`motion-safe:animate-spin`});case`available`:case`attention`:return/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(dp,{}),/* @__PURE__ */ (0,F.jsx)(`span`,{"aria-hidden":!0,className:V(`ring-background absolute top-1 right-1 size-2 rounded-full ring-2`,e===`available`?`bg-primary`:`bg-warning`)})]});case`failed`:return/* @__PURE__ */ (0,F.jsx)(yp,{className:`text-destructive`});case`unreachable`:return/* @__PURE__ */ (0,F.jsx)(_p,{className:`text-muted-foreground opacity-60`});default:return/* @__PURE__ */ (0,F.jsx)(_p,{className:`text-muted-foreground`})}}function Wp({controller:e,update:t}){return t.url?/* @__PURE__ */ (0,F.jsxs)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,className:`text-primary inline-flex w-fit items-center gap-1 text-sm font-medium underline-offset-4 hover:underline`,children:[e.t(t.preview?`changes`:`releaseNotes`),/* @__PURE__ */ (0,F.jsx)(pp,{className:`size-3.5`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,F.jsx)(`span`,{className:`sr-only`,children:e.t(`opensInNewTab`)})]}):null}var Gp=/* @__PURE__ */ new Set([`pulling`,`starting`,`rolling-back`,`deploying`]);function Kp({controller:e}){let t=qf(),[n,r]=e.t(`offText`).split(`{guide}`);return/* @__PURE__ */ (0,F.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[n,t?/* @__PURE__ */ (0,F.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`text-primary font-medium underline-offset-4 hover:underline`,children:e.t(`deploymentGuide`)}):e.t(`deploymentGuide`),r]})}function qp({controller:e,version:t}){return/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e.t(`attentionLocked`,{app:e.appName,version:t})})}function Jp({controller:e,snapshot:t,update:n}){let{notes:r,more:i}=pf(n);return/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-sm`,children:[/* @__PURE__ */ (0,F.jsx)(`span`,{className:`font-medium`,children:n.version}),n.publishedAt?/* @__PURE__ */ (0,F.jsxs)(`span`,{className:`text-muted-foreground`,title:Vp(n.publishedAt,e.dateLocale,e.timeZone),children:[`· `,Hp(n.publishedAt,e.locale,t.now)]}):null,n.preview?/* @__PURE__ */ (0,F.jsx)(Ip,{variant:`secondary`,children:e.t(`preview`)}):null]}),r.length>0?/* @__PURE__ */ (0,F.jsxs)(`ul`,{className:`grid list-disc gap-1 pl-4 text-sm`,children:[r.map((e,t)=>/* @__PURE__ */ (0,F.jsx)(`li`,{className:`break-words`,children:e},t)),i>0?/* @__PURE__ */ (0,F.jsx)(`li`,{className:`text-muted-foreground list-none`,children:e.t(`moreChanges`,{n:i,count:i})}):null]}):null]})}function Yp({children:e}){return/* @__PURE__ */ (0,F.jsx)(`h2`,{className:`text-sm font-semibold break-words`,children:e})}function Xp({controller:e,snapshot:t}){let n=Ud(t.response,t.recent);return n?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-destructive text-sm break-words`,children:n.message?e.t(`failedLine`,{version:n.version,message:n.message}):e.t(`failed`,{version:n.version})}):null}function Zp(e){let{controller:t,snapshot:n}=e,r=t.t,{shown:i,status:a}=n,o=Rf(n.response),s=Hd(n.response,n.recent),c=a?.available??a?.attention,l=a?.mode!==`off`,u=null;if(i===`installing`){let e=n.pending?.version??a?.installing?.version??``,i=a?.installing?.version===e?a.installing.stage:null;u=/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Yp,{children:r(`installing`,{version:e})}),n.restarting?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-sm`,children:r(`restarting`)}):i&&Gp.has(i)?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-sm`,children:r(`stage_${i}`,{version:a?.installed??o??``})}):null,n.waiting?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r(`restarts`,{app:t.appName})}):null,n.slow?/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(`p`,{role:`alert`,className:`text-destructive text-sm break-words`,children:r(`slow`,{project:t.project})}),/* @__PURE__ */ (0,F.jsx)(wp,{size:`sm`,variant:`outline`,className:`w-full`,onClick:t.stopWaiting,children:r(`stopWaiting`)})]}):null]})}else if(a){if(i===`failed`&&s){let n=s.offer;u=/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Yp,{children:r(`failed`,{version:s.version})}),s.message?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-destructive text-sm break-words`,children:s.message}):null,o?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r(`stillRunning`,{version:o})}):null,l?n&&qd(a,n)?/* @__PURE__ */ (0,F.jsx)(wp,{size:`sm`,className:`w-full`,onClick:()=>e.onInstall(n,n===a.attention),children:r(`tryAgain`)}):n?/* @__PURE__ */ (0,F.jsx)(qp,{controller:t,version:n.version}):null:/* @__PURE__ */ (0,F.jsx)(Kp,{controller:t})]})}else if(i===`available`&&a.available){let i=a.available,o=i.installsAt;u=/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Yp,{children:r(`available`)}),/* @__PURE__ */ (0,F.jsx)(Jp,{controller:t,snapshot:n,update:i}),/* @__PURE__ */ (0,F.jsx)(Xp,{controller:t,snapshot:n}),/* @__PURE__ */ (0,F.jsx)(Wp,{controller:t,update:i}),l?/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[o?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:new Date(o).getTime()>n.now?r(`installsOn`,{date:Vp(o,t.dateLocale,t.timeZone)}):r(`installsNextCheck`)}):null,/* @__PURE__ */ (0,F.jsx)(wp,{size:`sm`,className:`w-full`,onClick:()=>e.onInstall(i,!1),children:r(`installNow`)})]}):/* @__PURE__ */ (0,F.jsx)(Kp,{controller:t})]})}else if(i===`attention`&&a.attention){let i=a.attention;u=/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Yp,{children:r(`attention`,{version:i.version})}),/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-sm`,children:r(`attentionText`)}),/* @__PURE__ */ (0,F.jsx)(Xp,{controller:t,snapshot:n}),/* @__PURE__ */ (0,F.jsx)(Wp,{controller:t,update:i}),l?qd(a,i)?/* @__PURE__ */ (0,F.jsx)(wp,{size:`sm`,variant:`outline`,className:`w-full`,onClick:()=>e.onInstall(i,!0),children:r(`installAnyway`)}):/* @__PURE__ */ (0,F.jsx)(qp,{controller:t,version:i.version}):/* @__PURE__ */ (0,F.jsx)(Kp,{controller:t})]})}else c&&(u=/* @__PURE__ */ (0,F.jsx)(Jp,{controller:t,snapshot:n,update:c}))}return a?/* @__PURE__ */ (0,F.jsxs)(`div`,{className:`grid gap-3`,children:[u,/* @__PURE__ */ (0,F.jsxs)(`div`,{className:V(`text-muted-foreground grid gap-1 text-xs`,u?`border-t pt-3`:null),children:[/* @__PURE__ */ (0,F.jsx)(`p`,{children:r(`installedFooter`,{version:o??r(`development`),channel:r(a.channel)})}),/* @__PURE__ */ (0,F.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2`,children:[/* @__PURE__ */ (0,F.jsx)(`span`,{"aria-live":`polite`,children:n.checking?r(`checking`):a.checkedAt?r(`checked`,{time:Hp(a.checkedAt,t.locale,n.now)}):r(`notChecked`)}),i!==`installing`&&!n.checking?/* @__PURE__ */ (0,F.jsx)(wp,{variant:`link`,size:`xs`,className:`h-auto p-0 text-xs`,onClick:()=>void t.check(),children:r(`checkNow`)}):null]}),a.error?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-destructive break-words`,children:r(`checkFailed`,{error:a.error})}):null]})]}):/* @__PURE__ */ (0,F.jsx)(`div`,{className:`grid gap-3`,children:u})}function Qp(e){let{controller:t,target:n}=e,r=t.t,i=kd(Ad,t.locale);return/* @__PURE__ */ (0,F.jsx)(Tp,{open:n!==null,onOpenChange:t=>t?void 0:e.onCancel(),children:/* @__PURE__ */ (0,F.jsx)(Op,{children:n?/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsxs)(kp,{children:[/* @__PURE__ */ (0,F.jsx)(jp,{children:n.anyway?r(`confirmAnywayTitle`,{version:n.update.version}):r(`confirmTitle`,{version:n.update.version})}),/* @__PURE__ */ (0,F.jsxs)(Mp,{children:[n.anyway?`${r(`confirmAnywayText`,{app:t.appName})} `:null,r(`confirmText`,{app:t.appName})]}),n.anyway?/* @__PURE__ */ (0,F.jsx)(Wp,{controller:t,update:n.update}):null]}),/* @__PURE__ */ (0,F.jsxs)(Ap,{children:[/* @__PURE__ */ (0,F.jsx)(Pp,{children:i(`cancel`)}),/* @__PURE__ */ (0,F.jsx)(Np,{variant:n.anyway?`destructive`:`default`,onClick:()=>e.onConfirm(n.update),children:r(`install`)})]})]}):null})})}function $p({className:e}){let t=Kf(),n=Jf(),[r,i]=(0,_.useState)(null),a=t.t,{state:o,status:s}=n,c=Rf(n.response),l=Hd(n.response,n.recent),u={loading:a(`checkForUpdates`),unreachable:n.response?.error??a(`unreachable`),installing:n.restarting?a(`restarting`):a(`installing`,{version:n.pending?.version??s?.installing?.version??``}),checking:a(`checking`),off:a(`off`),failed:a(`failed`,{version:l?.version??``}),available:`${a(`available`)} · ${s?.available?.version??``}`,attention:a(`attention`,{version:s?.attention?.version??``}),current:c?a(`upToDateVersion`,{version:c}):a(`upToDate`)};return/* @__PURE__ */ (0,F.jsxs)(Cd,{children:[/* @__PURE__ */ (0,F.jsxs)(Lp,{open:n.open,onOpenChange:t.setOpen,children:[/* @__PURE__ */ (0,F.jsxs)(wd,{children:[/* @__PURE__ */ (0,F.jsx)(Td,{asChild:!0,children:/* @__PURE__ */ (0,F.jsx)(Rp,{asChild:!0,children:/* @__PURE__ */ (0,F.jsx)(wp,{variant:`ghost`,size:`icon-sm`,className:V(`relative rounded-full`,e),"aria-label":u[o],"data-update-state":o,children:/* @__PURE__ */ (0,F.jsx)(Up,{state:o})})})}),/* @__PURE__ */ (0,F.jsx)(Ed,{side:`bottom`,children:u[o]})]}),/* @__PURE__ */ (0,F.jsx)(zp,{align:`end`,className:`w-[min(20rem,calc(100vw-1.5rem))]`,children:n.panel?/* @__PURE__ */ (0,F.jsx)(Zp,{controller:t,snapshot:n,onInstall:(e,n)=>{t.setOpen(!1),i({update:e,anyway:n})}}):null})]}),/* @__PURE__ */ (0,F.jsx)(Qp,{controller:t,target:r,onCancel:()=>i(null),onConfirm:e=>{i(null),t.install(e)}})]})}var em=Sp(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function tm({className:e,variant:t,...n}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:V(em({variant:t}),e),...n})}function nm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`alert-description`,className:V(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}function rm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card`,className:V(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function im({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card-header`,className:V(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function am({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card-title`,className:V(`leading-none font-semibold`,e),...t})}function om({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card-description`,className:V(`text-sm text-muted-foreground`,e),...t})}function sm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card-content`,className:V(`px-6`,e),...t})}function cm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(Wl,{"data-slot":`label`,className:V(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function lm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`fieldset`,{"data-slot":`field-set`,className:V(`flex flex-col gap-6`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function um({className:e,variant:t=`legend`,...n}){return/* @__PURE__ */ (0,F.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:V(`mb-3 font-medium`,`data-[variant=legend]:text-base`,`data-[variant=label]:text-sm`,e),...n})}var dm=Sp(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`[&>[data-slot=field-label]]:flex-auto`,`has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto`,`@md/field-group:[&>[data-slot=field-label]]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}});function fm({className:e,orientation:t=`vertical`,...n}){return/* @__PURE__ */ (0,F.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:V(dm({orientation:t}),e),...n})}function pm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`field-content`,className:V(`group/field-content flex flex-1 flex-col gap-1.5 leading-snug`,e),...t})}function mm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(cm,{"data-slot":`field-label`,className:V(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4`,`has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10`,e),...t})}function hm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`p`,{"data-slot":`field-description`,className:V(`text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function gm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(Lu,{"data-slot":`radio-group`,className:V(`grid gap-3`,e),...t})}function _m({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(Hu,{"data-slot":`radio-group-item`,className:V(`aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t,children:/* @__PURE__ */ (0,F.jsx)(Wu,{"data-slot":`radio-group-indicator`,className:`relative flex items-center justify-center`,children:/* @__PURE__ */ (0,F.jsx)(lp,{className:`absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary`})})})}function vm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(hp,{role:`status`,"aria-label":`Loading`,className:V(`size-4 animate-spin`,e),...t})}function ym({label:e}){let t=Fd(Ad);return/* @__PURE__ */ (0,F.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-center gap-2 py-12 text-sm`,role:`status`,children:[/* @__PURE__ */ (0,F.jsx)(vm,{}),/* @__PURE__ */ (0,F.jsx)(`span`,{children:e??t(`loading`)})]})}function bm(e,t){let n=df(t);return n?e(n.unit,{count:n.count}):null}function xm(e,t){if(t.mode===`off`||!t.automatic)return e(`autoOff`);if(t.mode===`platform`)return e(`autoPlatform`);let n=ff(t.window),r=n?{...n,timezone:t.timezone}:null,i=t.channel===`stable`?bm(e,t.cooldown):null;return i?r?e(`autoReleasesWindow`,{cooldown:i,...r}):e(`autoReleases`,{cooldown:i}):r?e(`autoNextCheckWindow`,r):e(`autoNextCheck`)}function Sm(){let e=Kf(),t=Jf(),n=qf(),r=e.t,i=(0,_.useId)(),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),{response:l,status:u}=t,d=u?.channel??null,f=a??d??``,p=u?.channelLocked??null,m=!u||p!==null||t.savingChannel,h=bm(r,u?.cooldown??null);if(!l)return t.stopped?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r(`signedOut`)}):/* @__PURE__ */ (0,F.jsx)(ym,{});let g=async()=>{if(a&&a!==d){c(null);try{let t=await e.setChannel(a),n=e.getSnapshot().response;if(!n?.reachable||!n.updater)return c(n?.error??r(`unreachable`));if(!t)return c(r(`channelNotSaved`));o(null),e.notify({kind:`success`,title:r(`channelSaved`)})}catch(e){c(jd(e))}}},v=(e,t,n)=>/* @__PURE__ */ (0,F.jsxs)(fm,{orientation:`horizontal`,className:`items-start`,"data-disabled":m||void 0,children:[/* @__PURE__ */ (0,F.jsx)(_m,{value:e,id:`${i}-${e}`,className:`mt-0.5`}),/* @__PURE__ */ (0,F.jsxs)(pm,{children:[/* @__PURE__ */ (0,F.jsx)(mm,{htmlFor:`${i}-${e}`,children:t}),/* @__PURE__ */ (0,F.jsx)(hm,{children:n})]})]});return/* @__PURE__ */ (0,F.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[/* @__PURE__ */ (0,F.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-2 text-sm sm:grid-cols-[max-content_1fr]`,children:[/* @__PURE__ */ (0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`installedVersion`)}),/* @__PURE__ */ (0,F.jsxs)(`dd`,{className:`flex flex-wrap items-center gap-2 font-medium`,children:[l.app.version??r(`development`),u?.available?/* @__PURE__ */ (0,F.jsxs)(Ip,{variant:`secondary`,children:[r(`available`),` · `,u.available.version]}):u?.attention?/* @__PURE__ */ (0,F.jsx)(Ip,{variant:`outline`,children:r(`attention`,{version:u.attention.version})}):null]}),u?/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`channel`)}),/* @__PURE__ */ (0,F.jsx)(`dd`,{className:`font-medium`,children:r(u.channel)}),/* @__PURE__ */ (0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`automatic`)}),/* @__PURE__ */ (0,F.jsx)(`dd`,{children:xm(r,u)}),/* @__PURE__ */ (0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`lastCheck`)}),/* @__PURE__ */ (0,F.jsxs)(`dd`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[/* @__PURE__ */ (0,F.jsx)(`span`,{"aria-live":`polite`,children:t.checking?r(`checking`):u.checkedAt?Hp(u.checkedAt,e.locale,t.now):r(`notChecked`)}),/* @__PURE__ */ (0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,r(`updaterVersion`,{version:u.updater})]}),t.checking?null:/* @__PURE__ */ (0,F.jsx)(wp,{variant:`link`,size:`xs`,className:`h-auto p-0`,onClick:()=>void e.check(),children:r(`checkNow`)})]}),u.error?/* @__PURE__ */ (0,F.jsx)(`dd`,{className:`text-destructive break-words sm:col-start-2`,children:r(`checkFailed`,{error:u.error})}):null]}):null]}),!l.reachable||!u?/* @__PURE__ */ (0,F.jsx)(tm,{children:/* @__PURE__ */ (0,F.jsxs)(nm,{children:[/* @__PURE__ */ (0,F.jsx)(`p`,{className:`break-words`,children:l.error??r(`sectionUnreachable`)}),/* @__PURE__ */ (0,F.jsx)(`p`,{children:/* @__PURE__ */ (0,F.jsx)(Cm,{controller:e,guideUrl:n})})]})}):null,/* @__PURE__ */ (0,F.jsxs)(lm,{disabled:m,children:[/* @__PURE__ */ (0,F.jsx)(um,{variant:`label`,children:r(`channel`)}),/* @__PURE__ */ (0,F.jsxs)(gm,{value:f,disabled:m,onValueChange:e=>{c(null),o(e)},children:[v(`stable`,`${r(`stable`)} (${r(`recommended`)})`,h?r(`stableText`,{cooldown:h}):r(`stableTextNoCooldown`)),v(`preview`,r(`preview`),r(`previewText`))]}),p?/* @__PURE__ */ (0,F.jsx)(hm,{className:`text-foreground`,children:p}):null,/* @__PURE__ */ (0,F.jsx)(hm,{children:r(`switchBack`)})]}),/* @__PURE__ */ (0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-3`,children:[s?/* @__PURE__ */ (0,F.jsx)(`span`,{role:`alert`,className:`text-destructive mr-auto text-sm break-words`,children:s}):null,/* @__PURE__ */ (0,F.jsxs)(wp,{type:`button`,disabled:m||a===null||a===d,onClick:()=>void g(),children:[t.savingChannel?/* @__PURE__ */ (0,F.jsx)(vm,{}):null,r(`saveChannel`)]})]})]})}function Cm({controller:e,guideUrl:t}){let[n,r]=e.t(`sectionUnreachableHelp`).split(`{guide}`);return/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[n,t?/* @__PURE__ */ (0,F.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`text-primary font-medium underline-offset-4 hover:underline`,children:e.t(`deploymentGuide`)}):e.t(`deploymentGuide`),r]})}function wm({className:e}){let t=Kf();return/* @__PURE__ */ (0,F.jsxs)(rm,{className:e,children:[/* @__PURE__ */ (0,F.jsxs)(im,{children:[/* @__PURE__ */ (0,F.jsx)(am,{role:`heading`,"aria-level":2,children:t.t(`updates`)}),/* @__PURE__ */ (0,F.jsx)(om,{children:t.t(`sectionText`,{app:t.appName})})]}),/* @__PURE__ */ (0,F.jsx)(sm,{children:/* @__PURE__ */ (0,F.jsx)(Sm,{})})]})}var Tm=`/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
56
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) 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-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-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:-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-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-foreground:var(--foreground)}}@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}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.\\@container\\/card-header{container:card-header/inline-size}.\\@container\\/field-group{container:field-group/inline-size}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-1{top:var(--spacing)}.top-1\\/2,.top-\\[50\\%\\]{top:50%}.right-1{right:var(--spacing)}.left-1\\/2,.left-\\[50\\%\\]{left:50%}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-my-2{margin-block:calc(var(--spacing) * -2)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mr-auto{margin-right:auto}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.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-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.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-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-auto{height:auto}.min-h-4{min-height:calc(var(--spacing) * 4)}.w-72{width:calc(var(--spacing) * 72)}.w-\\[min\\(20rem\\,calc\\(100vw-1\\.5rem\\)\\)\\]{width:min(20rem,100vw - 1.5rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 2rem)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;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)}.translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{--tw-translate-y:calc(-50% - 2px);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-\\[0_1fr\\]{grid-template-columns:0 1fr}.grid-rows-\\[auto_1fr\\]{grid-template-rows:auto 1fr}.grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-items-start{justify-items:start}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-7{gap:calc(var(--spacing) * 7)}.gap-x-1\\.5{column-gap:calc(var(--spacing) * 1.5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.rounded-\\[2px\\]{border-radius:2px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) * .8)}.rounded-xl{border-radius:calc(var(--radius) * 1.4)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border{border-color:var(--border)}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.bg-background{background-color:var(--background)}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-warning{background-color:var(--warning)}.fill-foreground{fill:var(--foreground)}.fill-primary{fill:var(--primary)}.p-0{padding:0}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-sm\\/relaxed{font-size:var(--text-sm);line-height:var(--leading-relaxed)}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.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)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.underline-offset-4{text-underline-offset:4px}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px 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-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px 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-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)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);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-background{--tw-ring-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;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}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}:is(:where(.group\\/field):has([data-orientation=horizontal]) .group-has-\\[\\[data-orientation\\=horizontal\\]\\]\\/field\\:text-balance){text-wrap:balance}:is(:where(.group)[data-disabled=true] .group-data-\\[disabled\\=true\\]\\:pointer-events-none){pointer-events:none}:is(:where(.group)[data-disabled=true] .group-data-\\[disabled\\=true\\]\\:opacity-50),:is(:where(.group\\/field)[data-disabled=true] .group-data-\\[disabled\\=true\\]\\/field\\:opacity-50){opacity:.5}:is(:where(.group\\/alert-dialog-content)[data-size=sm] .group-data-\\[size\\=sm\\]\\/alert-dialog-content\\:grid){display:grid}:is(:where(.group\\/alert-dialog-content)[data-size=sm] .group-data-\\[size\\=sm\\]\\/alert-dialog-content\\:grid-cols-2){grid-template-columns:repeat(2,minmax(0,1fr))}:is(:where(.group\\/field-group)[data-variant=outline] .group-data-\\[variant\\=outline\\]\\/field-group\\:-mb-2){margin-bottom:calc(var(--spacing) * -2)}:is(:where(.peer):disabled~.peer-disabled\\:cursor-not-allowed){cursor:not-allowed}:is(:where(.peer):disabled~.peer-disabled\\:opacity-50){opacity:.5}.last\\:mt-0:last-child{margin-top:0}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\\:underline:hover{text-decoration-line:underline}}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(3px + 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)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-data-\\[slot\\=alert-dialog-media\\]\\:grid-rows-\\[auto_auto_1fr\\]:has([data-slot=alert-dialog-media]){grid-template-rows:auto auto 1fr}.has-data-\\[slot\\=alert-dialog-media\\]\\:gap-x-6:has([data-slot=alert-dialog-media]){column-gap:calc(var(--spacing) * 6)}.has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\\[state\\=checked\\]\\:border-primary:has([data-state=checked]){border-color:var(--primary)}.has-data-\\[state\\=checked\\]\\:bg-primary\\/5:has([data-state=checked]){background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.has-data-\\[state\\=checked\\]\\:bg-primary\\/5:has([data-state=checked]){background-color:color-mix(in oklab, var(--primary) 5%, transparent)}}.has-\\[\\>\\[data-slot\\=checkbox-group\\]\\]\\:gap-3:has(>[data-slot=checkbox-group]){gap:calc(var(--spacing) * 3)}.has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:items-start:has(>[data-slot=field-content]){align-items:flex-start}.has-\\[\\>\\[data-slot\\=field\\]\\]\\:w-full:has(>[data-slot=field]){width:100%}.has-\\[\\>\\[data-slot\\=field\\]\\]\\:flex-col:has(>[data-slot=field]){flex-direction:column}.has-\\[\\>\\[data-slot\\=field\\]\\]\\:rounded-md:has(>[data-slot=field]){border-radius:calc(var(--radius) * .8)}.has-\\[\\>\\[data-slot\\=field\\]\\]\\:border:has(>[data-slot=field]){border-style:var(--tw-border-style);border-width:1px}.has-\\[\\>\\[data-slot\\=radio-group\\]\\]\\:gap-3:has(>[data-slot=radio-group]){gap:calc(var(--spacing) * 3)}.has-\\[\\>svg\\]\\:grid-cols-\\[calc\\(var\\(--spacing\\)\\*4\\)_1fr\\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\\[\\>svg\\]\\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\\[\\>svg\\]\\:px-1\\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\\[invalid\\=true\\]\\:text-destructive[data-invalid=true]{color:var(--destructive)}.data-\\[orientation\\=horizontal\\]\\:h-px[data-orientation=horizontal]{height:1px}.data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.data-\\[orientation\\=vertical\\]\\:w-px[data-orientation=vertical]{width:1px}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\\[size\\=sm\\]\\:max-w-xs[data-size=sm]{max-width:var(--container-xs)}:is(.\\*\\:data-\\[slot\\=alert-description\\]\\:text-destructive\\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\\*\\:data-\\[slot\\=alert-description\\]\\:text-destructive\\/90>*)[data-slot=alert-description]{color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.data-\\[slot\\=checkbox-group\\]\\:gap-3[data-slot=checkbox-group]{gap:calc(var(--spacing) * 3)}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[variant\\=label\\]\\:text-sm[data-variant=label]{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.data-\\[variant\\=legend\\]\\:text-base[data-variant=legend]{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.nth-last-2\\:-mt-1:nth-last-child(2){margin-top:calc(var(--spacing) * -1)}@media (prefers-reduced-motion:no-preference){.motion-safe\\:animate-spin{animation:var(--animate-spin)}}@media (width>=40rem){.sm\\:col-start-2{grid-column-start:2}.sm\\:grid-cols-\\[max-content_1fr\\]{grid-template-columns:max-content 1fr}.sm\\:flex-row{flex-direction:row}.sm\\:justify-end{justify-content:flex-end}:is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:row-span-2){grid-row:span 2/span 2}:is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:place-items-start){place-items:start}:is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:text-left){text-align:left}:is(:where(.group\\/alert-dialog-content):has([data-slot=alert-dialog-media]) :is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:group-has-data-\\[slot\\=alert-dialog-media\\]\\/alert-dialog-content\\:col-start-2)){grid-column-start:2}:is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:has-data-\\[slot\\=alert-dialog-media\\]\\:grid-rows-\\[auto_1fr\\]):has([data-slot=alert-dialog-media]){grid-template-rows:auto 1fr}.data-\\[size\\=default\\]\\:sm\\:max-w-lg[data-size=default]{max-width:var(--container-lg)}}@media (width>=48rem){.md\\:p-12{padding:calc(var(--spacing) * 12)}}@container field-group (width>=28rem){.\\@md\\/field-group\\:flex-row{flex-direction:row}.\\@md\\/field-group\\:items-center{align-items:center}.\\@md\\/field-group\\:has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:items-start:has(>[data-slot=field-content]){align-items:flex-start}}.dark\\:border-input:is(.dark *){border-color:var(--input)}.dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab, var(--destructive) 60%, transparent)}}.dark\\:bg-input\\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\\:has-data-\\[state\\=checked\\]\\:bg-primary\\/10:is(.dark *):has([data-state=checked]){background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.dark\\:has-data-\\[state\\=checked\\]\\:bg-primary\\/10:is(.dark *):has([data-state=checked]){background-color:color-mix(in oklab, var(--primary) 10%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.\\[\\&_p\\]\\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-6 svg:not([class*=size-]){width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\\*\\:\\[svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-8>*):is(svg:not([class*=size-])){width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.\\[\\&\\>\\*\\]\\:w-full>*{width:100%}.\\[\\&\\>\\*\\]\\:data-\\[slot\\=field\\]\\:p-4>[data-slot=field]{padding:calc(var(--spacing) * 4)}@container field-group (width>=28rem){.\\@md\\/field-group\\:\\[\\&\\>\\*\\]\\:w-auto>*{width:auto}}.\\[\\&\\>\\.sr-only\\]\\:w-auto>.sr-only{width:auto}.\\[\\&\\>\\[data-slot\\=field-group\\]\\]\\:gap-4>[data-slot=field-group]{gap:calc(var(--spacing) * 4)}.\\[\\&\\>\\[data-slot\\=field-label\\]\\]\\:flex-auto>[data-slot=field-label]{flex:auto}@container field-group (width>=28rem){.\\@md\\/field-group\\:\\[\\&\\>\\[data-slot\\=field-label\\]\\]\\:flex-auto>[data-slot=field-label]{flex:auto}}:is(.has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:\\[\\&\\>\\[role\\=checkbox\\]\\,\\[role\\=radio\\]\\]\\:mt-px:has(>[data-slot=field-content])>[role=checkbox],.has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:\\[\\&\\>\\[role\\=checkbox\\]\\,\\[role\\=radio\\]\\]\\:mt-px:has(>[data-slot=field-content]) [role=radio]){margin-top:1px}@container field-group (width>=28rem){:is(.\\@md\\/field-group\\:has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:\\[\\&\\>\\[role\\=checkbox\\]\\,\\[role\\=radio\\]\\]\\:mt-px:has(>[data-slot=field-content])>[role=checkbox],.\\@md\\/field-group\\:has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:\\[\\&\\>\\[role\\=checkbox\\]\\,\\[role\\=radio\\]\\]\\:mt-px:has(>[data-slot=field-content]) [role=radio]){margin-top:1px}}.\\[\\&\\>a\\]\\:underline>a{text-decoration-line:underline}.\\[\\&\\>a\\]\\:underline-offset-4>a{text-underline-offset:4px}.\\[\\&\\>a\\:hover\\]\\:text-primary>a:hover{color:var(--primary)}.\\[\\&\\>svg\\]\\:pointer-events-none>svg{pointer-events:none}.\\[\\&\\>svg\\]\\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&\\>svg\\]\\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&\\>svg\\]\\:translate-y-0\\.5>svg{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\\[\\&\\>svg\\]\\:text-current>svg{color:currentColor}[data-variant=legend]+.\\[\\[data-variant\\=legend\\]\\+\\&\\]\\:-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}@media (hover:hover){a.\\[a\\&\\]\\:hover\\:bg-accent:hover{background-color:var(--accent)}a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:color-mix(in oklab, var(--secondary) 90%, transparent)}}a.\\[a\\&\\]\\:hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}a.\\[a\\&\\]\\:hover\\:underline:hover{text-decoration-line:underline}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root,.meldgrove-root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:var(--mg-accent,oklch(20.5% 0 0));--primary-foreground:var(--mg-accent-foreground,oklch(98.5% 0 0));--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(52% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--destructive-foreground:oklch(98.5% 0 0);--success:oklch(60% .15 150);--warning:oklch(75% .15 75);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:var(--mg-accent,oklch(20.5% 0 0));--sidebar-primary-foreground:var(--mg-accent-foreground,oklch(98.5% 0 0));--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:var(--mg-accent,oklch(92.2% 0 0));--primary-foreground:var(--mg-accent-foreground,oklch(20.5% 0 0));--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(98.5% 0 0);--success:oklch(72% .15 150);--warning:oklch(80% .15 75);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:var(--mg-accent,oklch(92.2% 0 0));--sidebar-primary-foreground:var(--mg-accent-foreground,oklch(20.5% 0 0));--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}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{font-family:inherit;display:inline-block}:host(meldgrove-updates-settings){display:block}.meldgrove-root{color:var(--color-foreground);-webkit-font-smoothing:antialiased}@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-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-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}`,Em=/* @__PURE__ */ new Map,Dm=null;function Om(){if(!Dm){Dm=new CSSStyleSheet,Dm.replaceSync(Tm);let e=Array.from(Dm.cssRules).filter(e=>typeof CSSPropertyRule<`u`&&e instanceof CSSPropertyRule).map(e=>e.cssText);if(e.length>0){let t=new CSSStyleSheet;t.replaceSync(e.join(`
|
|
57
|
-
`)),document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}}return
|
|
55
|
+
`},Ca=0,wa=[];function Ta(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Ca++)[0],a=_.useState(Ji)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=wi([e.lockRef.current],(e.shards||[]).map(ba),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=va(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=da(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=da(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 _a(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(wa.length&&wa[wa.length-1]===a){var r=`deltaY`in n?ya(n):va(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&xa(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(ba).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ea(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=va(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,ya(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,va(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return wa.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,oa),document.addEventListener(`touchmove`,c,oa),document.addEventListener(`touchstart`,u,oa),function(){wa=wa.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,oa),document.removeEventListener(`touchmove`,c,oa),document.removeEventListener(`touchstart`,u,oa)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Sa(i)}):null,p?_.createElement(ra,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ea(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Da=Ri(zi,Ta),Oa=_.forwardRef(function(e,t){return _.createElement(Vi,Si({},e,{ref:t,sideCar:Da}))});Oa.classNames=Vi.classNames;var ka=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Aa=/* @__PURE__ */ new WeakMap,ja=/* @__PURE__ */ new WeakMap,Ma={},Na=0,Pa=function(e){return e&&(e.host||Pa(e.parentNode))},Fa=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Pa(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})},Ia=function(e,t,n,r){var i=Fa(t,Array.isArray(e)?e:[e]);Ma[n]||(Ma[n]=/* @__PURE__ */ new WeakMap);var a=Ma[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=(Aa.get(e)||0)+1,l=(a.get(e)||0)+1;Aa.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ja.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(),Na++,function(){o.forEach(function(e){var t=Aa.get(e)-1,i=a.get(e)-1;Aa.set(e,t),a.set(e,i),t||(ja.has(e)||e.removeAttribute(r),ja.delete(e)),i||e.removeAttribute(n)}),Na--,Na||(Aa=/* @__PURE__ */ new WeakMap,Aa=/* @__PURE__ */ new WeakMap,ja=/* @__PURE__ */ new WeakMap,Ma={})}},La=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ka(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ia(r,i,n,`aria-hidden`)):function(){return null}},Ra=Object.defineProperty,za=(e,t)=>Ra(e,`name`,{value:t,configurable:!0}),Ba=`Dialog`,[Va,Ha]=/* @__PURE__ */ En(Ba),[Ua,Wa]=Va(Ba),Ga=/* @__PURE__ */ za(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),{nodes:l,registry:u}=ei(),[d,f]=ir({prop:r,defaultProp:i??!1,onChange:a,caller:Ba}),[p,m]=_.useState(0),[h,g]=_.useState(0);return/* @__PURE__ */ (0,F.jsx)(Ua,{scope:t,triggerRef:s,contentRef:c,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Ka=`DialogTrigger`,qa=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(Ka,n),a=Yt(t,i.triggerRef);return/* @__PURE__ */ (0,F.jsx)(_n.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":po(i.open),...r,ref:a,onClick:H(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Ja=`DialogPortal`,[Ya,Xa]=Va(Ja,{forceMount:void 0}),Za=/* @__PURE__ */ za(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Wa(Ja,t);return/* @__PURE__ */ (0,F.jsx)(Ya,{scope:t,forceMount:n,children:_.Children.map(r,e=>/* @__PURE__ */ (0,F.jsx)(fr,{present:n||a.open,children:/* @__PURE__ */ (0,F.jsx)(mi,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Qa=`DialogOverlay`,$a=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let n=Xa(Qa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wa(Qa,e.__scopeDialog);return a.modal?/* @__PURE__ */ (0,F.jsx)(fr,{present:r||a.open,children:/* @__PURE__ */ (0,F.jsx)(to,{...i,ref:t})}):null},`DialogOverlay`)),eo=/* @__PURE__ */ Qt(`DialogOverlay.RemoveScroll`),to=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(Qa,n),a=Yt(t,Br());return/* @__PURE__ */ (0,F.jsx)(Oa,{as:eo,allowPinchZoom:!0,shards:_.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:/* @__PURE__ */ (0,F.jsx)(_n.div,{"data-state":po(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),no=`DialogContent`,ro=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let n=Xa(no,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Wa(no,e.__scopeDialog);return/* @__PURE__ */ (0,F.jsx)(fr,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,F.jsx)(io,{...i,ref:t}):/* @__PURE__ */ (0,F.jsx)(ao,{...i,ref:t})})},`DialogContent`)),io=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let n=Wa(no,e.__scopeDialog),r=_.useRef(null),i=Yt(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return La(e)},[]),/* @__PURE__ */ (0,F.jsx)(oo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:H(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:H(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),ao=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let n=Wa(no,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return/* @__PURE__ */ (0,F.jsx)(oo,{...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`)),oo=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Wa(no,n);return bi(),/* @__PURE__ */ (0,F.jsx)($r,{registry:l.branchRegistry,children:/* @__PURE__ */ (0,F.jsx)(Zr,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,F.jsx)(zr,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?fo(o,l.descriptionId):o,"data-state":po(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),so=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(`DialogTitle`,n),{setTitleCount:a}=i;return On(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,F.jsx)(_n.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),co=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(`DialogDescription`,n),{setDescriptionCount:a}=i;return On(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ (0,F.jsx)(_n.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),lo=`DialogClose`,uo=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ za(function(e,t){let{__scopeDialog:n,...r}=e,i=Wa(lo,n);return/* @__PURE__ */ (0,F.jsx)(_n.button,{type:`button`,...r,ref:t,onClick:H(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function fo(...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}za(fo,`concatAriaDescribedby`);function po(e){return e?`open`:`closed`}za(po,`getState`);var mo=Object.defineProperty,ho=(e,t)=>mo(e,`name`,{value:t,configurable:!0}),[go,_o]=/* @__PURE__ */ En(`AlertDialog`,[Ha]),vo=Ha(),yo=/* @__PURE__ */ ho(e=>{let{__scopeAlertDialog:t,...n}=e,r=vo(t);return/* @__PURE__ */ (0,F.jsx)(Ga,{...r,...n,modal:!0})},`AlertDialog`);_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)(qa,{...i,...r,ref:t})},`AlertDialogTrigger`));var bo=/* @__PURE__ */ ho(e=>{let{__scopeAlertDialog:t,...n}=e,r=vo(t);return/* @__PURE__ */ (0,F.jsx)(Za,{...r,...n})},`AlertDialogPortal`),xo=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)($a,{...i,...r,ref:t})},`AlertDialogOverlay`)),[So,Co]=go(`AlertDialogContent`),wo=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=vo(n),o=Yt(t,_.useRef(null)),s=_.useRef(null);return/* @__PURE__ */ (0,F.jsx)(So,{scope:n,cancelRef:s,children:/* @__PURE__ */ (0,F.jsx)(ro,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:H(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),To=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)(so,{...i,...r,ref:t})},`AlertDialogTitle`)),Eo=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)(co,{...i,...r,ref:t})},`AlertDialogDescription`)),Do=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=vo(n);return/* @__PURE__ */ (0,F.jsx)(uo,{...i,...r,ref:t})},`AlertDialogAction`)),Oo=`AlertDialogCancel`,ko=_.forwardRef(/* @__PURE__ */ ho(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Co(Oo,n),a=vo(n),o=Yt(t,i);return/* @__PURE__ */ (0,F.jsx)(uo,{...a,...r,ref:o})},`AlertDialogCancel`)),Ao=Object.defineProperty,jo=(e,t)=>Ao(e,`name`,{value:t,configurable:!0});function Mo(e){let[t,n]=_.useState(void 0);return On(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}jo(Mo,`useSize`);var No=[`top`,`right`,`bottom`,`left`],Po=Math.min,Fo=Math.max,Io=Math.round,Lo=Math.floor,Ro=e=>({x:e,y:e}),zo={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function W(e,t,n){return Fo(e,Po(t,n))}function G(e,t){return typeof e==`function`?e(t):e}function Bo(e){return e.split(`-`)[0]}function Vo(e){return e.split(`-`)[1]}function Ho(e){return e===`x`?`y`:`x`}function Uo(e){return e===`y`?`height`:`width`}function Wo(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Go(e){return Ho(Wo(e))}function Ko(e,t,n){n===void 0&&(n=!1);let r=Vo(e),i=Go(e),a=Uo(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ts(o)),[o,ts(o)]}function qo(e){let t=ts(e);return[Jo(e),t,Jo(t)]}function Jo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Yo=[`left`,`right`],Xo=[`right`,`left`],Zo=[`top`,`bottom`],Qo=[`bottom`,`top`];function $o(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xo:Yo:t?Yo:Xo;case`left`:case`right`:return t?Zo:Qo;default:return[]}}function es(e,t,n,r){let i=Vo(e),a=$o(Bo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Jo)))),a}function ts(e){let t=Bo(e);return zo[t]+e.slice(t.length)}function ns(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function rs(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ns(e)}function is(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function as(e,t,n){let{reference:r,floating:i}=e,a=Wo(t),o=Go(t),s=Uo(o),c=Bo(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Vo(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function os(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=G(t,e),p=rs(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=is(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=is(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ss=50,cs=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:os},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=as(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ss&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=as(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ls=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=G(e,t)||{};if(l==null)return{};let d=rs(u),f={x:n,y:r},p=Go(i),m=Uo(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Po(d[_],T),E=Po(d[v],T),D=C-h[m]-E,O=C/2-h[m]/2+w,te=W(ee,O,D),k=!c.arrow&&Vo(i)!=null&&O!==te&&a.reference[m]/2-(O<ee?ee:E)-h[m]/2<0,A=k?O<ee?O-ee:O-D:0;return{[p]:f[p]+A,data:{[p]:te,centerOffset:O-te-A,...k&&{alignmentOffset:A}},reset:k}}}),us=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=G(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bo(r),_=Wo(o),v=Bo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ts(o)]:qo(o)),x=p!==`none`;!d&&x&&b.push(...es(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ko(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Wo(t)||T.every(e=>Wo(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wo(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function ds(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fs(e){return No.some(t=>e[t]>=0)}var ps=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=G(e,t);switch(i){case`referenceHidden`:{let e=ds(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fs(e)}}}case`escaped`:{let e=ds(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:fs(e)}}}default:return{}}}}},ms=/*#__PURE__*/ new Set([`left`,`top`]);async function hs(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bo(n),s=Vo(n),c=Wo(n)===`y`,l=ms.has(o)?-1:1,u=a&&c?-1:1,d=G(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var gs=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await hs(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_s=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=G(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wo(i),p=Ho(f),m=u[p],h=u[f],g=(e,t)=>W(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},vs=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=G(e,t),u={x:n,y:r},d=Wo(i),f=Ho(d),p=u[f],m=u[d],h=G(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ms.has(Bo(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},ys=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=G(e,t),c=await i.detectOverflow(t,s),l=Bo(n),u=Vo(n),d=Wo(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Po(p-c[m],g),y=Po(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Fo(c.left,c.right):S=p-2*Fo(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function bs(){return typeof window<`u`}function xs(e){return ws(e)?(e.nodeName||``).toLowerCase():`#document`}function Ss(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cs(e){return((ws(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ws(e){return bs()?e instanceof Node||e instanceof Ss(e).Node:!1}function Ts(e){return bs()?e instanceof Element||e instanceof Ss(e).Element:!1}function Es(e){return bs()?e instanceof HTMLElement||e instanceof Ss(e).HTMLElement:!1}function Ds(e){return!bs()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ss(e).ShadowRoot}function Os(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=zs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ks(e){return/^(table|td|th)$/.test(xs(e))}function As(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var js=/transform|translate|scale|rotate|perspective|filter/,Ms=/paint|layout|strict|content/,Ns=e=>!!e&&e!==`none`,Ps;function Fs(e){let t=Ts(e)?zs(e):e;return Ns(t.transform)||Ns(t.translate)||Ns(t.scale)||Ns(t.rotate)||Ns(t.perspective)||!Ls()&&(Ns(t.backdropFilter)||Ns(t.filter))||js.test(t.willChange||``)||Ms.test(t.contain||``)}function Is(e){let t=Vs(e);for(;Es(t)&&!Rs(t);){if(Fs(t))return t;if(As(t))return null;t=Vs(t)}return null}function Ls(){return Ps??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ps}function Rs(e){return/^(html|body|#document)$/.test(xs(e))}function zs(e){return Ss(e).getComputedStyle(e)}function Bs(e){return Ts(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vs(e){if(xs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ds(e)&&e.host||Cs(e);return Ds(t)?t.host:t}function Hs(e){let t=Vs(e);return Rs(t)?(e.ownerDocument||e).body:Es(t)&&Os(t)?t:Hs(t)}function Us(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Hs(e),i=r===e.ownerDocument?.body,a=Ss(r);if(i){let e=Ws(a);return t.concat(a,a.visualViewport||[],Os(r)?r:[],e&&n?Us(e):[])}return t.concat(r,Us(r,[],n))}function Ws(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gs(e){let t=zs(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Es(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Io(n)!==a||Io(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ks(e){return Ts(e)?e:e.contextElement}function qs(e){let t=Ks(e);if(!Es(t))return Ro(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gs(t),o=(a?Io(n.width):n.width)/r,s=(a?Io(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Js=/*#__PURE__*/ Ro(0);function Ys(e){let t=Ss(e);return!Ls()||!t.visualViewport?Js:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ss(e)}function Zs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ks(e),o=Ro(1);t&&(r?Ts(r)&&(o=qs(r)):o=qs(e));let s=Xs(a,n,r)?Ys(a):Ro(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Ss(a),t=Ts(r)?Ss(r):r,n=e,i=Ws(n);for(;i&&t!==n;){let e=qs(i),t=i.getBoundingClientRect(),r=zs(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Ss(i),i=Ws(n)}}return is({width:u,height:d,x:c,y:l})}function Qs(e,t){let n=Bs(e).scrollLeft;return t?t.left+n:Zs(Cs(e)).left+n}function $s(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qs(e,n),y:n.top+t.scrollTop}}function ec(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Cs(r),s=t?As(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ro(1),u=Ro(0),d=Es(r);if((d||!a)&&((xs(r)!==`body`||Os(o))&&(c=Bs(r)),d)){let e=Zs(r);l=qs(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$s(o,c):Ro(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function tc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function nc(e){let t=Bs(e),n=e.ownerDocument.body,r=Fo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Fo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Qs(e),o=-t.scrollTop;return zs(n).direction===`rtl`&&(a+=Fo(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var rc=25;function ic(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ss(e),a=Cs(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ls()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Qs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=rc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function ac(e,t){let n=Zs(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=qs(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function oc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ic(e,n,t);else if(t===`document`)r=nc(Cs(e));else if(Ts(t))r=ac(t,n);else{let n=Ys(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return is(r)}function sc(e,t){let n=t.get(e);if(n)return n;let r=Us(e,[],!1).filter(e=>Ts(e)&&xs(e)!==`body`),i=null,a=zs(e).position===`fixed`,o=a?Vs(e):e;for(;Ts(o)&&!Rs(o);){let e=zs(o),t=Fs(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Vs(o)}return t.set(e,r),r}function cc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?As(t)?[]:sc(t,this._c):[].concat(n),r],o=oc(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=oc(t,a[e],i);s=Fo(n.top,s),c=Po(n.right,c),l=Po(n.bottom,l),u=Fo(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function lc(e){let{width:t,height:n}=Gs(e);return{width:t,height:n}}function uc(e,t,n){let r=Es(t),i=Cs(t),a=n===`fixed`,o=Zs(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ro(0);if((r||!a)&&((xs(t)!==`body`||Os(i))&&(s=Bs(t)),r)){let e=Zs(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Qs(i));let l=i&&!r&&!a?$s(i,s):Ro(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function dc(e){return zs(e).position===`static`}function fc(e,t){if(!Es(e)||zs(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Cs(e)===n&&(n=n.ownerDocument.body),n}function pc(e,t){let n=Ss(e);if(As(e))return n;if(!Es(e)){let t=Vs(e);for(;t&&!Rs(t);){if(Ts(t)&&!dc(t))return t;t=Vs(t)}return n}let r=fc(e,t);for(;r&&ks(r)&&dc(r);)r=fc(r,t);return r&&Rs(r)&&dc(r)&&!Fs(r)?n:r||Is(e)||n}var mc=async function(e){let t=this.getOffsetParent||pc,n=this.getDimensions,r=await n(e.floating);return{reference:uc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hc(e){return zs(e).direction===`rtl`}var gc={convertOffsetParentRelativeRectToViewportRelativeRect:ec,getDocumentElement:Cs,getClippingRect:cc,getOffsetParent:pc,getElementRects:mc,getClientRects:tc,getDimensions:lc,getScale:qs,isElement:Ts,isRTL:hc};function _c(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vc(e,t,n){let r=null,i,a=Cs(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Lo(d),h=Lo(a.clientWidth-(u+f)),g=Lo(a.clientHeight-(d+p)),_=Lo(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Fo(0,Po(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!_c(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ss(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function yc(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ks(e),u=i||a?[...l?Us(l):[],...t?Us(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?vc(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zs(e):null;c&&g();function g(){let t=Zs(e);h&&!_c(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var bc=gs,xc=_s,Sc=us,Cc=ys,wc=ps,Tc=ls,Ec=vs,Dc=(e,t,n)=>{let r=/* @__PURE__ */ new Map,i=n??{},a={...gc,...i.platform,_c:r};return cs(e,t,{...i,platform:a})},Oc=typeof document<`u`?_.useLayoutEffect:function(){};function kc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!kc(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!kc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ac(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function jc(e,t){let n=Ac(e);return Math.round(t*n)/n}function Mc(e){let t=_.useRef(e);return Oc(()=>{t.current=e}),t}function Nc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);kc(f,r)||p(r);let[m,h]=_.useState(null),[g,y]=_.useState(null),b=_.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),x=_.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||m,C=o||g,w=_.useRef(null),T=_.useRef(null),ee=_.useRef(u),E=c!=null,D=Mc(c),O=Mc(i),te=Mc(l),k=_.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Dc(w.current,T.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};A.current&&!kc(ee.current,t)&&(ee.current=t,v.flushSync(()=>{d(t)}))})},[f,t,n,O,te]);Oc(()=>{l===!1&&ee.current.isPositioned&&(ee.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=_.useRef(!1);Oc(()=>(A.current=!0,()=>{A.current=!1}),[]),Oc(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(D.current)return D.current(S,C,k);k()}},[S,C,k,D,E]);let ne=_.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),re=_.useMemo(()=>({reference:S,floating:C}),[S,C]),j=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!re.floating)return e;let t=jc(re.floating,u.x),r=jc(re.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ac(re.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,re.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:k,refs:ne,elements:re,floatingStyles:j}),[u,k,ne,re,j])}var Pc=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Tc({element:r.current,padding:i}).fn(n):r?Tc({element:r,padding:i}).fn(n):{}}}},Fc=(e,t)=>{let n=bc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ic=(e,t)=>{let n=xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lc=(e,t)=>({fn:Ec(e).fn,options:[e,t]}),Rc=(e,t)=>{let n=Sc(e);return{name:n.name,fn:n.fn,options:[e,t]}},zc=(e,t)=>{let n=Cc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bc=(e,t)=>{let n=wc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vc=(e,t)=>{let n=Pc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hc=Object.defineProperty,Uc=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ ((e,t)=>Hc(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return/* @__PURE__ */ (0,F.jsx)(_n.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:/* @__PURE__ */ (0,F.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Wc=Object.defineProperty,Gc=(e,t)=>Wc(e,`name`,{value:t,configurable:!0}),Kc={Partial:`partial`,Always:`always`},qc={Optimized:`optimized`,Always:`always`},Jc=`Popper`,[Yc,Xc]=/* @__PURE__ */ En(Jc),[Zc,Qc]=Yc(Jc),$c=/* @__PURE__ */ Gc(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return/* @__PURE__ */ (0,F.jsx)(Zc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),el=`PopperAnchor`,tl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Gc(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Qc(el,n),o=_.useRef(null),s=a.onAnchorChange,c=Yt(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&dl(a.placementState),d=u?.[0],f=u?.[1];return r?null:/* @__PURE__ */ (0,F.jsx)(_n.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),nl=`PopperContent`,[rl,il]=Yc(nl),al=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Gc(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=Kc.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=qc.Optimized,onPlaced:m,...h}=e,g=Qc(nl,n),[v,y]=_.useState(null),b=Yt(t,y),[x,S]=_.useState(null),C=Mo(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,te={padding:E,boundary:D.filter(ll),altBoundary:O},{refs:k,floatingStyles:A,placement:ne,isPositioned:re,middlewareData:j}=Nc({strategy:`fixed`,placement:ee,whileElementsMounted:/* @__PURE__ */ Gc((...e)=>yc(...e,{animationFrame:p===qc.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Fc({mainAxis:i+T,alignmentAxis:o}),c&&Ic({mainAxis:!0,crossAxis:!1,...d===Kc.Partial?{limiter:Lc()}:{},...te}),c&&Rc({...te}),zc({...te,apply:/* @__PURE__ */ Gc(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Vc({element:x,padding:s}),ul({arrowWidth:w,arrowHeight:T}),f&&Bc(O?{strategy:`referenceHidden`,...te}:{strategy:`referenceHidden`,padding:te.padding,altBoundary:te.altBoundary})]}),M=g.setPlacementState;On(()=>(M(ne),()=>{M(void 0)}),[ne,M]);let[ie,ae]=dl(ne),oe=jr(m);On(()=>{re&&oe?.()},[re,oe]);let se=j.arrow?.x,ce=j.arrow?.y,le=j.arrow?.centerOffset!==0,[ue,de]=_.useState();return On(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),/* @__PURE__ */ (0,F.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...A,transform:re?A.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(` `),...j.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:/* @__PURE__ */ (0,F.jsx)(rl,{scope:n,placedSide:ie,placedAlign:ae,onArrowChange:S,arrowX:se,arrowY:ce,shouldHideArrow:le,children:/* @__PURE__ */ (0,F.jsx)(_n.div,{"data-side":ie,"data-align":ae,...h,ref:b,style:{...h.style,animation:re?h.style?.animation:`none`}})})})},`PopperContent`)),ol=`PopperArrow`,sl={top:`bottom`,right:`left`,bottom:`top`,left:`right`},cl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Gc(function(e,t){let{__scopePopper:n,...r}=e,i=il(ol,n),a=sl[i.placedSide];return/* @__PURE__ */ (0,F.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:/* @__PURE__ */ (0,F.jsx)(Uc,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function ll(e){return e!==null}Gc(ll,`isNotNull`);var ul=/* @__PURE__ */ Gc(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=dl(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function dl(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Gc(dl,`getSideAndAlignFromPlacement`);var fl=Object.defineProperty,pl=(e,t)=>fl(e,`name`,{value:t,configurable:!0}),ml=!1;function hl(){let[e,t]=_.useState(ml);return _.useEffect(()=>{ml||(ml=!0,t(!0))},[]),e}pl(hl,`useIsHydrated`);var gl=_.useSyncExternalStore;function _l(){return()=>{}}pl(_l,`subscribe`);function vl(){return gl(_l,()=>!0,()=>!1)}pl(vl,`useIsHydratedModern`);var yl=typeof gl==`function`?vl:hl,bl=Object.defineProperty,xl=(e,t)=>bl(e,`name`,{value:t,configurable:!0}),Sl=`rovingFocusGroup.onEntryFocus`,Cl={bubbles:!1,cancelable:!0},wl=`RovingFocusGroup`,[Tl,El,Dl]=/* @__PURE__ */ jn(wl),[Ol,kl]=/* @__PURE__ */ En(wl,[Dl]),Al={Vertical:`vertical`,Horizontal:`horizontal`},jl={LTR:`ltr`,RTL:`rtl`},[Ml,Nl]=Ol(wl),Pl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ xl(function(e,t){return/* @__PURE__ */ (0,F.jsx)(Tl.Provider,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,F.jsx)(Tl.Slot,{scope:e.__scopeRovingFocusGroup,children:/* @__PURE__ */ (0,F.jsx)(Fl,{...e,ref:t})})})},`RovingFocusGroup`)),Fl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ xl(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=_.useRef(null),p=Yt(t,f),m=Dr(a),[h,g]=ir({prop:o,defaultProp:s??null,onChange:c,caller:wl}),[v,y]=_.useState(!1),b=jr(l),x=El(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Sl,b),()=>e.removeEventListener(Sl,b)},[b]),/* @__PURE__ */ (0,F.jsx)(Ml,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:/* @__PURE__ */ (0,F.jsx)(_n.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:H(e.onMouseDown,()=>{S.current=!0}),onFocus:H(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Sl,Cl);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Vl([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Il=`RovingFocusGroupItem`,Ll=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ xl(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Sr(),l=a||c,u=Nl(Il,n),d=u.currentTabStopId===l,f=El(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=yl();return On(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),_.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),/* @__PURE__ */ (0,F.jsx)(Tl.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:/* @__PURE__ */ (0,F.jsx)(_n.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:H(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:H(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bl(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().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?Hl(n,r+1):n.slice(r+1)}setTimeout(()=>Vl(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),Rl={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zl(e,t){return t===jl.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}xl(zl,`getDirectionAwareKey`);function Bl(e,t,n){let r=zl(e.key,n);if(!(t===Al.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Al.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rl[r]}xl(Bl,`getFocusIntent`);function Vl(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}xl(Vl,`focusFirst`);function Hl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}xl(Hl,`wrapArray`);var Ul=Object.defineProperty,Wl=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ ((e,t)=>Ul(e,`name`,{value:t,configurable:!0}))(function(e,t){return/* @__PURE__ */ (0,F.jsx)(_n.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),Gl=Object.defineProperty,Kl=(e,t)=>Gl(e,`name`,{value:t,configurable:!0}),ql=`Popover`,[Jl,Yl]=/* @__PURE__ */ En(ql,[Xc]),Xl=Xc(),[Zl,Ql]=Jl(ql),$l=/* @__PURE__ */ Kl(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Xl(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=_.useState(0),[p,m]=_.useState(0),[h,g]=ir({prop:r,defaultProp:i??!1,onChange:a,caller:ql});return/* @__PURE__ */ (0,F.jsx)($c,{...s,children:/* @__PURE__ */ (0,F.jsx)(Zl,{scope:t,contentId:Sr(),titleId:Sr(),descriptionId:Sr(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:_.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),eu=`PopoverTrigger`,tu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(function(e,t){let{__scopePopover:n,...r}=e,i=Ql(eu,n),a=Xl(n),o=Yt(t,i.triggerRef),s=/* @__PURE__ */ (0,F.jsx)(_n.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":du(i.open),...r,ref:o,onClick:H(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:/* @__PURE__ */ (0,F.jsx)(tl,{asChild:!0,...a,children:s})},`PopoverTrigger`)),nu=`PopoverPortal`,[ru,K]=Jl(nu,{forceMount:void 0}),iu=/* @__PURE__ */ Kl(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Ql(nu,t);return/* @__PURE__ */ (0,F.jsx)(ru,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,F.jsx)(fr,{present:n||a.open,children:/* @__PURE__ */ (0,F.jsx)(mi,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),au=`PopoverContent`,ou=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(function(e,t){let n=K(au,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Ql(au,e.__scopePopover);return/* @__PURE__ */ (0,F.jsx)(fr,{present:r||a.open,children:a.modal?/* @__PURE__ */ (0,F.jsx)(cu,{...i,ref:t}):/* @__PURE__ */ (0,F.jsx)(lu,{...i,ref:t})})},`PopoverContent`)),su=/* @__PURE__ */ Qt(`PopoverContent.RemoveScroll`),cu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(function(e,t){let n=Ql(au,e.__scopePopover),r=_.useRef(null),i=Yt(t,r),a=_.useRef(!1),{nodes:o,registry:s}=ei();return _.useEffect(()=>{let e=r.current;if(e)return La(e)},[]),/* @__PURE__ */ (0,F.jsx)(Oa,{as:su,allowPinchZoom:!0,shards:_.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:/* @__PURE__ */ (0,F.jsx)(uu,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:H(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:H(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),lu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(function(e,t){let n=Ql(au,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return/* @__PURE__ */ (0,F.jsx)(uu,{...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`)),uu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Kl(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=Ql(au,n),g=Xl(n),[v,y]=_.useState(null),b=Yt(t,y);return ti(v),bi(),/* @__PURE__ */ (0,F.jsx)($r,{registry:p,children:/* @__PURE__ */ (0,F.jsx)(Zr,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ (0,F.jsx)(zr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:/* @__PURE__ */ (0,F.jsx)(al,{"data-state":du(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?fu(d,h.descriptionId):d,...g,...m,ref:b,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 du(e){return e?`open`:`closed`}Kl(du,`getState`);function fu(...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}Kl(fu,`concatAriaDescribedby`);var pu=Object.defineProperty,mu=(e,t)=>pu(e,`name`,{value:t,configurable:!0}),hu=`Radio`,[gu,_u]=/* @__PURE__ */ En(hu),[vu,yu]=gu(hu);function bu(e){let{__scopeRadio:t,checked:n=!1,children:r,disabled:i,form:a,name:o,onCheck:s,required:c,value:l=`on`,internal_do_not_use_render:u}=e,[d,f]=_.useState(null),[p,m]=_.useState(null),[h,g]=_.useState(null),v={checked:n,disabled:i,required:c,name:o,form:a,value:l,control:d,setControl:f,userClick:h,onUserClick:g,isFormControl:!d||!!a||!!d.closest(`form`),bubbleInput:p,setBubbleInput:m,onCheck:/* @__PURE__ */ mu(()=>s?.(),`onCheck`)};return/* @__PURE__ */ (0,F.jsx)(vu,{scope:t,...v,children:Du(u)?u(v):r})}mu(bu,`RadioProvider`);var xu=`RadioTrigger`,Su=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function({__scopeRadio:e,onClick:t,...n},r){let{checked:i,disabled:a,value:o,setControl:s,onCheck:c,onUserClick:l,isFormControl:u,bubbleInput:d}=yu(xu,e),f=Yt(r,s);return/* @__PURE__ */ (0,F.jsx)(_n.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":Ou(i),"data-disabled":a?``:void 0,disabled:a,value:o,...n,ref:f,onClick:H(t,e=>{let t=e.isPropagationStopped();i||(l({hasConsumerStoppedPropagation:t}),c()),d&&u&&(t||e.stopPropagation())})})},`RadioTrigger`)),Cu=`RadioIndicator`,wu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadio:n,forceMount:r,...i}=e,a=yu(Cu,n);return/* @__PURE__ */ (0,F.jsx)(fr,{present:r||a.checked,children:/* @__PURE__ */ (0,F.jsx)(_n.span,{"data-state":Ou(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})},`RadioIndicator`)),Tu=`RadioBubbleInput`,Eu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function({__scopeRadio:e,onClick:t,...n},r){let{control:i,checked:a,required:o,disabled:s,name:c,value:l,form:u,bubbleInput:d,setBubbleInput:f,userClick:p}=yu(Tu,e),m=Yt(r,f),h=Mo(i),g=_.useRef(!1),v=_.useRef(a),y=_.useRef(p),b=_.useRef(null);_.useEffect(()=>{let e=d;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(!n)return;let r=v.current!==a;v.current=a;let i=p!==null&&p!==y.current;if(y.current=p,i)b.current=r?null:p,r&&n.call(e,a),e.dispatchEvent(new Event(`click`,{bubbles:!p.hasConsumerStoppedPropagation}));else if(r){let t=b.current;b.current=null;let r=a&&t!==null;g.current=!0,n.call(e,a),e.dispatchEvent(new Event(`click`,{bubbles:!(r&&t.hasConsumerStoppedPropagation)})),g.current=!1}},[d,a,p]);let x=_.useRef(a);return/* @__PURE__ */ (0,F.jsx)(_n.input,{type:`radio`,"aria-hidden":!0,defaultChecked:x.current,required:o,disabled:s,name:c,value:l,form:u,...n,tabIndex:-1,ref:m,onClick:H(t,e=>{g.current&&e.stopPropagation()}),style:{...n.style,...h,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`RadioBubbleInput`));function Du(e){return typeof e==`function`}mu(Du,`isFunction`);function Ou(e){return e?`checked`:`unchecked`}mu(Ou,`getState`);var ku=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Au=`RadioGroup`,[ju,Mu]=/* @__PURE__ */ En(Au,[kl,_u]),Nu=kl(),Pu=_u(),[Fu,Iu]=ju(Au),Lu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,name:r,form:i,defaultValue:a,value:o,required:s=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,m=Nu(n),h=Dr(u),[g,v]=ir({prop:o,defaultProp:a??null,onChange:f,caller:Au}),[y,b]=_.useState(null),x=Yt(t,b),S=_.useRef(g);return _.useEffect(()=>{let e=i?y?.ownerDocument.getElementById(i):y?.closest(`form`);if(e instanceof HTMLFormElement){let t=/* @__PURE__ */ mu(()=>v(S.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[y,i,v]),/* @__PURE__ */ (0,F.jsx)(Fu,{scope:n,name:r,form:i,required:s,disabled:c,value:g,onValueChange:v,children:/* @__PURE__ */ (0,F.jsx)(Pl,{asChild:!0,...m,orientation:l,dir:h,loop:d,children:/* @__PURE__ */ (0,F.jsx)(_n.div,{role:`radiogroup`,"aria-required":s,"aria-orientation":l,"data-disabled":c?``:void 0,dir:h,...p,ref:x})})})},`RadioGroup`)),Ru=`RadioGroupItemProvider`,zu=`RadioGroupItemTrigger`;function Bu(e){let{__scopeRadioGroup:t,value:n,disabled:r,children:i,internal_do_not_use_render:a}=e,o=Iu(Ru,t),s=Pu(t),c=o.disabled||r;return/* @__PURE__ */ (0,F.jsx)(bu,{...s,checked:o.value===n,disabled:c,required:o.required,name:o.name,form:o.form,value:n,onCheck:()=>o.onValueChange(n),internal_do_not_use_render:a,children:i})}mu(Bu,`RadioGroupItemProvider`);var Vu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=Nu(n),a=Pu(n),{checked:o,disabled:s}=yu(zu,a.__scopeRadio),c=_.useRef(null),l=Yt(t,c),u=_.useRef(!1);return _.useEffect(()=>{let e=/* @__PURE__ */ mu(e=>{ku.includes(e.key)&&(u.current=!0)},`handleKeyDown`),t=/* @__PURE__ */ mu(()=>u.current=!1,`handleKeyUp`);return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),/* @__PURE__ */ (0,F.jsx)(Ll,{asChild:!0,...i,focusable:!s,active:o,children:/* @__PURE__ */ (0,F.jsx)(Su,{...a,...r,ref:l,onKeyDown:H(r.onKeyDown,e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:H(r.onFocus,()=>{u.current&&c.current?.click()})})})},`RadioGroupItemTrigger`)),Hu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,value:r,disabled:i,...a}=e;return/* @__PURE__ */ (0,F.jsx)(Bu,{__scopeRadioGroup:n,value:r,disabled:i,internal_do_not_use_render:({isFormControl:e})=>/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Vu,{...a,ref:t,__scopeRadioGroup:n}),e&&/* @__PURE__ */ (0,F.jsx)(Uu,{__scopeRadioGroup:n})]})})},`RadioGroupItem`)),Uu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=Pu(n);return/* @__PURE__ */ (0,F.jsx)(Eu,{...i,...r,ref:t})},`RadioGroupItemBubbleInput`)),Wu=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ mu(function(e,t){let{__scopeRadioGroup:n,...r}=e,i=Pu(n);return/* @__PURE__ */ (0,F.jsx)(wu,{...i,...r,ref:t})},`RadioGroupIndicator`)),Gu=Object.defineProperty,Ku=(e,t)=>Gu(e,`name`,{value:t,configurable:!0}),[qu,Ju]=/* @__PURE__ */ En(`Tooltip`,[Xc]),Yu=Xc(),Xu=`TooltipProvider`,Zu=700,Qu=`tooltip.open`,[q,J]=qu(Xu),Y=/* @__PURE__ */ Ku(e=>{let{__scopeTooltip:t,delayDuration:n=Zu,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),/* @__PURE__ */ (0,F.jsx)(q,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),X=`Tooltip`,[Z,$u]=qu(X),ed=/* @__PURE__ */ Ku(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=J(X,e.__scopeTooltip),l=Yu(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=Sr(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=ir({prop:r,defaultProp:i??!1,onChange:/* @__PURE__ */ Ku(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Qu))):c.onClose(),a?.(e)},`onChange`),caller:X}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let ee=f??m;return/* @__PURE__ */ (0,F.jsx)($c,{...l,children:/* @__PURE__ */ (0,F.jsx)(Z,{scope:t,contentId:ee,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),td=`TooltipTrigger`,nd=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=$u(td,n),o=J(td,n),s=Yu(n),c=Yt(t,_.useRef(null),a.onTriggerChange),l=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),/* @__PURE__ */ (0,F.jsx)(tl,{asChild:!0,...s,children:/* @__PURE__ */ (0,F.jsx)(_n.button,{"aria-describedby":a.open?yd(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:H(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:H(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:H(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:H(e.onBlur,a.onClose),onClick:H(e.onClick,a.onClose)})})},`TooltipTrigger`)),rd=`TooltipPortal`,[id,ad]=qu(rd,{forceMount:void 0}),od=/* @__PURE__ */ Ku(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=$u(rd,t);return/* @__PURE__ */ (0,F.jsx)(id,{scope:t,forceMount:n,children:/* @__PURE__ */ (0,F.jsx)(fr,{present:n||a.open,children:/* @__PURE__ */ (0,F.jsx)(mi,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),sd=`TooltipContent`,cd=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let n=ad(sd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=$u(sd,e.__scopeTooltip);return/* @__PURE__ */ (0,F.jsx)(fr,{present:r||o.open,children:o.disableHoverableContent?/* @__PURE__ */ (0,F.jsx)(dd,{side:i,...a,ref:t}):/* @__PURE__ */ (0,F.jsx)(ld,{side:i,...a,ref:t})})},`TooltipContent`)),ld=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let n=$u(sd,e.__scopeTooltip),r=J(sd,e.__scopeTooltip),i=_.useRef(null),a=Yt(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=md(r,pd(r,n.getBoundingClientRect())),a=hd(t.getBoundingClientRect()),o=_d([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=/* @__PURE__ */ Ku(e=>p(e,u),`handleTriggerLeave`),t=/* @__PURE__ */ Ku(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=/* @__PURE__ */ Ku(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!gd(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),/* @__PURE__ */ (0,F.jsx)(dd,{...e,ref:a})},`TooltipContentHoverable`)),ud=/* @__PURE__ */ tn(`TooltipContent`),dd=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=$u(sd,n),u=Yu(n),{onClose:d}=l,[f,p]=_.useState(null),m=Yt(t,p);ti(f),_.useEffect(()=>(document.addEventListener(Qu,d),()=>document.removeEventListener(Qu,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=/* @__PURE__ */ Ku(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return On(()=>(h(a),()=>{h(void 0)}),[a,h]),/* @__PURE__ */ (0,F.jsx)(zr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:/* @__PURE__ */ (0,F.jsxs)(al,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[/* @__PURE__ */ (0,F.jsx)(ud,{children:r}),i?/* @__PURE__ */ (0,F.jsx)(Sn,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),fd=/* @__PURE__ */ _.forwardRef(/* @__PURE__ */ Ku(function(e,t){let{__scopeTooltip:n,...r}=e,i=Yu(n);return/* @__PURE__ */ (0,F.jsx)(cl,{...i,...r,ref:t})},`TooltipArrow`));function pd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Ku(pd,`getExitSideFromRect`);function md(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Ku(md,`getPaddedExitPoints`);function hd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Ku(hd,`getPointsFromRect`);function gd(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}Ku(gd,`isPointInPolygon`);function _d(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),vd(t)}Ku(_d,`getHull`);function vd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Ku(vd,`getHullPresorted`);function yd(...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}Ku(yd,`concatAriaDescribedby`);var bd=(0,_.createContext)(null);function xd(e){return/* @__PURE__ */ (0,F.jsx)(bd.Provider,{value:e.container,children:e.children})}function Sd(){return(0,_.useContext)(bd)??void 0}function Cd({delayDuration:e=0,...t}){return/* @__PURE__ */ (0,F.jsx)(Y,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function wd({...e}){return/* @__PURE__ */ (0,F.jsx)(ed,{"data-slot":`tooltip`,...e})}function Td({...e}){return/* @__PURE__ */ (0,F.jsx)(nd,{"data-slot":`tooltip-trigger`,...e})}function Ed({className:e,sideOffset:t=0,children:n,...r}){return/* @__PURE__ */ (0,F.jsx)(od,{container:Sd(),children:/* @__PURE__ */ (0,F.jsxs)(cd,{"data-slot":`tooltip-content`,sideOffset:t,className:V(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,/* @__PURE__ */ (0,F.jsx)(fd,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function Dd(e){return e}function Od(e,t){return t?e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e):e}function kd(e,t){let n=e[t],r=e.en;return(e,t)=>{let i=t!==void 0&&Number(t.count)===1?`${e}_one`:null;return Od((i?n[i]??r[i]:void 0)??n[e]??r[e]??e,t)}}var Ad=Dd({en:{cancel:`Cancel`,confirm:`Confirm`,back:`Back`,next:`Next`,loading:`Loading…`,retry:`Retry`,copy:`Copy`,copied:`Copied`,error:`Something went wrong`,page:`Page {page} of {pages}`,total:`{count} entries`,total_one:`1 entry`},de:{cancel:`Abbrechen`,confirm:`Bestätigen`,back:`Zurück`,next:`Weiter`,loading:`Wird geladen…`,retry:`Erneut versuchen`,copy:`Kopieren`,copied:`Kopiert`,error:`Etwas ist schiefgelaufen`,page:`Seite {page} von {pages}`,total:`{count} Einträge`,total_one:`1 Eintrag`}});function jd(e){if(e instanceof Error)return e.message;if(typeof e==`string`&&e!==``)return e;let t=e?.message;return typeof t==`string`&&t!==``?t:`Something went wrong`}var Md=(0,_.createContext)(`en`);function Nd(e){return/* @__PURE__ */ (0,F.jsx)(Md.Provider,{value:e.locale,children:e.children})}function Pd(){return(0,_.useContext)(Md)}function Fd(e){let t=Pd();return(0,_.useCallback)(kd(e,t),[e,t])}var Id=Dd({en:{updates:`Updates`,checkForUpdates:`Check for updates`,checking:`Checking for updates…`,upToDate:`Up to date`,upToDateVersion:`Up to date · {version}`,available:`Update available`,releaseNotes:`Release notes`,changes:`Changes`,opensInNewTab:`(opens in a new tab)`,moreChanges:`and {n} more changes`,moreChanges_one:`and 1 more change`,installNow:`Install now`,installAnyway:`Install anyway…`,installsOn:`Installs automatically on {date}`,installsNextCheck:`Installs automatically at the next check`,attention:`{version} needs upgrade steps`,attentionText:`This release changes the setup. Take the upgrade steps from its release notes on the server first.`,attentionLocked:`The image tag set where {app} is deployed does not reach {version}. Take the upgrade steps, then change the tag there.`,failed:`Update to {version} failed`,stillRunning:`{version} is still running.`,tryAgain:`Try again`,installing:`Installing {version}…`,stage_pulling:`Downloading`,stage_starting:`Starting`,"stage_rolling-back":`Going back to {version}`,stage_deploying:`Deploying`,restarts:`{app} restarts. This page reloads when it is back.`,confirmTitle:`Install {version} now?`,confirmText:`{app} restarts and is unavailable for a moment. Database changes run automatically.`,confirmAnywayTitle:`Install {version} without its upgrade steps?`,confirmAnywayText:`The release notes name the steps this release needs on the server. Without them, {app} may not start again.`,install:`Install`,updated:`Updated to {version}`,restarting:`Restarting…`,slow:`This takes longer than expected. Check the server (journalctl -u meldgrove-updater-{project}).`,stopWaiting:`Stop waiting`,notStarted:`The installation did not start`,notConfirmed:`The installation could not be confirmed`,noAnswer:`{app} did not answer in time.`,failedLine:`{version} failed: {message}`,installed:`Installed`,installedFooter:`Installed: {version} · {channel}`,checked:`Checked {time}`,notChecked:`Not checked yet`,checkNow:`Check now`,checkFailed:`Last check failed: {error}`,stable:`Stable`,preview:`Preview`,off:`Automatic updates are off on this server`,offText:`Automatic updates are off on this server, so it cannot install from here. See the {guide}.`,deploymentGuide:`deployment guide`,unreachable:`No update service. See the deployment guide.`,development:`development`,sectionText:`New versions of {app} and how they install.`,installedVersion:`Installed version`,channel:`Channel`,recommended:`recommended`,stableText:`Releases. Updates that need no action install automatically after {cooldown}.`,stableTextNoCooldown:`Releases. Updates that need no action install automatically.`,previewText:`Unstable: every change on main as soon as its checks pass, before it is released. New features first, and now and then a new bug. Previews have no release notes.`,switchBack:`Switching back to Stable keeps this version until a release is newer.`,saveChannel:`Save channel`,channelSaved:`Channel saved`,channelNotSaved:`The update service did not switch the channel.`,automatic:`Automatic installs`,autoReleases:`On: releases install automatically after {cooldown}.`,autoReleasesWindow:`On: releases install automatically after {cooldown}, between {start} and {end} ({timezone}).`,autoNextCheck:`On: updates install automatically at the next check.`,autoNextCheckWindow:`On: updates install automatically at the next check, between {start} and {end} ({timezone}).`,autoOff:`Off on this server: nothing installs automatically.`,autoPlatform:`The platform installs them (deploy link).`,sectionUnreachable:`The update service is not reachable.`,sectionUnreachableHelp:`Automatic updates need the updater service from compose.yaml ({guide}).`,lastCheck:`Last check`,updaterVersion:`Updater {version}`,signedOut:`Sign in again as an admin to manage updates.`,days:`{count} days`,days_one:`1 day`,hours:`{count} hours`,hours_one:`1 hour`,minutes:`{count} minutes`,minutes_one:`1 minute`,seconds:`{count} seconds`,seconds_one:`1 second`},de:{updates:`Updates`,checkForUpdates:`Nach Updates suchen`,checking:`Suche nach Updates …`,upToDate:`Aktuell`,upToDateVersion:`Aktuell · {version}`,available:`Update verfügbar`,releaseNotes:`Versionshinweise`,changes:`Änderungen`,opensInNewTab:`(öffnet in neuem Tab)`,moreChanges:`und {n} weitere Änderungen`,moreChanges_one:`und 1 weitere Änderung`,installNow:`Jetzt installieren`,installAnyway:`Trotzdem installieren …`,installsOn:`Wird am {date} automatisch installiert`,installsNextCheck:`Wird bei der nächsten Prüfung automatisch installiert`,attention:`{version} braucht Schritte beim Upgrade`,attentionText:`Diese Version ändert die Einrichtung. Führe zuerst die Upgrade-Schritte aus den Versionshinweisen auf dem Server aus.`,attentionLocked:`Das Image-Tag, mit dem {app} deployt ist, erreicht {version} nicht. Führe die Upgrade-Schritte aus und ändere dann dort das Tag.`,failed:`Update auf {version} fehlgeschlagen`,stillRunning:`{version} läuft weiter.`,tryAgain:`Erneut versuchen`,installing:`{version} wird installiert …`,stage_pulling:`Download`,stage_starting:`Start`,"stage_rolling-back":`Zurück zu {version}`,stage_deploying:`Deployment`,restarts:`{app} startet neu. Diese Seite lädt neu, sobald sie wieder da ist.`,confirmTitle:`{version} jetzt installieren?`,confirmText:`{app} startet neu und ist kurz nicht erreichbar. Änderungen an der Datenbank laufen automatisch.`,confirmAnywayTitle:`{version} ohne Upgrade-Schritte installieren?`,confirmAnywayText:`Die Versionshinweise nennen die Schritte, die diese Version auf dem Server braucht. Ohne sie startet {app} vielleicht nicht wieder.`,install:`Installieren`,updated:`Auf {version} aktualisiert`,restarting:`Neustart …`,slow:`Das dauert länger als erwartet. Prüfe den Server (journalctl -u meldgrove-updater-{project}).`,stopWaiting:`Nicht mehr warten`,notStarted:`Die Installation hat nicht begonnen`,notConfirmed:`Die Installation ließ sich nicht bestätigen`,noAnswer:`{app} hat nicht rechtzeitig geantwortet.`,failedLine:`{version} fehlgeschlagen: {message}`,installed:`Installiert`,installedFooter:`Installiert: {version} · {channel}`,checked:`Geprüft {time}`,notChecked:`Noch nicht geprüft`,checkNow:`Jetzt prüfen`,checkFailed:`Letzte Prüfung fehlgeschlagen: {error}`,stable:`Stabil`,preview:`Vorschau`,off:`Automatische Updates sind auf diesem Server aus`,offText:`Automatische Updates sind auf diesem Server aus, daher kann es hier nicht installiert werden. Siehe {guide}.`,deploymentGuide:`Anleitung zum Deployment`,unreachable:`Kein Update-Dienst. Siehe Anleitung zum Deployment.`,development:`Entwicklung`,sectionText:`Neue Versionen von {app} und wie sie installiert werden.`,installedVersion:`Installierte Version`,channel:`Kanal`,recommended:`empfohlen`,stableText:`Veröffentlichte Versionen. Updates ohne nötige Schritte werden nach {cooldown} automatisch installiert.`,stableTextNoCooldown:`Veröffentlichte Versionen. Updates ohne nötige Schritte werden automatisch installiert.`,previewText:`Instabil: jede Änderung auf main, sobald ihre Prüfungen bestanden sind, noch vor der Veröffentlichung. Neues zuerst, und ab und zu ein neuer Fehler. Vorschauen haben keine Versionshinweise.`,switchBack:`Zurück auf Stabil bleibt diese Version, bis eine Veröffentlichung neuer ist.`,saveChannel:`Kanal speichern`,channelSaved:`Kanal gespeichert`,channelNotSaved:`Der Update-Dienst hat den Kanal nicht gewechselt.`,automatic:`Automatische Installation`,autoReleases:`An: Veröffentlichte Versionen werden nach {cooldown} automatisch installiert.`,autoReleasesWindow:`An: Veröffentlichte Versionen werden nach {cooldown} automatisch installiert, zwischen {start} und {end} ({timezone}).`,autoNextCheck:`An: Updates werden bei der nächsten Prüfung automatisch installiert.`,autoNextCheckWindow:`An: Updates werden bei der nächsten Prüfung automatisch installiert, zwischen {start} und {end} ({timezone}).`,autoOff:`Aus auf diesem Server: Nichts wird automatisch installiert.`,autoPlatform:`Die Plattform installiert sie (Deploy-Link).`,sectionUnreachable:`Der Update-Dienst ist nicht erreichbar.`,sectionUnreachableHelp:`Automatische Updates brauchen den Dienst updater aus compose.yaml ({guide}).`,lastCheck:`Letzte Prüfung`,updaterVersion:`Updater {version}`,signedOut:`Melde dich erneut als Admin an, um Updates zu verwalten.`,days:`{count} Tagen`,days_one:`1 Tag`,hours:`{count} Stunden`,hours_one:`1 Stunde`,minutes:`{count} Minuten`,minutes_one:`1 Minute`,seconds:`{count} Sekunden`,seconds_one:`1 Sekunde`}}),Ld=9e5,Rd=6e4,zd=1e4,Bd=/* @__PURE__ */ new Set([`failed`,`rolled-back`]);function Vd(e){return[e.available,e.attention].filter(e=>e!==null)}function Hd(e,t=null){let n=e?.updater,r=n?.last;if(!n||!r||!Bd.has(r.result))return null;if(t&&t.version===r.version&&t.finishedAt===r.finishedAt){let e=Vd(n),t=e.find(e=>e.version===r.version)??null;return!t&&e.length>0?null:{version:r.version,message:r.message??t?.failed??null,offer:t}}return n.available?.failed?{version:n.available.version,message:n.available.failed,offer:n.available}:n.attention&&n.attention.version===r.version?{version:r.version,message:n.attention.failed??r.message,offer:n.attention}:null}function Ud(e,t=null){let n=e?.updater,r=n?.last;return!n||!r||!Bd.has(r.result)||Hd(e,t)||Vd(n).length===0?null:{version:r.version,message:r.message}}function Wd(e,t,n=null){if(t)return`installing`;if(!e)return`loading`;let r=e.updater;return!e.reachable||!r?`unreachable`:r.installing?`installing`:Hd(e,n)?`failed`:r.available?`available`:r.attention?`attention`:r.mode===`off`?`off`:`current`}function Gd(e,t){let n=Wd(e,t.pending,t.recent??null);return n===`loading`||n===`unreachable`||n===`installing`?n:t.checking||e?.updater?.checking?`checking`:n}function Kd(e,t,n=null){return n?!0:t?.updater?e===`available`||e===`attention`||e===`failed`||e===`installing`:!1}function qd(e,t){return e.mode===`off`?!1:t!==e.attention||e.channelLocked===null}function Jd(e,t,n){return{version:e,from:t?.app.version??null,startedAt:n,confirmed:!1,earlier:t?.updater?.last??null,installStartedAt:null,answeredAt:null,reason:null,lastError:null,unreported:!1,outage:!1}}function Yd(e,t,n){return{...Jd(e.version,t,n),confirmed:!0,installStartedAt:e.startedAt}}function Xd(e){return{version:e.version,installStartedAt:e.installStartedAt,startedAt:e.startedAt}}function Zd(e){return Math.floor(e/1e3)*1e3}function Qd(e,t){return!t||e.version!==t.version?!1:t.installStartedAt===null?Date.parse(e.startedAt)>=Zd(t.startedAt):e.startedAt===t.installStartedAt}function $d(e,t){return e.version===t.version&&e.result===t.result&&e.finishedAt===t.finishedAt}function ef(e,t){let n=t?.last;if(!n||n.version!==e.version||e.earlier&&$d(n,e.earlier))return null;let r=e.installStartedAt===null?Zd(e.startedAt):Date.parse(e.installStartedAt);return Date.parse(n.finishedAt)>=r?n:null}function tf(e,t,n,r=null,i=n){let a=t.updater,o=a?.installing??null,s=o!==null&&!Qd(o,r);if(!e)return s?Yd(o,t,n):null;if(!a)return nf(e,t.error);if(o&&o.version===e.version)return e.confirmed&&e.installStartedAt===o.startedAt?e:{...e,confirmed:!0,installStartedAt:o.startedAt};if(e.confirmed)return e;if(s)return Yd(o,t,n);if(ef(e,a))return{...e,confirmed:!0};let c=e.answeredAt!==null&&i>=e.answeredAt;return e.unreported||!c?e:{...e,unreported:!0}}function nf(e,t){let n=t??e.lastError;return e.outage&&e.lastError===n?e:{...e,outage:!0,lastError:n}}function rf(e,t,n){let r={...e,answeredAt:n};if(t.kind===`accepted`)return{pending:{...(t.response?.updater?tf(r,t.response,n):r)??r,confirmed:!0},error:null};if(t.kind===`unclear`)return{pending:{...r,reason:t.error,lastError:t.error??e.lastError},error:null};let i=t.response?.updater?.installing;return!t.response||!i?{pending:null,error:t.error}:{pending:tf({...r,confirmed:!1},t.response,n),error:null}}function af(e,t,n){let r=t?.updater??null;if(t&&r){let n=ef(e,r),i=t.app.version;if(n&&Bd.has(n.result))return`failed`;if(r.installing?.version!==e.version){if(n?.result===`installed`)return`done`;if(n?.result===`accepted`){if(i===e.version)return`done`;let t=i!==null&&!e.version.startsWith(`sha256:`),n=i!==null&&e.from!==null&&i!==e.from;if(!t&&(e.outage||n))return`done`}else if(i===e.version)return`done`}}return n-e.startedAt>9e5?`slow`:`waiting`}function of(e,t){let n=t.app.version;return e===null||n===null||n===e?null:t.updater&&!t.updater.installing?n:null}var sf=1e4;function cf(e,t){let n=e===null?sf:e-t;return n>0?Math.min(sf,n):sf}function lf(e,t){return!e||e.confirmed?null:Math.max(e.startedAt+Rd,t+zd)}function uf(e){return e.unreported?{message:`notStarted`,detail:e.reason??e.lastError}:{message:`notConfirmed`,detail:e.lastError??e.reason}}function df(e){let t=`${e}.install`,n=`${e}.ignored`;return{loadPending(){try{let e=JSON.parse(sessionStorage.getItem(t)??`null`);return!e||typeof e.version!=`string`||typeof e.startedAt!=`number`?null:{...Jd(e.version,void 0,e.startedAt),...e}}catch{return null}},savePending(e){try{e?sessionStorage.setItem(t,JSON.stringify(e)):sessionStorage.removeItem(t)}catch{}},loadIgnored(){try{let e=JSON.parse(sessionStorage.getItem(n)??`null`);return!e||typeof e.version!=`string`||typeof e.startedAt!=`number`?null:{version:e.version,installStartedAt:e.installStartedAt??null,startedAt:e.startedAt}}catch{return null}},saveIgnored(e){try{e?sessionStorage.setItem(n,JSON.stringify(e)):sessionStorage.removeItem(n)}catch{}}}}function ff(e){let t=e?.trim().match(/^(\d+)\s*([dhms]?)$/);if(!t)return null;let n=Number(t[1]);return n===0?null:t[2]===`d`?{unit:`days`,count:n}:t[2]===`h`?{unit:`hours`,count:n}:t[2]===`m`?{unit:`minutes`,count:n}:t[2]===`s`||n%60!=0?{unit:`seconds`,count:n}:n%86400==0?{unit:`days`,count:n/86400}:n%3600==0?{unit:`hours`,count:n/3600}:{unit:`minutes`,count:n/60}}function pf(e){let t=e?.trim().match(/^(\d{1,2}:\d{2})\s*-\s*(\d{1,2}:\d{2})$/);return t?{start:t[1],end:t[2]}:null}function mf(e){let t=e.notes.slice(0,8);return{notes:t,more:Math.max(e.changes,e.notes.length)-t.length}}var hf=class extends Error{constructor(e=`Sign in again to continue.`){super(e),this.name=`SignedOutError`}};function gf(e,t){if(t===`status`)return e;let n=e.endsWith(`/`);return`${n?e.slice(0,-1):e}/${t}${n?`/`:``}`}async function _f(e){let t=await e.text();try{return{text:t,data:t?JSON.parse(t):null}}catch{return{text:t,data:null}}}function vf(e){return{async request({action:t,body:n,signal:r}){let i=await fetch(gf(e.url,t),{method:t===`status`?`GET`:`POST`,credentials:`same-origin`,headers:{accept:`application/json`,...n===void 0?{}:{"content-type":`application/json`},...e.headers?.()},body:n===void 0?void 0:JSON.stringify(n),redirect:`manual`,signal:r});if(i.type===`opaqueredirect`||i.redirected||i.status>=300&&i.status<400)throw new hf;let{text:a,data:o}=await _f(i).catch(e=>{if(i.status!==202)throw e;return{text:``,data:null}}),s=/html/i.test(i.headers.get(`content-type`)??``)||/^\s*</.test(a);if(i.status===200&&o===null&&s)throw new hf;return{status:i.status,data:o}}}}function yf(e){for(let t of document.cookie.split(`;`)){let[n,...r]=t.trim().split(`=`);if(n===e)return decodeURIComponent(r.join(`=`))}return null}var bf=[`stable`,`preview`],xf=e=>typeof e==`string`,Sf=e=>typeof e==`boolean`,Cf=e=>typeof e==`number`&&Number.isFinite(e),wf=e=>t=>t===null||e(t),Tf=(...e)=>t=>typeof t==`string`&&e.includes(t),Ef=e=>t=>typeof t==`object`&&!!t&&!Array.isArray(t)&&Object.entries(e).every(([e,n])=>n(t[e])),Df=Ef({version:xf,preview:Sf,publishedAt:wf(xf),url:wf(xf),notes:e=>Array.isArray(e)&&e.every(xf),changes:Cf,installsAt:wf(xf),failed:wf(xf)}),Of=Ef({updater:xf,mode:xf,channel:Tf(...bf),channelLocked:wf(xf),installed:wf(xf),available:wf(Df),attention:wf(Df),installing:wf(Ef({version:xf,startedAt:xf,manual:Sf,stage:xf})),last:wf(Ef({version:xf,result:xf,message:wf(xf),finishedAt:xf})),checking:Sf,checkedAt:wf(xf),error:wf(xf),automatic:Sf,cooldown:wf(xf),window:wf(xf),timezone:xf}),kf=Ef({app:Ef({version:wf(xf)}),reachable:Sf,updater:wf(Of),error:wf(xf)});function Af(e){return kf(e)?e:null}var jf=3e5,Mf=2e3,Nf=15e3,Pf=45e3,Ff=1500,If=3e4;function Lf(e){return e===`de`?`de-DE`:`en-GB`}function Rf(e){return{app:{version:null},reachable:!1,updater:null,error:e}}function zf(e){return e?.app.version??e?.updater?.installed??null}function Bf(e){let t=Af(e.data);if(t?.error)return t.error;let n=e.data;if(typeof n?.error==`string`)return n.error;if(typeof n?.error==`object`&&n.error!==null){let e=n.error.message;if(typeof e==`string`)return e}return typeof n?.message==`string`?n.message:`Request failed (${e.status})`}var Vf=e=>e===401||e===403||e===404,Q=e=>e===401?`signed-out`:`forbidden`,Hf=class{appName;project;locale;dateLocale;timeZone;t;transport;storage;notifyFn;onSignedOutFn;reloadFn;clock;fixedDateLocale;pageStart;restored=!1;listeners=/* @__PURE__ */ new Set;statusAbort=null;response;pageVersion=null;channel=null;lastPoll=null;pending=null;ignored=null;recent=null;checkRunning=!1;savingChannel=!1;open=!1;stopped=!1;reloading=!1;statusRunning=!1;lastStatusAt=0;started=!1;pollTimer=null;deadlineTimer=null;slowTimer=null;reloadTimer=null;tickTimer=null;snapshot;initialSnapshot;constructor(e){this.transport=e.transport,this.appName=e.appName,this.project=e.project,this.locale=e.locale??`en`,this.fixedDateLocale=e.dateLocale??null,this.dateLocale=this.fixedDateLocale??Lf(this.locale),this.timeZone=e.timeZone,this.t=kd(Id,this.locale),this.storage=e.storage??df(`meldgrove.updates.${e.project}`),this.notifyFn=e.notify??(()=>void 0),this.onSignedOutFn=e.onSignedOut??null,this.reloadFn=e.reload??(()=>window.location.reload()),this.clock=e.now??Date.now,this.pageStart=this.clock(),this.response=e.initialResponse,this.snapshot=this.compute(),this.initialSnapshot=this.snapshot}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));getSnapshot=()=>this.snapshot;getServerSnapshot=()=>this.initialSnapshot;emit(){this.snapshot=this.compute();for(let e of this.listeners)e()}compute(){let e=this.clock(),t=this.pending,n=this.response??(this.lastPoll?.failed&&!this.stopped?Rf(this.lastPoll.error):void 0),r=n?.updater??null,i=this.checkRunning||!!r?.checking,a=Gd(n,{checking:i,pending:t,recent:this.recent}),o=Wd(n,t,this.recent),s=Kd(o,n,t);s||(this.open=!1);let c=t!==null&&this.lastPoll!==null&&this.lastPoll.at>=t.startedAt&&this.lastPoll.failed;return{response:n,status:r,pending:t,recent:this.recent,checking:i,state:a,shown:o,panel:s,open:this.open&&s,restarting:c,slow:t!==null&&af(t,void 0,e)===`slow`,waiting:t!==null&&!this.stopped,stopped:this.stopped,savingChannel:this.savingChannel,now:e}}setLocale(e){e!==this.locale&&(this.locale=e,this.dateLocale=this.fixedDateLocale??Lf(e),this.t=kd(Id,e),this.emit())}configure(e){e.notify&&(this.notifyFn=e.notify),e.onSignedOut!==void 0&&(this.onSignedOutFn=e.onSignedOut);let t=!1;if(e.appName&&e.appName!==this.appName&&(this.appName=e.appName,t=!0),e.dateLocale!==void 0){this.fixedDateLocale=e.dateLocale;let n=this.fixedDateLocale??Lf(this.locale);n!==this.dateLocale&&(this.dateLocale=n,t=!0)}e.timeZone!==void 0&&(e.timeZone??void 0)!==this.timeZone&&(this.timeZone=e.timeZone??void 0,t=!0),t&&this.emit()}start(){this.started||(this.started=!0,this.restored||(this.restored=!0,this.pageStart=this.clock(),this.pending=this.storage.loadPending(),this.ignored=this.storage.loadIgnored(),this.emit()),this.armTimers(),window.addEventListener(`focus`,this.onFocus),window.addEventListener(`online`,this.onFocus),document.addEventListener(`visibilitychange`,this.onVisibility),this.openChannel(),this.tickTimer=setInterval(()=>this.emit(),If),this.fetchStatus())}dispose(){this.started=!1,this.channel?.close(),this.channel=null,window.removeEventListener(`focus`,this.onFocus),window.removeEventListener(`online`,this.onFocus),document.removeEventListener(`visibilitychange`,this.onVisibility);for(let e of[this.pollTimer,this.deadlineTimer,this.slowTimer,this.reloadTimer])e!==null&&clearTimeout(e);this.tickTimer!==null&&clearInterval(this.tickTimer),this.pollTimer=this.deadlineTimer=this.slowTimer=this.reloadTimer=this.tickTimer=null}onFocus=()=>{this.pending||this.clock()-this.lastStatusAt<6e4||this.fetchStatus()};onVisibility=()=>{document.visibilityState===`visible`&&this.onFocus()};openChannel(){if(!(this.channel||typeof BroadcastChannel>`u`))try{this.channel=new BroadcastChannel(`meldgrove.updates.${this.project}`),this.channel.onmessage=this.onMessage}catch{this.channel=null}}onMessage=e=>{let t=e.data;t?.type===`updated`&&typeof t.version==`string`&&this.reloadInto(t.version)};broadcast(e){let t={type:`updated`,version:e};this.channel?.postMessage(t)}reloadInto(e){!this.reloading&&this.started&&(this.reloading=!0,this.setPending(null),this.notify({kind:`success`,title:this.t(`updated`,{version:e})}),this.reloadTimer=setTimeout(()=>this.reloadFn(),Ff))}notify(e){this.notifyFn(e)}schedule(){if(this.pollTimer!==null&&clearTimeout(this.pollTimer),this.pollTimer=null,!this.started||this.stopped)return;let e=this.pending!==null;this.pollTimer=setTimeout(()=>{if(this.pollTimer=null,!e&&document.visibilityState===`hidden`)return this.schedule();this.fetchStatus()},e?Mf:jf)}armTimers(){this.deadlineTimer!==null&&clearTimeout(this.deadlineTimer),this.slowTimer!==null&&clearTimeout(this.slowTimer),this.deadlineTimer=this.slowTimer=null;let e=this.pending;if(!this.started||!e)return;let t=lf(e,this.pageStart);t!==null&&!this.stopped&&(this.deadlineTimer=setTimeout(()=>{this.deadlineTimer=null;let e=this.pending;if(!e||lf(e,this.pageStart)!==t)return;this.setPending(null);let n=uf(e);this.notify({kind:`error`,title:this.t(n.message),description:n.detail??void 0})},Math.max(0,t-this.clock())));let n=e.startedAt+Ld+1;n>this.clock()&&(this.slowTimer=setTimeout(()=>{this.slowTimer=null,this.emit()},n-this.clock()))}setPending(e){let t=e!==this.pending;this.pending=e,t&&(this.storage.savePending(e),this.armTimers(),this.schedule(),this.emit())}signOut(e){this.stopped||(this.stopped=!0,this.pollTimer!==null&&clearTimeout(this.pollTimer),this.deadlineTimer!==null&&clearTimeout(this.deadlineTimer),this.pollTimer=this.deadlineTimer=null,this.emit(),this.onSignedOutFn?.(e))}async send(e,t,n,r=new AbortController){let i=!1,a=setTimeout(()=>{i=!0,r.abort()},n);try{return await this.transport.request({action:e,body:t,signal:r.signal})}catch(e){throw i?Error(this.t(`noAnswer`,{app:this.appName}),{cause:e}):e}finally{clearTimeout(a)}}async fetchStatus(){if(this.stopped||this.statusRunning)return;this.statusRunning=!0;let e=this.clock(),t=cf(lf(this.pending,this.pageStart),e),n=new AbortController;this.statusAbort=n;try{let r=await this.send(`status`,void 0,t,n);if(n.signal.aborted)return;if(Vf(r.status))return this.signOut(Q(r.status));let i=Af(r.data);if(r.status!==200||!i)throw Error(Bf(r));this.lastStatusAt=this.clock(),this.receive(i,e)}catch(e){if(n.signal.aborted&&this.statusAbort!==n)return;if(e instanceof hf)return this.signOut(`signed-out`);this.pollFailed(jd(e))}finally{this.statusAbort===n&&(this.statusAbort=null,this.statusRunning=!1,this.pollTimer===null&&this.schedule())}}cancelStatus(){let e=this.statusAbort;e&&(this.statusAbort=null,this.statusRunning=!1,e.abort())}pollFailed(e){let t=this.clock();this.lastPoll={at:t,failed:!0,error:e};let n=this.pending;if(n&&t>=n.startedAt){let t=nf(n,e);if(t!==n)return this.setPending(t)}this.emit()}receive(e,t){this.response=e,this.pageVersion??=e.app.version,this.lastPoll={at:this.clock(),failed:!e.updater,error:e.error},this.follow(e,t),this.emit()}follow(e,t){if(this.reloading)return;let n=this.clock(),r=this.pending,i=tf(r,e,n,this.ignored,t);if(!i){let t=of(this.pageVersion,e);t&&this.reloadInto(t);return}let a=af(i,e,n);a===`done`?(this.broadcast(i.version),this.reloadInto(i.version)):a===`failed`?(this.recent=e.updater?.last??null,this.open=!0,this.setPending(null)):i!==r&&this.setPending(i)}async post(e,t){let n=this.clock(),r;try{r=await this.send(e,t,Pf)}catch(e){throw e instanceof hf&&this.signOut(`signed-out`),e}Vf(r.status)&&this.signOut(Q(r.status));let i=Af(r.data);if(r.status>=200&&r.status<300&&i)return this.receive(i,n),i;throw r.status===409&&i&&this.receive(i,n),Error(Bf(r))}setOpen=e=>{let t=this.snapshot;if(!e)this.open=!1;else if(t.panel)this.open=!0;else{(t.state===`current`||t.state===`off`||t.state===`unreachable`)&&this.check();return}this.emit()};check=async()=>{if(!this.checkRunning){this.checkRunning=!0,this.emit();try{let e=await this.post(`check`,{}),t=Wd(e,null);if(t===`available`||t===`attention`||t===`failed`||t===`installing`)this.open=!0;else if(e.updater?.error)this.notify({kind:`error`,title:this.t(`checkFailed`,{error:e.updater.error})});else if(t===`current`){let t=zf(e);this.notify({kind:`success`,title:t?this.t(`upToDateVersion`,{version:t}):this.t(`upToDate`)})}else t===`unreachable`&&this.notify({kind:`error`,title:e.error??this.t(`unreachable`)})}catch(e){this.notify({kind:`error`,title:jd(e)})}finally{this.checkRunning=!1,this.emit()}}};install=async e=>{this.recent=null,this.cancelStatus();let t=Jd(e.version,this.response,this.clock());this.open=!0,this.setPending(t);let n=this.clock(),{answer:r,response:i}=await this.requestInstall(e.version),a=this.pending;if(a?.version!==t.version||a.startedAt!==t.startedAt){i&&this.receive(i,n);return}let o=rf(a,r,this.clock());this.setPending(o.pending),o.error&&this.notify({kind:`error`,title:o.error}),i&&this.receive(i,n)};async requestInstall(e){let t;try{t=await this.send(`install`,{version:e},Nf)}catch(e){return e instanceof hf&&this.signOut(`signed-out`),{answer:{kind:`unclear`,error:jd(e)},response:null}}let n=Af(t.data),r=n?.updater?n:null;return t.status===202?{answer:{kind:`accepted`,response:r},response:r}:t.status>=400&&t.status<500?(Vf(t.status)&&this.signOut(Q(t.status)),{answer:{kind:`refused`,error:Bf(t),response:r},response:r}):{answer:{kind:`unclear`,error:n?.error??Bf(t)},response:t.status===200?n:null}}stopWaiting=()=>{let e=this.pending;e&&(this.ignored=Xd(e),this.storage.saveIgnored(this.ignored)),this.setPending(null)};setChannel=async e=>{this.savingChannel=!0,this.emit();try{let t=await this.post(`channel`,{channel:e});return t.reachable&&t.updater?.channel===e}finally{this.savingChannel=!1,this.emit()}}};function Uf(e){(e.kind===`success`?re.success:re.error)(e.title,e.description?{description:e.description}:void 0)}var Wf=(0,_.createContext)(null);function Gf(e){let t=(0,_.useMemo)(()=>({controller:e.controller,guideUrl:e.guideUrl}),[e.controller,e.guideUrl]);return/* @__PURE__ */ (0,F.jsx)(Wf.Provider,{value:t,children:e.children})}function Kf(){let e=(0,_.useContext)(Wf);if(!e)throw Error(`Render the update button and settings inside UpdatesProvider.`);return e}function qf(){return Kf().controller}function Jf(){return Kf().guideUrl}function Yf(){let e=qf();return(0,_.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot)}var Xf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Zf(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Xf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Qf=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},$f=e=>{let t=Qf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ep=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),$={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function tp(e){return e!=null}function np(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??$.width,a=e.size??e.height??$.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?ep(...c):ep(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??$[`stroke-width`])*Number(e.size??e.width??$.width)/Number(t.size??t.width??$.width):t.strokeWidth??$[`stroke-width`];return[`svg`,{...Object.entries($).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&tp(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&tp(t.width)&&{[r(`width`)]:t.width},...`height`in t&&tp(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function rp(e,t={}){return np(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var ip=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ap=(0,_.createContext)({}),op=()=>(0,_.useContext)(ap),sp=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=op()??{},b=!!c||ip(d),[x,S,C=[]]=rp(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:ep(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function cp(e,t=[],n=[]){let r=typeof e==`string`?Zf(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(sp,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=$f(r.name)),i}var lp={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};lp.node;var up=cp(lp),dp={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`}]]};dp.node;var fp=cp(dp),pp={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};pp.node;var mp=cp(pp),hp={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};hp.node;var gp=cp(hp),_p={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};_p.node;var vp=cp(_p),yp={name:`triangle-exclamation-point`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`,`triangle-alert`]};yp.node;var bp=cp(yp),xp=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Sp=xe,Cp=(e,t)=>n=>{if(t?.variants==null)return Sp(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=xp(t)||xp(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Sp(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},wp=Cp(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Tp({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?$t:`button`;return/* @__PURE__ */ (0,F.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:V(wp({variant:t,size:n,className:e})),...i})}function Ep({...e}){return/* @__PURE__ */ (0,F.jsx)(yo,{"data-slot":`alert-dialog`,...e})}function Dp({...e}){return/* @__PURE__ */ (0,F.jsx)(bo,{"data-slot":`alert-dialog-portal`,container:Sd(),...e})}function Op({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(xo,{"data-slot":`alert-dialog-overlay`,className:V(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function kp({className:e,size:t=`default`,...n}){return/* @__PURE__ */ (0,F.jsxs)(Dp,{children:[/* @__PURE__ */ (0,F.jsx)(Op,{}),/* @__PURE__ */ (0,F.jsx)(wo,{"data-slot":`alert-dialog-content`,"data-size":t,className:V(`group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg`,e),...n})]})}function Ap({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:V(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function jp({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:V(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Mp({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(To,{"data-slot":`alert-dialog-title`,className:V(`text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Np({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(Eo,{"data-slot":`alert-dialog-description`,className:V(`text-sm text-muted-foreground`,e),...t})}function Pp({className:e,variant:t=`default`,size:n=`default`,...r}){return/* @__PURE__ */ (0,F.jsx)(Tp,{variant:t,size:n,asChild:!0,children:/* @__PURE__ */ (0,F.jsx)(Do,{"data-slot":`alert-dialog-action`,className:V(e),...r})})}function Fp({className:e,variant:t=`outline`,size:n=`default`,...r}){return/* @__PURE__ */ (0,F.jsx)(Tp,{variant:t,size:n,asChild:!0,children:/* @__PURE__ */ (0,F.jsx)(ko,{"data-slot":`alert-dialog-cancel`,className:V(e),...r})})}var Ip=Cp(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function Lp({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?$t:`span`;return/* @__PURE__ */ (0,F.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:V(Ip({variant:t}),e),...r})}function Rp({...e}){return/* @__PURE__ */ (0,F.jsx)($l,{"data-slot":`popover`,...e})}function zp({...e}){return/* @__PURE__ */ (0,F.jsx)(tu,{"data-slot":`popover-trigger`,...e})}function Bp({className:e,align:t=`center`,sideOffset:n=4,...r}){return/* @__PURE__ */ (0,F.jsx)(iu,{container:Sd(),children:/* @__PURE__ */ (0,F.jsx)(ou,{"data-slot":`popover-content`,align:t,sideOffset:n,className:V(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...r})})}var Vp=[[`year`,31536e6],[`month`,2592e6],[`week`,6048e5],[`day`,864e5],[`hour`,36e5],[`minute`,6e4]];function Hp(e,t,n){let r=new Date(e);if(Number.isNaN(r.getTime()))return String(e);let i={dateStyle:`medium`,timeStyle:`short`};try{return new Intl.DateTimeFormat(t,{...i,timeZone:n}).format(r)}catch{return new Intl.DateTimeFormat(t,i).format(r)}}function Up(e,t,n=Date.now()){let r=new Date(e).getTime();if(Number.isNaN(r))return String(e);let i=r-n,a=new Intl.RelativeTimeFormat(t,{numeric:`auto`});for(let[e,t]of Vp)if(Math.abs(i)>=t)return a.format(Math.round(i/t),e);return a.format(0,`second`)}function Wp({state:e}){switch(e){case`checking`:return/* @__PURE__ */ (0,F.jsx)(vp,{className:`motion-safe:animate-spin`});case`installing`:return/* @__PURE__ */ (0,F.jsx)(gp,{className:`motion-safe:animate-spin`});case`available`:case`attention`:return/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(fp,{}),/* @__PURE__ */ (0,F.jsx)(`span`,{"aria-hidden":!0,className:V(`ring-background absolute top-1 right-1 size-2 rounded-full ring-2`,e===`available`?`bg-primary`:`bg-warning`)})]});case`failed`:return/* @__PURE__ */ (0,F.jsx)(bp,{className:`text-destructive`});case`unreachable`:return/* @__PURE__ */ (0,F.jsx)(vp,{className:`text-muted-foreground opacity-60`});default:return/* @__PURE__ */ (0,F.jsx)(vp,{className:`text-muted-foreground`})}}function Gp({controller:e,update:t}){return t.url?/* @__PURE__ */ (0,F.jsxs)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,className:`text-primary inline-flex w-fit items-center gap-1 text-sm font-medium underline-offset-4 hover:underline`,children:[e.t(t.preview?`changes`:`releaseNotes`),/* @__PURE__ */ (0,F.jsx)(mp,{className:`size-3.5`,"aria-hidden":!0}),` `,/* @__PURE__ */ (0,F.jsx)(`span`,{className:`sr-only`,children:e.t(`opensInNewTab`)})]}):null}var Kp=/* @__PURE__ */ new Set([`pulling`,`starting`,`rolling-back`,`deploying`]);function qp({controller:e}){let t=Jf(),[n,r]=e.t(`offText`).split(`{guide}`);return/* @__PURE__ */ (0,F.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[n,t?/* @__PURE__ */ (0,F.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`text-primary font-medium underline-offset-4 hover:underline`,children:e.t(`deploymentGuide`)}):e.t(`deploymentGuide`),r]})}function Jp({controller:e,version:t}){return/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:e.t(`attentionLocked`,{app:e.appName,version:t})})}function Yp({controller:e,snapshot:t,update:n}){let{notes:r,more:i}=mf(n);return/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-1.5 gap-y-1 text-sm`,children:[/* @__PURE__ */ (0,F.jsx)(`span`,{className:`font-medium`,children:n.version}),n.publishedAt?/* @__PURE__ */ (0,F.jsxs)(`span`,{className:`text-muted-foreground`,title:Hp(n.publishedAt,e.dateLocale,e.timeZone),children:[`· `,Up(n.publishedAt,e.locale,t.now)]}):null,n.preview?/* @__PURE__ */ (0,F.jsx)(Lp,{variant:`secondary`,children:e.t(`preview`)}):null]}),r.length>0?/* @__PURE__ */ (0,F.jsxs)(`ul`,{className:`grid list-disc gap-1 pl-4 text-sm`,children:[r.map((e,t)=>/* @__PURE__ */ (0,F.jsx)(`li`,{className:`break-words`,children:e},t)),i>0?/* @__PURE__ */ (0,F.jsx)(`li`,{className:`text-muted-foreground list-none`,children:e.t(`moreChanges`,{n:i,count:i})}):null]}):null]})}function Xp({children:e}){return/* @__PURE__ */ (0,F.jsx)(`h2`,{className:`text-sm font-semibold break-words`,children:e})}function Zp({controller:e,snapshot:t}){let n=Ud(t.response,t.recent);return n?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-destructive text-sm break-words`,children:n.message?e.t(`failedLine`,{version:n.version,message:n.message}):e.t(`failed`,{version:n.version})}):null}function Qp(e){let{controller:t,snapshot:n}=e,r=t.t,{shown:i,status:a}=n,o=zf(n.response),s=Hd(n.response,n.recent),c=a?.available??a?.attention,l=a?.mode!==`off`,u=null;if(i===`installing`){let e=n.pending?.version??a?.installing?.version??``,i=a?.installing?.version===e?a.installing.stage:null;u=/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Xp,{children:r(`installing`,{version:e})}),n.restarting?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-sm`,children:r(`restarting`)}):i&&Kp.has(i)?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-sm`,children:r(`stage_${i}`,{version:a?.installed??o??``})}):null,n.waiting?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r(`restarts`,{app:t.appName})}):null,n.slow?/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(`p`,{role:`alert`,className:`text-destructive text-sm break-words`,children:r(`slow`,{project:t.project})}),/* @__PURE__ */ (0,F.jsx)(Tp,{size:`sm`,variant:`outline`,className:`w-full`,onClick:t.stopWaiting,children:r(`stopWaiting`)})]}):null]})}else if(a){if(i===`failed`&&s){let n=s.offer;u=/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Xp,{children:r(`failed`,{version:s.version})}),s.message?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-destructive text-sm break-words`,children:s.message}):null,o?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r(`stillRunning`,{version:o})}):null,l?n&&qd(a,n)?/* @__PURE__ */ (0,F.jsx)(Tp,{size:`sm`,className:`w-full`,onClick:()=>e.onInstall(n,n===a.attention),children:r(`tryAgain`)}):n?/* @__PURE__ */ (0,F.jsx)(Jp,{controller:t,version:n.version}):null:/* @__PURE__ */ (0,F.jsx)(qp,{controller:t})]})}else if(i===`available`&&a.available){let i=a.available,o=i.installsAt;u=/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Xp,{children:r(`available`)}),/* @__PURE__ */ (0,F.jsx)(Yp,{controller:t,snapshot:n,update:i}),/* @__PURE__ */ (0,F.jsx)(Zp,{controller:t,snapshot:n}),/* @__PURE__ */ (0,F.jsx)(Gp,{controller:t,update:i}),l?/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[o?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:new Date(o).getTime()>n.now?r(`installsOn`,{date:Hp(o,t.dateLocale,t.timeZone)}):r(`installsNextCheck`)}):null,/* @__PURE__ */ (0,F.jsx)(Tp,{size:`sm`,className:`w-full`,onClick:()=>e.onInstall(i,!1),children:r(`installNow`)})]}):/* @__PURE__ */ (0,F.jsx)(qp,{controller:t})]})}else if(i===`attention`&&a.attention){let i=a.attention;u=/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(Xp,{children:r(`attention`,{version:i.version})}),/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-sm`,children:r(`attentionText`)}),/* @__PURE__ */ (0,F.jsx)(Zp,{controller:t,snapshot:n}),/* @__PURE__ */ (0,F.jsx)(Gp,{controller:t,update:i}),l?qd(a,i)?/* @__PURE__ */ (0,F.jsx)(Tp,{size:`sm`,variant:`outline`,className:`w-full`,onClick:()=>e.onInstall(i,!0),children:r(`installAnyway`)}):/* @__PURE__ */ (0,F.jsx)(Jp,{controller:t,version:i.version}):/* @__PURE__ */ (0,F.jsx)(qp,{controller:t})]})}else c&&(u=/* @__PURE__ */ (0,F.jsx)(Yp,{controller:t,snapshot:n,update:c}))}return a?/* @__PURE__ */ (0,F.jsxs)(`div`,{className:`grid gap-3`,children:[u,/* @__PURE__ */ (0,F.jsxs)(`div`,{className:V(`text-muted-foreground grid gap-1 text-xs`,u?`border-t pt-3`:null),children:[/* @__PURE__ */ (0,F.jsx)(`p`,{children:r(`installedFooter`,{version:o??r(`development`),channel:r(a.channel)})}),/* @__PURE__ */ (0,F.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2`,children:[/* @__PURE__ */ (0,F.jsx)(`span`,{"aria-live":`polite`,children:n.checking?r(`checking`):a.checkedAt?r(`checked`,{time:Up(a.checkedAt,t.locale,n.now)}):r(`notChecked`)}),i!==`installing`&&!n.checking?/* @__PURE__ */ (0,F.jsx)(Tp,{variant:`link`,size:`xs`,className:`h-auto p-0 text-xs`,onClick:()=>void t.check(),children:r(`checkNow`)}):null]}),a.error?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-destructive break-words`,children:r(`checkFailed`,{error:a.error})}):null]})]}):/* @__PURE__ */ (0,F.jsx)(`div`,{className:`grid gap-3`,children:u})}function $p(e){let{controller:t,target:n}=e,r=t.t,i=kd(Ad,t.locale);return/* @__PURE__ */ (0,F.jsx)(Ep,{open:n!==null,onOpenChange:t=>t?void 0:e.onCancel(),children:/* @__PURE__ */ (0,F.jsx)(kp,{children:n?/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsxs)(Ap,{children:[/* @__PURE__ */ (0,F.jsx)(Mp,{children:n.anyway?r(`confirmAnywayTitle`,{version:n.update.version}):r(`confirmTitle`,{version:n.update.version})}),/* @__PURE__ */ (0,F.jsxs)(Np,{children:[n.anyway?`${r(`confirmAnywayText`,{app:t.appName})} `:null,r(`confirmText`,{app:t.appName})]}),n.anyway?/* @__PURE__ */ (0,F.jsx)(Gp,{controller:t,update:n.update}):null]}),/* @__PURE__ */ (0,F.jsxs)(jp,{children:[/* @__PURE__ */ (0,F.jsx)(Fp,{children:i(`cancel`)}),/* @__PURE__ */ (0,F.jsx)(Pp,{variant:n.anyway?`destructive`:`default`,onClick:()=>e.onConfirm(n.update),children:r(`install`)})]})]}):null})})}function em({className:e}){let t=qf(),n=Yf(),[r,i]=(0,_.useState)(null),a=t.t,{state:o,status:s}=n,c=zf(n.response),l=Hd(n.response,n.recent),u={loading:a(`checkForUpdates`),unreachable:n.response?.error??a(`unreachable`),installing:n.restarting?a(`restarting`):a(`installing`,{version:n.pending?.version??s?.installing?.version??``}),checking:a(`checking`),off:a(`off`),failed:a(`failed`,{version:l?.version??``}),available:`${a(`available`)} · ${s?.available?.version??``}`,attention:a(`attention`,{version:s?.attention?.version??``}),current:c?a(`upToDateVersion`,{version:c}):a(`upToDate`)};return/* @__PURE__ */ (0,F.jsxs)(Cd,{children:[/* @__PURE__ */ (0,F.jsxs)(Rp,{open:n.open,onOpenChange:t.setOpen,children:[/* @__PURE__ */ (0,F.jsxs)(wd,{children:[/* @__PURE__ */ (0,F.jsx)(Td,{asChild:!0,children:/* @__PURE__ */ (0,F.jsx)(zp,{asChild:!0,children:/* @__PURE__ */ (0,F.jsx)(Tp,{variant:`ghost`,size:`icon-sm`,className:V(`relative rounded-full`,e),"aria-label":u[o],"data-update-state":o,children:/* @__PURE__ */ (0,F.jsx)(Wp,{state:o})})})}),/* @__PURE__ */ (0,F.jsx)(Ed,{side:`bottom`,children:u[o]})]}),/* @__PURE__ */ (0,F.jsx)(Bp,{align:`end`,className:`w-[min(20rem,calc(100vw-1.5rem))]`,children:n.panel?/* @__PURE__ */ (0,F.jsx)(Qp,{controller:t,snapshot:n,onInstall:(e,n)=>{t.setOpen(!1),i({update:e,anyway:n})}}):null})]}),/* @__PURE__ */ (0,F.jsx)($p,{controller:t,target:r,onCancel:()=>i(null),onConfirm:e=>{i(null),t.install(e)}})]})}var tm=Cp(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function nm({className:e,variant:t,...n}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:V(tm({variant:t}),e),...n})}function rm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`alert-description`,className:V(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}function im({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card`,className:V(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function am({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card-header`,className:V(`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,e),...t})}function om({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card-title`,className:V(`leading-none font-semibold`,e),...t})}function sm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card-description`,className:V(`text-sm text-muted-foreground`,e),...t})}function cm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`card-content`,className:V(`px-6`,e),...t})}function lm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(Wl,{"data-slot":`label`,className:V(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function um({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`fieldset`,{"data-slot":`field-set`,className:V(`flex flex-col gap-6`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,e),...t})}function dm({className:e,variant:t=`legend`,...n}){return/* @__PURE__ */ (0,F.jsx)(`legend`,{"data-slot":`field-legend`,"data-variant":t,className:V(`mb-3 font-medium`,`data-[variant=legend]:text-base`,`data-[variant=label]:text-sm`,e),...n})}var fm=Cp(`group/field flex w-full gap-3 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:[`flex-col [&>*]:w-full [&>.sr-only]:w-auto`],horizontal:[`flex-row items-center`,`[&>[data-slot=field-label]]:flex-auto`,`has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`],responsive:[`flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto`,`@md/field-group:[&>[data-slot=field-label]]:flex-auto`,`@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`]}},defaultVariants:{orientation:`vertical`}});function pm({className:e,orientation:t=`vertical`,...n}){return/* @__PURE__ */ (0,F.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:V(fm({orientation:t}),e),...n})}function mm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`div`,{"data-slot":`field-content`,className:V(`group/field-content flex flex-1 flex-col gap-1.5 leading-snug`,e),...t})}function hm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(lm,{"data-slot":`field-label`,className:V(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4`,`has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10`,e),...t})}function gm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(`p`,{"data-slot":`field-description`,className:V(`text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance`,`last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function _m({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(Lu,{"data-slot":`radio-group`,className:V(`grid gap-3`,e),...t})}function vm({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(Hu,{"data-slot":`radio-group-item`,className:V(`aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t,children:/* @__PURE__ */ (0,F.jsx)(Wu,{"data-slot":`radio-group-indicator`,className:`relative flex items-center justify-center`,children:/* @__PURE__ */ (0,F.jsx)(up,{className:`absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary`})})})}function ym({className:e,...t}){return/* @__PURE__ */ (0,F.jsx)(gp,{role:`status`,"aria-label":`Loading`,className:V(`size-4 animate-spin`,e),...t})}function bm({label:e}){let t=Fd(Ad);return/* @__PURE__ */ (0,F.jsxs)(`div`,{className:`text-muted-foreground flex items-center justify-center gap-2 py-12 text-sm`,role:`status`,children:[/* @__PURE__ */ (0,F.jsx)(ym,{}),/* @__PURE__ */ (0,F.jsx)(`span`,{children:e??t(`loading`)})]})}function xm(e,t){let n=ff(t);return n?e(n.unit,{count:n.count}):null}function Sm(e,t){if(t.mode===`off`||!t.automatic)return e(`autoOff`);if(t.mode===`platform`)return e(`autoPlatform`);let n=pf(t.window),r=n?{...n,timezone:t.timezone}:null,i=t.channel===`stable`?xm(e,t.cooldown):null;return i?r?e(`autoReleasesWindow`,{cooldown:i,...r}):e(`autoReleases`,{cooldown:i}):r?e(`autoNextCheckWindow`,r):e(`autoNextCheck`)}function Cm(){let e=qf(),t=Yf(),n=Jf(),r=e.t,i=(0,_.useId)(),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),{response:l,status:u}=t,d=u?.channel??null,f=a??d??``,p=u?.channelLocked??null,m=!u||p!==null||t.savingChannel,h=xm(r,u?.cooldown??null);if(!l)return t.stopped?/* @__PURE__ */ (0,F.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r(`signedOut`)}):/* @__PURE__ */ (0,F.jsx)(bm,{});let g=async()=>{if(a&&a!==d){c(null);try{let t=await e.setChannel(a),n=e.getSnapshot().response;if(!n?.reachable||!n.updater)return c(n?.error??r(`unreachable`));if(!t)return c(r(`channelNotSaved`));o(null),e.notify({kind:`success`,title:r(`channelSaved`)})}catch(e){c(jd(e))}}},v=(e,t,n)=>/* @__PURE__ */ (0,F.jsxs)(pm,{orientation:`horizontal`,className:`items-start`,"data-disabled":m||void 0,children:[/* @__PURE__ */ (0,F.jsx)(vm,{value:e,id:`${i}-${e}`,className:`mt-0.5`}),/* @__PURE__ */ (0,F.jsxs)(mm,{children:[/* @__PURE__ */ (0,F.jsx)(hm,{htmlFor:`${i}-${e}`,children:t}),/* @__PURE__ */ (0,F.jsx)(gm,{children:n})]})]});return/* @__PURE__ */ (0,F.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[/* @__PURE__ */ (0,F.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-2 text-sm sm:grid-cols-[max-content_1fr]`,children:[/* @__PURE__ */ (0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`installedVersion`)}),/* @__PURE__ */ (0,F.jsxs)(`dd`,{className:`flex flex-wrap items-center gap-2 font-medium`,children:[l.app.version??r(`development`),u?.available?/* @__PURE__ */ (0,F.jsxs)(Lp,{variant:`secondary`,children:[r(`available`),` · `,u.available.version]}):u?.attention?/* @__PURE__ */ (0,F.jsx)(Lp,{variant:`outline`,children:r(`attention`,{version:u.attention.version})}):null]}),u?/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[/* @__PURE__ */ (0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`channel`)}),/* @__PURE__ */ (0,F.jsx)(`dd`,{className:`font-medium`,children:r(u.channel)}),/* @__PURE__ */ (0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`automatic`)}),/* @__PURE__ */ (0,F.jsx)(`dd`,{children:Sm(r,u)}),/* @__PURE__ */ (0,F.jsx)(`dt`,{className:`text-muted-foreground`,children:r(`lastCheck`)}),/* @__PURE__ */ (0,F.jsxs)(`dd`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[/* @__PURE__ */ (0,F.jsx)(`span`,{"aria-live":`polite`,children:t.checking?r(`checking`):u.checkedAt?Up(u.checkedAt,e.locale,t.now):r(`notChecked`)}),/* @__PURE__ */ (0,F.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· `,r(`updaterVersion`,{version:u.updater})]}),t.checking?null:/* @__PURE__ */ (0,F.jsx)(Tp,{variant:`link`,size:`xs`,className:`h-auto p-0`,onClick:()=>void e.check(),children:r(`checkNow`)})]}),u.error?/* @__PURE__ */ (0,F.jsx)(`dd`,{className:`text-destructive break-words sm:col-start-2`,children:r(`checkFailed`,{error:u.error})}):null]}):null]}),!l.reachable||!u?/* @__PURE__ */ (0,F.jsx)(nm,{children:/* @__PURE__ */ (0,F.jsxs)(rm,{children:[/* @__PURE__ */ (0,F.jsx)(`p`,{className:`break-words`,children:l.error??r(`sectionUnreachable`)}),/* @__PURE__ */ (0,F.jsx)(`p`,{children:/* @__PURE__ */ (0,F.jsx)(wm,{controller:e,guideUrl:n})})]})}):null,/* @__PURE__ */ (0,F.jsxs)(um,{disabled:m,children:[/* @__PURE__ */ (0,F.jsx)(dm,{variant:`label`,children:r(`channel`)}),/* @__PURE__ */ (0,F.jsxs)(_m,{value:f,disabled:m,onValueChange:e=>{c(null),o(e)},children:[v(`stable`,`${r(`stable`)} (${r(`recommended`)})`,h?r(`stableText`,{cooldown:h}):r(`stableTextNoCooldown`)),v(`preview`,r(`preview`),r(`previewText`))]}),p?/* @__PURE__ */ (0,F.jsx)(gm,{className:`text-foreground`,children:p}):null,/* @__PURE__ */ (0,F.jsx)(gm,{children:r(`switchBack`)})]}),/* @__PURE__ */ (0,F.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-3`,children:[s?/* @__PURE__ */ (0,F.jsx)(`span`,{role:`alert`,className:`text-destructive mr-auto text-sm break-words`,children:s}):null,/* @__PURE__ */ (0,F.jsxs)(Tp,{type:`button`,disabled:m||a===null||a===d,onClick:()=>void g(),children:[t.savingChannel?/* @__PURE__ */ (0,F.jsx)(ym,{}):null,r(`saveChannel`)]})]})]})}function wm({controller:e,guideUrl:t}){let[n,r]=e.t(`sectionUnreachableHelp`).split(`{guide}`);return/* @__PURE__ */ (0,F.jsxs)(F.Fragment,{children:[n,t?/* @__PURE__ */ (0,F.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`text-primary font-medium underline-offset-4 hover:underline`,children:e.t(`deploymentGuide`)}):e.t(`deploymentGuide`),r]})}function Tm({className:e}){let t=qf();return/* @__PURE__ */ (0,F.jsxs)(im,{className:e,children:[/* @__PURE__ */ (0,F.jsxs)(am,{children:[/* @__PURE__ */ (0,F.jsx)(om,{role:`heading`,"aria-level":2,children:t.t(`updates`)}),/* @__PURE__ */ (0,F.jsx)(sm,{children:t.t(`sectionText`,{app:t.appName})})]}),/* @__PURE__ */ (0,F.jsx)(cm,{children:/* @__PURE__ */ (0,F.jsx)(Cm,{})})]})}var Em=`/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */
|
|
56
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) 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-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-duration:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:-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-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--leading-snug:1.375;--leading-normal:1.5;--leading-relaxed:1.625;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-foreground:var(--foreground)}}@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}*{border-color:var(--border);outline-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){*{outline-color:color-mix(in oklab, var(--ring) 50%, transparent)}}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}@layer components;@layer utilities{.\\@container\\/card-header{container:card-header/inline-size}.\\@container\\/field-group{container:field-group/inline-size}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:0}.top-1{top:var(--spacing)}.top-1\\/2,.top-\\[50\\%\\]{top:50%}.right-1{right:var(--spacing)}.left-1\\/2,.left-\\[50\\%\\]{left:50%}.z-50{z-index:50}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2/span 2}.row-start-1{grid-row-start:1}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-auto{margin-inline:auto}.-my-2{margin-block:calc(var(--spacing) * -2)}.mt-0\\.5{margin-top:calc(var(--spacing) * .5)}.mr-auto{margin-right:auto}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-4{margin-left:calc(var(--spacing) * 4)}.line-clamp-1{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.inline-flex{display:inline-flex}.aspect-square{aspect-ratio:1}.size-2{width:calc(var(--spacing) * 2);height:calc(var(--spacing) * 2)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.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-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.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-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-16{width:calc(var(--spacing) * 16);height:calc(var(--spacing) * 16)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-auto{height:auto}.min-h-4{min-height:calc(var(--spacing) * 4)}.w-72{width:calc(var(--spacing) * 72)}.w-\\[min\\(20rem\\,calc\\(100vw-1\\.5rem\\)\\)\\]{width:min(20rem,100vw - 1.5rem)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-\\[calc\\(100\\%-2rem\\)\\]{max-width:calc(100% - 2rem)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-\\(--radix-popover-content-transform-origin\\){transform-origin:var(--radix-popover-content-transform-origin)}.origin-\\(--radix-tooltip-content-transform-origin\\){transform-origin:var(--radix-tooltip-content-transform-origin)}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-\\[-50\\%\\]{--tw-translate-x:-50%;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)}.translate-y-\\[-50\\%\\]{--tw-translate-y:-50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\\[calc\\(-50\\%_-_2px\\)\\]{--tw-translate-y:calc(-50% - 2px);translate:var(--tw-translate-x) var(--tw-translate-y)}.rotate-45{rotate:45deg}.animate-in{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.animate-spin{animation:var(--animate-spin)}.list-disc{list-style-type:disc}.list-none{list-style-type:none}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-\\[0_1fr\\]{grid-template-columns:0 1fr}.grid-rows-\\[auto_1fr\\]{grid-template-rows:auto 1fr}.grid-rows-\\[auto_auto\\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-items-start{justify-items:start}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-7{gap:calc(var(--spacing) * 7)}.gap-x-1\\.5{column-gap:calc(var(--spacing) * 1.5)}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-0\\.5{row-gap:calc(var(--spacing) * .5)}.gap-y-1{row-gap:var(--spacing)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.overflow-hidden{overflow:hidden}.rounded-\\[2px\\]{border-radius:2px}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) * .8)}.rounded-xl{border-radius:calc(var(--radius) * 1.4)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-border{border-color:var(--border)}.border-input{border-color:var(--input)}.border-transparent{border-color:#0000}.bg-background{background-color:var(--background)}.bg-black\\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-destructive{background-color:var(--destructive)}.bg-foreground{background-color:var(--foreground)}.bg-muted{background-color:var(--muted)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-warning{background-color:var(--warning)}.fill-foreground{fill:var(--foreground)}.fill-primary{fill:var(--primary)}.p-0{padding:0}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-sm\\/relaxed{font-size:var(--text-sm);line-height:var(--leading-relaxed)}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.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)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-balance{text-wrap:balance}.break-words{overflow-wrap:break-word}.whitespace-nowrap{white-space:nowrap}.text-background{color:var(--background)}.text-card-foreground{color:var(--card-foreground)}.text-destructive{color:var(--destructive)}.text-foreground{color:var(--foreground)}.text-muted-foreground{color:var(--muted-foreground)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.underline-offset-4{text-underline-offset:4px}.opacity-60{opacity:.6}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px 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-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px 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-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)}.shadow-xs{--tw-shadow:0 1px 2px 0 var(--tw-shadow-color,#0000000d);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-background{--tw-ring-color:var(--background)}.outline-hidden{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;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}.fade-in-0{--tw-enter-opacity:0}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.zoom-in-95{--tw-enter-scale:.95}.running{animation-play-state:running}:is(:where(.group\\/field):has([data-orientation=horizontal]) .group-has-\\[\\[data-orientation\\=horizontal\\]\\]\\/field\\:text-balance){text-wrap:balance}:is(:where(.group)[data-disabled=true] .group-data-\\[disabled\\=true\\]\\:pointer-events-none){pointer-events:none}:is(:where(.group)[data-disabled=true] .group-data-\\[disabled\\=true\\]\\:opacity-50),:is(:where(.group\\/field)[data-disabled=true] .group-data-\\[disabled\\=true\\]\\/field\\:opacity-50){opacity:.5}:is(:where(.group\\/alert-dialog-content)[data-size=sm] .group-data-\\[size\\=sm\\]\\/alert-dialog-content\\:grid){display:grid}:is(:where(.group\\/alert-dialog-content)[data-size=sm] .group-data-\\[size\\=sm\\]\\/alert-dialog-content\\:grid-cols-2){grid-template-columns:repeat(2,minmax(0,1fr))}:is(:where(.group\\/field-group)[data-variant=outline] .group-data-\\[variant\\=outline\\]\\/field-group\\:-mb-2){margin-bottom:calc(var(--spacing) * -2)}:is(:where(.peer):disabled~.peer-disabled\\:cursor-not-allowed){cursor:not-allowed}:is(:where(.peer):disabled~.peer-disabled\\:opacity-50){opacity:.5}.last\\:mt-0:last-child{margin-top:0}@media (hover:hover){.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}.hover\\:bg-secondary\\/80:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){.hover\\:bg-secondary\\/80:hover{background-color:color-mix(in oklab, var(--secondary) 80%, transparent)}}.hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}.hover\\:underline:hover{text-decoration-line:underline}}.focus-visible\\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\\:ring-\\[3px\\]:focus-visible{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(3px + 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)}.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-destructive\\/20:focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:var(--ring)}@supports (color:color-mix(in lab, red, red)){.focus-visible\\:ring-ring\\/50:focus-visible{--tw-ring-color:color-mix(in oklab, var(--ring) 50%, transparent)}}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.has-data-\\[slot\\=alert-dialog-media\\]\\:grid-rows-\\[auto_auto_1fr\\]:has([data-slot=alert-dialog-media]){grid-template-rows:auto auto 1fr}.has-data-\\[slot\\=alert-dialog-media\\]\\:gap-x-6:has([data-slot=alert-dialog-media]){column-gap:calc(var(--spacing) * 6)}.has-data-\\[slot\\=card-action\\]\\:grid-cols-\\[1fr_auto\\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-data-\\[state\\=checked\\]\\:border-primary:has([data-state=checked]){border-color:var(--primary)}.has-data-\\[state\\=checked\\]\\:bg-primary\\/5:has([data-state=checked]){background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.has-data-\\[state\\=checked\\]\\:bg-primary\\/5:has([data-state=checked]){background-color:color-mix(in oklab, var(--primary) 5%, transparent)}}.has-\\[\\>\\[data-slot\\=checkbox-group\\]\\]\\:gap-3:has(>[data-slot=checkbox-group]){gap:calc(var(--spacing) * 3)}.has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:items-start:has(>[data-slot=field-content]){align-items:flex-start}.has-\\[\\>\\[data-slot\\=field\\]\\]\\:w-full:has(>[data-slot=field]){width:100%}.has-\\[\\>\\[data-slot\\=field\\]\\]\\:flex-col:has(>[data-slot=field]){flex-direction:column}.has-\\[\\>\\[data-slot\\=field\\]\\]\\:rounded-md:has(>[data-slot=field]){border-radius:calc(var(--radius) * .8)}.has-\\[\\>\\[data-slot\\=field\\]\\]\\:border:has(>[data-slot=field]){border-style:var(--tw-border-style);border-width:1px}.has-\\[\\>\\[data-slot\\=radio-group\\]\\]\\:gap-3:has(>[data-slot=radio-group]){gap:calc(var(--spacing) * 3)}.has-\\[\\>svg\\]\\:grid-cols-\\[calc\\(var\\(--spacing\\)\\*4\\)_1fr\\]:has(>svg){grid-template-columns:calc(var(--spacing) * 4) 1fr}.has-\\[\\>svg\\]\\:gap-x-3:has(>svg){column-gap:calc(var(--spacing) * 3)}.has-\\[\\>svg\\]\\:px-1\\.5:has(>svg){padding-inline:calc(var(--spacing) * 1.5)}.has-\\[\\>svg\\]\\:px-2\\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\\[\\>svg\\]\\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\\[\\>svg\\]\\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.aria-invalid\\:ring-destructive\\/20[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\\[invalid\\=true\\]\\:text-destructive[data-invalid=true]{color:var(--destructive)}.data-\\[orientation\\=horizontal\\]\\:h-px[data-orientation=horizontal]{height:1px}.data-\\[orientation\\=horizontal\\]\\:w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:h-full[data-orientation=vertical]{height:100%}.data-\\[orientation\\=vertical\\]\\:w-px[data-orientation=vertical]{width:1px}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:calc(2*var(--spacing)*-1)}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:calc(2*var(--spacing))}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:calc(2*var(--spacing)*-1)}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:calc(2*var(--spacing))}.data-\\[size\\=sm\\]\\:max-w-xs[data-size=sm]{max-width:var(--container-xs)}:is(.\\*\\:data-\\[slot\\=alert-description\\]\\:text-destructive\\/90>*)[data-slot=alert-description]{color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){:is(.\\*\\:data-\\[slot\\=alert-description\\]\\:text-destructive\\/90>*)[data-slot=alert-description]{color:color-mix(in oklab, var(--destructive) 90%, transparent)}}.data-\\[slot\\=checkbox-group\\]\\:gap-3[data-slot=checkbox-group]{gap:calc(var(--spacing) * 3)}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation:exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation:enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none)}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[variant\\=label\\]\\:text-sm[data-variant=label]{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.data-\\[variant\\=legend\\]\\:text-base[data-variant=legend]{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.nth-last-2\\:-mt-1:nth-last-child(2){margin-top:calc(var(--spacing) * -1)}@media (prefers-reduced-motion:no-preference){.motion-safe\\:animate-spin{animation:var(--animate-spin)}}@media (width>=40rem){.sm\\:col-start-2{grid-column-start:2}.sm\\:grid-cols-\\[max-content_1fr\\]{grid-template-columns:max-content 1fr}.sm\\:flex-row{flex-direction:row}.sm\\:justify-end{justify-content:flex-end}:is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:row-span-2){grid-row:span 2/span 2}:is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:place-items-start){place-items:start}:is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:text-left){text-align:left}:is(:where(.group\\/alert-dialog-content):has([data-slot=alert-dialog-media]) :is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:group-has-data-\\[slot\\=alert-dialog-media\\]\\/alert-dialog-content\\:col-start-2)){grid-column-start:2}:is(:where(.group\\/alert-dialog-content)[data-size=default] .sm\\:group-data-\\[size\\=default\\]\\/alert-dialog-content\\:has-data-\\[slot\\=alert-dialog-media\\]\\:grid-rows-\\[auto_1fr\\]):has([data-slot=alert-dialog-media]){grid-template-rows:auto 1fr}.data-\\[size\\=default\\]\\:sm\\:max-w-lg[data-size=default]{max-width:var(--container-lg)}}@media (width>=48rem){.md\\:p-12{padding:calc(var(--spacing) * 12)}}@container field-group (width>=28rem){.\\@md\\/field-group\\:flex-row{flex-direction:row}.\\@md\\/field-group\\:items-center{align-items:center}.\\@md\\/field-group\\:has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:items-start:has(>[data-slot=field-content]){align-items:flex-start}}.dark\\:border-input:is(.dark *){border-color:var(--input)}.dark\\:bg-destructive\\/60:is(.dark *){background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-destructive\\/60:is(.dark *){background-color:color-mix(in oklab, var(--destructive) 60%, transparent)}}.dark\\:bg-input\\/30:is(.dark *){background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:bg-input\\/30:is(.dark *){background-color:color-mix(in oklab, var(--input) 30%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-accent\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--accent) 50%, transparent)}}.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:var(--input)}@supports (color:color-mix(in lab, red, red)){.dark\\:hover\\:bg-input\\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--input) 50%, transparent)}}}.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:focus-visible\\:ring-destructive\\/40:is(.dark *):focus-visible{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\\:has-data-\\[state\\=checked\\]\\:bg-primary\\/10:is(.dark *):has([data-state=checked]){background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){.dark\\:has-data-\\[state\\=checked\\]\\:bg-primary\\/10:is(.dark *):has([data-state=checked]){background-color:color-mix(in oklab, var(--primary) 10%, transparent)}}.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){.dark\\:aria-invalid\\:ring-destructive\\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color:color-mix(in oklab, var(--destructive) 40%, transparent)}}.\\[\\&_p\\]\\:leading-relaxed p{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.\\[\\&_svg\\]\\:pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-3 svg:not([class*=size-]){width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-6 svg:not([class*=size-]){width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.\\[\\.border-b\\]\\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\\[\\.border-t\\]\\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\\*\\:\\[svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-8>*):is(svg:not([class*=size-])){width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.\\[\\&\\>\\*\\]\\:w-full>*{width:100%}.\\[\\&\\>\\*\\]\\:data-\\[slot\\=field\\]\\:p-4>[data-slot=field]{padding:calc(var(--spacing) * 4)}@container field-group (width>=28rem){.\\@md\\/field-group\\:\\[\\&\\>\\*\\]\\:w-auto>*{width:auto}}.\\[\\&\\>\\.sr-only\\]\\:w-auto>.sr-only{width:auto}.\\[\\&\\>\\[data-slot\\=field-group\\]\\]\\:gap-4>[data-slot=field-group]{gap:calc(var(--spacing) * 4)}.\\[\\&\\>\\[data-slot\\=field-label\\]\\]\\:flex-auto>[data-slot=field-label]{flex:auto}@container field-group (width>=28rem){.\\@md\\/field-group\\:\\[\\&\\>\\[data-slot\\=field-label\\]\\]\\:flex-auto>[data-slot=field-label]{flex:auto}}:is(.has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:\\[\\&\\>\\[role\\=checkbox\\]\\,\\[role\\=radio\\]\\]\\:mt-px:has(>[data-slot=field-content])>[role=checkbox],.has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:\\[\\&\\>\\[role\\=checkbox\\]\\,\\[role\\=radio\\]\\]\\:mt-px:has(>[data-slot=field-content]) [role=radio]){margin-top:1px}@container field-group (width>=28rem){:is(.\\@md\\/field-group\\:has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:\\[\\&\\>\\[role\\=checkbox\\]\\,\\[role\\=radio\\]\\]\\:mt-px:has(>[data-slot=field-content])>[role=checkbox],.\\@md\\/field-group\\:has-\\[\\>\\[data-slot\\=field-content\\]\\]\\:\\[\\&\\>\\[role\\=checkbox\\]\\,\\[role\\=radio\\]\\]\\:mt-px:has(>[data-slot=field-content]) [role=radio]){margin-top:1px}}.\\[\\&\\>a\\]\\:underline>a{text-decoration-line:underline}.\\[\\&\\>a\\]\\:underline-offset-4>a{text-underline-offset:4px}.\\[\\&\\>a\\:hover\\]\\:text-primary>a:hover{color:var(--primary)}.\\[\\&\\>svg\\]\\:pointer-events-none>svg{pointer-events:none}.\\[\\&\\>svg\\]\\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&\\>svg\\]\\:size-4>svg{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\\[\\&\\>svg\\]\\:translate-y-0\\.5>svg{--tw-translate-y:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.\\[\\&\\>svg\\]\\:text-current>svg{color:currentColor}[data-variant=legend]+.\\[\\[data-variant\\=legend\\]\\+\\&\\]\\:-mt-1\\.5{margin-top:calc(var(--spacing) * -1.5)}@media (hover:hover){a.\\[a\\&\\]\\:hover\\:bg-accent:hover{background-color:var(--accent)}a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:var(--destructive)}@supports (color:color-mix(in lab, red, red)){a.\\[a\\&\\]\\:hover\\:bg-destructive\\/90:hover{background-color:color-mix(in oklab, var(--destructive) 90%, transparent)}}a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:var(--primary)}@supports (color:color-mix(in lab, red, red)){a.\\[a\\&\\]\\:hover\\:bg-primary\\/90:hover{background-color:color-mix(in oklab, var(--primary) 90%, transparent)}}a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:var(--secondary)}@supports (color:color-mix(in lab, red, red)){a.\\[a\\&\\]\\:hover\\:bg-secondary\\/90:hover{background-color:color-mix(in oklab, var(--secondary) 90%, transparent)}}a.\\[a\\&\\]\\:hover\\:text-accent-foreground:hover{color:var(--accent-foreground)}a.\\[a\\&\\]\\:hover\\:underline:hover{text-decoration-line:underline}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}:root,.meldgrove-root{--radius:.625rem;--background:oklch(100% 0 0);--foreground:oklch(14.5% 0 0);--card:oklch(100% 0 0);--card-foreground:oklch(14.5% 0 0);--popover:oklch(100% 0 0);--popover-foreground:oklch(14.5% 0 0);--primary:var(--mg-accent,oklch(20.5% 0 0));--primary-foreground:var(--mg-accent-foreground,oklch(98.5% 0 0));--secondary:oklch(97% 0 0);--secondary-foreground:oklch(20.5% 0 0);--muted:oklch(97% 0 0);--muted-foreground:oklch(52% 0 0);--accent:oklch(97% 0 0);--accent-foreground:oklch(20.5% 0 0);--destructive:oklch(57.7% .245 27.325);--destructive-foreground:oklch(98.5% 0 0);--success:oklch(60% .15 150);--warning:oklch(75% .15 75);--border:oklch(92.2% 0 0);--input:oklch(92.2% 0 0);--ring:oklch(70.8% 0 0);--chart-1:oklch(64.6% .222 41.116);--chart-2:oklch(60% .118 184.704);--chart-3:oklch(39.8% .07 227.392);--chart-4:oklch(82.8% .189 84.429);--chart-5:oklch(76.9% .188 70.08);--sidebar:oklch(98.5% 0 0);--sidebar-foreground:oklch(14.5% 0 0);--sidebar-primary:var(--mg-accent,oklch(20.5% 0 0));--sidebar-primary-foreground:var(--mg-accent-foreground,oklch(98.5% 0 0));--sidebar-accent:oklch(97% 0 0);--sidebar-accent-foreground:oklch(20.5% 0 0);--sidebar-border:oklch(92.2% 0 0);--sidebar-ring:oklch(70.8% 0 0)}.dark{--background:oklch(14.5% 0 0);--foreground:oklch(98.5% 0 0);--card:oklch(20.5% 0 0);--card-foreground:oklch(98.5% 0 0);--popover:oklch(20.5% 0 0);--popover-foreground:oklch(98.5% 0 0);--primary:var(--mg-accent,oklch(92.2% 0 0));--primary-foreground:var(--mg-accent-foreground,oklch(20.5% 0 0));--secondary:oklch(26.9% 0 0);--secondary-foreground:oklch(98.5% 0 0);--muted:oklch(26.9% 0 0);--muted-foreground:oklch(70.8% 0 0);--accent:oklch(26.9% 0 0);--accent-foreground:oklch(98.5% 0 0);--destructive:oklch(70.4% .191 22.216);--destructive-foreground:oklch(98.5% 0 0);--success:oklch(72% .15 150);--warning:oklch(80% .15 75);--border:oklch(100% 0 0/.1);--input:oklch(100% 0 0/.15);--ring:oklch(55.6% 0 0);--chart-1:oklch(48.8% .243 264.376);--chart-2:oklch(69.6% .17 162.48);--chart-3:oklch(76.9% .188 70.08);--chart-4:oklch(62.7% .265 303.9);--chart-5:oklch(64.5% .246 16.439);--sidebar:oklch(20.5% 0 0);--sidebar-foreground:oklch(98.5% 0 0);--sidebar-primary:var(--mg-accent,oklch(92.2% 0 0));--sidebar-primary-foreground:var(--mg-accent-foreground,oklch(20.5% 0 0));--sidebar-accent:oklch(26.9% 0 0);--sidebar-accent-foreground:oklch(98.5% 0 0);--sidebar-border:oklch(100% 0 0/.1);--sidebar-ring:oklch(55.6% 0 0)}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{font-family:inherit;display:inline-block}:host(meldgrove-updates-settings){display:block}.meldgrove-root{color:var(--color-foreground);-webkit-font-smoothing:antialiased}@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-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-duration{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));filter:blur(var(--tw-enter-blur,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));filter:blur(var(--tw-exit-blur,0))}}`,Dm=/* @__PURE__ */ new Map,Om=null;function km(){if(!Om){Om=new CSSStyleSheet,Om.replaceSync(Em);let e=Array.from(Om.cssRules).filter(e=>typeof CSSPropertyRule<`u`&&e instanceof CSSPropertyRule).map(e=>e.cssText);if(e.length>0){let t=new CSSStyleSheet;t.replaceSync(e.join(`
|
|
57
|
+
`)),document.adoptedStyleSheets=[...document.adoptedStyleSheets,t]}}return Om}function Am(e){return e.getAttribute(`locale`)===`de`?`de`:`en`}function jm(e){let t=e.getAttribute(`url`);if(!t)throw Error(`<${e.localName}> needs the attribute url.`);let n=Dm.get(t);if(!n){let r=e.getAttribute(`csrf-token`),i=e.getAttribute(`csrf-cookie`)??`csrftoken`,a=e.getAttribute(`csrf-header`)??`X-CSRFToken`;n={controller:new Hf({transport:vf({url:t,headers:()=>{let e=r??yf(i);return e?{[a]:e}:{}}}),appName:e.getAttribute(`app-name`)??`Meldgrove`,project:e.getAttribute(`project`)??`app`,locale:Am(e),dateLocale:e.getAttribute(`date-locale`)??void 0,timeZone:e.getAttribute(`time-zone`)??void 0,storage:e.getAttribute(`storage-key`)?df(e.getAttribute(`storage-key`)):void 0,notify:Uf}),elements:/* @__PURE__ */ new Set},Dm.set(t,n)}return n.elements.add(e),n.elements.size===1&&n.controller.start(),n.controller}function Mm(e){for(let[t,n]of Dm)n.elements.delete(e)&&n.elements.size===0&&(n.controller.dispose(),Dm.delete(t))}function Nm(e){let t=e.getAttribute(`theme`)??`class`;return t===`dark`?!0:t===`light`?!1:t===`system`?window.matchMedia(`(prefers-color-scheme: dark)`).matches:document.documentElement.classList.contains(`dark`)}var Pm=class extends HTMLElement{root=null;wrapper=null;observer=null;media=null;connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});e.adoptedStyleSheets=[km()],this.wrapper=document.createElement(`div`),this.wrapper.className=`meldgrove-root`;let t=document.createElement(`div`);e.replaceChildren(this.wrapper,t);let n=jm(this);this.applyTheme(t),this.observer=new MutationObserver(()=>this.applyTheme(t)),this.observer.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),this.media=window.matchMedia(`(prefers-color-scheme: dark)`),this.media.addEventListener(`change`,this.onMedia),this.root=(0,g.createRoot)(this.wrapper),this.root.render(/* @__PURE__ */ (0,F.jsx)(_.StrictMode,{children:/* @__PURE__ */ (0,F.jsx)(Nd,{locale:Am(this),children:/* @__PURE__ */ (0,F.jsx)(Gf,{controller:n,guideUrl:this.getAttribute(`guide-url`),children:/* @__PURE__ */ (0,F.jsx)(xd,{container:t,children:/* @__PURE__ */ (0,F.jsx)(Cd,{children:this.content()})})})})})),Lm(this.getAttribute(`theme`)??`class`)}disconnectedCallback(){this.observer?.disconnect(),this.media?.removeEventListener(`change`,this.onMedia);let e=this.root;this.root=null,queueMicrotask(()=>e?.unmount()),Mm(this)}onMedia=()=>{let e=this.shadowRoot?.lastElementChild;e instanceof HTMLElement&&this.applyTheme(e)};applyTheme(e){let t=Nm(this);for(let n of[this.wrapper,e])n?.classList.toggle(`dark`,t),n?.classList.add(`meldgrove-root`)}},Fm=class extends Pm{content(){return/* @__PURE__ */ (0,F.jsx)(em,{})}},Im=class extends Pm{content(){return this.hasAttribute(`plain`)?/* @__PURE__ */ (0,F.jsx)(Cm,{}):/* @__PURE__ */ (0,F.jsx)(Tm,{})}};function Lm(e){if(document.querySelector(`meldgrove-toaster`))return;let t=document.createElement(`meldgrove-toaster`);t.setAttribute(`theme`,e);let n=t.attachShadow({mode:`open`});n.adoptedStyleSheets=[km()];let r=document.createElement(`div`);r.className=`meldgrove-root`,n.append(r),document.body.append(t);let i=(0,g.createRoot)(r),a=()=>{let e=Nm(t);r.classList.toggle(`dark`,e),i.render(/* @__PURE__ */ (0,F.jsx)(ye,{position:`bottom-right`,theme:e?`dark`:`light`}))};a(),new MutationObserver(a).observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,a)}customElements.get(`meldgrove-update-button`)||customElements.define(`meldgrove-update-button`,Fm),customElements.get(`meldgrove-updates-settings`)||customElements.define(`meldgrove-updates-settings`,Im);
|
|
@@ -14,6 +14,11 @@ export declare const INSTALL_TIMEOUT_MS = 15000;
|
|
|
14
14
|
export declare const POST_TIMEOUT_MS = 45000;
|
|
15
15
|
/** The page reloads this long after the new version answered. */
|
|
16
16
|
export declare const RELOAD_DELAY_MS = 1500;
|
|
17
|
+
/** What a page tells the app's other pages in this browser (BroadcastChannel `meldgrove.updates.<project>`). */
|
|
18
|
+
export type UpdatesMessage = {
|
|
19
|
+
type: "updated";
|
|
20
|
+
version: string;
|
|
21
|
+
};
|
|
17
22
|
type LastResult = NonNullable<UpdaterStatus["last"]>;
|
|
18
23
|
/** A message for the person: the app shows it as a toast. */
|
|
19
24
|
export type Notice = {
|
|
@@ -44,7 +49,7 @@ export type UpdatesControllerOptions = {
|
|
|
44
49
|
* (signed in, but no longer an app admin).
|
|
45
50
|
*/
|
|
46
51
|
onSignedOut?: (reason: SignedOutReason) => void;
|
|
47
|
-
/** Reloads the page once the new version answers. */
|
|
52
|
+
/** Reloads the page once the new version answers (on this page or another of the app). */
|
|
48
53
|
reload?: () => void;
|
|
49
54
|
/** The clock (epoch ms); for tests. */
|
|
50
55
|
now?: () => number;
|
|
@@ -91,6 +96,11 @@ export type SignedOutReason = "signed-out" | "forbidden";
|
|
|
91
96
|
* the page when the new version answers, and stops every automatic request
|
|
92
97
|
* once the session ended. Never checks by itself. The React components and
|
|
93
98
|
* the standalone element render its snapshot.
|
|
99
|
+
*
|
|
100
|
+
* No page keeps old code after an update: the page that saw an installation
|
|
101
|
+
* finish tells the app's other pages in this browser, and they reload too; a
|
|
102
|
+
* page that missed it (asleep, in another browser, an automatic install)
|
|
103
|
+
* reloads once a status names another app version than the page's first.
|
|
94
104
|
*/
|
|
95
105
|
export declare class UpdatesController {
|
|
96
106
|
appName: string;
|
|
@@ -112,6 +122,14 @@ export declare class UpdatesController {
|
|
|
112
122
|
/** The request that asks for the status now, to cancel when an installation starts. */
|
|
113
123
|
private statusAbort;
|
|
114
124
|
private response;
|
|
125
|
+
/**
|
|
126
|
+
* The app's version in the page's first answer: the code this page runs.
|
|
127
|
+
* Never from `initialResponse`: a page served from a cache would reload
|
|
128
|
+
* again and again.
|
|
129
|
+
*/
|
|
130
|
+
private pageVersion;
|
|
131
|
+
/** Tells the app's other pages in this browser that an installation is done, and hears theirs. */
|
|
132
|
+
private channel;
|
|
115
133
|
/** When the latest status request ended, and whether it failed (no status, or not reachable). */
|
|
116
134
|
private lastPoll;
|
|
117
135
|
private pending;
|
|
@@ -158,6 +176,22 @@ export declare class UpdatesController {
|
|
|
158
176
|
dispose(): void;
|
|
159
177
|
private onFocus;
|
|
160
178
|
private onVisibility;
|
|
179
|
+
/** The channel of the app's pages in this browser; without BroadcastChannel, the version check still reloads them. */
|
|
180
|
+
private openChannel;
|
|
181
|
+
/**
|
|
182
|
+
* Another page of the app saw an installation finish: reload once. Also a
|
|
183
|
+
* page whose first status already named the version: it may have loaded
|
|
184
|
+
* the old code just before the switch.
|
|
185
|
+
*/
|
|
186
|
+
private onMessage;
|
|
187
|
+
/** Tells the app's other pages in this browser that it runs `version` now. */
|
|
188
|
+
private broadcast;
|
|
189
|
+
/**
|
|
190
|
+
* The app runs `version` now: says so and reloads the page once, after
|
|
191
|
+
* 1.5 s (a timer `dispose` clears). Not after `dispose`: an answer still
|
|
192
|
+
* on its way does nothing.
|
|
193
|
+
*/
|
|
194
|
+
private reloadInto;
|
|
161
195
|
/** Shows a message the way the page shows the controller's own (toast). */
|
|
162
196
|
notify(notice: Notice): void;
|
|
163
197
|
/** The next status request: every 2 s while following (also in the background), else every 5 min. */
|
|
@@ -182,7 +216,12 @@ export declare class UpdatesController {
|
|
|
182
216
|
private pollFailed;
|
|
183
217
|
/** A new status, from a status request (sent at `sentAt`) or from the answer of a POST. */
|
|
184
218
|
private receive;
|
|
185
|
-
/**
|
|
219
|
+
/**
|
|
220
|
+
* Confirms this tab's attempt, adopts a reported installation, and ends it
|
|
221
|
+
* once its result is known; done reloads every page of the app in this
|
|
222
|
+
* browser. Without an installation to follow, reloads a page whose code is
|
|
223
|
+
* older than the app's.
|
|
224
|
+
*/
|
|
186
225
|
private follow;
|
|
187
226
|
/** A POST to `check` or `channel`: a status into the snapshot, or an Error with the route's reason. */
|
|
188
227
|
private post;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { errorMessage, translate } from "../lib/i18n-core.js";
|
|
2
2
|
import { messages } from "./messages.js";
|
|
3
|
-
import { answerInstall, buttonState, followStatus, hasPanel, ignoreInstall, installOutcome, installStorage, noteOutage, panelState, reconcileDeadline, SLOW_AFTER_MS, startAttempt, statusTimeout, unconfirmedEnd, } from "./state.js";
|
|
3
|
+
import { answerInstall, buttonState, followStatus, hasPanel, ignoreInstall, installOutcome, installStorage, noteOutage, panelState, reconcileDeadline, SLOW_AFTER_MS, staleVersion, startAttempt, statusTimeout, unconfirmedEnd, } from "./state.js";
|
|
4
4
|
import { SignedOutError, } from "./transport.js";
|
|
5
5
|
import { parseUpdatesResponse, } from "./types.js";
|
|
6
6
|
/** Status requests: every 5 minutes, every 2 seconds while following an installation. */
|
|
@@ -59,6 +59,11 @@ const signedOutReason = (status) => (status === 401 ? "signed-out" : "forbidden"
|
|
|
59
59
|
* the page when the new version answers, and stops every automatic request
|
|
60
60
|
* once the session ended. Never checks by itself. The React components and
|
|
61
61
|
* the standalone element render its snapshot.
|
|
62
|
+
*
|
|
63
|
+
* No page keeps old code after an update: the page that saw an installation
|
|
64
|
+
* finish tells the app's other pages in this browser, and they reload too; a
|
|
65
|
+
* page that missed it (asleep, in another browser, an automatic install)
|
|
66
|
+
* reloads once a status names another app version than the page's first.
|
|
62
67
|
*/
|
|
63
68
|
export class UpdatesController {
|
|
64
69
|
appName;
|
|
@@ -80,6 +85,14 @@ export class UpdatesController {
|
|
|
80
85
|
/** The request that asks for the status now, to cancel when an installation starts. */
|
|
81
86
|
statusAbort = null;
|
|
82
87
|
response;
|
|
88
|
+
/**
|
|
89
|
+
* The app's version in the page's first answer: the code this page runs.
|
|
90
|
+
* Never from `initialResponse`: a page served from a cache would reload
|
|
91
|
+
* again and again.
|
|
92
|
+
*/
|
|
93
|
+
pageVersion = null;
|
|
94
|
+
/** Tells the app's other pages in this browser that an installation is done, and hears theirs. */
|
|
95
|
+
channel = null;
|
|
83
96
|
/** When the latest status request ended, and whether it failed (no status, or not reachable). */
|
|
84
97
|
lastPoll = null;
|
|
85
98
|
pending = null;
|
|
@@ -220,12 +233,15 @@ export class UpdatesController {
|
|
|
220
233
|
window.addEventListener("focus", this.onFocus);
|
|
221
234
|
window.addEventListener("online", this.onFocus);
|
|
222
235
|
document.addEventListener("visibilitychange", this.onVisibility);
|
|
236
|
+
this.openChannel();
|
|
223
237
|
this.tickTimer = setInterval(() => this.emit(), TICK_MS);
|
|
224
238
|
void this.fetchStatus();
|
|
225
239
|
}
|
|
226
240
|
/** Stops every timer and listener (also a pending reload); `start` resumes. */
|
|
227
241
|
dispose() {
|
|
228
242
|
this.started = false;
|
|
243
|
+
this.channel?.close();
|
|
244
|
+
this.channel = null;
|
|
229
245
|
window.removeEventListener("focus", this.onFocus);
|
|
230
246
|
window.removeEventListener("online", this.onFocus);
|
|
231
247
|
document.removeEventListener("visibilitychange", this.onVisibility);
|
|
@@ -246,6 +262,47 @@ export class UpdatesController {
|
|
|
246
262
|
if (document.visibilityState === "visible")
|
|
247
263
|
this.onFocus();
|
|
248
264
|
};
|
|
265
|
+
/** The channel of the app's pages in this browser; without BroadcastChannel, the version check still reloads them. */
|
|
266
|
+
openChannel() {
|
|
267
|
+
if (this.channel || typeof BroadcastChannel === "undefined")
|
|
268
|
+
return;
|
|
269
|
+
try {
|
|
270
|
+
this.channel = new BroadcastChannel(`meldgrove.updates.${this.project}`);
|
|
271
|
+
this.channel.onmessage = this.onMessage;
|
|
272
|
+
}
|
|
273
|
+
catch {
|
|
274
|
+
this.channel = null;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Another page of the app saw an installation finish: reload once. Also a
|
|
279
|
+
* page whose first status already named the version: it may have loaded
|
|
280
|
+
* the old code just before the switch.
|
|
281
|
+
*/
|
|
282
|
+
onMessage = (event) => {
|
|
283
|
+
const message = event.data;
|
|
284
|
+
if (message?.type !== "updated" || typeof message.version !== "string")
|
|
285
|
+
return;
|
|
286
|
+
this.reloadInto(message.version);
|
|
287
|
+
};
|
|
288
|
+
/** Tells the app's other pages in this browser that it runs `version` now. */
|
|
289
|
+
broadcast(version) {
|
|
290
|
+
const message = { type: "updated", version };
|
|
291
|
+
this.channel?.postMessage(message);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* The app runs `version` now: says so and reloads the page once, after
|
|
295
|
+
* 1.5 s (a timer `dispose` clears). Not after `dispose`: an answer still
|
|
296
|
+
* on its way does nothing.
|
|
297
|
+
*/
|
|
298
|
+
reloadInto(version) {
|
|
299
|
+
if (this.reloading || !this.started)
|
|
300
|
+
return;
|
|
301
|
+
this.reloading = true;
|
|
302
|
+
this.setPending(null);
|
|
303
|
+
this.notify({ kind: "success", title: this.t("updated", { version }) });
|
|
304
|
+
this.reloadTimer = setTimeout(() => this.reloadFn(), RELOAD_DELAY_MS);
|
|
305
|
+
}
|
|
249
306
|
/** Shows a message the way the page shows the controller's own (toast). */
|
|
250
307
|
notify(notice) {
|
|
251
308
|
this.notifyFn(notice);
|
|
@@ -406,25 +463,33 @@ export class UpdatesController {
|
|
|
406
463
|
/** A new status, from a status request (sent at `sentAt`) or from the answer of a POST. */
|
|
407
464
|
receive(response, sentAt) {
|
|
408
465
|
this.response = response;
|
|
466
|
+
this.pageVersion ??= response.app.version;
|
|
409
467
|
this.lastPoll = { at: this.clock(), failed: !response.updater, error: response.error };
|
|
410
468
|
this.follow(response, sentAt);
|
|
411
469
|
this.emit();
|
|
412
470
|
}
|
|
413
|
-
/**
|
|
471
|
+
/**
|
|
472
|
+
* Confirms this tab's attempt, adopts a reported installation, and ends it
|
|
473
|
+
* once its result is known; done reloads every page of the app in this
|
|
474
|
+
* browser. Without an installation to follow, reloads a page whose code is
|
|
475
|
+
* older than the app's.
|
|
476
|
+
*/
|
|
414
477
|
follow(response, sentAt) {
|
|
415
478
|
if (this.reloading)
|
|
416
479
|
return;
|
|
417
480
|
const now = this.clock();
|
|
418
481
|
const pending = this.pending;
|
|
419
482
|
const followed = followStatus(pending, response, now, this.ignored, sentAt);
|
|
420
|
-
if (!followed)
|
|
483
|
+
if (!followed) {
|
|
484
|
+
const version = staleVersion(this.pageVersion, response);
|
|
485
|
+
if (version)
|
|
486
|
+
this.reloadInto(version);
|
|
421
487
|
return;
|
|
488
|
+
}
|
|
422
489
|
const result = installOutcome(followed, response, now);
|
|
423
490
|
if (result === "done") {
|
|
424
|
-
this.
|
|
425
|
-
this.
|
|
426
|
-
this.notify({ kind: "success", title: this.t("updated", { version: followed.version }) });
|
|
427
|
-
this.reloadTimer = setTimeout(() => this.reloadFn(), RELOAD_DELAY_MS);
|
|
491
|
+
this.broadcast(followed.version);
|
|
492
|
+
this.reloadInto(followed.version);
|
|
428
493
|
}
|
|
429
494
|
else if (result === "failed") {
|
|
430
495
|
this.recent = response.updater?.last ?? null;
|
package/dist/updates/state.d.ts
CHANGED
|
@@ -160,6 +160,16 @@ export type InstallOutcome = "done" | "failed" | "waiting" | "slow";
|
|
|
160
160
|
* earlier, at `reconcileDeadline`, on a timer of its own.)
|
|
161
161
|
*/
|
|
162
162
|
export declare function installOutcome(pending: PendingInstall, response: UpdatesResponse | undefined, now: number): InstallOutcome;
|
|
163
|
+
/**
|
|
164
|
+
* The version the app runs now, when it is not the one this page was loaded
|
|
165
|
+
* from (`pageVersion`: the app's version in the page's first status) and the
|
|
166
|
+
* update service reports no installation: the page runs old code and
|
|
167
|
+
* reloads. Another tab, another administrator or an automatic install
|
|
168
|
+
* updated the app. Null otherwise: in development (no app version), and
|
|
169
|
+
* without update service (it restarts during an installation, which may
|
|
170
|
+
* still roll back).
|
|
171
|
+
*/
|
|
172
|
+
export declare function staleVersion(pageVersion: string | null, response: UpdatesResponse): string | null;
|
|
163
173
|
/** How long a status request may take. */
|
|
164
174
|
export declare const STATUS_TIMEOUT_MS = 10000;
|
|
165
175
|
/**
|
package/dist/updates/state.js
CHANGED
|
@@ -271,6 +271,21 @@ export function installOutcome(pending, response, now) {
|
|
|
271
271
|
}
|
|
272
272
|
return now - pending.startedAt > SLOW_AFTER_MS ? "slow" : "waiting";
|
|
273
273
|
}
|
|
274
|
+
/**
|
|
275
|
+
* The version the app runs now, when it is not the one this page was loaded
|
|
276
|
+
* from (`pageVersion`: the app's version in the page's first status) and the
|
|
277
|
+
* update service reports no installation: the page runs old code and
|
|
278
|
+
* reloads. Another tab, another administrator or an automatic install
|
|
279
|
+
* updated the app. Null otherwise: in development (no app version), and
|
|
280
|
+
* without update service (it restarts during an installation, which may
|
|
281
|
+
* still roll back).
|
|
282
|
+
*/
|
|
283
|
+
export function staleVersion(pageVersion, response) {
|
|
284
|
+
const version = response.app.version;
|
|
285
|
+
if (pageVersion === null || version === null || version === pageVersion)
|
|
286
|
+
return null;
|
|
287
|
+
return response.updater && !response.updater.installing ? version : null;
|
|
288
|
+
}
|
|
274
289
|
/** How long a status request may take. */
|
|
275
290
|
export const STATUS_TIMEOUT_MS = 10_000;
|
|
276
291
|
/**
|