Files
intotheeast-com-content/plugins/admin2/app/_app/immutable/nodes/0.C494mprM.js
T

20 lines
74 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/Cu5ilWky.js","../chunks/krC2xWPP.js"])))=>i.map(i=>d[i]);
import{_ as pn}from"../chunks/PPVm8Dsz.js";import"../chunks/DsnmJJEf.js";import{p as Je,d as i,a,r,t as L,b as Qe,c as w,E as En,D as Zt,v as yn,i as F,m as _t,u as xe,j as o,g as e,B as kt,s as m,h as f,q as mt,e as oe,f as X,l as Pt,am as Tt,G as cn,o as wn,n as qt}from"../chunks/krC2xWPP.js";import{s as tt}from"../chunks/C4MegWN0.js";import{p as ke,i as I,s as Wt,r as dn}from"../chunks/DjsWWzyL.js";import{c as ut,s as Te,h as Tn}from"../chunks/j_DJpx8B.js";import{e as rt,s as p,l as je,m as dt,b as gt,S as Nn,n as un,o as In,i as Vt,t as at,r as An,f as Cn,B as Yt}from"../chunks/Lvd_r9sp.js";import{p as ft,u as Sn}from"../chunks/euuZp6ft.js";import{g as Mt,b as Mn}from"../chunks/BVTiZ3e2.js";import{b as Re}from"../chunks/BSopV7IU.js";import{b as Et,c as T,a as Ye,i as R,d as $e}from"../chunks/Cu5ilWky.js";import{B as Dn,t as yt,b as Jt}from"../chunks/BzsopytP.js";import{c as Qt}from"../chunks/YfSC2Q4o.js";import{c as Rn}from"../chunks/CJohx04Q.js";import{p as wt}from"../chunks/BzvfRedh.js";import{c as Ln,f as On,h as kn,g as Pn}from"../chunks/JyCYNBPC.js";import{k as Bn,o as Bt,a as _e,e as It,d as Nt,s as ie,r as $t}from"../chunks/CddAxf8c.js";import{c as xt}from"../chunks/BcwIk3O9.js";import{c as Ct,d as Vn}from"../chunks/CNrnzl73.js";import{c as Hn,a as Wn}from"../chunks/CuDfWLaU.js";import{r as en}from"../chunks/CY9LEyBT.js";import{o as jt}from"../chunks/DukJHxi2.js";import{b as Xn}from"../chunks/ciapVzar.js";import{b as At}from"../chunks/CpuCZOqP.js";import{d as vt}from"../chunks/DtZdUUoV.js";import{h as Un}from"../chunks/CU9nfEd1.js";import{C as fn}from"../chunks/ZWbUro-G.js";import{C as Gn}from"../chunks/DEuEFefA.js";import{T as vn}from"../chunks/CSNyvbvN.js";import{P as mn}from"../chunks/C1jLV8_5.js";import{L as Kt}from"../chunks/C_E2vM9U.js";import{C as gn}from"../chunks/CqW2kplp.js";import{G as Fn}from"../chunks/6XVG9yYt.js";import{E as zn}from"../chunks/CYnWUDOj.js";import{s as ht}from"../chunks/BUlo3N_r.js";import{g as jn}from"../chunks/BDkfn6gG.js";import{c as et}from"../chunks/CnCfJfYZ.js";import{L as Kn,C as Zn,a as tn,b as qn,M as Yn,c as Jn,W as Qn}from"../chunks/C_vpoRDT.js";import{p as Rt}from"../chunks/DtMVEuno.js";import{T as $n}from"../chunks/zdwqcrP5.js";import{S as ea,F as nn}from"../chunks/BZUPCn-g.js";import{S as ta}from"../chunks/h5AuRbZl.js";import{U as na}from"../chunks/DwS2ehmU.js";import{I as aa}from"../chunks/CM67Jphm.js";import{P as ra}from"../chunks/Bi6PtFz0.js";import{P as oa}from"../chunks/IgssrPG4.js";import{C as ia}from"../chunks/CurHnm4X.js";import{S as sa,M as la}from"../chunks/BrVNO555.js";import"../chunks/BbvEV2h7.js";const ca=!1,da=!1,wi=Object.freeze(Object.defineProperty({__proto__:null,prerender:da,ssr:ca},Symbol.toStringTag,{value:"Module"})),ua=Array(12).fill(0);var fa=w('<div class="sonner-loading-bar"></div>'),va=w('<div><div class="sonner-spinner"></div></div>');function ma(d,t){Je(t,!0);var n=va(),s=i(n);rt(s,23,()=>ua,(x,g)=>`spinner-bar-${g}`,(x,g)=>{var H=fa();a(x,H)}),r(s),r(n),L(x=>{Te(n,1,x),p(n,"data-visible",t.visible)},[()=>ut(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),a(d,n),Qe()}const ga=typeof window<"u"?window:void 0;function _a(d){let t=d.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}class ba{#t;#e;constructor(t={}){const{window:n=ga,document:s=n?.document}=t;n!==void 0&&(this.#t=s,this.#e=Bn(x=>{const g=Bt(n,"focusin",x),H=Bt(n,"focusout",x);return()=>{g(),H()}}))}get current(){return this.#e?.(),this.#t?_a(this.#t):null}}new ba;class ha{#t;#e;constructor(t){this.#t=t,this.#e=Symbol(t)}get key(){return this.#e}exists(){return En(this.#e)}get(){const t=Zt(this.#e);if(t===void 0)throw new Error(`Context "${this.#t}" not found`);return t}getOr(t){const n=Zt(this.#e);return n===void 0?t:n}set(t){return yn(this.#e,t)}}const xa=new ha("<Toaster/>");function Lt(d){return d.label!==void 0}function pa(){let d=F(_t(typeof document<"u"?document.hidden:!1));return xe(()=>Bt(document,"visibilitychange",()=>{o(d,document.hidden,!0)})),{get current(){return e(d)}}}const an=4e3,Ea=14,ya=45,wa=200,Ta=.05,Na={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Ia(d){const[t,n]=d.split("-"),s=[];return t&&s.push(t),n&&s.push(n),s}function rn(d){return 1/(1.5+Math.abs(d)/20)}var Aa=w("<div><!></div>"),Ca=w('<button data-close-button=""><!></button>'),Sa=w('<div data-icon=""><!> <!></div>'),Ma=w('<div data-description=""><!></div>'),Da=w('<button data-button="" data-cancel=""> </button>'),Ra=w('<button data-button=""> </button>'),La=w('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Oa=w('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function ka(d,t){Je(t,!0);const n=z=>{var $=oe(),be=X($);{var Se=we=>{var v=Aa(),y=i(v);tt(y,()=>t.loadingIcon),r(v),L(q=>{Te(v,1,q),p(v,"data-visible",e(B)==="loading")},[()=>ut(dt(e(de)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),a(we,v)},Me=we=>{{let v=f(()=>dt(e(de)?.loader,t.toast.classes?.loader)),y=f(()=>e(B)==="loading");ma(we,{get class(){return e(v)},get visible(){return e(y)}})}};I(be,we=>{t.loadingIcon?we(Se):we(Me,-1)})}a(z,$)};let s=ke(t,"cancelButtonStyle",3,""),x=ke(t,"actionButtonStyle",3,""),g=ke(t,"descriptionClass",3,""),H=ke(t,"unstyled",3,!1),P=ke(t,"defaultRichColors",3,!1);const A={...Na};let O=F(!1),N=F(!1),D=F(!1),c=F(!1),b=F(!1),l=F(0),h=F(0),W=t.toast.duration||t.duration||an,S=F(void 0),U=F(null),E=F(null);const te=f(()=>t.index===0),j=f(()=>t.index+1<=t.visibleToasts),B=f(()=>t.toast.type),Y=f(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),ye=f(()=>t.toast.class||""),Z=f(()=>t.toast.descriptionClass||""),_=f(()=>je.heights.findIndex(z=>z.toastId===t.toast.id)||0),J=f(()=>t.toast.closeButton??t.closeButton),ve=f(()=>t.toast.duration??t.duration??an);let Ae=null;const Ue=f(()=>t.position.split("-")),Ke=f(()=>je.heights.reduce((z,$,be)=>be>=e(_)?z:z+$.height,0)),ot=pa(),nt=f(()=>t.toast.invert||t.invert),De=f(()=>e(B)==="loading"),de=f(()=>({...A,...t.classes})),ae=f(()=>t.toast.title),G=f(()=>t.toast.description);let me=F(0),Ce=F(0);const Be=f(()=>Math.round(e(_)*Ea+e(Ke)));xe(()=>{e(ae),e(G);let z;t.expanded||t.expandByDefault?z=1:z=1-t.index*Ta;const $=kt(()=>e(S));if($===void 0)return;$.style.setProperty("height","auto");const be=$.offsetHeight,Se=$.getBoundingClientRect().height,Me=Math.round(Se/z+Number.EPSILON&100)/100;$.style.removeProperty("height");let we;Math.abs(Me-be)<1?we=Me:we=be,o(h,we,!0),je.setHeight({toastId:t.toast.id,height:we})});function u(){o(N,!0),o(l,e(Be),!0),je.removeHeight(t.toast.id),setTimeout(()=>{je.remove(t.toast.id)},wa)}let k;const se=f(()=>t.toast.promise&&e(B)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function re(){o(me,new Date().getTime(),!0),k=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),u()},W)}function ue(){if(e(Ce)<e(me)){const z=new Date().getTime()-e(me);W=W-z}o(Ce,new Date().getTime(),!0)}xe(()=>{t.toast.updated&&(clearTimeout(k),W=e(ve),re())}),xe(()=>(e(se)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&ot.current?ue():re()),()=>clearTimeout(k))),jt(()=>{o(O,!0);const z=e(S)?.getBoundingClientRect().height;return o(h,z,!0),je.setHeight({toastId:t.toast.id,height:z}),()=>{je.removeHeight(t.toast.id)}}),xe(()=>{t.toast.delete&&kt(()=>{u(),t.toast.onDismiss?.(t.toast)})});const Ve=z=>{if(e(De))return;o(l,e(Be),!0);const $=z.target;$.setPointerCapture(z.pointerId),$.tagName!=="BUTTON"&&(o(D,!0),Ae={x:z.clientX,y:z.clientY})},Ze=()=>{if(e(c)||!e(Y))return;Ae=null;const z=Number(e(S)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),$=Number(e(S)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),be=new Date().getTime()-0,Se=e(U)==="x"?z:$,Me=Math.abs(Se)/be;if(Math.abs(Se)>=ya||Me>.11){o(l,e(Be),!0),t.toast.onDismiss?.(t.toast),e(U)==="x"?o(E,z>0?"right":"left",!0):o(E,$>0?"down":"up",!0),u(),o(c,!0);return}else e(S)?.style.setProperty("--swipe-amount-x","0px"),e(S)?.style.setProperty("--swipe-amount-y","0px");o(b,!1),o(D,!1),o(U,null)},We=z=>{if(!Ae||!e(Y)||(window.getSelection()?.toString().length??-1)>0)return;const be=z.clientY-Ae.y,Se=z.clientX-Ae.x,Me=t.swipeDirections??Ia(t.position);!e(U)&&(Math.abs(Se)>1||Math.abs(be)>1)&&o(U,Math.abs(Se)>Math.abs(be)?"x":"y",!0);let we={x:0,y:0};if(e(U)==="y"){if(Me.includes("top")||Me.includes("bottom"))if(Me.includes("top")&&be<0||Me.includes("bottom")&&be>0)we.y=be;else{const v=be*rn(be);we.y=Math.abs(v)<Math.abs(be)?v:be}}else if(e(U)==="x"&&(Me.includes("left")||Me.includes("right")))if(Me.includes("left")&&Se<0||Me.includes("right")&&Se>0)we.x=Se;else{const v=Se*rn(Se);we.x=Math.abs(v)<Math.abs(Se)?v:Se}(Math.abs(we.x)>0||Math.abs(we.y)>0)&&o(b,!0),e(S)?.style.setProperty("--swipe-amount-x",`${we.x}px`),e(S)?.style.setProperty("--swipe-amount-y",`${we.y}px`)},he=()=>{o(D,!1),o(U,null),Ae=null},Oe=f(()=>t.toast.icon?t.toast.icon:e(B)==="success"?t.successIcon:e(B)==="error"?t.errorIcon:e(B)==="warning"?t.warningIcon:e(B)==="info"?t.infoIcon:e(B)==="loading"?t.loadingIcon:null);var C=Oa();p(C,"tabindex",0);let Xe;var it=i(C);{var He=z=>{var $=Ca(),be=i($);tt(be,()=>t.closeIcon??mt),r($),L(Se=>{p($,"aria-label",t.closeButtonAriaLabel),p($,"data-disabled",e(De)),Te($,1,Se)},[()=>ut(dt(e(de)?.closeButton,t.toast?.classes?.closeButton))]),_e("click",$,()=>{e(De)||!e(Y)||(u(),t.toast.onDismiss?.(t.toast))}),a(z,$)};I(it,z=>{e(J)&&!t.toast.component&&e(B)!=="loading"&&t.closeIcon!==null&&z(He)})}var Ge=m(it,2);{var st=z=>{const $=f(()=>t.toast.component);var be=oe(),Se=X(be);xt(Se,()=>e($),(Me,we)=>{we(Me,Wt(()=>t.toast.componentProps,{closeToast:u}))}),a(z,be)},lt=z=>{var $=La(),be=X($);{var Se=V=>{var K=Sa(),M=i(K);{var le=Q=>{var ce=oe(),Le=X(ce);{var Ee=ct=>{var Dt=oe(),Ht=X(Dt);xt(Ht,()=>t.toast.icon,(ze,qe)=>{qe(ze,{})}),a(ct,Dt)},Fe=ct=>{n(ct)};I(Le,ct=>{t.toast.icon?ct(Ee):ct(Fe,-1)})}a(Q,ce)};I(M,Q=>{(t.toast.promise||e(B)==="loading")&&Q(le)})}var Ie=m(M,2);{var ge=Q=>{var ce=oe(),Le=X(ce);{var Ee=ze=>{var qe=oe(),bt=X(qe);xt(bt,()=>t.toast.icon,(hn,xn)=>{xn(hn,{})}),a(ze,qe)},Fe=ze=>{var qe=oe(),bt=X(qe);tt(bt,()=>t.successIcon??mt),a(ze,qe)},ct=ze=>{var qe=oe(),bt=X(qe);tt(bt,()=>t.errorIcon??mt),a(ze,qe)},Dt=ze=>{var qe=oe(),bt=X(qe);tt(bt,()=>t.warningIcon??mt),a(ze,qe)},Ht=ze=>{var qe=oe(),bt=X(qe);tt(bt,()=>t.infoIcon??mt),a(ze,qe)};I(Le,ze=>{t.toast.icon?ze(Ee):e(B)==="success"?ze(Fe,1):e(B)==="error"?ze(ct,2):e(B)==="warning"?ze(Dt,3):e(B)==="info"&&ze(Ht,4)})}a(Q,ce)};I(Ie,Q=>{t.toast.type!=="loading"&&Q(ge)})}r(K),L(Q=>Te(K,1,Q),[()=>ut(dt(e(de)?.icon,t.toast?.classes?.icon))]),a(V,K)};I(be,V=>{(e(B)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Oe)!==null||t.toast.icon)&&V(Se)})}var Me=m(be,2),we=i(Me),v=i(we);{var y=V=>{var K=oe(),M=X(K);{var le=ge=>{const Q=f(()=>t.toast.title);var ce=oe(),Le=X(ce);xt(Le,()=>e(Q),(Ee,Fe)=>{Fe(Ee,Wt(()=>t.toast.componentProps))}),a(ge,ce)},Ie=ge=>{var Q=Pt();L(()=>ie(Q,t.toast.title)),a(ge,Q)};I(M,ge=>{typeof t.toast.title!="string"?ge(le):ge(Ie,-1)})}a(V,K)};I(v,V=>{t.toast.title&&V(y)})}r(we);var q=m(we,2);{var fe=V=>{var K=Ma(),M=i(K);{var le=ge=>{const Q=f(()=>t.toast.description);var ce=oe(),Le=X(ce);xt(Le,()=>e(Q),(Ee,Fe)=>{Fe(Ee,Wt(()=>t.toast.componentProps))}),a(ge,ce)},Ie=ge=>{var Q=Pt();L(()=>ie(Q,t.toast.description)),a(ge,Q)};I(M,ge=>{typeof t.toast.description!="string"?ge(le):ge(Ie,-1)})}r(K),L(ge=>Te(K,1,ge),[()=>ut(dt(g(),e(Z),e(de)?.description,t.toast.classes?.description))]),a(V,K)};I(q,V=>{t.toast.description&&V(fe)})}r(Me);var pe=m(Me,2);{var Ne=V=>{var K=oe(),M=X(K);{var le=Q=>{var ce=oe(),Le=X(ce);xt(Le,()=>t.toast.cancel,(Ee,Fe)=>{Fe(Ee,{})}),a(Q,ce)},Ie=Q=>{var ce=Da(),Le=i(ce,!0);r(ce),L(Ee=>{gt(ce,t.toast.cancelButtonStyle??s()),Te(ce,1,Ee),ie(Le,t.toast.cancel.label)},[()=>ut(dt(e(de)?.cancelButton,t.toast?.classes?.cancelButton))]),_e("click",ce,Ee=>{Lt(t.toast.cancel)&&e(Y)&&(t.toast.cancel?.onClick?.(Ee),u())}),a(Q,ce)},ge=f(()=>Lt(t.toast.cancel));I(M,Q=>{typeof t.toast.cancel=="function"?Q(le):e(ge)&&Q(Ie,1)})}a(V,K)};I(pe,V=>{t.toast.cancel&&V(Ne)})}var ne=m(pe,2);{var ee=V=>{var K=oe(),M=X(K);{var le=Q=>{var ce=oe(),Le=X(ce);xt(Le,()=>t.toast.action,(Ee,Fe)=>{Fe(Ee,{})}),a(Q,ce)},Ie=Q=>{var ce=Ra(),Le=i(ce,!0);r(ce),L(Ee=>{gt(ce,t.toast.actionButtonStyle??x()),Te(ce,1,Ee),ie(Le,t.toast.action.label)},[()=>ut(dt(e(de)?.actionButton,t.toast?.classes?.actionButton))]),_e("click",ce,Ee=>{Lt(t.toast.action)&&(t.toast.action?.onClick(Ee),!Ee.defaultPrevented&&u())}),a(Q,ce)},ge=f(()=>Lt(t.toast.action));I(M,Q=>{typeof t.toast.action=="function"?Q(le):e(ge)&&Q(Ie,1)})}a(V,K)};I(ne,V=>{t.toast.action&&V(ee)})}L((V,K)=>{Te(Me,1,V),Te(we,1,K)},[()=>ut(dt(e(de)?.content,t.toast?.classes?.content)),()=>ut(dt(e(de)?.title,t.toast?.classes?.title))]),a(z,$)};I(Ge,z=>{t.toast.component?z(st):z(lt,-1)})}r(C),At(C,z=>o(S,z),()=>e(S)),L((z,$,be)=>{Te(C,1,z),p(C,"aria-live",t.toast.important?"assertive":"polite"),p(C,"data-rich-colors",t.toast.richColors??P()),p(C,"data-styled",!(t.toast.component||t.toast.unstyled||H())),p(C,"data-mounted",e(O)),p(C,"data-promise",$),p(C,"data-swiped",e(b)),p(C,"data-removed",e(N)),p(C,"data-visible",e(j)),p(C,"data-y-position",e(Ue)[0]),p(C,"data-x-position",e(Ue)[1]),p(C,"data-index",t.index),p(C,"data-front",e(te)),p(C,"data-swiping",e(D)),p(C,"data-dismissible",e(Y)),p(C,"data-type",e(B)),p(C,"data-invert",e(nt)),p(C,"data-swipe-out",e(c)),p(C,"data-swipe-direction",e(E)),p(C,"data-expanded",be),Xe=gt(C,`${t.style} ${t.toast.style}`,Xe,{"--index":t.index,"--toasts-before":t.index,"--z-index":je.toasts.length-t.index,"--offset":`${e(N)?e(l):e(Be)}px`,"--initial-height":t.expandByDefault?"auto":`${e(h)}px`})},[()=>ut(dt(t.class,e(ye),e(de)?.toast,t.toast?.classes?.toast,e(de)?.[e(B)],t.toast?.classes?.[e(B)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(O))]),_e("pointermove",C,We),_e("pointerup",C,Ze),_e("pointerdown",C,Ve),It("dragend",C,he),a(d,C),Qe()}Nt(["pointermove","pointerup","pointerdown","click"]);var Pa=Tt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Ba(d){var t=Pa();a(d,t)}var Va=Tt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function Ha(d){var t=Va();a(d,t)}var Wa=Tt('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function Xa(d){var t=Wa();a(d,t)}var Ua=Tt('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function Ga(d){var t=Ua();a(d,t)}var Fa=Tt('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function za(d){var t=Fa();a(d,t)}const ja=3,_n="24px",bn="16px",Ka=4e3,Za=356,qa=14,Xt="dark",Ot="light";function Ya(d,t){const n={};return[d,t].forEach((s,x)=>{const g=x===1,H=g?"--mobile-offset":"--offset",P=g?bn:_n;function A(O){["top","right","bottom","left"].forEach(N=>{n[`${H}-${N}`]=typeof O=="number"?`${O}px`:O})}typeof s=="number"||typeof s=="string"?A(s):typeof s=="object"?["top","right","bottom","left"].forEach(O=>{const N=s[O];N===void 0?n[`${H}-${O}`]=P:n[`${H}-${O}`]=typeof N=="number"?`${N}px`:N}):A(P)}),n}var Ja=w("<ol></ol>"),Qa=w('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function $a(d,t){Je(t,!0);function n(u){return u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Xt:Ot}let s=ke(t,"invert",3,!1),x=ke(t,"position",3,"bottom-right"),g=ke(t,"hotkey",19,()=>["altKey","KeyT"]),H=ke(t,"expand",3,!1),P=ke(t,"closeButton",3,!1),A=ke(t,"offset",3,_n),O=ke(t,"mobileOffset",3,bn),N=ke(t,"theme",3,"light"),D=ke(t,"richColors",3,!1),c=ke(t,"duration",3,Ka),b=ke(t,"visibleToasts",3,ja),l=ke(t,"toastOptions",19,()=>({})),h=ke(t,"dir",7,"auto"),W=ke(t,"gap",3,qa),S=ke(t,"pauseWhenPageIsHidden",3,!1),U=ke(t,"containerAriaLabel",3,"Notifications"),E=ke(t,"closeButtonAriaLabel",3,"Close toast"),te=dn(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function j(){if(h()!=="auto")return h();if(typeof window>"u"||typeof document>"u")return"ltr";const u=document.documentElement.getAttribute("dir");return u==="auto"||!u?(kt(()=>h(window.getComputedStyle(document.documentElement).direction??"ltr")),h()):(kt(()=>h(u)),u)}const B=f(()=>Array.from(new Set([x(),...je.toasts.filter(u=>u.position).map(u=>u.position)].filter(Boolean))));let Y=F(!1),ye=F(!1),Z=F(_t(n(N()))),_=F(void 0),J=F(null),ve=F(!1);const Ae=f(()=>g().join("+").replace(/Key/g,"").replace(/Digit/g,""));xe(()=>{je.toasts.length<=1&&o(Y,!1)}),xe(()=>{const u=je.toasts.filter(k=>k.dismiss&&!k.delete);if(u.length>0){const k=je.toasts.map(se=>u.find(ue=>ue.id===se.id)?{...se,delete:!0}:se);je.toasts=k}}),xe(()=>()=>{e(_)&&e(J)&&(e(J).focus({preventScroll:!0}),o(J,null),o(ve,!1))}),jt(()=>(je.reset(),Bt(document,"keydown",k=>{g().every(re=>k[re]||k.code===re)&&(o(Y,!0),e(_)?.focus()),k.code==="Escape"&&(document.activeElement===e(_)||e(_)?.contains(document.activeElement))&&o(Y,!1)}))),xe(()=>{if(N()!=="system"&&o(Z,N()),typeof window<"u"){N()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?o(Z,Xt):o(Z,Ot));const u=window.matchMedia("(prefers-color-scheme: dark)"),k=({matches:se})=>{N()==="system"&&o(Z,se?Xt:Ot,!0)};"addEventListener"in u?u.addEventListener("change",k):u.addListener(k)}});const Ue=u=>{t.onblur?.(u),e(ve)&&!u.currentTarget.contains(u.relatedTarget)&&(o(ve,!1),e(J)&&(e(J).focus({preventScroll:!0}),o(J,null)))},Ke=u=>{t.onfocus?.(u),!(u.target instanceof HTMLElement&&u.target.dataset.dismissible==="false")&&(e(ve)||(o(ve,!0),o(J,u.relatedTarget,!0)))},ot=u=>{t.onpointerdown?.(u),!(u.target instanceof HTMLElement&&u.target.dataset.dismissible==="false")&&o(ye,!0)},nt=u=>{t.onmouseenter?.(u),o(Y,!0)},De=u=>{t.onmouseleave?.(u),e(ye)||o(Y,!1)},de=u=>{t.onmousemove?.(u),o(Y,!0)},ae=u=>{t.ondragend?.(u),o(Y,!1)},G=u=>{t.onpointerup?.(u),o(ye,!1)};xa.set(new Nn);var me=Qa();p(me,"tabindex",-1);var Ce=i(me);{var Be=u=>{var k=oe(),se=X(k);rt(se,18,()=>e(B),re=>re,(re,ue,Ve,Ze)=>{const We=f(()=>{const[C,Xe]=ue.split("-");return{y:C,x:Xe}}),he=f(()=>Ya(A(),O()));var Oe=Ja();un(Oe,C=>({tabindex:-1,dir:C,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Z),"data-y-position":e(We).y,"data-x-position":e(We).x,style:t.style,onblur:Ue,onfocus:Ke,onmouseenter:nt,onmousemove:de,onmouseleave:De,ondragend:ae,onpointerdown:ot,onpointerup:G,...te,[In]:{"--front-toast-height":`${je.heights[0]?.height}px`,"--width":`${Za}px`,"--gap":`${W()}px`,"--offset-top":e(he)["--offset-top"],"--offset-right":e(he)["--offset-right"],"--offset-bottom":e(he)["--offset-bottom"],"--offset-left":e(he)["--offset-left"],"--mobile-offset-top":e(he)["--mobile-offset-top"],"--mobile-offset-right":e(he)["--mobile-offset-right"],"--mobile-offset-bottom":e(he)["--mobile-offset-bottom"],"--mobile-offset-left":e(he)["--mobile-offset-left"]}}),[()=>j()],void 0,void 0,"svelte-nbs0zk"),rt(Oe,23,()=>je.toasts.filter(C=>!C.position&&e(Ve)===0||C.position===ue),C=>C.id,(C,Xe,it,He)=>{{const Ge=Ne=>{var ne=oe(),ee=X(ne);{var V=M=>{var le=oe(),Ie=X(le);tt(Ie,()=>t.successIcon??mt),a(M,le)},K=M=>{Ba(M)};I(ee,M=>{t.successIcon?M(V):t.successIcon!==null&&M(K,1)})}a(Ne,ne)},st=Ne=>{var ne=oe(),ee=X(ne);{var V=M=>{var le=oe(),Ie=X(le);tt(Ie,()=>t.errorIcon??mt),a(M,le)},K=M=>{Ha(M)};I(ee,M=>{t.errorIcon?M(V):t.errorIcon!==null&&M(K,1)})}a(Ne,ne)},lt=Ne=>{var ne=oe(),ee=X(ne);{var V=M=>{var le=oe(),Ie=X(le);tt(Ie,()=>t.warningIcon??mt),a(M,le)},K=M=>{Xa(M)};I(ee,M=>{t.warningIcon?M(V):t.warningIcon!==null&&M(K,1)})}a(Ne,ne)},z=Ne=>{var ne=oe(),ee=X(ne);{var V=M=>{var le=oe(),Ie=X(le);tt(Ie,()=>t.infoIcon??mt),a(M,le)},K=M=>{Ga(M)};I(ee,M=>{t.infoIcon?M(V):t.infoIcon!==null&&M(K,1)})}a(Ne,ne)},$=Ne=>{var ne=oe(),ee=X(ne);{var V=M=>{var le=oe(),Ie=X(le);tt(Ie,()=>t.closeIcon??mt),a(M,le)},K=M=>{za(M)};I(ee,M=>{t.closeIcon?M(V):t.closeIcon!==null&&M(K,1)})}a(Ne,ne)};let be=f(()=>l()?.duration??c()),Se=f(()=>l()?.class??""),Me=f(()=>l()?.descriptionClass||""),we=f(()=>l()?.style??""),v=f(()=>l().classes||{}),y=f(()=>l().unstyled??!1),q=f(()=>l()?.cancelButtonStyle??""),fe=f(()=>l()?.actionButtonStyle??""),pe=f(()=>l()?.closeButtonAriaLabel??E());ka(C,{get index(){return e(it)},get toast(){return e(Xe)},get defaultRichColors(){return D()},get duration(){return e(be)},get class(){return e(Se)},get descriptionClass(){return e(Me)},get invert(){return s()},get visibleToasts(){return b()},get closeButton(){return P()},get interacting(){return e(ye)},get position(){return ue},get style(){return e(we)},get classes(){return e(v)},get unstyled(){return e(y)},get cancelButtonStyle(){return e(q)},get actionButtonStyle(){return e(fe)},get closeButtonAriaLabel(){return e(pe)},get expandByDefault(){return H()},get expanded(){return e(Y)},get pauseWhenPageIsHidden(){return S()},get loadingIcon(){return t.loadingIcon},successIcon:Ge,errorIcon:st,warningIcon:lt,infoIcon:z,closeIcon:$,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),r(Oe),At(Oe,C=>o(_,C),()=>e(_)),L(()=>Oe.dir=Oe.dir),a(re,Oe)}),a(u,k)};I(Ce,u=>{je.toasts.length>0&&u(Be)})}r(me),L(()=>p(me,"aria-label",`${U()??""} ${e(Ae)??""}`)),a(d,me),Qe()}async function er(d){if(typeof localStorage>"u"||d.user&&Object.keys(d.user).length>0)return null;const t=on("grav_admin_prefs"),n=on("grav_admin_theme");if(!t&&!n)return null;const s={};if(t)try{const x=JSON.parse(localStorage.getItem(t)??"{}");tr(x,s,["editorMode","fontFamily","fontSize","adminLanguage","pagesPerPage","pagesViewMode"])}catch{}if(n)try{const x=JSON.parse(localStorage.getItem(n)??"{}");(x.colorMode==="light"||x.colorMode==="dark")&&(s.colorMode=x.colorMode),typeof x.accentHue=="number"&&(s.accentHue=x.accentHue),typeof x.accentSaturation=="number"&&(s.accentSaturation=x.accentSaturation)}catch{}if(Object.keys(s).length===0)return sn(t,n),null;try{const x=await Ln(s);return sn(t,n),x}catch{return null}}function on(d){for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);if(n&&(n===d||n.startsWith(d+"::")))return n}return null}function sn(...d){for(const t of d)if(t)try{localStorage.removeItem(t)}catch{}}function tr(d,t,n){for(const s of n)d[s]!==void 0&&d[s]!==null&&(t[s]=d[s])}const nr="M67.862,12.158 C69.242,10.526 73.919,9.67 75.598,13.129 C76.493,14.973 76.661,17.361 76.632,19.152 C72.928,18.959 69.569,23.188 69.569,23.188 C69.569,23.188 72.637,21.74 76.448,21.715 C76.448,21.715 77.463,22.598 78.73,24.257 C77.02,27.47 74.207,34.278 76.243,41.425 C76.582,42.833 77.092,44.044 77.726,45.073 C77.749,45.118 77.77,45.162 77.795,45.208 C77.845,45.274 77.891,45.33 77.939,45.391 C81.307,50.463 87.481,51.056 87.481,51.056 C84.575,49.606 82.207,47.296 80.665,44.496 C79.864,42.998 79.374,41.734 79.073,40.735 C77.438,34.422 79.845,30.736 81.222,28.264 C84.392,23.347 90.166,20.371 96.373,21.079 C105.086,22.074 111.341,29.941 110.346,38.65 C109.738,43.971 106.565,48.373 102.204,50.767 C103.198,53.457 102.244,56.686 102.141,57.019 L102.132,57.047 C104.773,60.37 104.889,62.285 104.798,64.064 C101.609,63.527 98.506,65.545 98.204,65.749 L98.18,65.765 C98.18,65.765 104.656,64.219 108.418,67.575 C110.865,70.206 112.497,72.584 113.469,74.341 C114.862,76.846 121.329,77.024 120.592,81.529 C119.856,86.028 114.923,86.071 107.191,80.969 C99.936,76.174 95.792,72.124 92.18,64.86 C89.711,69.837 83.944,77.236 74.218,83.058 C69.363,98.164 46.264,127.073 38.788,122.974 C36.575,121.762 36.155,120.166 36.655,118.518 C37.191,114.389 45.733,104.898 45.733,104.898 C45.733,104.898 45.913,106.89 48.646,111.085 C45.037,99.88 54.611,86.054 57.146,81.347 C61.131,80.077 61.42,74.96 61.42,74.96 C61.67,67.212 58.285,61.56 54.929,58.114 L54.719,57.901 C61.588,47.803 65.367,43.53 66.982,41.901 L67.113,41.769 C67.681,41.205 67.939,41.011 67.939,41.011 L68.114,40.836 C69.204,39.774 70.917,38.535 71.569,38.206 C66.517,29.425 65.496,17.048 66.82,13.713 C66.712,13.893 66.615,14.078 66.533,14.269 C67.023,13.126 67.351,12.76 67.862,12.158 Z M54.719,57.901 C57.178,60.903 57.975,65.44 58.091,69.595 L58.091,69.618 C58.103,70.087 58.103,70.548 58.102,71.008 C57.985,74.447 56.944,79.198 54.719,79.198 L54.724,79.228 C52.436,79.13 49.61,79.618 47.086,80.408 L41.504,81.742 C41.504,81.742 41.551,81.74 41.635,81.739 L41.789,81.739 C42.572,81.745 44.782,81.866 46.088,82.994 C44.298,85.909 40.32,89.527 35.883,91.582 C29.425,94.576 27.57,88.618 30.848,84.744 C31.653,83.797 32.466,82.999 33.235,82.345 C32.74,81.832 32.428,81.147 32.346,80.277 C32.345,80.272 32.342,80.268 32.341,80.264 C31.891,78.287 32.139,75.721 34.936,71.641 C35.488,70.778 36.151,69.893 36.944,68.994 C36.969,68.963 36.99,68.935 37.016,68.905 C37.05,68.864 37.088,68.824 37.124,68.784 C37.144,68.761 37.162,68.739 37.183,68.716 C37.383,68.488 37.596,68.266 37.822,68.053 C41.078,64.718 46.177,61.252 54.145,58.124 Z M79.231,54.233 C77.957,52.959 75.892,52.96 74.62,54.233 L71.907,56.945 C70.633,58.22 70.633,60.284 71.907,61.557 L74.885,64.535 C76.159,65.809 78.223,65.809 79.496,64.535 L82.208,61.823 C83.482,60.549 83.482,58.484 82.208,57.211 Z M69.392,53.149 C68.578,52.336 67.258,52.336 66.445,53.149 C65.631,53.963 65.631,55.282 66.445,56.096 C67.258,56.91 68.578,56.91 69.392,56.096 C70.205,55.282 70.205,53.963 69.392,53.149 Z M73.796,48.746 C72.982,47.932 71.663,47.932 70.849,48.746 C70.035,49.559 70.035,50.879 70.849,51.693 C71.663,52.506 72.982,52.506 73.796,51.693 C74.61,50.879 74.61,49.559 73.796,48.746 Z M100.231,30.609 C94.872,25.571 89.526,23.393 83.42,30.368 C77.318,37.345 81.195,45.436 86.777,49.429 C92.36,53.423 101.558,50.684 105.005,44.132 C107.758,38.89 105.193,35.391 102.343,32.593 L102.013,32.273 C101.407,31.692 100.797,31.141 100.231,30.609 Z M95.759,41.445 C93.609,38.867 97.629,34.188 100.15,36.982 C104.796,42.13 97.913,44.023 95.759,41.445 Z";function ar(d,t,n){const g=`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<rect width="32" height="32" rx="7" fill="${`hsl(${d}, ${t}%, ${n?55:45}%)`}"/>
<svg x="3" y="1" width="26" height="30" viewBox="29 10 92 114">
<path fill="white" fill-rule="evenodd" d="${nr}"/>
</svg>
</svg>`;return`data:image/svg+xml,${encodeURIComponent(g)}`}async function rr(){return Et.get("/system/environments")}async function or(d){return Et.post("/system/environments",{name:d})}async function ir(d){await Et.delete(`/system/environments/${encodeURIComponent(d)}`)}function sr(){let d=F(""),t=F(_t([])),n=F(!1);async function s(){if(e(n))return null;o(n,!0);try{const A=await rr();o(d,A.detected,!0),o(t,A.environments,!0);const O=T.environment;return O!==""&&!e(t).some(N=>N.name===O)&&(T.environment=""),A}finally{o(n,!1)}}function x(){typeof window<"u"&&window.location.reload()}function g(A){A!==T.environment&&(T.environment=A,x())}async function H(A){const O=await or(A);return e(t).some(N=>N.name===O.name)||o(t,[...e(t),O],!0),g(O.name),O}async function P(A){await ir(A),o(t,e(t).filter(O=>O.name!==A),!0),T.environment===A&&g("")}return{get target(){return T.environment},get detected(){return e(d)},get environments(){return e(t)},get loading(){return e(n)},get label(){return T.environment===""?"Default":T.environment},load:s,setTarget:g,createAndSelect:H,deleteEnvironment:P}}const Pe=sr();var lr=w('<div class="flex w-full items-center gap-2 bg-destructive/10 px-3 py-1.5 text-[0.75rem]"><span class="flex-1 text-destructive"> </span> <button type="button" class="h-6 rounded px-2 text-[0.6875rem] text-muted-foreground hover:bg-muted disabled:opacity-50"> </button> <button type="button" class="h-6 rounded bg-destructive px-2 text-[0.6875rem] font-medium text-destructive-foreground disabled:opacity-50"> </button></div>'),cr=w('<span class="text-[0.625rem] text-muted-foreground"> </span>'),dr=w('<button type="button" class="flex items-center px-2 text-muted-foreground/60 opacity-0 transition hover:text-destructive group-hover:opacity-100"><!></button>'),ur=w('<div class="group flex w-full items-stretch"><button type="button"><span class="flex h-4 w-4 items-center justify-center"><!></span> <span class="flex-1"> </span> <!></button> <!></div>'),fr=w('<button type="button" class="flex w-full items-center gap-2 px-3 py-1.5 text-start text-[0.8125rem] text-popover-foreground transition-colors hover:bg-accent/50"><!> <span> </span></button>'),vr=w('<form class="flex items-center gap-1 px-2 py-1.5"><input type="text" placeholder="env-name" class="h-7 flex-1 rounded border border-border bg-background px-2 text-[0.75rem] focus:outline-none focus:ring-1 focus:ring-primary" pattern="[A-Za-z0-9][A-Za-z0-9._-]*"/> <button type="submit" class="h-7 rounded bg-primary px-2 text-[0.6875rem] font-medium text-primary-foreground disabled:opacity-50"> </button></form> <p class="px-3 pb-1 text-[0.625rem] text-muted-foreground"> </p>',1),mr=w('<div class="mt-1 border-t border-border pt-1"><!></div>'),gr=w('<div class="mt-1 border-t border-border px-3 py-1.5 text-[0.6875rem] text-destructive"> <code> </code> </div>'),_r=w('<div class="fixed inset-0 z-40"></div> <div class="absolute left-0 z-50 mt-1 min-w-[240px] rounded-md border border-border bg-popover py-1 shadow-md"><div class="px-3 pb-1 pt-1 text-[0.625rem] uppercase tracking-wide text-muted-foreground/70"> </div> <!> <!> <!></div>',1),br=w('<div class="relative"><button type="button"><span> </span> <!></button> <!></div>');function hr(d,t){Je(t,!0);let n=F(!1),s=F(!1),x=F(!1),g=F(""),H=F(void 0),P=F(null),A=F(!1);jt(()=>{Pe.load().catch(()=>{});const Z=Ye.subscribe("system:environments",()=>{Pe.load().catch(()=>{})});return()=>Z()});async function O(Z){o(n,!1),Z!==Pe.target&&(Un()&&!await vt.confirm({title:R.t("ADMIN_NEXT.UNSAVED_CHANGES"),message:R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.SWITCH_DISCARDS_UNSAVED"),confirmLabel:R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.SWITCH_AND_RELOAD"),cancelLabel:R.t("ADMIN_NEXT.CANCEL"),variant:"destructive"})||Pe.setTarget(Z))}async function N(){o(g,e(W)?Pe.detected:"",!0),o(x,!0),await cn(),e(H)?.select()}async function D(){const Z=e(g).trim();if(Z){o(s,!0);try{await Pe.createAndSelect(Z),at.success(R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.ENV_CREATED",{name:Z})),o(x,!1),o(n,!1)}catch(_){const J=_&&typeof _=="object"&&"message"in _?_.message:R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.FAILED_TO_CREATE");at.error(J)}finally{o(s,!1)}}}async function c(Z){o(A,!0);try{await Pe.deleteEnvironment(Z),at.success(R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.ENV_DELETED",{name:Z})),o(P,null)}catch(_){const J=_&&typeof _=="object"&&"message"in _?_.message:R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.FAILED_TO_DELETE");at.error(J)}finally{o(A,!1)}}function b(Z){Z.key==="Escape"&&(e(P)?o(P,null):e(x)?o(x,!1):o(n,!1))}const l=f(()=>Hn("config")),h=f(()=>Pe.target===""?R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.DEFAULT"):Pe.target),W=f(()=>Pe.detected!==""&&!Pe.environments.some(Z=>Z.name===Pe.detected)),S=f(()=>Pe.target!==""&&Pe.environments.length>0&&!Pe.environments.some(Z=>Z.name===Pe.target));var U=br(),E=i(U),te=i(E),j=i(te,!0);r(te);var B=m(te,2);{let Z=f(()=>e(n)?"rotate-180":"");fn(B,{size:11,get class(){return`transition-transform ${e(Z)??""}`}})}r(E);var Y=m(E,2);{var ye=Z=>{var _=_r(),J=X(_),ve=m(J,2),Ae=i(ve),Ue=i(Ae,!0);r(Ae);var Ke=m(Ae,2);rt(Ke,17,()=>Pe.environments,Vt,(ae,G)=>{var me=oe(),Ce=X(me);{var Be=k=>{var se=lr(),re=i(se),ue=i(re,!0);r(re);var Ve=m(re,2),Ze=i(Ve,!0);r(Ve);var We=m(Ve,2),he=i(We,!0);r(We),r(se),L((Oe,C,Xe)=>{ie(ue,Oe),Ve.disabled=e(A),ie(Ze,C),We.disabled=e(A),ie(he,Xe)},[()=>e(G).hasOverrides?R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.CONFIRM_DELETE_WITH_OVERRIDES",{name:e(G).name}):R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.CONFIRM_DELETE",{name:e(G).name}),()=>R.t("ADMIN_NEXT.CANCEL"),()=>e(A)?"…":R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.DELETE")]),_e("click",Ve,()=>o(P,null)),_e("click",We,()=>c(e(G).name)),a(k,se)},u=k=>{var se=ur(),re=i(se),ue=i(re),Ve=i(ue);{var Ze=He=>{Gn(He,{size:13})};I(Ve,He=>{e(G).name===Pe.target&&He(Ze)})}r(ue);var We=m(ue,2),he=i(We,!0);r(We);var Oe=m(We,2);{var C=He=>{var Ge=cr(),st=i(Ge,!0);r(Ge),L(lt=>ie(st,lt),[()=>R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.HAS_OVERRIDES")]),a(He,Ge)};I(Oe,He=>{e(G).hasOverrides&&He(C)})}r(re);var Xe=m(re,2);{var it=He=>{var Ge=dr(),st=i(Ge);vn(st,{size:13}),r(Ge),L(lt=>p(Ge,"title",lt),[()=>R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.DELETE_ENV_TOOLTIP",{name:e(G).name})]),_e("click",Ge,()=>o(P,e(G).name,!0)),a(He,Ge)};I(Xe,He=>{e(l)&&e(G).name!==""&&e(G).name!==Pe.detected&&He(it)})}r(se),L(()=>{Te(re,1,`flex flex-1 items-center gap-2 px-3 py-1.5 text-start text-[0.8125rem] transition-colors
${e(G).name===Pe.target?"bg-accent text-accent-foreground font-medium":"text-popover-foreground hover:bg-accent/50"}`),ie(he,e(G).label)}),_e("click",re,()=>O(e(G).name)),a(k,se)};I(Ce,k=>{e(P)===e(G).name?k(Be):k(u,-1)})}a(ae,me)});var ot=m(Ke,2);{var nt=ae=>{var G=mr(),me=i(G);{var Ce=u=>{var k=fr(),se=i(k);mn(se,{size:13});var re=m(se,2),ue=i(re,!0);r(re),r(k),L(Ve=>ie(ue,Ve),[()=>e(W)?R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.CREATE_ENV_NAMED",{name:Pe.detected}):R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.CREATE_ENVIRONMENT")]),_e("click",k,N),a(u,k)},Be=u=>{var k=vr(),se=X(k),re=i(se);An(re),At(re,he=>o(H,he),()=>e(H));var ue=m(re,2),Ve=i(ue,!0);r(ue),r(se);var Ze=m(se,2),We=i(Ze,!0);r(Ze),L((he,Oe,C)=>{re.disabled=e(s),ue.disabled=he,ie(Ve,Oe),ie(We,C)},[()=>e(s)||!e(g).trim(),()=>e(s)?"…":R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.CREATE"),()=>R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.CREATES_PATH",{name:e(g)||"<name>"})]),It("submit",se,he=>{he.preventDefault(),D()}),Xn(re,()=>e(g),he=>o(g,he)),a(u,k)};I(me,u=>{e(x)?u(Be,-1):u(Ce)})}r(G),a(ae,G)};I(ot,ae=>{e(l)&&ae(nt)})}var De=m(ot,2);{var de=ae=>{var G=gr(),me=i(G),Ce=m(me),Be=i(Ce,!0);r(Ce);var u=m(Ce);r(G),L((k,se)=>{ie(me,`${k??""} `),ie(Be,Pe.target),ie(u,` ${se??""}`)},[()=>R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.SELECTED_ENV"),()=>R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.NO_LONGER_EXISTS_PICK_ANOTHER")]),a(ae,G)};I(De,ae=>{e(S)&&ae(de)})}r(ve),L(ae=>ie(Ue,ae),[()=>R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.SAVE_CONFIG_TO")]),_e("click",J,()=>o(n,!1)),a(Z,_)};I(Y,Z=>{e(n)&&Z(ye)})}r(U),L(Z=>{Te(E,1,`inline-flex items-center gap-1.5 rounded-md border px-2 py-0.5 text-[0.6875rem] font-medium transition-colors
${e(S)?"border-destructive/40 bg-destructive/10 text-destructive":Pe.target===""?"border-muted-foreground/30 bg-muted/40 text-muted-foreground hover:bg-muted":"border-primary/30 bg-primary/10 text-primary hover:bg-primary/15"}`),p(E,"title",Z),ie(j,e(h))},[()=>R.t("ADMIN_NEXT.ENVIRONMENT_SWITCHER.SELECT_WHERE_CONFIG_WRITES_ARE_SAVED")]),_e("keydown",U,b),_e("click",E,()=>o(n,!e(n))),a(d,U),Qe()}Nt(["keydown","click"]);var xr=w('<button class="flex w-full items-center rounded-md px-3 py-1.5 text-start text-sm text-popover-foreground transition-colors hover:bg-accent"> </button>'),pr=w('<div class="fixed inset-0 z-40"></div> <div class="absolute right-0 top-full z-50 mt-1.5 min-w-44 rounded-lg border border-border bg-popover p-1 shadow-lg"></div>',1),Er=w('<div class="relative"><div class="flex items-center"><button><!></button> <button class="flex h-7 items-center rounded-r-md px-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></button></div> <!></div>');function yr(d,t){Je(t,!0);let n=F(!1),s=F(!1);const x=[{value:"standard",label:"Standard Cache"},{value:"all",label:"All Caches"},{value:"assets",label:"Assets Only"},{value:"images",label:"Images Only"},{value:"tmp",label:"Tmp Only"}];async function g(S){o(n,!1),o(s,!0);try{await Et.delete(`/cache?scope=${S}`),at.success(R.t("ADMIN_NEXT.TOASTS.CACHE_CLEARED",{scope:S}))}catch{at.error(R.t("ADMIN_NEXT.CACHE_CLEAR_BUTTON.FAILED_TO_CLEAR_CACHE"))}finally{o(s,!1)}}function H(){o(n,!1)}var P=Er(),A=i(P),O=i(A),N=i(O);{var D=S=>{Kt(S,{size:14,class:"animate-spin"})},c=S=>{vn(S,{size:14})};I(N,S=>{e(s)?S(D):S(c,-1)})}r(O);var b=m(O,2),l=i(b);fn(l,{size:12}),r(b),r(A);var h=m(A,2);{var W=S=>{var U=pr(),E=X(U),te=m(E,2);rt(te,21,()=>x,Vt,(j,B)=>{var Y=xr(),ye=i(Y,!0);r(Y),L(()=>ie(ye,e(B).label)),_e("click",Y,()=>g(e(B).value)),a(j,Y)}),r(te),_e("click",E,H),a(S,U)};I(h,S=>{e(n)&&S(W)})}r(P),L((S,U)=>{Te(O,1,`flex h-7 items-center gap-1 rounded-l-md px-2 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground
${e(n)?"":"rounded-r-md"}`),O.disabled=e(s),p(O,"title",S),p(b,"title",U)},[()=>R.t("ADMIN_NEXT.CACHE_CLEAR_BUTTON.CLEAR_CACHE"),()=>R.t("ADMIN_NEXT.CACHE_CLEAR_BUTTON.CACHE_OPTIONS")]),_e("click",O,()=>e(s)?null:g("standard")),_e("click",b,()=>o(n,!e(n))),a(d,P),Qe()}Nt(["click"]);var wr=w("<i></i>"),Tr=w('<i class="fa-solid fa-link text-sm"></i>'),Nr=w('<a class="flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></a>');function Ir(d,t){Je(t,!0);var n=oe(),s=X(n);rt(s,17,()=>wt.menubarLinks,Vt,(x,g)=>{var H=oe(),P=X(H);{var A=O=>{var N=Nr(),D=i(N);{var c=l=>{var h=wr();L(W=>Te(h,1,`fa-solid fa-${W??""} text-sm`),[()=>e(g).icon.replace(/^fa-/,"")]),a(l,h)},b=l=>{var h=Tr();a(l,h)};I(D,l=>{e(g).icon?l(c):l(b,-1)})}r(N),L(()=>{p(N,"href",e(g).url),p(N,"target",e(g).external?"_blank":void 0),p(N,"rel",e(g).external?"noopener":void 0),p(N,"title",e(g).label)}),a(O,N)};I(P,O=>{e(g).url&&O(A)})}a(x,H)}),a(d,n),Qe()}async function Ar(){return Et.get("/menubar/items")}async function Cr(d,t,n){return Et.post(`/menubar/actions/${d}/${t}`,n)}var Sr=w("<i></i>"),Mr=w('<i class="fa-solid fa-circle-dot text-sm"></i>'),Dr=w('<button class="flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></button>'),Rr=w("<!> <!>",1);function Lr(d,t){Je(t,!0);let n=F(_t([])),s=F(null),x=F(!1),g=F(null);async function H(){try{o(n,await Ar(),!0)}catch{}}let P=!1;function A(){P||(P=!0,queueMicrotask(()=>{P=!1,H()}))}async function O(l){if(l.confirm){o(g,l,!0),o(x,!0);return}await N(l)}async function N(l){o(s,l.id,!0);try{const h=await Cr(l.plugin,l.action);h.status==="success"?at.success(h.message):at.error(h.message)}catch(h){const W=h instanceof Error?h.message:"Action failed";at.error(W)}finally{o(s,null)}}xe(()=>{H()}),xe(()=>{const l=[Ye.subscribe("plugins:*",A),Ye.subscribe("themes:*",A),Ye.subscribe("gpm:*",A)];return()=>{for(const h of l)h()}});var D=Rr(),c=X(D);{let l=f(()=>R.t("ADMIN_NEXT.CONFIRM_ACTION")),h=f(()=>e(g)?.confirm??"");gn(c,{get open(){return e(x)},get title(){return e(l)},get message(){return e(h)},confirmLabel:"Continue",onconfirm:()=>{o(x,!1),e(g)&&N(e(g)),o(g,null)},oncancel:()=>{o(x,!1),o(g,null)}})}var b=m(c,2);rt(b,17,()=>e(n),l=>l.id,(l,h)=>{var W=Dr(),S=i(W);{var U=j=>{Kt(j,{size:14,class:"animate-spin"})},E=j=>{var B=Sr();L(Y=>Te(B,1,`fa-solid ${Y??""} text-sm`),[()=>e(h).icon.startsWith("fa-")?e(h).icon:"fa-"+e(h).icon]),a(j,B)},te=j=>{var B=Mr();a(j,B)};I(S,j=>{e(s)===e(h).id?j(U):e(h).icon?j(E,1):j(te,-1)})}r(W),L(()=>{p(W,"title",e(h).label),W.disabled=e(s)===e(h).id}),_e("click",W,()=>O(e(h))),a(l,W)}),a(d,D),Qe()}Nt(["click"]);var Or=w('<a target="_blank" rel="noopener noreferrer" class="inline-flex h-7 items-center gap-1.5 whitespace-nowrap rounded-md border border-border px-2 text-[0.75rem] font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground lg:px-2.5"><!> <span class="hidden lg:inline"> </span> <!></a>');function kr(d,t){Je(t,!0);const n=f(()=>T.serverUrl||"/");var s=Or(),x=i(s);Fn(x,{size:13});var g=m(x,2),H=i(g,!0);r(g);var P=m(g,2);zn(P,{size:11,class:"hidden text-muted-foreground/60 lg:inline"}),r(s),L((A,O,N)=>{p(s,"href",e(n)),p(s,"title",A),p(s,"aria-label",O),ie(H,N)},[()=>R.t("ADMIN_NEXT.VIEW_SITE_BUTTON.OPEN_SITE_FRONTEND_IN_A_NEW_TAB"),()=>R.t("ADMIN_NEXT.VIEW_SITE_BUTTON.VIEW_SITE"),()=>R.t("ADMIN_NEXT.VIEW_SITE_BUTTON.VIEW_SITE")]),a(d,s),Qe()}let Ut=F(_t({})),Gt=F(!1);const St={get counts(){return e(Ut)},get loaded(){return e(Gt)},async load(){try{const d=await jn();o(Ut,{pages:d.pages?.total??null,users:d.users?.total??null,media:d.media?.total??null,plugins:d.plugins?.total??null,themes:d.themes?.total??null},!0),o(Gt,!0)}catch{}},clear(){o(Ut,{},!0),o(Gt,!1)}};async function Pr(){return Et.get("/floating-widgets")}let Ft=F(_t([])),zt=F(!1);const pt={get items(){return e(Ft)},get loaded(){return e(zt)},async load(){try{const d=await Pr();o(Ft,d.sort((t,n)=>(n.priority??0)-(t.priority??0)),!0),o(zt,!0)}catch{}},clear(){o(Ft,[],!0),o(zt,!1)}};var Br=w('<div class="flex flex-shrink-0 items-center justify-between px-3 py-2.5 text-white svelte-cnilt6"><div class="flex items-center gap-2 svelte-cnilt6"><div class="flex h-7 w-7 items-center justify-center rounded-md bg-white/20 backdrop-blur svelte-cnilt6"><i></i></div> <div class="text-sm font-semibold svelte-cnilt6"> </div></div> <button type="button" class="flex h-7 w-7 items-center justify-center rounded-md text-white/75 transition-colors hover:bg-white/15 hover:text-white svelte-cnilt6" title="Close"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-cnilt6"><line x1="18" y1="6" x2="6" y2="18" class="svelte-cnilt6"></line><line x1="6" y1="6" x2="18" y2="18" class="svelte-cnilt6"></line></svg></button></div> <div class="flex-1 overflow-auto svelte-cnilt6"></div>',1),Vr=w('<div class="flex-1 overflow-hidden svelte-cnilt6"></div>'),Hr=w("<div><!></div>"),Wr=w("<button><i></i></button>"),Xr=w('<button class="fixed inset-0 z-40 cursor-default svelte-cnilt6"></button>'),Ur=w('<!> <button class="fw-fab fixed z-50 flex h-12 w-12 items-center justify-center rounded-full text-white shadow-lg transition-all hover:scale-105 hover:shadow-xl active:scale-95 svelte-cnilt6"><!></button> <!>',1),Gr=w('<button class="fw-fab fixed z-50 flex h-12 w-12 items-center justify-center rounded-full text-white shadow-lg transition-all hover:scale-105 hover:shadow-xl active:scale-95 svelte-cnilt6"><i></i></button>'),Fr=w("<!> <!>",1);function zr(d,t){Je(t,!0);const n="linear-gradient(135deg, #6366f1, #8b5cf6)",s=420,x=580,g=48,H=12,P=20,A=3;function O(_){return _?_.includes("fa-solid")||_.includes("fa-regular")||_.includes("fa-brands")?_:"fa-solid "+(_.startsWith("fa-")?_:"fa-"+_):"fa-solid fa-robot"}let N=F(!1),D=_t({}),c=_t({}),b=_t({});const l=window.__GRAV_WIDGET_LOADING??={};function h(_){return`/gpm/plugins/${_}/widget-script`}let W=_t({});function S(_){W[_]=!0,setTimeout(()=>{D[_]=!1,W[_]=!1,j(_)},200)}function U(_,J){if(D[_])S(_);else{for(const ve of Object.keys(D))ve!==_&&D[ve]&&(D[ve]=!1,W[ve]=!1,j(ve));D[_]=!0,requestAnimationFrame(()=>{b[_]?te(_,J):E(_,J)})}}async function E(_,J){const ve=`grav-${J}--widget`;if(customElements.get(ve)){b[_]=!0,te(_,J);return}if(l[ve]){try{await l[ve],b[_]=!0,te(_,J)}catch{console.error(`[FloatingWidget] Failed to load ${J}`)}return}l[ve]=(async()=>{const Ae=await Et.fetchScript(h(J));window.__GRAV_API_SERVER_URL=T.serverUrl,window.__GRAV_API_PREFIX=T.apiPrefix||"/api/v1",window.__GRAV_API_TOKEN=T.accessToken;const Ue=new Blob([`window.__GRAV_WIDGET_TAG = ${JSON.stringify(ve)};
${Ae}`],{type:"application/javascript"}),Ke=URL.createObjectURL(Ue);await import(Ke),URL.revokeObjectURL(Ke),await customElements.whenDefined(ve)})();try{await l[ve],b[_]=!0,te(_,J)}catch(Ae){console.error(`[FloatingWidget] Failed to load ${J}:`,Ae)}}function te(_,J){const ve=c[_];if(!ve)return;const Ae=`grav-${J}--widget`;ve.innerHTML="";const Ue=document.createElement(Ae);Ue.addEventListener("close",()=>{W[_]=!0,setTimeout(()=>{D[_]=!1,W[_]=!1,j(_)},200)}),ve.appendChild(Ue)}function j(_){const J=c[_];J&&(J.innerHTML="")}const B=new Set;xe(()=>{if(pt.loaded)for(const _ of pt.items)_.autoLoad&&!B.has(_.id)&&(B.add(_.id),E(_.id,_.plugin))}),xe(()=>{window.__GRAV_API_SERVER_URL=T.serverUrl,window.__GRAV_API_PREFIX=T.apiPrefix||"/api/v1",window.__GRAV_API_TOKEN=T.accessToken});var Y=oe(),ye=X(Y);{var Z=_=>{const J=f(()=>pt.items.filter(De=>De.showFab!==!1)),ve=f(()=>e(J).length>=A);var Ae=Fr(),Ue=X(Ae);rt(Ue,17,()=>pt.items,De=>De.id,(De,de)=>{const ae=f(()=>e(J).findIndex(re=>re.id===e(de).id)),G=f(()=>e(ve)?P:P+e(ae)*(g+H)),me=f(()=>e(de).width??s),Ce=f(()=>e(de).height??x),Be=f(()=>e(de).gradient??n);var u=oe(),k=X(u);{var se=re=>{var ue=Hr(),Ve=i(ue);{var Ze=he=>{var Oe=Br(),C=X(Oe),Xe=i(C),it=i(Xe),He=i(it);r(it);var Ge=m(it,2),st=i(Ge,!0);r(Ge),r(Xe);var lt=m(Xe,2);r(C);var z=m(C,2);At(z,($,be)=>c[be.id]=$,$=>c?.[$.id],()=>[e(de)]),L($=>{gt(C,`background: ${e(Be)??""};`),Te(He,1,`${$??""} text-sm leading-none`,"svelte-cnilt6"),ie(st,e(de).label)},[()=>O(e(de).icon)]),_e("click",lt,()=>S(e(de).id)),a(he,Oe)},We=he=>{var Oe=Vr();At(Oe,(C,Xe)=>c[Xe.id]=C,C=>c?.[C.id],()=>[e(de)]),a(he,Oe)};I(Ve,he=>{e(de).useStandardHeader!==!1?he(Ze):he(We,-1)})}r(ue),L(()=>{Te(ue,1,`fw-panel fixed z-[60] flex flex-col overflow-hidden rounded-xl border border-border bg-popover shadow-2xl ${W[e(de).id]?"fw-closing":"fw-opening"}`,"svelte-cnilt6"),gt(ue,`width: ${e(me)??""}px; height: ${e(Ce)??""}px; bottom: ${e(G)+g+8}px; inset-inline-end: 20px;`)}),a(re,ue)};I(k,re=>{D[e(de).id]&&re(se)})}a(De,u)});var Ke=m(Ue,2);{var ot=De=>{var de=Ur(),ae=X(de);rt(ae,19,()=>e(J),u=>u.id,(u,k,se)=>{const re=f(()=>P+(g+H)*(e(se)+1));var ue=Wr(),Ve=i(ue);r(ue),L(Ze=>{Te(ue,1,`fw-fab fw-dial-item fixed z-50 flex h-12 w-12 items-center justify-center rounded-full text-white shadow-lg transition-all hover:scale-105 active:scale-95 ${e(N)?"fw-dial-open":"fw-dial-closed"}`,"svelte-cnilt6"),gt(ue,`bottom: ${e(re)??""}px; inset-inline-end: 20px; background: ${e(k).gradient??n??""}; --dial-delay: ${e(se)*30}ms;`),p(ue,"title",e(k).label),p(ue,"tabindex",e(N)?0:-1),p(ue,"aria-hidden",!e(N)),Te(Ve,1,`${Ze??""} text-base leading-none`,"svelte-cnilt6")},[()=>O(e(k).icon)]),_e("click",ue,()=>{o(N,!1),U(e(k).id,e(k).plugin)}),a(u,ue)});var G=m(ae,2);gt(G,"bottom: 20px; inset-inline-end: 20px; background: linear-gradient(135deg, #6366f1, #8b5cf6);");var me=i(G);{let u=f(()=>e(N)?"rotate-45":"");mn(me,{size:22,get class(){return`transition-transform ${e(u)??""}`}})}r(G);var Ce=m(G,2);{var Be=u=>{var k=Xr();L(se=>p(k,"aria-label",se),[()=>R.t("ADMIN_NEXT.FLOATING_WIDGET_LOADER.CLOSE_WIDGETS_MENU")]),_e("click",k,()=>o(N,!1)),a(u,k)};I(Ce,u=>{e(N)&&u(Be)})}L(()=>{p(G,"title",e(N)?"Close":"Plugin widgets"),p(G,"aria-expanded",e(N))}),_e("click",G,()=>o(N,!e(N))),a(De,de)},nt=De=>{var de=oe(),ae=X(de);rt(ae,19,()=>e(J),G=>G.id,(G,me,Ce)=>{const Be=f(()=>P+e(Ce)*(g+H));var u=Gr(),k=i(u);r(u),L(se=>{gt(u,`bottom: ${e(Be)??""}px; inset-inline-end: 20px; background: ${e(me).gradient??n??""};`),p(u,"title",e(me).label),Te(k,1,`${se??""} text-base leading-none`,"svelte-cnilt6")},[()=>O(e(me).icon)]),_e("click",u,()=>U(e(me).id,e(me).plugin)),a(G,u)}),a(De,de)};I(Ke,De=>{e(ve)?De(ot):De(nt,-1)})}a(_,Ae)};I(ye,_=>{pt.loaded&&pt.items.length>0&&_(Z)})}a(d,Y),Qe()}Nt(["click"]);var jr=w('<div></div> <div><div class="flex-1 overflow-hidden svelte-1823ccj"></div></div>',1);function Kr(d,t){Je(t,!0);const n=420;let s=F(null),x={},g=null,H=F(!1),P=F(null);const A=window.__GRAV_PANEL_LOADING??={};function O(E){return`/gpm/plugins/${E}/panel-script`}function N(E){return`grav-${E}--panel`}function D(){o(H,!0),et.close(),setTimeout(()=>{et.activePanel||h(),o(H,!1)},250)}function c(){D()}async function b(E,te){const j=N(te);if(customElements.get(j)){x[E]=!0,l(te);return}if(A[j]){try{await A[j],x[E]=!0,l(te)}catch{console.error(`[ContextPanel] Failed to load ${te}`)}return}A[j]=(async()=>{const B=await Et.fetchScript(O(te));window.__GRAV_API_SERVER_URL=T.serverUrl,window.__GRAV_API_PREFIX=T.apiPrefix||"/api/v1",window.__GRAV_API_TOKEN=T.accessToken;const Y=new Blob([`window.__GRAV_PANEL_TAG = ${JSON.stringify(j)};
${B}`],{type:"application/javascript"}),ye=URL.createObjectURL(Y);await import(ye),URL.revokeObjectURL(ye),await customElements.whenDefined(j)})();try{await A[j],x[E]=!0,l(te)}catch(B){console.error(`[ContextPanel] Failed to load ${te}:`,B)}}function l(E){if(!e(s))return;const te=N(E);e(s).innerHTML="";const j=document.createElement(te),B=et.context;B&&(j.setAttribute("route",B.route),j.setAttribute("lang",B.lang),j.setAttribute("type",B.type)),j.addEventListener("close",()=>D()),j.addEventListener("badge",Y=>{const ye=et.activePanel;ye&&Y.detail?.count!==void 0&&et.setBadge(ye,Y.detail.count)}),j.addEventListener("resize",Y=>{Y.detail?.width&&o(P,Y.detail.width,!0)}),e(s).appendChild(j),g=j}function h(){e(s)&&(e(s).innerHTML=""),g=null,o(P,null)}xe(()=>{const E=et.activePanel;if(!E)return;const te=et.getPanel(E);te&&cn().then(()=>{et.activePanel===E&&(x[E]?l(te.plugin):b(E,te.plugin))})}),xe(()=>{const E=et.context;g&&E&&(g.setAttribute("route",E.route),g.setAttribute("lang",E.lang),g.setAttribute("type",E.type))}),xe(()=>{window.__GRAV_API_SERVER_URL=T.serverUrl,window.__GRAV_API_PREFIX=T.apiPrefix||"/api/v1",window.__GRAV_API_TOKEN=T.accessToken});var W=oe(),S=X(W);{var U=E=>{const te=f(()=>et.getPanel(et.activePanel??"")),j=f(()=>e(P)??e(te)?.width??n);var B=jr(),Y=X(B),ye=m(Y,2),Z=i(ye);At(Z,_=>o(s,_),()=>e(s)),r(ye),L(()=>{Te(Y,1,`cp-backdrop fixed inset-0 z-40 bg-black/40 ${e(H)?"cp-backdrop-closing":"cp-backdrop-opening"}`,"svelte-1823ccj"),Te(ye,1,`cp-panel fixed end-0 top-0 z-40 flex h-full flex-col border-s border-border bg-background shadow-2xl ${e(H)?"cp-closing":"cp-opening"}`,"svelte-1823ccj"),gt(ye,`width: ${e(j)??""}px; max-width: 100vw; transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);`)}),_e("click",Y,c),a(E,B)};I(S,E=>{(et.activePanel||e(H))&&E(U)})}a(d,W),Qe()}Nt(["click"]);var Zr=w("<input/>");function ln(d,t){Je(t,!0);let n=dn(t,["$$slots","$$events","$$legacy","class"]);var s=Zr();un(s,x=>({class:x,...n}),[()=>Cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t.class)],void 0,void 0,void 0,!0),a(d,s),Qe()}var qr=w('<p class="text-[0.8125rem] text-destructive"> </p>'),Yr=w('<div class="fixed inset-0 z-[60] flex items-center justify-center bg-neutral-900/75 p-4 backdrop-blur-sm" role="dialog" aria-modal="true" aria-labelledby="reauth-title"><div class="w-full max-w-sm rounded-xl border border-border bg-card p-6 shadow-2xl"><div class="flex gap-4"><div class="flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary/10"><!></div> <div class="min-w-0 flex-1"><h3 id="reauth-title" class="text-base font-semibold text-foreground"> </h3> <p class="mt-1.5 text-sm text-muted-foreground"> </p></div></div> <form class="mt-5 space-y-3"><div><label for="reauth-username" class="text-[0.8125rem] font-medium text-foreground"> </label> <!></div> <div><label for="reauth-password" class="text-[0.8125rem] font-medium text-foreground"> </label> <!></div> <!> <div class="flex justify-end gap-2 pt-1"><!> <!></div></form></div></div>');function Jr(d,t){Je(t,!0);let n=F(""),s=F(!1),x=F(null);xe(()=>{$e.reauthOpen&&queueMicrotask(()=>{document.getElementById("reauth-password")?.focus()})}),xe(()=>{if(!$e.reauthOpen)return;const D=`${T.serverUrl}${T.apiPrefix||"/api/v1"}`;fetch(`${D}/auth/setup`,{headers:{Accept:"application/json"}}).then(c=>c.ok?c.json():null).then(c=>{(c?.data??c)?.setup_required&&($e.rejectPending(new Error("Setup required")),$e.closeReauth(),$e.stop(),T.logout(),Mt(`${Re}/setup`))}).catch(()=>{})});async function g(D){if(D.preventDefault(),!(e(s)||!e(n).trim())){o(s,!0),o(x,null);try{const c=`${T.serverUrl}${T.apiPrefix||"/api/v1"}`,b=await fetch(`${c}/auth/token`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({username:T.username,password:e(n)})});if(!b.ok){b.status===401?o(x,"Invalid password"):o(x,`Sign-in failed (${b.status})`),o(s,!1);return}const l=await b.json(),h=l.data??l;T.setTokens(h.access_token,h.refresh_token,h.expires_in),h.user&&T.setPermissions(h.user.super_admin??!1,h.user.access??{}),$e.schedule(),$e.closeReauth(),o(n,"");const W=window.__apiClientRetry__;W&&await $e.retryPending(W)}catch{o(x,"Network error — please try again")}finally{o(s,!1)}}}async function H(){$e.rejectPending(new Error("User signed out")),$e.closeReauth(),$e.stop(),T.logout(),await Mt(`${Re}/login`)}function P(D){D.key==="Escape"&&H()}var A=oe();It("keydown",wn,function(...D){($e.reauthOpen?P:void 0)?.apply(this,D)});var O=X(A);{var N=D=>{var c=Yr(),b=i(c),l=i(b),h=i(l),W=i(h);Kn(W,{size:20,class:"text-primary"}),r(h);var S=m(h,2),U=i(S),E=i(U,!0);r(U);var te=m(U,2),j=i(te,!0);r(te),r(S),r(l);var B=m(l,2),Y=i(B),ye=i(Y),Z=i(ye,!0);r(ye);var _=m(ye,2);ln(_,{id:"reauth-username",type:"text",get value(){return T.username},disabled:!0,class:"mt-1.5"}),r(Y);var J=m(Y,2),ve=i(J),Ae=i(ve,!0);r(ve);var Ue=m(ve,2);ln(Ue,{id:"reauth-password",type:"password",get value(){return e(n)},oninput:ae=>o(n,ae.currentTarget.value,!0),autocomplete:"current-password",required:!0,class:"mt-1.5"}),r(J);var Ke=m(J,2);{var ot=ae=>{var G=qr(),me=i(G,!0);r(G),L(()=>ie(me,e(x))),a(ae,G)};I(Ke,ae=>{e(x)&&ae(ot)})}var nt=m(Ke,2),De=i(nt);Yt(De,{type:"button",variant:"outline",size:"sm",onclick:H,get disabled(){return e(s)},children:(ae,G)=>{qt();var me=Pt();L(Ce=>ie(me,Ce),[()=>R.t("ADMIN_NEXT.SIGN_OUT")]),a(ae,me)},$$slots:{default:!0}});var de=m(De,2);{let ae=f(()=>e(s)||!e(n).trim());Yt(de,{type:"submit",size:"sm",get disabled(){return e(ae)},children:(G,me)=>{qt();var Ce=Pt();L(()=>ie(Ce,e(s)?"Signing in…":"Sign in")),a(G,Ce)},$$slots:{default:!0}})}r(nt),r(B),r(b),r(c),L((ae,G,me,Ce)=>{ie(E,ae),ie(j,G),ie(Z,me),ie(Ae,Ce)},[()=>R.t("ADMIN_NEXT.REAUTH_MODAL.SESSION_EXPIRED"),()=>R.t("ADMIN_NEXT.REAUTH_MODAL.PLEASE_RE_ENTER_YOUR_PASSWORD_TO"),()=>R.t("ADMIN_NEXT.USERNAME"),()=>R.t("ADMIN_NEXT.PASSWORD")]),It("submit",B,g),a(D,c)};I(O,D=>{$e.reauthOpen&&D(N)})}a(d,A),Qe()}var Qr=w('<span class="relative inline-flex h-7 w-7 items-center justify-center rounded-full border-2 border-background text-[0.6875rem] font-semibold text-white ring-0"> </span>'),$r=w('<span class="relative inline-flex h-7 w-7 items-center justify-center rounded-full border-2 border-background bg-muted text-[0.6875rem] font-semibold text-foreground"> </span>'),eo=w('<div class="flex items-center gap-1.5"><div class="flex -space-x-2"><!> <!></div></div>');function to(d,t){Je(t,!0);let n=ke(t,"max",3,5);function s(D){let c=0;for(let b=0;b<D.length;b++)c=c*31+D.charCodeAt(b)|0;return`hsl(${(c%360+360)%360} 65% 45%)`}function x(D){const c=D.user?.trim()||D.clientId;if(!c)return"?";const b=c.split(/\s+/).filter(Boolean);return b.length>=2?(b[0][0]+b[1][0]).toUpperCase():c.slice(0,2).toUpperCase()}let g=f(()=>t.peers.filter(D=>D.clientId!==t.clientId)),H=f(()=>e(g).slice(0,n())),P=f(()=>Math.max(0,e(g).length-n()));var A=oe(),O=X(A);{var N=D=>{var c=eo(),b=i(c),l=i(b);rt(l,17,()=>e(H),S=>S.clientId,(S,U)=>{var E=Qr(),te=i(E,!0);r(E),L((j,B)=>{gt(E,`background-color: ${j??""}`),p(E,"title",e(U).user??e(U).clientId),ie(te,B)},[()=>s(e(U).clientId),()=>x(e(U))]),a(S,E)});var h=m(l,2);{var W=S=>{var U=$r(),E=i(U);r(U),L(()=>{p(U,"title",`${e(P)} more`),ie(E,`+${e(P)??""}`)}),a(S,U)};I(h,S=>{e(P)>0&&S(W)})}r(b),r(c),L(()=>p(c,"aria-label",`${e(g).length} collaborator${e(g).length===1?"":"s"}`)),a(D,c)};I(O,D=>{e(g).length>0&&D(N)})}a(d,A),Qe()}var no=w("<span><!> <span> </span></span>");function ao(d,t){let n=ke(t,"peerCount",3,0),s=f(()=>{switch(t.status){case"connected":return n()>0?`Live (${n()+1} editing)`:"Live";case"connecting":return"Connecting…";case"offline":return"Offline";case"error":return"Error";default:return"Idle"}}),x=f(()=>{switch(t.status){case"connected":return"text-emerald-600 dark:text-emerald-400";case"connecting":return"text-amber-600 dark:text-amber-400";case"offline":return"text-muted-foreground";case"error":return"text-red-600 dark:text-red-400";default:return"text-muted-foreground"}});var g=no(),H=i(g);{var P=l=>{Kt(l,{class:"h-3.5 w-3.5 animate-spin"})},A=l=>{var h=oe(),W=X(h);{var S=E=>{qn(E,{class:"h-3.5 w-3.5"})},U=E=>{tn(E,{class:"h-3.5 w-3.5"})};I(W,E=>{n()>0?E(S):E(U,-1)})}a(l,h)},O=l=>{Zn(l,{class:"h-3.5 w-3.5"})},N=l=>{$n(l,{class:"h-3.5 w-3.5"})},D=l=>{tn(l,{class:"h-3.5 w-3.5 opacity-50"})};I(H,l=>{t.status==="connecting"?l(P):t.status==="connected"?l(A,1):t.status==="offline"?l(O,2):t.status==="error"?l(N,3):l(D,-1)})}var c=m(H,2),b=i(c,!0);r(c),r(g),L(()=>{Te(g,1,`inline-flex items-center gap-1.5 text-xs font-medium ${e(x)??""}`),p(g,"title",t.detail??e(s)),ie(b,e(s))}),a(d,g)}var ro=w('<button class="fixed inset-0 z-30 bg-black/50 lg:hidden"></button>'),oo=w('<span class="ms-auto rounded-full bg-primary/10 px-1.5 py-0.5 text-[0.625rem] font-semibold text-primary"> </span>'),io=w("<span> </span> <!>",1),so=w("<li><a><!> <!></a></li>"),lo=w('<span class="ms-auto rounded-full bg-primary/10 px-1.5 py-0.5 text-[0.625rem] font-semibold text-primary"> </span>'),co=w("<span> </span> <!>",1),uo=w("<li><a><i></i> <!></a></li>"),fo=w('<li class="my-1 border-t border-sidebar-border"></li> <!>',1),vo=w("<span> </span>"),mo=w('<a class="flex items-center justify-center rounded-md p-1.5 transition-colors hover:bg-sidebar-accent"><img class="h-7 w-7 rounded-full object-cover"/></a>'),go=w('<div class="flex items-center gap-2.5 rounded-md px-2 py-1.5"><a class="shrink-0"><img class="h-8 w-8 rounded-full object-cover"/></a> <div class="min-w-0 flex-1"><a class="block truncate text-[0.8125rem] font-medium text-foreground hover:underline"> </a></div> <button class="flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/50 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"></path><path d="M9 12h12l-3 -3"></path><path d="M18 15l3 -3"></path></svg></button></div>'),_o=w('<div class="text-sidebar-foreground/60"> </div>'),bo=w('<div class="text-sidebar-foreground/50"> </div>'),ho=w('<div class="flex-1 text-xs leading-tight"><!> <!></div>'),xo=Tt('<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 12l-10 0"></path><path d="M20 12l-4 4"></path><path d="M20 12l-4 -4"></path><path d="M4 4l0 16"></path></svg>'),po=Tt('<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12l10 0"></path><path d="M4 12l4 4"></path><path d="M4 12l4 -4"></path><path d="M20 4l0 16"></path></svg>'),Eo=w('<div class="flex items-center gap-2 border-s border-border ps-3"><!> <!></div>'),yo=w('<div class="inline-flex rounded-md border border-border shadow-sm"><button><!> <span class="hidden sm:inline"> </span></button> <button><!> <span class="hidden sm:inline"> </span></button></div>'),wo=w('<div class="flex h-screen overflow-hidden bg-background"><!> <aside><div class="flex h-12 items-center border-b border-sidebar-border px-3"><!></div> <nav class="flex-1 overflow-y-auto px-2 py-2"><ul class="space-y-0.5"><!> <!></ul></nav> <div class="border-t border-sidebar-border px-2 pt-2"><a><!> <!></a></div> <div class="border-t border-sidebar-border px-2 py-2"><!></div> <div class="flex items-center gap-2 border-t border-sidebar-border px-4 py-1.5"><!> <button><!></button></div></aside> <div class="flex min-w-0 flex-1 flex-col overflow-hidden"><header class="flex h-12 shrink-0 items-center gap-3 border-b border-border bg-background px-4"><button class="text-muted-foreground lg:hidden"><!></button> <!> <!> <div class="flex-1"></div> <!> <div class="flex items-center gap-1"><!> <!> <!> <!></div> <div class="h-5 w-px bg-border"></div> <button class="flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground"><!></button></header> <main class="flex-1 overflow-x-hidden overflow-y-auto"><div class="h-full min-w-0"><!></div></main></div> <!> <!> <!></div>');function To(d,t){Je(t,!0),xe(()=>{T.isAuthenticated?$e.start():$e.stop()}),xe(()=>{T.isAuthenticated?(ht.load().then(()=>ht.fetchBadges()),pt.load(),et.load(),St.load()):(ht.clear(),pt.clear(),et.clear(),St.clear())}),xe(()=>{T.isAuthenticated&&T.username&&Ct()}),xe(()=>{if(!T.isAuthenticated)return;const v=[Ye.subscribe("plugins:update:admin",()=>Ct()),Ye.subscribe("plugins:update:admin2",()=>Ct()),Ye.subscribe("plugins:update:api",()=>Ct()),Ye.subscribe("grav:update",()=>Ct())];return()=>{for(const y of v)y()}}),xe(()=>{if(!T.isAuthenticated)return;const v=new Set;let y=!1;const q=Le=>{v.add(Le),!y&&(y=!0,queueMicrotask(()=>{y=!1;const Ee=Array.from(v);v.clear();for(const Fe of Ee)Fe()}))},fe=()=>St.load(),pe=()=>ht.load().then(()=>ht.fetchBadges()),Ne=()=>ht.fetchBadges(),ne=()=>pt.load(),ee=()=>et.load(),V=()=>q(fe),K=()=>q(pe),M=()=>q(Ne),le=()=>q(ne),Ie=()=>q(ee),ge=()=>{K(),le(),Ie(),V()},Q=Le=>{const Ee=Le.detail;Ee&&Ee.id!=null&&Ee.count!=null&&ht.setBadge(Ee.id,Ee.count)};window.addEventListener("grav:sidebar:badge",Q);const ce=[Ye.subscribe("plugins:*",ge),Ye.subscribe("themes:*",ge),Ye.subscribe("gpm:*",ge),Ye.subscribe("pages:*",()=>{V(),M()}),Ye.subscribe("users:*",()=>{V(),M()}),Ye.subscribe("media:*",()=>{V(),M()}),Ye.subscribe("config:*",M)];return()=>{for(const Le of ce)Le();window.removeEventListener("grav:sidebar:badge",Q)}});let n=F(!1),s=F(!1);const x=[{href:`${Re}/`,labelKey:"ADMIN_NEXT.NAV.DASHBOARD",icon:Jn},{href:`${Re}/config`,labelKey:"ADMIN_NEXT.NAV.CONFIGURATION",icon:ta,permission:"api.config.read"},{href:`${Re}/users`,labelKey:"ADMIN_NEXT.NAV.USERS",icon:na,badgeKey:"users",permission:"api.users.read"},{href:`${Re}/pages`,labelKey:"ADMIN_NEXT.NAV.PAGES",icon:nn,badgeKey:"pages",permission:"api.pages.read"},{href:`${Re}/media`,labelKey:"ADMIN_NEXT.NAV.MEDIA",icon:aa,badgeKey:"media",permission:"api.media.read"},{href:`${Re}/plugins`,labelKey:"ADMIN_NEXT.NAV.PLUGINS",icon:ra,badgeKey:"plugins",permission:"api.gpm.read"},{href:`${Re}/themes`,labelKey:"ADMIN_NEXT.NAV.THEMES",icon:oa,badgeKey:"themes",permission:"api.gpm.read"},{href:`${Re}/tools`,labelKey:"ADMIN_NEXT.NAV.TOOLS",icon:Qn,permission:"api.system.read"}],g=f(()=>x.filter(v=>!v.permission||Wn(v.permission))),H=f(()=>ht.items),P={href:`${Re}/settings`,labelKey:"ADMIN_NEXT.NAV.SETTINGS",icon:ea};function A(v){return v===`${Re}/`?ft.url.pathname===`${Re}/`:ft.url.pathname.startsWith(v)}async function O(){try{await On()}catch{}await Vn(),Mt(`${Re}/login`)}const N=f(()=>en(T.avatarUrl||null,T.email||null,T.fullname||null,T.username)),D=f(()=>en(null,T.email||null,T.fullname||null,T.username));function c(v){const y=v.target;y.src!==e(D)&&(y.src=e(D))}var b=wo(),l=i(b);{var h=v=>{var y=ro();L(q=>p(y,"aria-label",q),[()=>R.t("ADMIN_NEXT.APP_SHELL.CLOSE_MENU")]),_e("click",y,()=>o(s,!1)),a(v,y)};I(l,v=>{e(s)&&v(h)})}var W=m(l,2),S=i(W),U=i(S);{let v=f(()=>!e(n));Dn(U,{size:"sidebar",get showLabel(){return e(v)}})}r(S);var E=m(S,2),te=i(E),j=i(te);rt(j,17,()=>e(g),Vt,(v,y)=>{var q=so(),fe=i(q),pe=i(fe);{let ee=f(()=>A(e(y).href)?2:1.5);xt(pe,()=>e(y).icon,(V,K)=>{K(V,{size:16,get strokeWidth(){return e(ee)}})})}var Ne=m(pe,2);{var ne=ee=>{var V=io(),K=X(V),M=i(K,!0);r(K);var le=m(K,2);{var Ie=ge=>{var Q=oo(),ce=i(Q,!0);r(Q),L(()=>ie(ce,St.counts[e(y).badgeKey])),a(ge,Q)};I(le,ge=>{e(y).badgeKey&&St.counts[e(y).badgeKey]!=null&&ge(Ie)})}L(ge=>ie(M,ge),[()=>R.t(e(y).labelKey)]),a(ee,V)};I(Ne,ee=>{e(n)||ee(ne)})}r(fe),r(q),L((ee,V)=>{p(fe,"href",e(y).href),Te(fe,1,`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[0.8125rem] font-medium transition-colors
${ee??""}`),p(fe,"title",V)},[()=>A(e(y).href)?"bg-primary/10 text-primary":"text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",()=>e(n)?R.t(e(y).labelKey):void 0]),_e("click",fe,()=>o(s,!1)),a(v,q)});var B=m(j,2);{var Y=v=>{var y=fo(),q=m(X(y),2);rt(q,17,()=>e(H),fe=>fe.id,(fe,pe)=>{var Ne=uo(),ne=i(Ne),ee=i(ne),V=m(ee,2);{var K=M=>{const le=f(()=>ht.badges[e(pe).id]??e(pe).badge);var Ie=co(),ge=X(Ie),Q=i(ge,!0);r(ge);var ce=m(ge,2);{var Le=Ee=>{var Fe=lo(),ct=i(Fe,!0);r(Fe),L(()=>ie(ct,e(le))),a(Ee,Fe)};I(ce,Ee=>{e(le)!=null&&Ee(Le)})}L(()=>ie(Q,e(pe).label)),a(M,Ie)};I(V,M=>{e(n)||M(K)})}r(ne),r(Ne),L((M,le)=>{p(ne,"href",`${Re??""}${e(pe).route??""}`),Te(ne,1,`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[0.8125rem] font-medium transition-colors
${M??""}`),p(ne,"title",e(n)?e(pe).label:void 0),Te(ee,1,`fa-solid ${le??""} w-4 text-center text-[0.8125rem]`)},[()=>A(`${Re}${e(pe).route}`)?"bg-primary/10 text-primary":"text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",()=>e(pe).icon.startsWith("fa-")?e(pe).icon:"fa-"+e(pe).icon]),_e("click",ne,()=>o(s,!1)),a(fe,Ne)}),a(v,y)};I(B,v=>{e(H).length>0&&v(Y)})}r(te),r(E);var ye=m(E,2),Z=i(ye),_=i(Z);{let v=f(()=>A(P.href)?2:1.5);xt(_,()=>P.icon,(y,q)=>{q(y,{size:16,get strokeWidth(){return e(v)}})})}var J=m(_,2);{var ve=v=>{var y=vo(),q=i(y,!0);r(y),L(fe=>ie(q,fe),[()=>R.t(P.labelKey)]),a(v,y)};I(J,v=>{e(n)||v(ve)})}r(Z),r(ye);var Ae=m(ye,2),Ue=i(Ae);{var Ke=v=>{var y=mo(),q=i(y);r(y),L(()=>{p(y,"href",`${Re??""}/users/${T.username??""}`),p(y,"title",T.fullname||T.username),p(q,"src",e(N)),p(q,"alt",T.fullname||T.username)}),It("error",q,c),$t(q),a(v,y)},ot=v=>{var y=go(),q=i(y),fe=i(q);r(q);var pe=m(q,2),Ne=i(pe),ne=i(Ne,!0);r(Ne),r(pe);var ee=m(pe,2);r(y),L(V=>{p(q,"href",`${Re??""}/users/${T.username??""}`),p(fe,"src",e(N)),p(fe,"alt",T.fullname||T.username),p(Ne,"href",`${Re??""}/users/${T.username??""}`),ie(ne,T.fullname||T.username),p(ee,"title",V)},[()=>R.t("ADMIN_NEXT.SIGN_OUT")]),It("error",fe,c),$t(fe),_e("click",ee,O),a(v,y)};I(Ue,v=>{e(n)?v(Ke):v(ot,-1)})}r(Ae);var nt=m(Ae,2),De=i(nt);{var de=v=>{var y=ho(),q=i(y);{var fe=ne=>{var ee=_o(),V=i(ee,!0);r(ee),L(K=>ie(V,K),[()=>R.t("ADMIN_NEXT.APP_SHELL.GRAV_VERSION",{version:T.gravVersion})]),a(ne,ee)};I(q,ne=>{T.gravVersion&&ne(fe)})}var pe=m(q,2);{var Ne=ne=>{var ee=bo(),V=i(ee,!0);r(ee),L(K=>ie(V,K),[()=>R.t("ADMIN_NEXT.APP_SHELL.ADMIN_VERSION",{version:T.adminVersion})]),a(ne,ee)};I(pe,ne=>{T.adminVersion&&ne(Ne)})}r(y),a(v,y)};I(De,v=>{!e(n)&&(T.gravVersion||T.adminVersion)&&v(de)})}var ae=m(De,2),G=i(ae);{var me=v=>{var y=xo();a(v,y)},Ce=v=>{var y=po();a(v,y)};I(G,v=>{e(n)?v(me):v(Ce,-1)})}r(ae),r(nt),r(W);var Be=m(W,2),u=i(Be),k=i(u),se=i(k);Yn(se,{size:18}),r(k);var re=m(k,2);hr(re,{});var ue=m(re,2);{var Ve=v=>{const y=f(()=>Rt.presence);var q=Eo(),fe=i(q);to(fe,{get peers(){return e(y).peers},get clientId(){return e(y).clientId}});var pe=m(fe,2);{let Ne=f(()=>e(y).peers.filter(ne=>ne.clientId!==e(y).clientId).length);ao(pe,{get status(){return e(y).status},get detail(){return e(y).detail},get peerCount(){return e(Ne)}})}r(q),a(v,q)};I(ue,v=>{Rt.presence&&v(Ve)})}var Ze=m(ue,4);{var We=v=>{const y=f(()=>Rt.modeToggle);var q=yo(),fe=i(q),pe=i(fe);nn(pe,{size:13});var Ne=m(pe,2),ne=i(Ne,!0);r(Ne),r(fe);var ee=m(fe,2),V=i(ee);ia(V,{size:13});var K=m(V,2),M=i(K,!0);r(K),r(ee),r(q),L((le,Ie,ge,Q,ce,Le)=>{Te(fe,1,`inline-flex h-7 items-center gap-1.5 rounded-l-md px-2 text-[0.75rem] font-medium transition-colors sm:px-2.5
${wt.editorMode==="normal"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`),p(fe,"title",le),p(fe,"aria-label",Ie),ie(ne,ge),Te(ee,1,`inline-flex h-7 items-center gap-1.5 rounded-r-md px-2 text-[0.75rem] font-medium transition-colors sm:px-2.5
${wt.editorMode==="expert"?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"}`),p(ee,"title",Q),p(ee,"aria-label",ce),ie(M,Le)},[()=>R.t("ADMIN_NEXT.NORMAL_MODE"),()=>R.t("ADMIN_NEXT.NORMAL_MODE"),()=>R.t("ADMIN_NEXT.PAGES.MODE_NORMAL"),()=>R.t("ADMIN_NEXT.EXPERT_MODE"),()=>R.t("ADMIN_NEXT.EXPERT_MODE"),()=>R.t("ADMIN_NEXT.PAGES.MODE_EXPERT")]),_e("click",fe,function(...le){e(y).onNormal?.apply(this,le)}),_e("click",ee,function(...le){e(y).onExpert?.apply(this,le)}),a(v,q)};I(Ze,v=>{Rt.modeToggle&&v(We)})}var he=m(Ze,2),Oe=i(he);kr(Oe,{});var C=m(Oe,2);Lr(C,{});var Xe=m(C,2);Ir(Xe,{});var it=m(Xe,2);yr(it,{}),r(he);var He=m(he,4),Ge=i(He);{var st=v=>{sa(v,{size:15})},lt=v=>{la(v,{size:15})};I(Ge,v=>{yt.isDark?v(st):v(lt,-1)})}r(He),r(u);var z=m(u,2),$=i(z),be=i($);tt(be,()=>t.children),r($),r(z),r(Be);var Se=m(Be,2);Kr(Se,{});var Me=m(Se,2);zr(Me,{});var we=m(Me,2);Jr(we,{}),r(b),L((v,y,q,fe,pe)=>{Te(W,1,`fixed z-40 flex h-full flex-col border-e border-sidebar-border bg-sidebar text-sidebar-foreground transition-all duration-200 lg:relative lg:z-auto
${e(n)?"w-[52px]":"w-56"}
${e(s)?"translate-x-0":"max-lg:-translate-x-full max-lg:rtl:translate-x-full lg:translate-x-0"}`),p(Z,"href",P.href),Te(Z,1,`flex items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[0.8125rem] font-medium transition-colors
${v??""}`),p(Z,"title",y),Te(ae,1,`ms-auto hidden h-7 w-7 shrink-0 items-center justify-center rounded-md p-1.5 text-sidebar-foreground/50 transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground lg:flex ${e(n)?"mx-auto":""}`),p(ae,"aria-label",q),p(k,"aria-label",fe),p(He,"aria-label",pe)},[()=>A(P.href)?"bg-primary/10 text-primary":"text-sidebar-foreground/80 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",()=>e(n)?R.t(P.labelKey):void 0,()=>e(n)?R.t("ADMIN_NEXT.EXPAND_SIDEBAR"):R.t("ADMIN_NEXT.COLLAPSE_SIDEBAR"),()=>R.t("ADMIN_NEXT.TOGGLE_MENU"),()=>R.t("ADMIN_NEXT.TOGGLE_DARK_MODE")]),_e("click",Z,()=>o(s,!1)),_e("click",ae,()=>o(n,!e(n))),_e("click",k,()=>o(s,!e(s))),_e("click",He,()=>yt.toggleColorMode()),a(d,b),Qe()}Nt(["click"]);function No(d,t){Je(t,!0);{let n=f(()=>!!vt.current),s=f(()=>vt.current?.title),x=f(()=>vt.current?.message??""),g=f(()=>vt.current?.confirmLabel),H=f(()=>vt.current?.cancelLabel),P=f(()=>vt.current?.variant);gn(d,{get open(){return e(n)},get title(){return e(s)},get message(){return e(x)},get confirmLabel(){return e(g)},get cancelLabel(){return e(H)},get variant(){return e(P)},onconfirm:()=>vt.accept(),oncancel:()=>vt.dismiss()})}Qe()}var Io=w('<link rel="icon"/>'),Ao=w("<!> <!> <!>",1);function Ti(d,t){Je(t,!0);const n=f(()=>ft.url.pathname===`${Re}/login`||ft.url.pathname===`${Re}/forgot`||ft.url.pathname===`${Re}/reset`||ft.url.pathname===`${Re}/invite`||ft.url.pathname===`${Re}/setup`),s=f(()=>!e(n)&&!T.isAuthenticated);xe(()=>{if(e(s)){const c=ft.url.pathname+ft.url.search+ft.url.hash;Mt(`${Re}/login?returnTo=${encodeURIComponent(c)}`)}});let x=F(!1);xe(()=>{T.isAuthenticated&&wt.loaded&&!e(x)&&(o(x,!0),R.load(wt.adminLanguage))}),xe(()=>{typeof document>"u"||(document.documentElement.setAttribute("lang",R.lang),document.documentElement.setAttribute("dir",R.dir))}),xe(()=>{T.isAuthenticated&&!Qt.loaded&&Qt.load()}),xe(()=>{if(!T.isAuthenticated)return;let c=!1,b=0;async function l(){if(kn())return;const S=Date.now();if(!(S-b<5e3)){b=S;try{const U=await Pn();if(wt.init(U),yt.init(U),Jt.init(U),!c){c=!0;const E=await er(U);E&&(wt.init(E),yt.init(E),Jt.init(E))}}catch(U){console.error("[preferences] fetch failed:",U)}}}l();const h=setInterval(()=>{document.visibilityState==="visible"&&l()},3e4),W=()=>{document.visibilityState==="visible"&&l()};return document.addEventListener("visibilitychange",W),()=>{clearInterval(h),document.removeEventListener("visibilitychange",W)}});let g=!1;xe(()=>{T.isAuthenticated&&!g&&(g=!0,pn(()=>import("../chunks/Cu5ilWky.js").then(c=>c.e),__vite__mapDeps([0,1]),import.meta.url).then(({api:c})=>c.get("/custom-fields").then(b=>{if(b&&typeof b=="object")for(const[l,h]of Object.entries(b)){const W=typeof h=="string"?h:h.slug,S=typeof h=="string"?"plugins":h.kind;Rn.register(W,{[l]:l},S)}}).catch(()=>{})))}),xe(()=>{typeof window>"u"||(window.__GRAV_DIALOGS={confirm:c=>vt.confirm(c)})}),xe(()=>{typeof window>"u"||(window.__GRAV_TOAST={success:(c,b)=>at.success(c,b),error:(c,b)=>at.error(c,b),info:(c,b)=>at.info(c,b),warning:(c,b)=>at.warning(c,b)})}),xe(()=>{typeof window>"u"||(window.__GRAV_ADMIN_BASE=Re,window.__GRAV_NAVIGATE=(c,b)=>Mt(c,b))}),Mn(c=>{Sn.current&&!c.willUnload&&c.to?.url&&(c.cancel(),window.location.href=c.to.url.href)}),xe(()=>{if(typeof window>"u")return;let c=Date.now(),b=!1;function l(){b&&Date.now()-c>3e4&&Ye.emit({tag:"*:focus",resource:"*",action:"focus"}),c=Date.now()}function h(){b=!0,c=Date.now()}return window.addEventListener("focus",l),window.addEventListener("blur",h),()=>{window.removeEventListener("focus",l),window.removeEventListener("blur",h)}});var H=Ao();Tn("12qhfyh",c=>{var b=Io();L(l=>p(b,"href",l),[()=>ar(yt.accentHue,yt.accentSaturation,yt.isDark)]),a(c,b)});var P=X(H);{let c=f(()=>R.dir==="rtl"?"bottom-left":"bottom-right");$a(P,{get position(){return e(c)},closeButton:!0,visibleToasts:5,toastOptions:{class:"grav-toast"}})}var A=m(P,2);No(A,{});var O=m(A,2);{var N=c=>{var b=oe(),l=X(b);tt(l,()=>t.children),a(c,b)},D=c=>{To(c,{children:(b,l)=>{var h=oe(),W=X(h);tt(W,()=>t.children),a(b,h)},$$slots:{default:!0}})};I(O,c=>{e(n)?c(N):T.isAuthenticated&&c(D,1)})}a(d,H),Qe()}export{Ti as component,wi as universal};