13 lines
818 KiB
JavaScript
13 lines
818 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editor-BNe2uH1t.js","./index-Vcq4gwWv.js"])))=>i.map(i=>d[i]);
|
||
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function a(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(l){if(l.ep)return;l.ep=!0;const r=a(l);fetch(l.href,r)}})();function uf(e){const t=Object.create(null);for(const a of e.split(","))t[a]=1;return a=>a in t}const Et={},zr=[],vn=()=>{},yg=()=>!1,uu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),du=e=>e.startsWith("onUpdate:"),zt=Object.assign,df=(e,t)=>{const a=e.indexOf(t);a>-1&&e.splice(a,1)},tx=Object.prototype.hasOwnProperty,kt=(e,t)=>tx.call(e,t),Xe=Array.isArray,jr=e=>Ts(e)==="[object Map]",co=e=>Ts(e)==="[object Set]",lm=e=>Ts(e)==="[object Date]",ot=e=>typeof e=="function",Mt=e=>typeof e=="string",Ea=e=>typeof e=="symbol",_t=e=>e!==null&&typeof e=="object",bg=e=>(_t(e)||ot(e))&&ot(e.then)&&ot(e.catch),_g=Object.prototype.toString,Ts=e=>_g.call(e),ax=e=>Ts(e).slice(8,-1),xg=e=>Ts(e)==="[object Object]",cu=e=>Mt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Yo=uf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),fu=e=>{const t=Object.create(null);return(a=>t[a]||(t[a]=e(a)))},nx=/-\w/g,ea=fu(e=>e.replace(nx,t=>t.slice(1).toUpperCase())),lx=/\B([A-Z])/g,Fl=fu(e=>e.replace(lx,"-$1").toLowerCase()),pu=fu(e=>e.charAt(0).toUpperCase()+e.slice(1)),Jo=fu(e=>e?`on${pu(e)}`:""),dn=(e,t)=>!Object.is(e,t),bi=(e,...t)=>{for(let a=0;a<e.length;a++)e[a](...t)},kg=(e,t,a,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:a})},mu=e=>{const t=parseFloat(e);return isNaN(t)?e:t},rx=e=>{const t=Mt(e)?Number(e):NaN;return isNaN(t)?e:t};let rm;const vu=()=>rm||(rm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function oa(e){if(Xe(e)){const t={};for(let a=0;a<e.length;a++){const n=e[a],l=Mt(n)?ux(n):oa(n);if(l)for(const r in l)t[r]=l[r]}return t}else if(Mt(e)||_t(e))return e}const ox=/;(?![^(]*\))/g,sx=/:([^]+)/,ix=/\/\*[^]*?\*\//g;function ux(e){const t={};return e.replace(ix,"").split(ox).forEach(a=>{if(a){const n=a.split(sx);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function pe(e){let t="";if(Mt(e))t=e;else if(Xe(e))for(let a=0;a<e.length;a++){const n=pe(e[a]);n&&(t+=n+" ")}else if(_t(e))for(const a in e)e[a]&&(t+=a+" ");return t.trim()}function ut(e){if(!e)return null;let{class:t,style:a}=e;return t&&!Mt(t)&&(e.class=pe(t)),a&&(e.style=oa(a)),e}const dx="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",cx=uf(dx);function wg(e){return!!e||e===""}function fx(e,t){if(e.length!==t.length)return!1;let a=!0;for(let n=0;a&&n<e.length;n++)a=fo(e[n],t[n]);return a}function fo(e,t){if(e===t)return!0;let a=lm(e),n=lm(t);if(a||n)return a&&n?e.getTime()===t.getTime():!1;if(a=Ea(e),n=Ea(t),a||n)return e===t;if(a=Xe(e),n=Xe(t),a||n)return a&&n?fx(e,t):!1;if(a=_t(e),n=_t(t),a||n){if(!a||!n)return!1;const l=Object.keys(e).length,r=Object.keys(t).length;if(l!==r)return!1;for(const o in e){const i=e.hasOwnProperty(o),u=t.hasOwnProperty(o);if(i&&!u||!i&&u||!fo(e[o],t[o]))return!1}}return String(e)===String(t)}function cf(e,t){return e.findIndex(a=>fo(a,t))}const $g=e=>!!(e&&e.__v_isRef===!0),_=e=>Mt(e)?e:e==null?"":Xe(e)||_t(e)&&(e.toString===_g||!ot(e.toString))?$g(e)?_(e.value):JSON.stringify(e,Cg,2):String(e),Cg=(e,t)=>$g(t)?Cg(e,t.value):jr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((a,[n,l],r)=>(a[sd(n,r)+" =>"]=l,a),{})}:co(t)?{[`Set(${t.size})`]:[...t.values()].map(a=>sd(a))}:Ea(t)?sd(t):_t(t)&&!Xe(t)&&!xg(t)?String(t):t,sd=(e,t="")=>{var a;return Ea(e)?`Symbol(${(a=e.description)!=null?a:t})`:e};let Ut;class Sg{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ut&&(Ut.active?(this.parent=Ut,this.index=(Ut.scopes||(Ut.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,a;if(this.scopes)for(t=0,a=this.scopes.length;t<a;t++)this.scopes[t].pause();for(t=0,a=this.effects.length;t<a;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,a;if(this.scopes)for(t=0,a=this.scopes.length;t<a;t++)this.scopes[t].resume();for(t=0,a=this.effects.length;t<a;t++)this.effects[t].resume()}}run(t){if(this._active){const a=Ut;try{return Ut=this,t()}finally{Ut=a}}}on(){++this._on===1&&(this.prevScope=Ut,Ut=this)}off(){if(this._on>0&&--this._on===0){if(Ut===this)Ut=this.prevScope;else{let t=Ut;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let a,n;for(a=0,n=this.effects.length;a<n;a++)this.effects[a].stop();for(this.effects.length=0,a=0,n=this.cleanups.length;a<n;a++)this.cleanups[a]();if(this.cleanups.length=0,this.scopes){for(a=0,n=this.scopes.length;a<n;a++)this.scopes[a].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const l=this.parent.scopes.pop();l&&l!==this&&(this.parent.scopes[this.index]=l,l.index=this.index)}this.parent=void 0}}}function Eg(e){return new Sg(e)}function ff(){return Ut}function Ag(e,t=!1){Ut&&Ut.cleanups.push(e)}let Tt;const id=new WeakSet;class Tg{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ut&&(Ut.active?Ut.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,id.has(this)&&(id.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Dg(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,om(this),Og(this);const t=Tt,a=ja;Tt=this,ja=!0;try{return this.fn()}finally{Pg(this),Tt=t,ja=a,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)vf(t);this.deps=this.depsTail=void 0,om(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?id.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){dc(this)&&this.run()}get dirty(){return dc(this)}}let Mg=0,Zo,Xo;function Dg(e,t=!1){if(e.flags|=8,t){e.next=Xo,Xo=e;return}e.next=Zo,Zo=e}function pf(){Mg++}function mf(){if(--Mg>0)return;if(Xo){let t=Xo;for(Xo=void 0;t;){const a=t.next;t.next=void 0,t.flags&=-9,t=a}}let e;for(;Zo;){let t=Zo;for(Zo=void 0;t;){const a=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=a}}if(e)throw e}function Og(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Pg(e){let t,a=e.depsTail,n=a;for(;n;){const l=n.prevDep;n.version===-1?(n===a&&(a=l),vf(n),px(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=l}e.deps=t,e.depsTail=a}function dc(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ig(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ig(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===is)||(e.globalVersion=is,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!dc(e))))return;e.flags|=2;const t=e.dep,a=Tt,n=ja;Tt=e,ja=!0;try{Og(e);const l=e.fn(e._value);(t.version===0||dn(l,e._value))&&(e.flags|=128,e._value=l,t.version++)}catch(l){throw t.version++,l}finally{Tt=a,ja=n,Pg(e),e.flags&=-3}}function vf(e,t=!1){const{dep:a,prevSub:n,nextSub:l}=e;if(n&&(n.nextSub=l,e.prevSub=void 0),l&&(l.prevSub=n,e.nextSub=void 0),a.subs===e&&(a.subs=n,!n&&a.computed)){a.computed.flags&=-5;for(let r=a.computed.deps;r;r=r.nextDep)vf(r,!0)}!t&&!--a.sc&&a.map&&a.map.delete(a.key)}function px(e){const{prevDep:t,nextDep:a}=e;t&&(t.nextDep=a,e.prevDep=void 0),a&&(a.prevDep=t,e.nextDep=void 0)}let ja=!0;const Rg=[];function Hn(){Rg.push(ja),ja=!1}function Kn(){const e=Rg.pop();ja=e===void 0?!0:e}function om(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const a=Tt;Tt=void 0;try{t()}finally{Tt=a}}}let is=0,mx=class{constructor(t,a){this.sub=t,this.dep=a,this.version=a.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class hu{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Tt||!ja||Tt===this.computed)return;let a=this.activeLink;if(a===void 0||a.sub!==Tt)a=this.activeLink=new mx(Tt,this),Tt.deps?(a.prevDep=Tt.depsTail,Tt.depsTail.nextDep=a,Tt.depsTail=a):Tt.deps=Tt.depsTail=a,qg(a);else if(a.version===-1&&(a.version=this.version,a.nextDep)){const n=a.nextDep;n.prevDep=a.prevDep,a.prevDep&&(a.prevDep.nextDep=n),a.prevDep=Tt.depsTail,a.nextDep=void 0,Tt.depsTail.nextDep=a,Tt.depsTail=a,Tt.deps===a&&(Tt.deps=n)}return a}trigger(t){this.version++,is++,this.notify(t)}notify(t){pf();try{for(let a=this.subs;a;a=a.prevSub)a.sub.notify()&&a.sub.dep.notify()}finally{mf()}}}function qg(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)qg(n)}const a=e.dep.subs;a!==e&&(e.prevSub=a,a&&(a.nextSub=e)),e.dep.subs=e}}const Ai=new WeakMap,sr=Symbol(""),cc=Symbol(""),us=Symbol("");function la(e,t,a){if(ja&&Tt){let n=Ai.get(e);n||Ai.set(e,n=new Map);let l=n.get(a);l||(n.set(a,l=new hu),l.map=n,l.key=a),l.track()}}function In(e,t,a,n,l,r){const o=Ai.get(e);if(!o){is++;return}const i=u=>{u&&u.trigger()};if(pf(),t==="clear")o.forEach(i);else{const u=Xe(e),c=u&&cu(a);if(u&&a==="length"){const d=Number(n);o.forEach((p,v)=>{(v==="length"||v===us||!Ea(v)&&v>=d)&&i(p)})}else switch((a!==void 0||o.has(void 0))&&i(o.get(a)),c&&i(o.get(us)),t){case"add":u?c&&i(o.get("length")):(i(o.get(sr)),jr(e)&&i(o.get(cc)));break;case"delete":u||(i(o.get(sr)),jr(e)&&i(o.get(cc)));break;case"set":jr(e)&&i(o.get(sr));break}}mf()}function vx(e,t){const a=Ai.get(e);return a&&a.get(t)}function Sr(e){const t=gt(e);return t===e?t:(la(t,"iterate",us),Ca(e)?t:t.map(Wa))}function gu(e){return la(e=gt(e),"iterate",us),e}function sn(e,t){return Wn(e)?eo(ir(e)?Wa(t):t):Wa(t)}const hx={__proto__:null,[Symbol.iterator](){return ud(this,Symbol.iterator,e=>sn(this,e))},concat(...e){return Sr(this).concat(...e.map(t=>Xe(t)?Sr(t):t))},entries(){return ud(this,"entries",e=>(e[1]=sn(this,e[1]),e))},every(e,t){return Tn(this,"every",e,t,void 0,arguments)},filter(e,t){return Tn(this,"filter",e,t,a=>a.map(n=>sn(this,n)),arguments)},find(e,t){return Tn(this,"find",e,t,a=>sn(this,a),arguments)},findIndex(e,t){return Tn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Tn(this,"findLast",e,t,a=>sn(this,a),arguments)},findLastIndex(e,t){return Tn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Tn(this,"forEach",e,t,void 0,arguments)},includes(...e){return dd(this,"includes",e)},indexOf(...e){return dd(this,"indexOf",e)},join(e){return Sr(this).join(e)},lastIndexOf(...e){return dd(this,"lastIndexOf",e)},map(e,t){return Tn(this,"map",e,t,void 0,arguments)},pop(){return Eo(this,"pop")},push(...e){return Eo(this,"push",e)},reduce(e,...t){return sm(this,"reduce",e,t)},reduceRight(e,...t){return sm(this,"reduceRight",e,t)},shift(){return Eo(this,"shift")},some(e,t){return Tn(this,"some",e,t,void 0,arguments)},splice(...e){return Eo(this,"splice",e)},toReversed(){return Sr(this).toReversed()},toSorted(e){return Sr(this).toSorted(e)},toSpliced(...e){return Sr(this).toSpliced(...e)},unshift(...e){return Eo(this,"unshift",e)},values(){return ud(this,"values",e=>sn(this,e))}};function ud(e,t,a){const n=gu(e),l=n[t]();return n!==e&&!Ca(e)&&(l._next=l.next,l.next=()=>{const r=l._next();return r.done||(r.value=a(r.value)),r}),l}const gx=Array.prototype;function Tn(e,t,a,n,l,r){const o=gu(e),i=o!==e&&!Ca(e),u=o[t];if(u!==gx[t]){const p=u.apply(e,r);return i?Wa(p):p}let c=a;o!==e&&(i?c=function(p,v){return a.call(this,sn(e,p),v,e)}:a.length>2&&(c=function(p,v){return a.call(this,p,v,e)}));const d=u.call(o,c,n);return i&&l?l(d):d}function sm(e,t,a,n){const l=gu(e),r=l!==e&&!Ca(e);let o=a,i=!1;l!==e&&(r?(i=n.length===0,o=function(c,d,p){return i&&(i=!1,c=sn(e,c)),a.call(this,c,sn(e,d),p,e)}):a.length>3&&(o=function(c,d,p){return a.call(this,c,d,p,e)}));const u=l[t](o,...n);return i?sn(e,u):u}function dd(e,t,a){const n=gt(e);la(n,"iterate",us);const l=n[t](...a);return(l===-1||l===!1)&&_u(a[0])?(a[0]=gt(a[0]),n[t](...a)):l}function Eo(e,t,a=[]){Hn(),pf();const n=gt(e)[t].apply(e,a);return mf(),Kn(),n}const yx=uf("__proto__,__v_isRef,__isVue"),Lg=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ea));function bx(e){Ea(e)||(e=String(e));const t=gt(this);return la(t,"has",e),t.hasOwnProperty(e)}class Ng{constructor(t=!1,a=!1){this._isReadonly=t,this._isShallow=a}get(t,a,n){if(a==="__v_skip")return t.__v_skip;const l=this._isReadonly,r=this._isShallow;if(a==="__v_isReactive")return!l;if(a==="__v_isReadonly")return l;if(a==="__v_isShallow")return r;if(a==="__v_raw")return n===(l?r?Ug:jg:r?zg:Vg).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=Xe(t);if(!l){let u;if(o&&(u=hx[a]))return u;if(a==="hasOwnProperty")return bx}const i=Reflect.get(t,a,Ct(t)?t:n);if((Ea(a)?Lg.has(a):yx(a))||(l||la(t,"get",a),r))return i;if(Ct(i)){const u=o&&cu(a)?i:i.value;return l&&_t(u)?At(u):u}return _t(i)?l?At(i):Ka(i):i}}class Bg extends Ng{constructor(t=!1){super(!1,t)}set(t,a,n,l){let r=t[a];const o=Xe(t)&&cu(a);if(!this._isShallow){const c=Wn(r);if(!Ca(n)&&!Wn(n)&&(r=gt(r),n=gt(n)),!o&&Ct(r)&&!Ct(n))return c||(r.value=n),!0}const i=o?Number(a)<t.length:kt(t,a),u=Reflect.set(t,a,n,Ct(t)?t:l);return t===gt(l)&&(i?dn(n,r)&&In(t,"set",a,n):In(t,"add",a,n)),u}deleteProperty(t,a){const n=kt(t,a);t[a];const l=Reflect.deleteProperty(t,a);return l&&n&&In(t,"delete",a,void 0),l}has(t,a){const n=Reflect.has(t,a);return(!Ea(a)||!Lg.has(a))&&la(t,"has",a),n}ownKeys(t){return la(t,"iterate",Xe(t)?"length":sr),Reflect.ownKeys(t)}}class Fg extends Ng{constructor(t=!1){super(!0,t)}set(t,a){return!0}deleteProperty(t,a){return!0}}const _x=new Bg,xx=new Fg,kx=new Bg(!0),wx=new Fg(!0),fc=e=>e,Gs=e=>Reflect.getPrototypeOf(e);function $x(e,t,a){return function(...n){const l=this.__v_raw,r=gt(l),o=jr(r),i=e==="entries"||e===Symbol.iterator&&o,u=e==="keys"&&o,c=l[e](...n),d=a?fc:t?eo:Wa;return!t&&la(r,"iterate",u?cc:sr),zt(Object.create(c),{next(){const{value:p,done:v}=c.next();return v?{value:p,done:v}:{value:i?[d(p[0]),d(p[1])]:d(p),done:v}}})}}function Ys(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Cx(e,t){const a={get(l){const r=this.__v_raw,o=gt(r),i=gt(l);e||(dn(l,i)&&la(o,"get",l),la(o,"get",i));const{has:u}=Gs(o),c=t?fc:e?eo:Wa;if(u.call(o,l))return c(r.get(l));if(u.call(o,i))return c(r.get(i));r!==o&&r.get(l)},get size(){const l=this.__v_raw;return!e&&la(gt(l),"iterate",sr),l.size},has(l){const r=this.__v_raw,o=gt(r),i=gt(l);return e||(dn(l,i)&&la(o,"has",l),la(o,"has",i)),l===i?r.has(l):r.has(l)||r.has(i)},forEach(l,r){const o=this,i=o.__v_raw,u=gt(i),c=t?fc:e?eo:Wa;return!e&&la(u,"iterate",sr),i.forEach((d,p)=>l.call(r,c(d),c(p),o))}};return zt(a,e?{add:Ys("add"),set:Ys("set"),delete:Ys("delete"),clear:Ys("clear")}:{add(l){const r=gt(this),o=Gs(r),i=gt(l),u=!t&&!Ca(l)&&!Wn(l)?i:l;return o.has.call(r,u)||dn(l,u)&&o.has.call(r,l)||dn(i,u)&&o.has.call(r,i)||(r.add(u),In(r,"add",u,u)),this},set(l,r){!t&&!Ca(r)&&!Wn(r)&&(r=gt(r));const o=gt(this),{has:i,get:u}=Gs(o);let c=i.call(o,l);c||(l=gt(l),c=i.call(o,l));const d=u.call(o,l);return o.set(l,r),c?dn(r,d)&&In(o,"set",l,r):In(o,"add",l,r),this},delete(l){const r=gt(this),{has:o,get:i}=Gs(r);let u=o.call(r,l);u||(l=gt(l),u=o.call(r,l)),i&&i.call(r,l);const c=r.delete(l);return u&&In(r,"delete",l,void 0),c},clear(){const l=gt(this),r=l.size!==0,o=l.clear();return r&&In(l,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(l=>{a[l]=$x(l,e,t)}),a}function yu(e,t){const a=Cx(e,t);return(n,l,r)=>l==="__v_isReactive"?!e:l==="__v_isReadonly"?e:l==="__v_raw"?n:Reflect.get(kt(a,l)&&l in n?a:n,l,r)}const Sx={get:yu(!1,!1)},Ex={get:yu(!1,!0)},Ax={get:yu(!0,!1)},Tx={get:yu(!0,!0)},Vg=new WeakMap,zg=new WeakMap,jg=new WeakMap,Ug=new WeakMap;function Mx(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ka(e){return Wn(e)?e:bu(e,!1,_x,Sx,Vg)}function Hg(e){return bu(e,!1,kx,Ex,zg)}function At(e){return bu(e,!0,xx,Ax,jg)}function Er(e){return bu(e,!0,wx,Tx,Ug)}function bu(e,t,a,n,l){if(!_t(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const r=l.get(e);if(r)return r;const o=Mx(ax(e));if(o===0)return e;const i=new Proxy(e,o===2?n:a);return l.set(e,i),i}function ir(e){return Wn(e)?ir(e.__v_raw):!!(e&&e.__v_isReactive)}function Wn(e){return!!(e&&e.__v_isReadonly)}function Ca(e){return!!(e&&e.__v_isShallow)}function _u(e){return e?!!e.__v_raw:!1}function gt(e){const t=e&&e.__v_raw;return t?gt(t):e}function Ti(e){return!kt(e,"__v_skip")&&Object.isExtensible(e)&&kg(e,"__v_skip",!0),e}const Wa=e=>_t(e)?Ka(e):e,eo=e=>_t(e)?At(e):e;function Ct(e){return e?e.__v_isRef===!0:!1}function E(e){return Kg(e,!1)}function pr(e){return Kg(e,!0)}function Kg(e,t){return Ct(e)?e:new Dx(e,t)}class Dx{constructor(t,a){this.dep=new hu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=a?t:gt(t),this._value=a?t:Wa(t),this.__v_isShallow=a}get value(){return this.dep.track(),this._value}set value(t){const a=this._rawValue,n=this.__v_isShallow||Ca(t)||Wn(t);t=n?t:gt(t),dn(t,a)&&(this._rawValue=t,this._value=n?t:Wa(t),this.dep.trigger())}}function Ox(e){e.dep&&e.dep.trigger()}function s(e){return Ct(e)?e.value:e}function ca(e){return ot(e)?e():s(e)}const Px={get:(e,t,a)=>t==="__v_raw"?e:s(Reflect.get(e,t,a)),set:(e,t,a,n)=>{const l=e[t];return Ct(l)&&!Ct(a)?(l.value=a,!0):Reflect.set(e,t,a,n)}};function Wg(e){return ir(e)?e:new Proxy(e,Px)}class Ix{constructor(t){this.__v_isRef=!0,this._value=void 0;const a=this.dep=new hu,{get:n,set:l}=t(a.track.bind(a),a.trigger.bind(a));this._get=n,this._set=l}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Rx(e){return new Ix(e)}function Kt(e){const t=Xe(e)?new Array(e.length):{};for(const a in e)t[a]=Gg(e,a);return t}class qx{constructor(t,a,n){this._object=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=Ea(a)?a:String(a),this._raw=gt(t);let l=!0,r=t;if(!Xe(t)||Ea(this._key)||!cu(this._key))do l=!_u(r)||Ca(r);while(l&&(r=r.__v_raw));this._shallow=l}get value(){let t=this._object[this._key];return this._shallow&&(t=s(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&Ct(this._raw[this._key])){const a=this._object[this._key];if(Ct(a)){a.value=t;return}}this._object[this._key]=t}get dep(){return vx(this._raw,this._key)}}class Lx{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Nx(e,t,a){return Ct(e)?e:ot(e)?new Lx(e):_t(e)&&arguments.length>1?Gg(e,t,a):E(e)}function Gg(e,t,a){return new qx(e,t,a)}class Bx{constructor(t,a,n){this.fn=t,this.setter=a,this._value=void 0,this.dep=new hu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=is-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!a,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Tt!==this)return Dg(this,!0),!0}get value(){const t=this.dep.track();return Ig(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Fx(e,t,a=!1){let n,l;return ot(e)?n=e:(n=e.get,l=e.set),new Bx(n,l,a)}const Js={},Mi=new WeakMap;let er;function Vx(e,t=!1,a=er){if(a){let n=Mi.get(a);n||Mi.set(a,n=[]),n.push(e)}}function zx(e,t,a=Et){const{immediate:n,deep:l,once:r,scheduler:o,augmentJob:i,call:u}=a,c=O=>l?O:Ca(O)||l===!1||l===0?Rn(O,1):Rn(O);let d,p,v,m,y=!1,x=!1;if(Ct(e)?(p=()=>e.value,y=Ca(e)):ir(e)?(p=()=>c(e),y=!0):Xe(e)?(x=!0,y=e.some(O=>ir(O)||Ca(O)),p=()=>e.map(O=>{if(Ct(O))return O.value;if(ir(O))return c(O);if(ot(O))return u?u(O,2):O()})):ot(e)?t?p=u?()=>u(e,2):e:p=()=>{if(v){Hn();try{v()}finally{Kn()}}const O=er;er=d;try{return u?u(e,3,[m]):e(m)}finally{er=O}}:p=vn,t&&l){const O=p,I=l===!0?1/0:l;p=()=>Rn(O(),I)}const C=ff(),w=()=>{d.stop(),C&&C.active&&df(C.effects,d)};if(r&&t){const O=t;t=(...I)=>{O(...I),w()}}let S=x?new Array(e.length).fill(Js):Js;const q=O=>{if(!(!(d.flags&1)||!d.dirty&&!O))if(t){const I=d.run();if(l||y||(x?I.some((B,L)=>dn(B,S[L])):dn(I,S))){v&&v();const B=er;er=d;try{const L=[I,S===Js?void 0:x&&S[0]===Js?[]:S,m];S=I,u?u(t,3,L):t(...L)}finally{er=B}}}else d.run()};return i&&i(q),d=new Tg(p),d.scheduler=o?()=>o(q,!1):q,m=O=>Vx(O,!1,d),v=d.onStop=()=>{const O=Mi.get(d);if(O){if(u)u(O,4);else for(const I of O)I();Mi.delete(d)}},t?n?q(!0):S=d.run():o?o(q.bind(null,!0),!0):d.run(),w.pause=d.pause.bind(d),w.resume=d.resume.bind(d),w.stop=w,w}function Rn(e,t=1/0,a){if(t<=0||!_t(e)||e.__v_skip||(a=a||new Map,(a.get(e)||0)>=t))return e;if(a.set(e,t),t--,Ct(e))Rn(e.value,t,a);else if(Xe(e))for(let n=0;n<e.length;n++)Rn(e[n],t,a);else if(co(e)||jr(e))e.forEach(n=>{Rn(n,t,a)});else if(xg(e)){for(const n in e)Rn(e[n],t,a);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Rn(e[n],t,a)}return e}function Ms(e,t,a,n){try{return n?e(...n):e()}catch(l){xu(l,t,a)}}function La(e,t,a,n){if(ot(e)){const l=Ms(e,t,a,n);return l&&bg(l)&&l.catch(r=>{xu(r,t,a)}),l}if(Xe(e)){const l=[];for(let r=0;r<e.length;r++)l.push(La(e[r],t,a,n));return l}}function xu(e,t,a,n=!0){const l=t?t.vnode:null,{errorHandler:r,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||Et;if(t){let i=t.parent;const u=t.proxy,c=`https://vuejs.org/error-reference/#runtime-${a}`;for(;i;){const d=i.ec;if(d){for(let p=0;p<d.length;p++)if(d[p](e,u,c)===!1)return}i=i.parent}if(r){Hn(),Ms(r,null,10,[e,u,c]),Kn();return}}jx(e,a,l,n,o)}function jx(e,t,a,n=!0,l=!1){if(l)throw e;console.error(e)}const da=[];let rn=-1;const Ur=[];let _l=null,Ir=0;const Yg=Promise.resolve();let Di=null;function Ge(e){const t=Di||Yg;return e?t.then(this?e.bind(this):e):t}function Ux(e){let t=rn+1,a=da.length;for(;t<a;){const n=t+a>>>1,l=da[n],r=ds(l);r<e||r===e&&l.flags&2?t=n+1:a=n}return t}function hf(e){if(!(e.flags&1)){const t=ds(e),a=da[da.length-1];!a||!(e.flags&2)&&t>=ds(a)?da.push(e):da.splice(Ux(t),0,e),e.flags|=1,Jg()}}function Jg(){Di||(Di=Yg.then(Xg))}function Hx(e){Xe(e)?Ur.push(...e):_l&&e.id===-1?_l.splice(Ir+1,0,e):e.flags&1||(Ur.push(e),e.flags|=1),Jg()}function im(e,t,a=rn+1){for(;a<da.length;a++){const n=da[a];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;da.splice(a,1),a--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Zg(e){if(Ur.length){const t=[...new Set(Ur)].sort((a,n)=>ds(a)-ds(n));if(Ur.length=0,_l){_l.push(...t);return}for(_l=t,Ir=0;Ir<_l.length;Ir++){const a=_l[Ir];a.flags&4&&(a.flags&=-2),a.flags&8||a(),a.flags&=-2}_l=null,Ir=0}}const ds=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Xg(e){try{for(rn=0;rn<da.length;rn++){const t=da[rn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ms(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;rn<da.length;rn++){const t=da[rn];t&&(t.flags&=-2)}rn=-1,da.length=0,Zg(),Di=null,(da.length||Ur.length)&&Xg()}}let Qt=null,Qg=null;function Oi(e){const t=Qt;return Qt=e,Qg=e&&e.type.__scopeId||null,t}function N(e,t=Qt,a){if(!t||e._n)return e;const n=(...l)=>{n._d&&Ri(-1);const r=Oi(t);let o;try{o=e(...l)}finally{Oi(r),n._d&&Ri(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function Jt(e,t){if(Qt===null)return e;const a=Su(Qt),n=e.dirs||(e.dirs=[]);for(let l=0;l<t.length;l++){let[r,o,i,u=Et]=t[l];r&&(ot(r)&&(r={mounted:r,updated:r}),r.deep&&Rn(o),n.push({dir:r,instance:a,value:o,oldValue:void 0,arg:i,modifiers:u}))}return e}function Gl(e,t,a,n){const l=e.dirs,r=t&&t.dirs;for(let o=0;o<l.length;o++){const i=l[o];r&&(i.oldValue=r[o].value);let u=i.dir[n];u&&(Hn(),La(u,a,8,[e.el,i,e,t]),Kn())}}function yt(e,t){if(ra){let a=ra.provides;const n=ra.parent&&ra.parent.provides;n===a&&(a=ra.provides=Object.create(n)),a[e]=t}}function ct(e,t,a=!1){const n=kn();if(n||Kr){let l=Kr?Kr._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(l&&e in l)return l[e];if(arguments.length>1)return a&&ot(t)?t.call(n&&n.proxy):t}}const Kx=Symbol.for("v-scx"),Wx=()=>ct(Kx);function Aa(e,t){return ku(e,null,t)}function ey(e,t){return ku(e,null,{flush:"post"})}function ze(e,t,a){return ku(e,t,a)}function ku(e,t,a=Et){const{immediate:n,deep:l,flush:r,once:o}=a,i=zt({},a),u=t&&n||!t&&r!=="post";let c;if(ms){if(r==="sync"){const m=Wx();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!u){const m=()=>{};return m.stop=vn,m.resume=vn,m.pause=vn,m}}const d=ra;i.call=(m,y,x)=>La(m,d,y,x);let p=!1;r==="post"?i.scheduler=m=>{ua(m,d&&d.suspense)}:r!=="sync"&&(p=!0,i.scheduler=(m,y)=>{y?m():hf(m)}),i.augmentJob=m=>{t&&(m.flags|=4),p&&(m.flags|=2,d&&(m.id=d.uid,m.i=d))};const v=zx(e,t,i);return ms&&(c?c.push(v):u&&v()),v}function Gx(e,t,a){const n=this.proxy,l=Mt(e)?e.includes(".")?ty(n,e):()=>n[e]:e.bind(n,n);let r;ot(t)?r=t:(r=t.handler,a=t);const o=Ds(this),i=ku(l,r.bind(n),a);return o(),i}function ty(e,t){const a=t.split(".");return()=>{let n=e;for(let l=0;l<a.length&&n;l++)n=n[a[l]];return n}}const gl=new WeakMap,ay=Symbol("_vte"),Yx=e=>e.__isTeleport,nr=e=>e&&(e.disabled||e.disabled===""),Jx=e=>e&&(e.defer||e.defer===""),um=e=>typeof SVGElement<"u"&&e instanceof SVGElement,dm=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,pc=(e,t)=>{const a=e&&e.to;return Mt(a)?t?t(a):null:a},Zx={name:"Teleport",__isTeleport:!0,process(e,t,a,n,l,r,o,i,u,c){const{mc:d,pc:p,pbc:v,o:{insert:m,querySelector:y,createText:x,createComment:C,parentNode:w}}=c,S=nr(t.props);let{dynamicChildren:q}=t;const O=(L,W,T)=>{L.shapeFlag&16&&d(L.children,W,T,l,r,o,i,u)},I=(L=t)=>{const W=nr(L.props),T=L.target=pc(L.props,y),R=mc(T,L,x,m);T&&(o!=="svg"&&um(T)?o="svg":o!=="mathml"&&dm(T)&&(o="mathml"),l&&l.isCE&&(l.ce._teleportTargets||(l.ce._teleportTargets=new Set)).add(T),W||(O(L,T,R),jo(L,!1)))},B=L=>{const W=()=>{if(gl.get(L)===W){if(gl.delete(L),nr(L.props)){const T=w(L.el)||a;O(L,T,L.anchor),jo(L,!0)}I(L)}};gl.set(L,W),ua(W,r)};if(e==null){const L=t.el=x(""),W=t.anchor=x("");if(m(L,a,n),m(W,a,n),Jx(t.props)||r&&r.pendingBranch){B(t);return}S&&(O(t,a,W),jo(t,!0)),I()}else{t.el=e.el;const L=t.anchor=e.anchor,W=gl.get(e);if(W){W.flags|=8,gl.delete(e),B(t);return}t.targetStart=e.targetStart;const T=t.target=e.target,R=t.targetAnchor=e.targetAnchor,G=nr(e.props),A=G?a:T,D=G?L:R;if(o==="svg"||um(T)?o="svg":(o==="mathml"||dm(T))&&(o="mathml"),q?(v(e.dynamicChildren,q,A,l,r,o,i),xf(e,t,!0)):u||p(e,t,A,D,l,r,o,i,!1),S)G?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Zs(t,a,L,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const z=t.target=pc(t.props,y);z&&Zs(t,z,null,c,0)}else G&&Zs(t,T,R,c,1);jo(t,S)}},remove(e,t,a,{um:n,o:{remove:l}},r){const{shapeFlag:o,children:i,anchor:u,targetStart:c,targetAnchor:d,target:p,props:v}=e,m=r||!nr(v),y=gl.get(e);if(y&&(y.flags|=8,gl.delete(e)),p&&(l(c),l(d)),r&&l(u),!y&&o&16)for(let x=0;x<i.length;x++){const C=i[x];n(C,t,a,m,!!C.dynamicChildren)}},move:Zs,hydrate:Xx};function Zs(e,t,a,{o:{insert:n},m:l},r=2){r===0&&n(e.targetAnchor,t,a);const{el:o,anchor:i,shapeFlag:u,children:c,props:d}=e,p=r===2;if(p&&n(o,t,a),!gl.has(e)&&(!p||nr(d))&&u&16)for(let v=0;v<c.length;v++)l(c[v],t,a,2);p&&n(i,t,a)}function Xx(e,t,a,n,l,r,{o:{nextSibling:o,parentNode:i,querySelector:u,insert:c,createText:d}},p){function v(C,w){let S=w;for(;S;){if(S&&S.nodeType===8){if(S.data==="teleport start anchor")t.targetStart=S;else if(S.data==="teleport anchor"){t.targetAnchor=S,C._lpa=t.targetAnchor&&o(t.targetAnchor);break}}S=o(S)}}function m(C,w){w.anchor=p(o(C),w,i(C),a,n,l,r)}const y=t.target=pc(t.props,u),x=nr(t.props);if(y){const C=y._lpa||y.firstChild;t.shapeFlag&16&&(x?(m(e,t),v(y,C),t.targetAnchor||mc(y,t,d,c,i(e)===y?e:null)):(t.anchor=o(e),v(y,C),t.targetAnchor||mc(y,t,d,c),p(C&&o(C),t,y,a,n,l,r))),jo(t,x)}else x&&t.shapeFlag&16&&(m(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}const Qx=Zx;function jo(e,t){const a=e.ctx;if(a&&a.ut){let n,l;for(t?(n=e.el,l=e.anchor):(n=e.targetStart,l=e.targetAnchor);n&&n!==l;)n.nodeType===1&&n.setAttribute("data-v-owner",a.uid),n=n.nextSibling;a.ut()}}function mc(e,t,a,n,l=null){const r=t.targetStart=a(""),o=t.targetAnchor=a("");return r[ay]=o,e&&(n(r,e,l),n(o,e,l)),o}const on=Symbol("_leaveCb"),Ao=Symbol("_enterCb");function ek(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return $t(()=>{e.isMounted=!0}),Dt(()=>{e.isUnmounting=!0}),e}const Ma=[Function,Array],tk={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ma,onEnter:Ma,onAfterEnter:Ma,onEnterCancelled:Ma,onBeforeLeave:Ma,onLeave:Ma,onAfterLeave:Ma,onLeaveCancelled:Ma,onBeforeAppear:Ma,onAppear:Ma,onAfterAppear:Ma,onAppearCancelled:Ma};function ak(e,t){const{leavingVNodes:a}=e;let n=a.get(t.type);return n||(n=Object.create(null),a.set(t.type,n)),n}function vc(e,t,a,n,l){const{appear:r,mode:o,persisted:i=!1,onBeforeEnter:u,onEnter:c,onAfterEnter:d,onEnterCancelled:p,onBeforeLeave:v,onLeave:m,onAfterLeave:y,onLeaveCancelled:x,onBeforeAppear:C,onAppear:w,onAfterAppear:S,onAppearCancelled:q}=t,O=String(e.key),I=ak(a,e),B=(T,R)=>{T&&La(T,n,9,R)},L=(T,R)=>{const G=R[1];B(T,R),Xe(T)?T.every(A=>A.length<=1)&&G():T.length<=1&&G()},W={mode:o,persisted:i,beforeEnter(T){let R=u;if(!a.isMounted)if(r)R=C||u;else return;T[on]&&T[on](!0);const G=I[O];G&&Rr(e,G)&&G.el[on]&&G.el[on](),B(R,[T])},enter(T){if(I[O]===e)return;let R=c,G=d,A=p;if(!a.isMounted)if(r)R=w||c,G=S||d,A=q||p;else return;let D=!1;T[Ao]=V=>{D||(D=!0,V?B(A,[T]):B(G,[T]),W.delayedLeave&&W.delayedLeave(),T[Ao]=void 0)};const z=T[Ao].bind(null,!1);R?L(R,[T,z]):z()},leave(T,R){const G=String(e.key);if(T[Ao]&&T[Ao](!0),a.isUnmounting)return R();B(v,[T]);let A=!1;T[on]=z=>{A||(A=!0,R(),z?B(x,[T]):B(y,[T]),T[on]=void 0,I[G]===e&&delete I[G])};const D=T[on].bind(null,!1);I[G]=e,m?L(m,[T,D]):D()},clone(T){return vc(T,t,a,n)}};return W}function cs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,cs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ny(e,t=!1,a){let n=[],l=0;for(let r=0;r<e.length;r++){let o=e[r];const i=a==null?o.key:String(a)+String(o.key!=null?o.key:r);o.type===me?(o.patchFlag&128&&l++,n=n.concat(ny(o.children,t,i))):(t||o.type!==Ga)&&n.push(i!=null?Tl(o,{key:i}):o)}if(l>1)for(let r=0;r<n.length;r++)n[r].patchFlag=-2;return n}function ae(e,t){return ot(e)?zt({name:e.name},t,{setup:e}):e}function gf(){const e=kn();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function ly(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function cm(e,t){let a;return!!((a=Object.getOwnPropertyDescriptor(e,t))&&!a.configurable)}const Pi=new WeakMap;function Qo(e,t,a,n,l=!1){if(Xe(e)){e.forEach((x,C)=>Qo(x,t&&(Xe(t)?t[C]:t),a,n,l));return}if(Hr(n)&&!l){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Qo(e,t,a,n.component.subTree);return}const r=n.shapeFlag&4?Su(n.component):n.el,o=l?null:r,{i,r:u}=e,c=t&&t.r,d=i.refs===Et?i.refs={}:i.refs,p=i.setupState,v=gt(p),m=p===Et?yg:x=>cm(d,x)?!1:kt(v,x),y=(x,C)=>!(C&&cm(d,C));if(c!=null&&c!==u){if(fm(t),Mt(c))d[c]=null,m(c)&&(p[c]=null);else if(Ct(c)){const x=t;y(c,x.k)&&(c.value=null),x.k&&(d[x.k]=null)}}if(ot(u))Ms(u,i,12,[o,d]);else{const x=Mt(u),C=Ct(u);if(x||C){const w=()=>{if(e.f){const S=x?m(u)?p[u]:d[u]:y()||!e.k?u.value:d[e.k];if(l)Xe(S)&&df(S,r);else if(Xe(S))S.includes(r)||S.push(r);else if(x)d[u]=[r],m(u)&&(p[u]=d[u]);else{const q=[r];y(u,e.k)&&(u.value=q),e.k&&(d[e.k]=q)}}else x?(d[u]=o,m(u)&&(p[u]=o)):C&&(y(u,e.k)&&(u.value=o),e.k&&(d[e.k]=o))};if(o){const S=()=>{w(),Pi.delete(e)};S.id=-1,Pi.set(e,S),ua(S,a)}else fm(e),w()}}}function fm(e){const t=Pi.get(e);t&&(t.flags|=8,Pi.delete(e))}vu().requestIdleCallback;vu().cancelIdleCallback;const Hr=e=>!!e.type.__asyncLoader,ry=e=>e.type.__isKeepAlive;function oy(e,t){iy(e,"a",t)}function sy(e,t){iy(e,"da",t)}function iy(e,t,a=ra){const n=e.__wdc||(e.__wdc=()=>{let l=a;for(;l;){if(l.isDeactivated)return;l=l.parent}return e()});if(wu(t,n,a),a){let l=a.parent;for(;l&&l.parent;)ry(l.parent.vnode)&&nk(n,t,a,l),l=l.parent}}function nk(e,t,a,n){const l=wu(t,e,n,!0);Qn(()=>{df(n[t],l)},a)}function wu(e,t,a=ra,n=!1){if(a){const l=a[e]||(a[e]=[]),r=t.__weh||(t.__weh=(...o)=>{Hn();const i=Ds(a),u=La(t,a,e,o);return i(),Kn(),u});return n?l.unshift(r):l.push(r),r}}const Xn=e=>(t,a=ra)=>{(!ms||e==="sp")&&wu(e,(...n)=>t(...n),a)},uy=Xn("bm"),$t=Xn("m"),lk=Xn("bu"),yf=Xn("u"),Dt=Xn("bum"),Qn=Xn("um"),rk=Xn("sp"),ok=Xn("rtg"),sk=Xn("rtc");function ik(e,t=ra){wu("ec",e,t)}const dy="components";function uk(e,t){return fy(dy,e,!0,t)||e}const cy=Symbol.for("v-ndc");function Wt(e){return Mt(e)?fy(dy,e,!1)||e:e||cy}function fy(e,t,a=!0,n=!1){const l=Qt||ra;if(l){const r=l.type;{const i=Kk(r,!1);if(i&&(i===t||i===ea(t)||i===pu(ea(t))))return r}const o=pm(l[e]||r[e],t)||pm(l.appContext[e],t);return!o&&n?r:o}}function pm(e,t){return e&&(e[t]||e[ea(t)]||e[pu(ea(t))])}function Ie(e,t,a,n){let l;const r=a,o=Xe(e);if(o||Mt(e)){const i=o&&ir(e);let u=!1,c=!1;i&&(u=!Ca(e),c=Wn(e),e=gu(e)),l=new Array(e.length);for(let d=0,p=e.length;d<p;d++)l[d]=t(u?c?eo(Wa(e[d])):Wa(e[d]):e[d],d,void 0,r)}else if(typeof e=="number"){l=new Array(e);for(let i=0;i<e;i++)l[i]=t(i+1,i,void 0,r)}else if(_t(e))if(e[Symbol.iterator])l=Array.from(e,(i,u)=>t(i,u,void 0,r));else{const i=Object.keys(e);l=new Array(i.length);for(let u=0,c=i.length;u<c;u++){const d=i[u];l[u]=t(e[d],d,u,r)}}else l=[];return l}function Ee(e,t,a={},n,l){if(Qt.ce||Qt.parent&&Hr(Qt.parent)&&Qt.parent.ce){const c=Object.keys(a).length>0;return t!=="default"&&(a.name=t),f(),j(me,null,[M("slot",a,n&&n())],c?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),f();const o=r&&py(r(a)),i=a.key||o&&o.key,u=j(me,{key:(i&&!Ea(i)?i:`_${t}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&e._===1?64:-2);return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),r&&r._c&&(r._d=!0),u}function py(e){return e.some(t=>ps(t)?!(t.type===Ga||t.type===me&&!py(t.children)):!0)?e:null}function my(e,t){const a={};for(const n in e)a[Jo(n)]=e[n];return a}const hc=e=>e?Iy(e)?Su(e):hc(e.parent):null,es=zt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>hc(e.parent),$root:e=>hc(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>gy(e),$forceUpdate:e=>e.f||(e.f=()=>{hf(e.update)}),$nextTick:e=>e.n||(e.n=Ge.bind(e.proxy)),$watch:e=>Gx.bind(e)}),cd=(e,t)=>e!==Et&&!e.__isScriptSetup&&kt(e,t),dk={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:a,setupState:n,data:l,props:r,accessCache:o,type:i,appContext:u}=e;if(t[0]!=="$"){const v=o[t];if(v!==void 0)switch(v){case 1:return n[t];case 2:return l[t];case 4:return a[t];case 3:return r[t]}else{if(cd(n,t))return o[t]=1,n[t];if(l!==Et&&kt(l,t))return o[t]=2,l[t];if(kt(r,t))return o[t]=3,r[t];if(a!==Et&&kt(a,t))return o[t]=4,a[t];yc&&(o[t]=0)}}const c=es[t];let d,p;if(c)return t==="$attrs"&&la(e.attrs,"get",""),c(e);if((d=i.__cssModules)&&(d=d[t]))return d;if(a!==Et&&kt(a,t))return o[t]=4,a[t];if(p=u.config.globalProperties,kt(p,t))return p[t]},set({_:e},t,a){const{data:n,setupState:l,ctx:r}=e;return cd(l,t)?(l[t]=a,!0):n!==Et&&kt(n,t)?(n[t]=a,!0):kt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=a,!0)},has({_:{data:e,setupState:t,accessCache:a,ctx:n,appContext:l,props:r,type:o}},i){let u;return!!(a[i]||e!==Et&&i[0]!=="$"&&kt(e,i)||cd(t,i)||kt(r,i)||kt(n,i)||kt(es,i)||kt(l.config.globalProperties,i)||(u=o.__cssModules)&&u[i])},defineProperty(e,t,a){return a.get!=null?e._.accessCache[t]=0:kt(a,"value")&&this.set(e,t,a.value,null),Reflect.defineProperty(e,t,a)}};function gc(e){return Xe(e)?e.reduce((t,a)=>(t[a]=null,t),{}):e}function vy(e,t){const a=gc(e);for(const n in t){if(n.startsWith("__skip"))continue;let l=a[n];l?Xe(l)||ot(l)?l=a[n]={type:l,default:t[n]}:l.default=t[n]:l===null&&(l=a[n]={default:t[n]}),l&&t[`__skip_${n}`]&&(l.skipFactory=!0)}return a}let yc=!0;function ck(e){const t=gy(e),a=e.proxy,n=e.ctx;yc=!1,t.beforeCreate&&mm(t.beforeCreate,e,"bc");const{data:l,computed:r,methods:o,watch:i,provide:u,inject:c,created:d,beforeMount:p,mounted:v,beforeUpdate:m,updated:y,activated:x,deactivated:C,beforeDestroy:w,beforeUnmount:S,destroyed:q,unmounted:O,render:I,renderTracked:B,renderTriggered:L,errorCaptured:W,serverPrefetch:T,expose:R,inheritAttrs:G,components:A,directives:D,filters:z}=t;if(c&&fk(c,n,null),o)for(const re in o){const ie=o[re];ot(ie)&&(n[re]=ie.bind(a))}if(l){const re=l.call(a,a);_t(re)&&(e.data=Ka(re))}if(yc=!0,r)for(const re in r){const ie=r[re],Ae=ot(ie)?ie.bind(a,a):ot(ie.get)?ie.get.bind(a,a):vn,_e=!ot(ie)&&ot(ie.set)?ie.set.bind(a):vn,xe=k({get:Ae,set:_e});Object.defineProperty(n,re,{enumerable:!0,configurable:!0,get:()=>xe.value,set:ne=>xe.value=ne})}if(i)for(const re in i)hy(i[re],n,a,re);if(u){const re=ot(u)?u.call(a):u;Reflect.ownKeys(re).forEach(ie=>{yt(ie,re[ie])})}d&&mm(d,e,"c");function K(re,ie){Xe(ie)?ie.forEach(Ae=>re(Ae.bind(a))):ie&&re(ie.bind(a))}if(K(uy,p),K($t,v),K(lk,m),K(yf,y),K(oy,x),K(sy,C),K(ik,W),K(sk,B),K(ok,L),K(Dt,S),K(Qn,O),K(rk,T),Xe(R))if(R.length){const re=e.exposed||(e.exposed={});R.forEach(ie=>{Object.defineProperty(re,ie,{get:()=>a[ie],set:Ae=>a[ie]=Ae,enumerable:!0})})}else e.exposed||(e.exposed={});I&&e.render===vn&&(e.render=I),G!=null&&(e.inheritAttrs=G),A&&(e.components=A),D&&(e.directives=D),T&&ly(e)}function fk(e,t,a=vn){Xe(e)&&(e=bc(e));for(const n in e){const l=e[n];let r;_t(l)?"default"in l?r=ct(l.from||n,l.default,!0):r=ct(l.from||n):r=ct(l),Ct(r)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):t[n]=r}}function mm(e,t,a){La(Xe(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,a)}function hy(e,t,a,n){let l=n.includes(".")?ty(a,n):()=>a[n];if(Mt(e)){const r=t[e];ot(r)&&ze(l,r)}else if(ot(e))ze(l,e.bind(a));else if(_t(e))if(Xe(e))e.forEach(r=>hy(r,t,a,n));else{const r=ot(e.handler)?e.handler.bind(a):t[e.handler];ot(r)&&ze(l,r,e)}}function gy(e){const t=e.type,{mixins:a,extends:n}=t,{mixins:l,optionsCache:r,config:{optionMergeStrategies:o}}=e.appContext,i=r.get(t);let u;return i?u=i:!l.length&&!a&&!n?u=t:(u={},l.length&&l.forEach(c=>Ii(u,c,o,!0)),Ii(u,t,o)),_t(t)&&r.set(t,u),u}function Ii(e,t,a,n=!1){const{mixins:l,extends:r}=t;r&&Ii(e,r,a,!0),l&&l.forEach(o=>Ii(e,o,a,!0));for(const o in t)if(!(n&&o==="expose")){const i=pk[o]||a&&a[o];e[o]=i?i(e[o],t[o]):t[o]}return e}const pk={data:vm,props:hm,emits:hm,methods:Uo,computed:Uo,beforeCreate:ia,created:ia,beforeMount:ia,mounted:ia,beforeUpdate:ia,updated:ia,beforeDestroy:ia,beforeUnmount:ia,destroyed:ia,unmounted:ia,activated:ia,deactivated:ia,errorCaptured:ia,serverPrefetch:ia,components:Uo,directives:Uo,watch:vk,provide:vm,inject:mk};function vm(e,t){return t?e?function(){return zt(ot(e)?e.call(this,this):e,ot(t)?t.call(this,this):t)}:t:e}function mk(e,t){return Uo(bc(e),bc(t))}function bc(e){if(Xe(e)){const t={};for(let a=0;a<e.length;a++)t[e[a]]=e[a];return t}return e}function ia(e,t){return e?[...new Set([].concat(e,t))]:t}function Uo(e,t){return e?zt(Object.create(null),e,t):t}function hm(e,t){return e?Xe(e)&&Xe(t)?[...new Set([...e,...t])]:zt(Object.create(null),gc(e),gc(t??{})):t}function vk(e,t){if(!e)return t;if(!t)return e;const a=zt(Object.create(null),e);for(const n in t)a[n]=ia(e[n],t[n]);return a}function yy(){return{app:null,config:{isNativeTag:yg,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let hk=0;function gk(e,t){return function(n,l=null){ot(n)||(n=zt({},n)),l!=null&&!_t(l)&&(l=null);const r=yy(),o=new WeakSet,i=[];let u=!1;const c=r.app={_uid:hk++,_component:n,_props:l,_container:null,_context:r,_instance:null,version:Gk,get config(){return r.config},set config(d){},use(d,...p){return o.has(d)||(d&&ot(d.install)?(o.add(d),d.install(c,...p)):ot(d)&&(o.add(d),d(c,...p))),c},mixin(d){return r.mixins.includes(d)||r.mixins.push(d),c},component(d,p){return p?(r.components[d]=p,c):r.components[d]},directive(d,p){return p?(r.directives[d]=p,c):r.directives[d]},mount(d,p,v){if(!u){const m=c._ceVNode||M(n,l);return m.appContext=r,v===!0?v="svg":v===!1&&(v=void 0),e(m,d,v),u=!0,c._container=d,d.__vue_app__=c,Su(m.component)}},onUnmount(d){i.push(d)},unmount(){u&&(La(i,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(d,p){return r.provides[d]=p,c},runWithContext(d){const p=Kr;Kr=c;try{return d()}finally{Kr=p}}};return c}}let Kr=null;const yk=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ea(t)}Modifiers`]||e[`${Fl(t)}Modifiers`];function bk(e,t,...a){if(e.isUnmounted)return;const n=e.vnode.props||Et;let l=a;const r=t.startsWith("update:"),o=r&&yk(n,t.slice(7));o&&(o.trim&&(l=a.map(d=>Mt(d)?d.trim():d)),o.number&&(l=a.map(mu)));let i,u=n[i=Jo(t)]||n[i=Jo(ea(t))];!u&&r&&(u=n[i=Jo(Fl(t))]),u&&La(u,e,6,l);const c=n[i+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,La(c,e,6,l)}}const _k=new WeakMap;function by(e,t,a=!1){const n=a?_k:t.emitsCache,l=n.get(e);if(l!==void 0)return l;const r=e.emits;let o={},i=!1;if(!ot(e)){const u=c=>{const d=by(c,t,!0);d&&(i=!0,zt(o,d))};!a&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!r&&!i?(_t(e)&&n.set(e,null),null):(Xe(r)?r.forEach(u=>o[u]=null):zt(o,r),_t(e)&&n.set(e,o),o)}function $u(e,t){return!e||!uu(t)?!1:(t=t.slice(2).replace(/Once$/,""),kt(e,t[0].toLowerCase()+t.slice(1))||kt(e,Fl(t))||kt(e,t))}function gm(e){const{type:t,vnode:a,proxy:n,withProxy:l,propsOptions:[r],slots:o,attrs:i,emit:u,render:c,renderCache:d,props:p,data:v,setupState:m,ctx:y,inheritAttrs:x}=e,C=Oi(e);let w,S;try{if(a.shapeFlag&4){const O=l||n,I=O;w=un(c.call(I,O,d,p,m,v,y)),S=i}else{const O=t;w=un(O.length>1?O(p,{attrs:i,slots:o,emit:u}):O(p,null)),S=t.props?i:xk(i)}}catch(O){ts.length=0,xu(O,e,1),w=M(Ga)}let q=w;if(S&&x!==!1){const O=Object.keys(S),{shapeFlag:I}=q;O.length&&I&7&&(r&&O.some(du)&&(S=kk(S,r)),q=Tl(q,S,!1,!0))}return a.dirs&&(q=Tl(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(a.dirs):a.dirs),a.transition&&cs(q,a.transition),w=q,Oi(C),w}const xk=e=>{let t;for(const a in e)(a==="class"||a==="style"||uu(a))&&((t||(t={}))[a]=e[a]);return t},kk=(e,t)=>{const a={};for(const n in e)(!du(n)||!(n.slice(9)in t))&&(a[n]=e[n]);return a};function wk(e,t,a){const{props:n,children:l,component:r}=e,{props:o,children:i,patchFlag:u}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(a&&u>=0){if(u&1024)return!0;if(u&16)return n?ym(n,o,c):!!o;if(u&8){const d=t.dynamicProps;for(let p=0;p<d.length;p++){const v=d[p];if(_y(o,n,v)&&!$u(c,v))return!0}}}else return(l||i)&&(!i||!i.$stable)?!0:n===o?!1:n?o?ym(n,o,c):!0:!!o;return!1}function ym(e,t,a){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let l=0;l<n.length;l++){const r=n[l];if(_y(t,e,r)&&!$u(a,r))return!0}return!1}function _y(e,t,a){const n=e[a],l=t[a];return a==="style"&&_t(n)&&_t(l)?!fo(n,l):n!==l}function $k({vnode:e,parent:t,suspense:a},n){for(;t;){const l=t.subTree;if(l.suspense&&l.suspense.activeBranch===e&&(l.suspense.vnode.el=l.el=n,e=l),l===e)(e=t.vnode).el=n,t=t.parent;else break}a&&a.activeBranch===e&&(a.vnode.el=n)}const xy={},ky=()=>Object.create(xy),wy=e=>Object.getPrototypeOf(e)===xy;function Ck(e,t,a,n=!1){const l={},r=ky();e.propsDefaults=Object.create(null),$y(e,t,l,r);for(const o in e.propsOptions[0])o in l||(l[o]=void 0);a?e.props=n?l:Hg(l):e.type.props?e.props=l:e.props=r,e.attrs=r}function Sk(e,t,a,n){const{props:l,attrs:r,vnode:{patchFlag:o}}=e,i=gt(l),[u]=e.propsOptions;let c=!1;if((n||o>0)&&!(o&16)){if(o&8){const d=e.vnode.dynamicProps;for(let p=0;p<d.length;p++){let v=d[p];if($u(e.emitsOptions,v))continue;const m=t[v];if(u)if(kt(r,v))m!==r[v]&&(r[v]=m,c=!0);else{const y=ea(v);l[y]=_c(u,i,y,m,e,!1)}else m!==r[v]&&(r[v]=m,c=!0)}}}else{$y(e,t,l,r)&&(c=!0);let d;for(const p in i)(!t||!kt(t,p)&&((d=Fl(p))===p||!kt(t,d)))&&(u?a&&(a[p]!==void 0||a[d]!==void 0)&&(l[p]=_c(u,i,p,void 0,e,!0)):delete l[p]);if(r!==i)for(const p in r)(!t||!kt(t,p))&&(delete r[p],c=!0)}c&&In(e.attrs,"set","")}function $y(e,t,a,n){const[l,r]=e.propsOptions;let o=!1,i;if(t)for(let u in t){if(Yo(u))continue;const c=t[u];let d;l&&kt(l,d=ea(u))?!r||!r.includes(d)?a[d]=c:(i||(i={}))[d]=c:$u(e.emitsOptions,u)||(!(u in n)||c!==n[u])&&(n[u]=c,o=!0)}if(r){const u=gt(a),c=i||Et;for(let d=0;d<r.length;d++){const p=r[d];a[p]=_c(l,u,p,c[p],e,!kt(c,p))}}return o}function _c(e,t,a,n,l,r){const o=e[a];if(o!=null){const i=kt(o,"default");if(i&&n===void 0){const u=o.default;if(o.type!==Function&&!o.skipFactory&&ot(u)){const{propsDefaults:c}=l;if(a in c)n=c[a];else{const d=Ds(l);n=c[a]=u.call(null,t),d()}}else n=u;l.ce&&l.ce._setProp(a,n)}o[0]&&(r&&!i?n=!1:o[1]&&(n===""||n===Fl(a))&&(n=!0))}return n}const Ek=new WeakMap;function Cy(e,t,a=!1){const n=a?Ek:t.propsCache,l=n.get(e);if(l)return l;const r=e.props,o={},i=[];let u=!1;if(!ot(e)){const d=p=>{u=!0;const[v,m]=Cy(p,t,!0);zt(o,v),m&&i.push(...m)};!a&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!r&&!u)return _t(e)&&n.set(e,zr),zr;if(Xe(r))for(let d=0;d<r.length;d++){const p=ea(r[d]);bm(p)&&(o[p]=Et)}else if(r)for(const d in r){const p=ea(d);if(bm(p)){const v=r[d],m=o[p]=Xe(v)||ot(v)?{type:v}:zt({},v),y=m.type;let x=!1,C=!0;if(Xe(y))for(let w=0;w<y.length;++w){const S=y[w],q=ot(S)&&S.name;if(q==="Boolean"){x=!0;break}else q==="String"&&(C=!1)}else x=ot(y)&&y.name==="Boolean";m[0]=x,m[1]=C,(x||kt(m,"default"))&&i.push(p)}}const c=[o,i];return _t(e)&&n.set(e,c),c}function bm(e){return e[0]!=="$"&&!Yo(e)}const bf=e=>e==="_"||e==="_ctx"||e==="$stable",_f=e=>Xe(e)?e.map(un):[un(e)],Ak=(e,t,a)=>{if(t._n)return t;const n=N((...l)=>_f(t(...l)),a);return n._c=!1,n},Sy=(e,t,a)=>{const n=e._ctx;for(const l in e){if(bf(l))continue;const r=e[l];if(ot(r))t[l]=Ak(l,r,n);else if(r!=null){const o=_f(r);t[l]=()=>o}}},Ey=(e,t)=>{const a=_f(t);e.slots.default=()=>a},Ay=(e,t,a)=>{for(const n in t)(a||!bf(n))&&(e[n]=t[n])},Tk=(e,t,a)=>{const n=e.slots=ky();if(e.vnode.shapeFlag&32){const l=t._;l?(Ay(n,t,a),a&&kg(n,"_",l,!0)):Sy(t,n)}else t&&Ey(e,t)},Mk=(e,t,a)=>{const{vnode:n,slots:l}=e;let r=!0,o=Et;if(n.shapeFlag&32){const i=t._;i?a&&i===1?r=!1:Ay(l,t,a):(r=!t.$stable,Sy(t,l)),o=t}else t&&(Ey(e,t),o={default:1});if(r)for(const i in l)!bf(i)&&o[i]==null&&delete l[i]},ua=Rk;function Dk(e){return Ok(e)}function Ok(e,t){const a=vu();a.__VUE__=!0;const{insert:n,remove:l,patchProp:r,createElement:o,createText:i,createComment:u,setText:c,setElementText:d,parentNode:p,nextSibling:v,setScopeId:m=vn,insertStaticContent:y}=e,x=($,P,U,ce=null,X=null,oe=null,ke=void 0,Se=null,Te=!!P.dynamicChildren)=>{if($===P)return;$&&!Rr($,P)&&(ce=Z($),ne($,X,oe,!0),$=null),P.patchFlag===-2&&(Te=!1,P.dynamicChildren=null);const{type:se,ref:Me,shapeFlag:Ce}=P;switch(se){case Cu:C($,P,U,ce);break;case Ga:w($,P,U,ce);break;case _i:$==null&&S(P,U,ce,ke);break;case me:A($,P,U,ce,X,oe,ke,Se,Te);break;default:Ce&1?I($,P,U,ce,X,oe,ke,Se,Te):Ce&6?D($,P,U,ce,X,oe,ke,Se,Te):(Ce&64||Ce&128)&&se.process($,P,U,ce,X,oe,ke,Se,Te,ee)}Me!=null&&X?Qo(Me,$&&$.ref,oe,P||$,!P):Me==null&&$&&$.ref!=null&&Qo($.ref,null,oe,$,!0)},C=($,P,U,ce)=>{if($==null)n(P.el=i(P.children),U,ce);else{const X=P.el=$.el;P.children!==$.children&&c(X,P.children)}},w=($,P,U,ce)=>{$==null?n(P.el=u(P.children||""),U,ce):P.el=$.el},S=($,P,U,ce)=>{[$.el,$.anchor]=y($.children,P,U,ce,$.el,$.anchor)},q=({el:$,anchor:P},U,ce)=>{let X;for(;$&&$!==P;)X=v($),n($,U,ce),$=X;n(P,U,ce)},O=({el:$,anchor:P})=>{let U;for(;$&&$!==P;)U=v($),l($),$=U;l(P)},I=($,P,U,ce,X,oe,ke,Se,Te)=>{if(P.type==="svg"?ke="svg":P.type==="math"&&(ke="mathml"),$==null)B(P,U,ce,X,oe,ke,Se,Te);else{const se=$.el&&$.el._isVueCE?$.el:null;try{se&&se._beginPatch(),T($,P,X,oe,ke,Se,Te)}finally{se&&se._endPatch()}}},B=($,P,U,ce,X,oe,ke,Se)=>{let Te,se;const{props:Me,shapeFlag:Ce,transition:Fe,dirs:Ue}=$;if(Te=$.el=o($.type,oe,Me&&Me.is,Me),Ce&8?d(Te,$.children):Ce&16&&W($.children,Te,null,ce,X,fd($,oe),ke,Se),Ue&&Gl($,null,ce,"created"),L(Te,$,$.scopeId,ke,ce),Me){for(const at in Me)at!=="value"&&!Yo(at)&&r(Te,at,null,Me[at],oe,ce);"value"in Me&&r(Te,"value",null,Me.value,oe),(se=Me.onVnodeBeforeMount)&&an(se,ce,$)}Ue&&Gl($,null,ce,"beforeMount");const Ze=Pk(X,Fe);Ze&&Fe.beforeEnter(Te),n(Te,P,U),((se=Me&&Me.onVnodeMounted)||Ze||Ue)&&ua(()=>{se&&an(se,ce,$),Ze&&Fe.enter(Te),Ue&&Gl($,null,ce,"mounted")},X)},L=($,P,U,ce,X)=>{if(U&&m($,U),ce)for(let oe=0;oe<ce.length;oe++)m($,ce[oe]);if(X){let oe=X.subTree;if(P===oe||Dy(oe.type)&&(oe.ssContent===P||oe.ssFallback===P)){const ke=X.vnode;L($,ke,ke.scopeId,ke.slotScopeIds,X.parent)}}},W=($,P,U,ce,X,oe,ke,Se,Te=0)=>{for(let se=Te;se<$.length;se++){const Me=$[se]=Se?Pn($[se]):un($[se]);x(null,Me,P,U,ce,X,oe,ke,Se)}},T=($,P,U,ce,X,oe,ke)=>{const Se=P.el=$.el;let{patchFlag:Te,dynamicChildren:se,dirs:Me}=P;Te|=$.patchFlag&16;const Ce=$.props||Et,Fe=P.props||Et;let Ue;if(U&&Yl(U,!1),(Ue=Fe.onVnodeBeforeUpdate)&&an(Ue,U,P,$),Me&&Gl(P,$,U,"beforeUpdate"),U&&Yl(U,!0),(Ce.innerHTML&&Fe.innerHTML==null||Ce.textContent&&Fe.textContent==null)&&d(Se,""),se?R($.dynamicChildren,se,Se,U,ce,fd(P,X),oe):ke||ie($,P,Se,null,U,ce,fd(P,X),oe,!1),Te>0){if(Te&16)G(Se,Ce,Fe,U,X);else if(Te&2&&Ce.class!==Fe.class&&r(Se,"class",null,Fe.class,X),Te&4&&r(Se,"style",Ce.style,Fe.style,X),Te&8){const Ze=P.dynamicProps;for(let at=0;at<Ze.length;at++){const nt=Ze[at],$e=Ce[nt],ge=Fe[nt];(ge!==$e||nt==="value")&&r(Se,nt,$e,ge,X,U)}}Te&1&&$.children!==P.children&&d(Se,P.children)}else!ke&&se==null&&G(Se,Ce,Fe,U,X);((Ue=Fe.onVnodeUpdated)||Me)&&ua(()=>{Ue&&an(Ue,U,P,$),Me&&Gl(P,$,U,"updated")},ce)},R=($,P,U,ce,X,oe,ke)=>{for(let Se=0;Se<P.length;Se++){const Te=$[Se],se=P[Se],Me=Te.el&&(Te.type===me||!Rr(Te,se)||Te.shapeFlag&198)?p(Te.el):U;x(Te,se,Me,null,ce,X,oe,ke,!0)}},G=($,P,U,ce,X)=>{if(P!==U){if(P!==Et)for(const oe in P)!Yo(oe)&&!(oe in U)&&r($,oe,P[oe],null,X,ce);for(const oe in U){if(Yo(oe))continue;const ke=U[oe],Se=P[oe];ke!==Se&&oe!=="value"&&r($,oe,Se,ke,X,ce)}"value"in U&&r($,"value",P.value,U.value,X)}},A=($,P,U,ce,X,oe,ke,Se,Te)=>{const se=P.el=$?$.el:i(""),Me=P.anchor=$?$.anchor:i("");let{patchFlag:Ce,dynamicChildren:Fe,slotScopeIds:Ue}=P;Ue&&(Se=Se?Se.concat(Ue):Ue),$==null?(n(se,U,ce),n(Me,U,ce),W(P.children||[],U,Me,X,oe,ke,Se,Te)):Ce>0&&Ce&64&&Fe&&$.dynamicChildren&&$.dynamicChildren.length===Fe.length?(R($.dynamicChildren,Fe,U,X,oe,ke,Se),(P.key!=null||X&&P===X.subTree)&&xf($,P,!0)):ie($,P,U,Me,X,oe,ke,Se,Te)},D=($,P,U,ce,X,oe,ke,Se,Te)=>{P.slotScopeIds=Se,$==null?P.shapeFlag&512?X.ctx.activate(P,U,ce,ke,Te):z(P,U,ce,X,oe,ke,Te):V($,P,Te)},z=($,P,U,ce,X,oe,ke)=>{const Se=$.component=Vk($,ce,X);if(ry($)&&(Se.ctx.renderer=ee),zk(Se,!1,ke),Se.asyncDep){if(X&&X.registerDep(Se,K,ke),!$.el){const Te=Se.subTree=M(Ga);w(null,Te,P,U),$.placeholder=Te.el}}else K(Se,$,P,U,X,oe,ke)},V=($,P,U)=>{const ce=P.component=$.component;if(wk($,P,U))if(ce.asyncDep&&!ce.asyncResolved){re(ce,P,U);return}else ce.next=P,ce.update();else P.el=$.el,ce.vnode=P},K=($,P,U,ce,X,oe,ke)=>{const Se=()=>{if($.isMounted){let{next:Ce,bu:Fe,u:Ue,parent:Ze,vnode:at}=$;{const We=Ty($);if(We){Ce&&(Ce.el=at.el,re($,Ce,ke)),We.asyncDep.then(()=>{ua(()=>{$.isUnmounted||se()},X)});return}}let nt=Ce,$e;Yl($,!1),Ce?(Ce.el=at.el,re($,Ce,ke)):Ce=at,Fe&&bi(Fe),($e=Ce.props&&Ce.props.onVnodeBeforeUpdate)&&an($e,Ze,Ce,at),Yl($,!0);const ge=gm($),be=$.subTree;$.subTree=ge,x(be,ge,p(be.el),Z(be),$,X,oe),Ce.el=ge.el,nt===null&&$k($,ge.el),Ue&&ua(Ue,X),($e=Ce.props&&Ce.props.onVnodeUpdated)&&ua(()=>an($e,Ze,Ce,at),X)}else{let Ce;const{el:Fe,props:Ue}=P,{bm:Ze,m:at,parent:nt,root:$e,type:ge}=$,be=Hr(P);Yl($,!1),Ze&&bi(Ze),!be&&(Ce=Ue&&Ue.onVnodeBeforeMount)&&an(Ce,nt,P),Yl($,!0);{$e.ce&&$e.ce._hasShadowRoot()&&$e.ce._injectChildStyle(ge,$.parent?$.parent.type:void 0);const We=$.subTree=gm($);x(null,We,U,ce,$,X,oe),P.el=We.el}if(at&&ua(at,X),!be&&(Ce=Ue&&Ue.onVnodeMounted)){const We=P;ua(()=>an(Ce,nt,We),X)}(P.shapeFlag&256||nt&&Hr(nt.vnode)&&nt.vnode.shapeFlag&256)&&$.a&&ua($.a,X),$.isMounted=!0,P=U=ce=null}};$.scope.on();const Te=$.effect=new Tg(Se);$.scope.off();const se=$.update=Te.run.bind(Te),Me=$.job=Te.runIfDirty.bind(Te);Me.i=$,Me.id=$.uid,Te.scheduler=()=>hf(Me),Yl($,!0),se()},re=($,P,U)=>{P.component=$;const ce=$.vnode.props;$.vnode=P,$.next=null,Sk($,P.props,ce,U),Mk($,P.children,U),Hn(),im($),Kn()},ie=($,P,U,ce,X,oe,ke,Se,Te=!1)=>{const se=$&&$.children,Me=$?$.shapeFlag:0,Ce=P.children,{patchFlag:Fe,shapeFlag:Ue}=P;if(Fe>0){if(Fe&128){_e(se,Ce,U,ce,X,oe,ke,Se,Te);return}else if(Fe&256){Ae(se,Ce,U,ce,X,oe,ke,Se,Te);return}}Ue&8?(Me&16&&ve(se,X,oe),Ce!==se&&d(U,Ce)):Me&16?Ue&16?_e(se,Ce,U,ce,X,oe,ke,Se,Te):ve(se,X,oe,!0):(Me&8&&d(U,""),Ue&16&&W(Ce,U,ce,X,oe,ke,Se,Te))},Ae=($,P,U,ce,X,oe,ke,Se,Te)=>{$=$||zr,P=P||zr;const se=$.length,Me=P.length,Ce=Math.min(se,Me);let Fe;for(Fe=0;Fe<Ce;Fe++){const Ue=P[Fe]=Te?Pn(P[Fe]):un(P[Fe]);x($[Fe],Ue,U,null,X,oe,ke,Se,Te)}se>Me?ve($,X,oe,!0,!1,Ce):W(P,U,ce,X,oe,ke,Se,Te,Ce)},_e=($,P,U,ce,X,oe,ke,Se,Te)=>{let se=0;const Me=P.length;let Ce=$.length-1,Fe=Me-1;for(;se<=Ce&&se<=Fe;){const Ue=$[se],Ze=P[se]=Te?Pn(P[se]):un(P[se]);if(Rr(Ue,Ze))x(Ue,Ze,U,null,X,oe,ke,Se,Te);else break;se++}for(;se<=Ce&&se<=Fe;){const Ue=$[Ce],Ze=P[Fe]=Te?Pn(P[Fe]):un(P[Fe]);if(Rr(Ue,Ze))x(Ue,Ze,U,null,X,oe,ke,Se,Te);else break;Ce--,Fe--}if(se>Ce){if(se<=Fe){const Ue=Fe+1,Ze=Ue<Me?P[Ue].el:ce;for(;se<=Fe;)x(null,P[se]=Te?Pn(P[se]):un(P[se]),U,Ze,X,oe,ke,Se,Te),se++}}else if(se>Fe)for(;se<=Ce;)ne($[se],X,oe,!0),se++;else{const Ue=se,Ze=se,at=new Map;for(se=Ze;se<=Fe;se++){const He=P[se]=Te?Pn(P[se]):un(P[se]);He.key!=null&&at.set(He.key,se)}let nt,$e=0;const ge=Fe-Ze+1;let be=!1,We=0;const it=new Array(ge);for(se=0;se<ge;se++)it[se]=0;for(se=Ue;se<=Ce;se++){const He=$[se];if($e>=ge){ne(He,X,oe,!0);continue}let Je;if(He.key!=null)Je=at.get(He.key);else for(nt=Ze;nt<=Fe;nt++)if(it[nt-Ze]===0&&Rr(He,P[nt])){Je=nt;break}Je===void 0?ne(He,X,oe,!0):(it[Je-Ze]=se+1,Je>=We?We=Je:be=!0,x(He,P[Je],U,null,X,oe,ke,Se,Te),$e++)}const Be=be?Ik(it):zr;for(nt=Be.length-1,se=ge-1;se>=0;se--){const He=Ze+se,Je=P[He],Ot=P[He+1],Gt=He+1<Me?Ot.el||My(Ot):ce;it[se]===0?x(null,Je,U,Gt,X,oe,ke,Se,Te):be&&(nt<0||se!==Be[nt]?xe(Je,U,Gt,2):nt--)}}},xe=($,P,U,ce,X=null)=>{const{el:oe,type:ke,transition:Se,children:Te,shapeFlag:se}=$;if(se&6){xe($.component.subTree,P,U,ce);return}if(se&128){$.suspense.move(P,U,ce);return}if(se&64){ke.move($,P,U,ee);return}if(ke===me){n(oe,P,U);for(let Ce=0;Ce<Te.length;Ce++)xe(Te[Ce],P,U,ce);n($.anchor,P,U);return}if(ke===_i){q($,P,U);return}if(ce!==2&&se&1&&Se)if(ce===0)Se.persisted&&!oe[on]?n(oe,P,U):(Se.beforeEnter(oe),n(oe,P,U),ua(()=>Se.enter(oe),X));else{const{leave:Ce,delayLeave:Fe,afterLeave:Ue}=Se,Ze=()=>{$.ctx.isUnmounted?l(oe):n(oe,P,U)},at=()=>{const nt=oe._isLeaving||!!oe[on];oe._isLeaving&&oe[on](!0),Se.persisted&&!nt?Ze():Ce(oe,()=>{Ze(),Ue&&Ue()})};Fe?Fe(oe,Ze,at):at()}else n(oe,P,U)},ne=($,P,U,ce=!1,X=!1)=>{const{type:oe,props:ke,ref:Se,children:Te,dynamicChildren:se,shapeFlag:Me,patchFlag:Ce,dirs:Fe,cacheIndex:Ue,memo:Ze}=$;if(Ce===-2&&(X=!1),Se!=null&&(Hn(),Qo(Se,null,U,$,!0),Kn()),Ue!=null&&(P.renderCache[Ue]=void 0),Me&256){P.ctx.deactivate($);return}const at=Me&1&&Fe,nt=!Hr($);let $e;if(nt&&($e=ke&&ke.onVnodeBeforeUnmount)&&an($e,P,$),Me&6)de($.component,U,ce);else{if(Me&128){$.suspense.unmount(U,ce);return}at&&Gl($,null,P,"beforeUnmount"),Me&64?$.type.remove($,P,U,ee,ce):se&&!se.hasOnce&&(oe!==me||Ce>0&&Ce&64)?ve(se,P,U,!1,!0):(oe===me&&Ce&384||!X&&Me&16)&&ve(Te,P,U),ce&&fe($)}const ge=Ze!=null&&Ue==null;(nt&&($e=ke&&ke.onVnodeUnmounted)||at||ge)&&ua(()=>{$e&&an($e,P,$),at&&Gl($,null,P,"unmounted"),ge&&($.el=null)},U)},fe=$=>{const{type:P,el:U,anchor:ce,transition:X}=$;if(P===me){F(U,ce);return}if(P===_i){O($);return}const oe=()=>{l(U),X&&!X.persisted&&X.afterLeave&&X.afterLeave()};if($.shapeFlag&1&&X&&!X.persisted){const{leave:ke,delayLeave:Se}=X,Te=()=>ke(U,oe);Se?Se($.el,oe,Te):Te()}else oe()},F=($,P)=>{let U;for(;$!==P;)U=v($),l($),$=U;l(P)},de=($,P,U)=>{const{bum:ce,scope:X,job:oe,subTree:ke,um:Se,m:Te,a:se}=$;_m(Te),_m(se),ce&&bi(ce),X.stop(),oe&&(oe.flags|=8,ne(ke,$,P,U)),Se&&ua(Se,P),ua(()=>{$.isUnmounted=!0},P)},ve=($,P,U,ce=!1,X=!1,oe=0)=>{for(let ke=oe;ke<$.length;ke++)ne($[ke],P,U,ce,X)},Z=$=>{if($.shapeFlag&6)return Z($.component.subTree);if($.shapeFlag&128)return $.suspense.next();const P=v($.anchor||$.el),U=P&&P[ay];return U?v(U):P};let he=!1;const J=($,P,U)=>{let ce;$==null?P._vnode&&(ne(P._vnode,null,null,!0),ce=P._vnode.component):x(P._vnode||null,$,P,null,null,null,U),P._vnode=$,he||(he=!0,im(ce),Zg(),he=!1)},ee={p:x,um:ne,m:xe,r:fe,mt:z,mc:W,pc:ie,pbc:R,n:Z,o:e};return{render:J,hydrate:void 0,createApp:gk(J)}}function fd({type:e,props:t},a){return a==="svg"&&e==="foreignObject"||a==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:a}function Yl({effect:e,job:t},a){a?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Pk(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function xf(e,t,a=!1){const n=e.children,l=t.children;if(Xe(n)&&Xe(l))for(let r=0;r<n.length;r++){const o=n[r];let i=l[r];i.shapeFlag&1&&!i.dynamicChildren&&((i.patchFlag<=0||i.patchFlag===32)&&(i=l[r]=Pn(l[r]),i.el=o.el),!a&&i.patchFlag!==-2&&xf(o,i)),i.type===Cu&&(i.patchFlag===-1&&(i=l[r]=Pn(i)),i.el=o.el),i.type===Ga&&!i.el&&(i.el=o.el)}}function Ik(e){const t=e.slice(),a=[0];let n,l,r,o,i;const u=e.length;for(n=0;n<u;n++){const c=e[n];if(c!==0){if(l=a[a.length-1],e[l]<c){t[n]=l,a.push(n);continue}for(r=0,o=a.length-1;r<o;)i=r+o>>1,e[a[i]]<c?r=i+1:o=i;c<e[a[r]]&&(r>0&&(t[n]=a[r-1]),a[r]=n)}}for(r=a.length,o=a[r-1];r-- >0;)a[r]=o,o=t[o];return a}function Ty(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Ty(t)}function _m(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function My(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?My(t.subTree):null}const Dy=e=>e.__isSuspense;function Rk(e,t){t&&t.pendingBranch?Xe(e)?t.effects.push(...e):t.effects.push(e):Hx(e)}const me=Symbol.for("v-fgt"),Cu=Symbol.for("v-txt"),Ga=Symbol.for("v-cmt"),_i=Symbol.for("v-stc"),ts=[];let ka=null;function f(e=!1){ts.push(ka=e?null:[])}function qk(){ts.pop(),ka=ts[ts.length-1]||null}let fs=1;function Ri(e,t=!1){fs+=e,e<0&&ka&&t&&(ka.hasOnce=!0)}function Oy(e){return e.dynamicChildren=fs>0?ka||zr:null,qk(),fs>0&&ka&&ka.push(e),e}function b(e,t,a,n,l,r){return Oy(g(e,t,a,n,l,r,!0))}function j(e,t,a,n,l){return Oy(M(e,t,a,n,l,!0))}function ps(e){return e?e.__v_isVNode===!0:!1}function Rr(e,t){return e.type===t.type&&e.key===t.key}const Py=({key:e})=>e??null,xi=({ref:e,ref_key:t,ref_for:a})=>(typeof e=="number"&&(e=""+e),e!=null?Mt(e)||Ct(e)||ot(e)?{i:Qt,r:e,k:t,f:!!a}:e:null);function g(e,t=null,a=null,n=0,l=null,r=e===me?0:1,o=!1,i=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Py(t),ref:t&&xi(t),scopeId:Qg,slotScopeIds:null,children:a,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:n,dynamicProps:l,dynamicChildren:null,appContext:null,ctx:Qt};return i?(kf(u,a),r&128&&e.normalize(u)):a&&(u.shapeFlag|=Mt(a)?8:16),fs>0&&!o&&ka&&(u.patchFlag>0||r&6)&&u.patchFlag!==32&&ka.push(u),u}const M=Lk;function Lk(e,t=null,a=null,n=0,l=null,r=!1){if((!e||e===cy)&&(e=Ga),ps(e)){const i=Tl(e,t,!0);return a&&kf(i,a),fs>0&&!r&&ka&&(i.shapeFlag&6?ka[ka.indexOf(e)]=i:ka.push(i)),i.patchFlag=-2,i}if(Wk(e)&&(e=e.__vccOpts),t){t=ft(t);let{class:i,style:u}=t;i&&!Mt(i)&&(t.class=pe(i)),_t(u)&&(_u(u)&&!Xe(u)&&(u=zt({},u)),t.style=oa(u))}const o=Mt(e)?1:Dy(e)?128:Yx(e)?64:_t(e)?4:ot(e)?2:0;return g(e,t,a,n,l,o,r,!0)}function ft(e){return e?_u(e)||wy(e)?zt({},e):e:null}function Tl(e,t,a=!1,n=!1){const{props:l,ref:r,patchFlag:o,children:i,transition:u}=e,c=t?Ye(l||{},t):l,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Py(c),ref:t&&t.ref?a&&r?Xe(r)?r.concat(xi(t)):[r,xi(t)]:xi(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==me?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Tl(e.ssContent),ssFallback:e.ssFallback&&Tl(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&n&&cs(d,u.clone(d)),d}function ye(e=" ",t=0){return M(Cu,null,e,t)}function Nk(e,t){const a=M(_i,null,e);return a.staticCount=t,a}function Y(e="",t=!1){return t?(f(),j(Ga,null,e)):M(Ga,null,e)}function un(e){return e==null||typeof e=="boolean"?M(Ga):Xe(e)?M(me,null,e.slice()):ps(e)?Pn(e):M(Cu,null,String(e))}function Pn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Tl(e)}function kf(e,t){let a=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Xe(t))a=16;else if(typeof t=="object")if(n&65){const l=t.default;l&&(l._c&&(l._d=!1),kf(e,l()),l._c&&(l._d=!0));return}else{a=32;const l=t._;!l&&!wy(t)?t._ctx=Qt:l===3&&Qt&&(Qt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ot(t)?(t={default:t,_ctx:Qt},a=32):(t=String(t),n&64?(a=16,t=[ye(t)]):a=8);e.children=t,e.shapeFlag|=a}function Ye(...e){const t={};for(let a=0;a<e.length;a++){const n=e[a];for(const l in n)if(l==="class")t.class!==n.class&&(t.class=pe([t.class,n.class]));else if(l==="style")t.style=oa([t.style,n.style]);else if(uu(l)){const r=t[l],o=n[l];o&&r!==o&&!(Xe(r)&&r.includes(o))?t[l]=r?[].concat(r,o):o:o==null&&r==null&&!du(l)&&(t[l]=o)}else l!==""&&(t[l]=n[l])}return t}function an(e,t,a,n=null){La(e,t,7,[a,n])}const Bk=yy();let Fk=0;function Vk(e,t,a){const n=e.type,l=(t?t.appContext:e.appContext)||Bk,r={uid:Fk++,vnode:e,type:n,parent:t,appContext:l,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Sg(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(l.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Cy(n,l),emitsOptions:by(n,l),emit:null,emitted:null,propsDefaults:Et,inheritAttrs:n.inheritAttrs,ctx:Et,data:Et,props:Et,attrs:Et,slots:Et,refs:Et,setupState:Et,setupContext:null,suspense:a,suspenseId:a?a.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return r.ctx={_:r},r.root=t?t.root:r,r.emit=bk.bind(null,r),e.ce&&e.ce(r),r}let ra=null;const kn=()=>ra||Qt;let qi,xc;{const e=vu(),t=(a,n)=>{let l;return(l=e[a])||(l=e[a]=[]),l.push(n),r=>{l.length>1?l.forEach(o=>o(r)):l[0](r)}};qi=t("__VUE_INSTANCE_SETTERS__",a=>ra=a),xc=t("__VUE_SSR_SETTERS__",a=>ms=a)}const Ds=e=>{const t=ra;return qi(e),e.scope.on(),()=>{e.scope.off(),qi(t)}},xm=()=>{ra&&ra.scope.off(),qi(null)};function Iy(e){return e.vnode.shapeFlag&4}let ms=!1;function zk(e,t=!1,a=!1){t&&xc(t);const{props:n,children:l}=e.vnode,r=Iy(e);Ck(e,n,r,t),Tk(e,l,a||t);const o=r?jk(e,t):void 0;return t&&xc(!1),o}function jk(e,t){const a=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,dk);const{setup:n}=a;if(n){Hn();const l=e.setupContext=n.length>1?Hk(e):null,r=Ds(e),o=Ms(n,e,0,[e.props,l]),i=bg(o);if(Kn(),r(),(i||e.sp)&&!Hr(e)&&ly(e),i){if(o.then(xm,xm),t)return o.then(u=>{km(e,u)}).catch(u=>{xu(u,e,0)});e.asyncDep=o}else km(e,o)}else Ry(e)}function km(e,t,a){ot(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:_t(t)&&(e.setupState=Wg(t)),Ry(e)}function Ry(e,t,a){const n=e.type;e.render||(e.render=n.render||vn);{const l=Ds(e);Hn();try{ck(e)}finally{Kn(),l()}}}const Uk={get(e,t){return la(e,"get",""),e[t]}};function Hk(e){const t=a=>{e.exposed=a||{}};return{attrs:new Proxy(e.attrs,Uk),slots:e.slots,emit:e.emit,expose:t}}function Su(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Wg(Ti(e.exposed)),{get(t,a){if(a in t)return t[a];if(a in es)return es[a](e)},has(t,a){return a in t||a in es}})):e.proxy}function Kk(e,t=!0){return ot(e)?e.displayName||e.name:e.name||t&&e.__name}function Wk(e){return ot(e)&&"__vccOpts"in e}const k=(e,t)=>Fx(e,t,ms);function qa(e,t,a){try{Ri(-1);const n=arguments.length;return n===2?_t(t)&&!Xe(t)?ps(t)?M(e,null,[t]):M(e,t):M(e,null,t):(n>3?a=Array.prototype.slice.call(arguments,2):n===3&&ps(a)&&(a=[a]),M(e,t,a))}finally{Ri(1)}}const Gk="3.5.35";let kc;const wm=typeof window<"u"&&window.trustedTypes;if(wm)try{kc=wm.createPolicy("vue",{createHTML:e=>e})}catch{}const qy=kc?e=>kc.createHTML(e):e=>e,Yk="http://www.w3.org/2000/svg",Jk="http://www.w3.org/1998/Math/MathML",Dn=typeof document<"u"?document:null,$m=Dn&&Dn.createElement("template"),Zk={insert:(e,t,a)=>{t.insertBefore(e,a||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,a,n)=>{const l=t==="svg"?Dn.createElementNS(Yk,e):t==="mathml"?Dn.createElementNS(Jk,e):a?Dn.createElement(e,{is:a}):Dn.createElement(e);return e==="select"&&n&&n.multiple!=null&&l.setAttribute("multiple",n.multiple),l},createText:e=>Dn.createTextNode(e),createComment:e=>Dn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Dn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,a,n,l,r){const o=a?a.previousSibling:t.lastChild;if(l&&(l===r||l.nextSibling))for(;t.insertBefore(l.cloneNode(!0),a),!(l===r||!(l=l.nextSibling)););else{$m.innerHTML=qy(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const i=$m.content;if(n==="svg"||n==="mathml"){const u=i.firstChild;for(;u.firstChild;)i.appendChild(u.firstChild);i.removeChild(u)}t.insertBefore(i,a)}return[o?o.nextSibling:t.firstChild,a?a.previousSibling:t.lastChild]}},fl="transition",To="animation",to=Symbol("_vtc"),Ly={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Xk=zt({},tk,Ly),Jl=(e,t=[])=>{Xe(e)?e.forEach(a=>a(...t)):e&&e(...t)},Cm=e=>e?Xe(e)?e.some(t=>t.length>1):e.length>1:!1;function Qk(e){const t={};for(const A in e)A in Ly||(t[A]=e[A]);if(e.css===!1)return t;const{name:a="v",type:n,duration:l,enterFromClass:r=`${a}-enter-from`,enterActiveClass:o=`${a}-enter-active`,enterToClass:i=`${a}-enter-to`,appearFromClass:u=r,appearActiveClass:c=o,appearToClass:d=i,leaveFromClass:p=`${a}-leave-from`,leaveActiveClass:v=`${a}-leave-active`,leaveToClass:m=`${a}-leave-to`}=e,y=ew(l),x=y&&y[0],C=y&&y[1],{onBeforeEnter:w,onEnter:S,onEnterCancelled:q,onLeave:O,onLeaveCancelled:I,onBeforeAppear:B=w,onAppear:L=S,onAppearCancelled:W=q}=t,T=(A,D,z,V)=>{A._enterCancelled=V,yl(A,D?d:i),yl(A,D?c:o),z&&z()},R=(A,D)=>{A._isLeaving=!1,yl(A,p),yl(A,m),yl(A,v),D&&D()},G=A=>(D,z)=>{const V=A?L:S,K=()=>T(D,A,z);Jl(V,[D,K]),Sm(()=>{yl(D,A?u:r),nn(D,A?d:i),Cm(V)||Em(D,n,x,K)})};return zt(t,{onBeforeEnter(A){Jl(w,[A]),nn(A,r),nn(A,o)},onBeforeAppear(A){Jl(B,[A]),nn(A,u),nn(A,c)},onEnter:G(!1),onAppear:G(!0),onLeave(A,D){A._isLeaving=!0;const z=()=>R(A,D);nn(A,p),A._enterCancelled?(nn(A,v),wc(A)):(wc(A),nn(A,v)),Sm(()=>{A._isLeaving&&(yl(A,p),nn(A,m),Cm(O)||Em(A,n,C,z))}),Jl(O,[A,z])},onEnterCancelled(A){T(A,!1,void 0,!0),Jl(q,[A])},onAppearCancelled(A){T(A,!0,void 0,!0),Jl(W,[A])},onLeaveCancelled(A){R(A),Jl(I,[A])}})}function ew(e){if(e==null)return null;if(_t(e))return[pd(e.enter),pd(e.leave)];{const t=pd(e);return[t,t]}}function pd(e){return rx(e)}function nn(e,t){t.split(/\s+/).forEach(a=>a&&e.classList.add(a)),(e[to]||(e[to]=new Set)).add(t)}function yl(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const a=e[to];a&&(a.delete(t),a.size||(e[to]=void 0))}function Sm(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let tw=0;function Em(e,t,a,n){const l=e._endId=++tw,r=()=>{l===e._endId&&n()};if(a!=null)return setTimeout(r,a);const{type:o,timeout:i,propCount:u}=Ny(e,t);if(!o)return n();const c=o+"end";let d=0;const p=()=>{e.removeEventListener(c,v),r()},v=m=>{m.target===e&&++d>=u&&p()};setTimeout(()=>{d<u&&p()},i+1),e.addEventListener(c,v)}function Ny(e,t){const a=window.getComputedStyle(e),n=y=>(a[y]||"").split(", "),l=n(`${fl}Delay`),r=n(`${fl}Duration`),o=Am(l,r),i=n(`${To}Delay`),u=n(`${To}Duration`),c=Am(i,u);let d=null,p=0,v=0;t===fl?o>0&&(d=fl,p=o,v=r.length):t===To?c>0&&(d=To,p=c,v=u.length):(p=Math.max(o,c),d=p>0?o>c?fl:To:null,v=d?d===fl?r.length:u.length:0);const m=d===fl&&/\b(?:transform|all)(?:,|$)/.test(n(`${fl}Property`).toString());return{type:d,timeout:p,propCount:v,hasTransform:m}}function Am(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((a,n)=>Tm(a)+Tm(e[n])))}function Tm(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function wc(e){return(e?e.ownerDocument:document).body.offsetHeight}function aw(e,t,a){const n=e[to];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):a?e.setAttribute("class",t):e.className=t}const Li=Symbol("_vod"),By=Symbol("_vsh"),vs={name:"show",beforeMount(e,{value:t},{transition:a}){e[Li]=e.style.display==="none"?"":e.style.display,a&&t?a.beforeEnter(e):Mo(e,t)},mounted(e,{value:t},{transition:a}){a&&t&&a.enter(e)},updated(e,{value:t,oldValue:a},{transition:n}){!t!=!a&&(n?t?(n.beforeEnter(e),Mo(e,!0),n.enter(e)):n.leave(e,()=>{Mo(e,!1)}):Mo(e,t))},beforeUnmount(e,{value:t}){Mo(e,t)}};function Mo(e,t){e.style.display=t?e[Li]:"none",e[By]=!t}const nw=Symbol(""),lw=/(?:^|;)\s*display\s*:/;function rw(e,t,a){const n=e.style,l=Mt(a);let r=!1;if(a&&!l){if(t)if(Mt(t))for(const o of t.split(";")){const i=o.slice(0,o.indexOf(":")).trim();a[i]==null&&Ho(n,i,"")}else for(const o in t)a[o]==null&&Ho(n,o,"");for(const o in a){o==="display"&&(r=!0);const i=a[o];i!=null?sw(e,o,!Mt(t)&&t?t[o]:void 0,i)||Ho(n,o,i):Ho(n,o,"")}}else if(l){if(t!==a){const o=n[nw];o&&(a+=";"+o),n.cssText=a,r=lw.test(a)}}else t&&e.removeAttribute("style");Li in e&&(e[Li]=r?n.display:"",e[By]&&(n.display="none"))}const Mm=/\s*!important$/;function Ho(e,t,a){if(Xe(a))a.forEach(n=>Ho(e,t,n));else if(a==null&&(a=""),t.startsWith("--"))e.setProperty(t,a);else{const n=ow(e,t);Mm.test(a)?e.setProperty(Fl(n),a.replace(Mm,""),"important"):e[n]=a}}const Dm=["Webkit","Moz","ms"],md={};function ow(e,t){const a=md[t];if(a)return a;let n=ea(t);if(n!=="filter"&&n in e)return md[t]=n;n=pu(n);for(let l=0;l<Dm.length;l++){const r=Dm[l]+n;if(r in e)return md[t]=r}return t}function sw(e,t,a,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Mt(n)&&a===n}const Om="http://www.w3.org/1999/xlink";function Pm(e,t,a,n,l,r=cx(t)){n&&t.startsWith("xlink:")?a==null?e.removeAttributeNS(Om,t.slice(6,t.length)):e.setAttributeNS(Om,t,a):a==null||r&&!wg(a)?e.removeAttribute(t):e.setAttribute(t,r?"":Ea(a)?String(a):a)}function Im(e,t,a,n,l){if(t==="innerHTML"||t==="textContent"){a!=null&&(e[t]=t==="innerHTML"?qy(a):a);return}const r=e.tagName;if(t==="value"&&r!=="PROGRESS"&&!r.includes("-")){const i=r==="OPTION"?e.getAttribute("value")||"":e.value,u=a==null?e.type==="checkbox"?"on":"":String(a);(i!==u||!("_value"in e))&&(e.value=u),a==null&&e.removeAttribute(t),e._value=a;return}let o=!1;if(a===""||a==null){const i=typeof e[t];i==="boolean"?a=wg(a):a==null&&i==="string"?(a="",o=!0):i==="number"&&(a=0,o=!0)}try{e[t]=a}catch{}o&&e.removeAttribute(l||t)}function wl(e,t,a,n){e.addEventListener(t,a,n)}function iw(e,t,a,n){e.removeEventListener(t,a,n)}const Rm=Symbol("_vei");function uw(e,t,a,n,l=null){const r=e[Rm]||(e[Rm]={}),o=r[t];if(n&&o)o.value=n;else{const[i,u]=dw(t);if(n){const c=r[t]=pw(n,l);wl(e,i,c,u)}else o&&(iw(e,i,o,u),r[t]=void 0)}}const qm=/(?:Once|Passive|Capture)$/;function dw(e){let t;if(qm.test(e)){t={};let n;for(;n=e.match(qm);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Fl(e.slice(2)),t]}let vd=0;const cw=Promise.resolve(),fw=()=>vd||(cw.then(()=>vd=0),vd=Date.now());function pw(e,t){const a=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=a.attached)return;const l=a.value;if(Xe(l)){const r=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{r.call(n),n._stopped=!0};const o=l.slice(),i=[n];for(let u=0;u<o.length&&!n._stopped;u++){const c=o[u];c&&La(c,t,5,i)}}else La(l,t,5,[n])};return a.value=e,a.attached=fw(),a}const Lm=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,mw=(e,t,a,n,l,r)=>{const o=l==="svg";t==="class"?aw(e,n,o):t==="style"?rw(e,a,n):uu(t)?du(t)||uw(e,t,a,n,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):vw(e,t,n,o))?(Im(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Pm(e,t,n,o,r,t!=="value")):e._isVueCE&&(hw(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Mt(n)))?Im(e,ea(t),n,r,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),Pm(e,t,n,o))};function vw(e,t,a,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Lm(t)&&ot(a));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const l=e.tagName;if(l==="IMG"||l==="VIDEO"||l==="CANVAS"||l==="SOURCE")return!1}return Lm(t)&&Mt(a)?!1:t in e}function hw(e,t){const a=e._def.props;if(!a)return!1;const n=ea(t);return Array.isArray(a)?a.some(l=>ea(l)===n):Object.keys(a).some(l=>ea(l)===n)}const Fy=new WeakMap,Vy=new WeakMap,Ni=Symbol("_moveCb"),Nm=Symbol("_enterCb"),gw=e=>(delete e.props.mode,e),yw=gw({name:"TransitionGroup",props:zt({},Xk,{tag:String,moveClass:String}),setup(e,{slots:t}){const a=kn(),n=ek();let l,r;return yf(()=>{if(!l.length)return;const o=e.moveClass||`${e.name||"v"}-move`;if(!ww(l[0].el,a.vnode.el,o)){l=[];return}l.forEach(_w),l.forEach(xw);const i=l.filter(kw);wc(a.vnode.el),i.forEach(u=>{const c=u.el,d=c.style;nn(c,o),d.transform=d.webkitTransform=d.transitionDuration="";const p=c[Ni]=v=>{v&&v.target!==c||(!v||v.propertyName.endsWith("transform"))&&(c.removeEventListener("transitionend",p),c[Ni]=null,yl(c,o))};c.addEventListener("transitionend",p)}),l=[]}),()=>{const o=gt(e),i=Qk(o);let u=o.tag||me;if(l=[],r)for(let c=0;c<r.length;c++){const d=r[c];d.el&&d.el instanceof Element&&(l.push(d),cs(d,vc(d,i,n,a)),Fy.set(d,zy(d.el)))}r=t.default?ny(t.default()):[];for(let c=0;c<r.length;c++){const d=r[c];d.key!=null&&cs(d,vc(d,i,n,a))}return M(u,null,r)}}}),bw=yw;function _w(e){const t=e.el;t[Ni]&&t[Ni](),t[Nm]&&t[Nm]()}function xw(e){Vy.set(e,zy(e.el))}function kw(e){const t=Fy.get(e),a=Vy.get(e),n=t.left-a.left,l=t.top-a.top;if(n||l){const r=e.el,o=r.style,i=r.getBoundingClientRect();let u=1,c=1;return r.offsetWidth&&(u=i.width/r.offsetWidth),r.offsetHeight&&(c=i.height/r.offsetHeight),(!Number.isFinite(u)||u===0)&&(u=1),(!Number.isFinite(c)||c===0)&&(c=1),Math.abs(u-1)<.01&&(u=1),Math.abs(c-1)<.01&&(c=1),o.transform=o.webkitTransform=`translate(${n/u}px,${l/c}px)`,o.transitionDuration="0s",e}}function zy(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function ww(e,t,a){const n=e.cloneNode(),l=e[to];l&&l.forEach(i=>{i.split(/\s+/).forEach(u=>u&&n.classList.remove(u))}),a.split(/\s+/).forEach(i=>i&&n.classList.add(i)),n.style.display="none";const r=t.nodeType===1?t:t.parentNode;r.appendChild(n);const{hasTransform:o}=Ny(n);return r.removeChild(n),o}const ao=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Xe(t)?a=>bi(t,a):t};function $w(e){e.target.composing=!0}function Bm(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Fn=Symbol("_assign");function Fm(e,t,a){return t&&(e=e.trim()),a&&(e=mu(e)),e}const Ua={created(e,{modifiers:{lazy:t,trim:a,number:n}},l){e[Fn]=ao(l);const r=n||l.props&&l.props.type==="number";wl(e,t?"change":"input",o=>{o.target.composing||e[Fn](Fm(e.value,a,r))}),(a||r)&&wl(e,"change",()=>{e.value=Fm(e.value,a,r)}),t||(wl(e,"compositionstart",$w),wl(e,"compositionend",Bm),wl(e,"change",Bm))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:a,modifiers:{lazy:n,trim:l,number:r}},o){if(e[Fn]=ao(o),e.composing)return;const i=(r||e.type==="number")&&!/^0\d/.test(e.value)?mu(e.value):e.value,u=t??"";if(i===u)return;const c=e.getRootNode();(c instanceof Document||c instanceof ShadowRoot)&&c.activeElement===e&&e.type!=="range"&&(n&&t===a||l&&e.value.trim()===u)||(e.value=u)}},Cw={deep:!0,created(e,t,a){e[Fn]=ao(a),wl(e,"change",()=>{const n=e._modelValue,l=hs(e),r=e.checked,o=e[Fn];if(Xe(n)){const i=cf(n,l),u=i!==-1;if(r&&!u)o(n.concat(l));else if(!r&&u){const c=[...n];c.splice(i,1),o(c)}}else if(co(n)){const i=new Set(n);r?i.add(l):i.delete(l),o(i)}else o(jy(e,r))})},mounted:Vm,beforeUpdate(e,t,a){e[Fn]=ao(a),Vm(e,t,a)}};function Vm(e,{value:t,oldValue:a},n){e._modelValue=t;let l;if(Xe(t))l=cf(t,n.props.value)>-1;else if(co(t))l=t.has(n.props.value);else{if(t===a)return;l=fo(t,jy(e,!0))}e.checked!==l&&(e.checked=l)}const Sw={deep:!0,created(e,{value:t,modifiers:{number:a}},n){const l=co(t);wl(e,"change",()=>{const r=Array.prototype.filter.call(e.options,o=>o.selected).map(o=>a?mu(hs(o)):hs(o));e[Fn](e.multiple?l?new Set(r):r:r[0]),e._assigning=!0,Ge(()=>{e._assigning=!1})}),e[Fn]=ao(n)},mounted(e,{value:t}){zm(e,t)},beforeUpdate(e,t,a){e[Fn]=ao(a)},updated(e,{value:t}){e._assigning||zm(e,t)}};function zm(e,t){const a=e.multiple,n=Xe(t);if(!(a&&!n&&!co(t))){for(let l=0,r=e.options.length;l<r;l++){const o=e.options[l],i=hs(o);if(a)if(n){const u=typeof i;u==="string"||u==="number"?o.selected=t.some(c=>String(c)===String(i)):o.selected=cf(t,i)>-1}else o.selected=t.has(i);else if(fo(hs(o),t)){e.selectedIndex!==l&&(e.selectedIndex=l);return}}!a&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function hs(e){return"_value"in e?e._value:e.value}function jy(e,t){const a=t?"_trueValue":"_falseValue";return a in e?e[a]:t}const Ew=["ctrl","shift","alt","meta"],Aw={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Ew.some(a=>e[`${a}Key`]&&!t.includes(a))},mt=(e,t)=>{if(!e)return e;const a=e._withMods||(e._withMods={}),n=t.join(".");return a[n]||(a[n]=((l,...r)=>{for(let o=0;o<t.length;o++){const i=Aw[t[o]];if(i&&i(l,t))return}return e(l,...r)}))},Tw={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},gn=(e,t)=>{const a=e._withKeys||(e._withKeys={}),n=t.join(".");return a[n]||(a[n]=(l=>{if(!("key"in l))return;const r=Fl(l.key);if(t.some(o=>o===r||Tw[o]===r))return e(l)}))},Mw=zt({patchProp:mw},Zk);let jm;function Dw(){return jm||(jm=Dk(Mw))}const Ow=((...e)=>{const t=Dw().createApp(...e),{mount:a}=t;return t.mount=n=>{const l=Iw(n);if(!l)return;const r=t._component;!ot(r)&&!r.render&&!r.template&&(r.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const o=a(l,!1,Pw(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),o},t});function Pw(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Iw(e){return Mt(e)?document.querySelector(e):e}const qr=typeof document<"u";function Uy(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Rw(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Uy(e.default)}const xt=Object.assign;function hd(e,t){const a={};for(const n in t){const l=t[n];a[n]=Ya(l)?l.map(e):e(l)}return a}const as=()=>{},Ya=Array.isArray;function Um(e,t){const a={};for(const n in e)a[n]=n in t?t[n]:e[n];return a}const Hy=Symbol("");function no(e,t){return xt(new Error,{type:e,[Hy]:!0},t)}function ln(e,t){return e instanceof Error&&Hy in e&&(t==null||!!(e.type&t))}const wf=Symbol(""),Hm=Symbol(""),Eu=Symbol(""),$f=Symbol(""),$c=Symbol("");function wn(){return ct(Eu)}function ga(e){return ct($f)}const Ky=/#/g,qw=/&/g,Lw=/\//g,Nw=/=/g,Bw=/\?/g,Wy=/\+/g,Fw=/%5B/g,Vw=/%5D/g,Gy=/%5E/g,zw=/%60/g,Yy=/%7B/g,jw=/%7C/g,Jy=/%7D/g,Uw=/%20/g;function Cf(e){return e==null?"":encodeURI(""+e).replace(jw,"|").replace(Fw,"[").replace(Vw,"]")}function Hw(e){return Cf(e).replace(Yy,"{").replace(Jy,"}").replace(Gy,"^")}function Cc(e){return Cf(e).replace(Wy,"%2B").replace(Uw,"+").replace(Ky,"%23").replace(qw,"%26").replace(zw,"`").replace(Yy,"{").replace(Jy,"}").replace(Gy,"^")}function Kw(e){return Cc(e).replace(Nw,"%3D")}function Ww(e){return Cf(e).replace(Ky,"%23").replace(Bw,"%3F")}function Gw(e){return Ww(e).replace(Lw,"%2F")}function Bi(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Yw=/\/$/,Jw=e=>e.replace(Yw,"");function gd(e,t,a="/"){let n,l={},r="",o="";const i=t.indexOf("#");let u=t.indexOf("?");return u=i>=0&&u>i?-1:u,u>=0&&(n=t.slice(0,u),r=t.slice(u,i>0?i:t.length),l=e(r.slice(1))),i>=0&&(n=n||t.slice(0,i),o=t.slice(i,t.length)),n=e2(n??t,a),{fullPath:n+r+o,path:n,query:l,hash:Bi(o)}}function Zw(e,t){const a=t.query?e(t.query):"";return t.path+(a&&"?")+a+(t.hash||"")}function Km(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Xw(e,t,a){const n=t.matched.length-1,l=a.matched.length-1;return n>-1&&n===l&&lo(t.matched[n],a.matched[l])&&Zy(t.params,a.params)&&e(t.query)===e(a.query)&&t.hash===a.hash}function lo(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Zy(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var a in e)if(!Qw(e[a],t[a]))return!1;return!0}function Qw(e,t){return Ya(e)?Wm(e,t):Ya(t)?Wm(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function Wm(e,t){return Ya(t)?e.length===t.length&&e.every((a,n)=>a===t[n]):e.length===1&&e[0]===t}function e2(e,t){if(e.startsWith("/"))return e;if(!e)return t;const a=t.split("/"),n=e.split("/"),l=n[n.length-1];(l===".."||l===".")&&n.push("");let r=a.length-1,o,i;for(o=0;o<n.length;o++)if(i=n[o],i!==".")if(i==="..")r>1&&r--;else break;return a.slice(0,r).join("/")+"/"+n.slice(o).join("/")}const pl={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};function t2(e){if(!e)if(qr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Jw(e)}const a2=/^[^#]+#/;function n2(e,t){return e.replace(a2,"#")+t}function l2(e,t){const a=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{behavior:t.behavior,left:n.left-a.left-(t.left||0),top:n.top-a.top-(t.top||0)}}const Au=()=>({left:window.scrollX,top:window.scrollY});function r2(e){let t;if("el"in e){const a=e.el,n=typeof a=="string"&&a.startsWith("#"),l=typeof a=="string"?n?document.getElementById(a.slice(1)):document.querySelector(a):a;if(!l)return;t=l2(l,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Gm(e,t){return(history.state?history.state.position-t:-1)+e}const Sc=new Map;function o2(e,t){Sc.set(e,t)}function s2(e){const t=Sc.get(e);return Sc.delete(e),t}function i2(e){return typeof e=="string"||e&&typeof e=="object"}function Xy(e){return typeof e=="string"||typeof e=="symbol"}function u2(e){const t={};if(e===""||e==="?")return t;const a=(e[0]==="?"?e.slice(1):e).split("&");for(let n=0;n<a.length;++n){const l=a[n].replace(Wy," "),r=l.indexOf("="),o=Bi(r<0?l:l.slice(0,r)),i=r<0?null:Bi(l.slice(r+1));if(o in t){let u=t[o];Ya(u)||(u=t[o]=[u]),u.push(i)}else t[o]=i}return t}function Ym(e){let t="";for(let a in e){const n=e[a];if(a=Kw(a),n==null){n!==void 0&&(t+=(t.length?"&":"")+a);continue}(Ya(n)?n.map(l=>l&&Cc(l)):[n&&Cc(n)]).forEach(l=>{l!==void 0&&(t+=(t.length?"&":"")+a,l!=null&&(t+="="+l))})}return t}function d2(e){const t={};for(const a in e){const n=e[a];n!==void 0&&(t[a]=Ya(n)?n.map(l=>l==null?null:""+l):n==null?n:""+n)}return t}function Do(){let e=[];function t(n){return e.push(n),()=>{const l=e.indexOf(n);l>-1&&e.splice(l,1)}}function a(){e=[]}return{add:t,list:()=>e.slice(),reset:a}}function Qy(e,t,a){const n=e.value;if(!n)return;let l=n;const r=()=>{l[t].delete(a)};Qn(r),sy(r),oy(()=>{const o=e.value;o&&(l=o),l[t].add(a)}),l[t].add(a)}function eb(e){Qy(ct(wf,{}),"leaveGuards",e)}function c2(e){Qy(ct(wf,{}),"updateGuards",e)}function xl(e,t,a,n,l,r=o=>o()){const o=n&&(n.enterCallbacks[l]=n.enterCallbacks[l]||[]);return()=>new Promise((i,u)=>{const c=v=>{v===!1?u(no(4,{from:a,to:t})):v instanceof Error?u(v):i2(v)?u(no(2,{from:t,to:v})):(o&&n.enterCallbacks[l]===o&&typeof v=="function"&&o.push(v),i())},d=r(()=>e.call(n&&n.instances[l],t,a,c));let p=Promise.resolve(d);e.length<3&&(p=p.then(c)),p.catch(v=>u(v))})}function yd(e,t,a,n,l=r=>r()){const r=[];for(const o of e)for(const i in o.components){let u=o.components[i];if(!(t!=="beforeRouteEnter"&&!o.instances[i]))if(Uy(u)){const c=(u.__vccOpts||u)[t];c&&r.push(xl(c,a,n,o,i,l))}else{let c=u();r.push(()=>c.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${i}" at "${o.path}"`);const p=Rw(d)?d.default:d;o.mods[i]=d,o.components[i]=p;const v=(p.__vccOpts||p)[t];return v&&xl(v,a,n,o,i,l)()}))}}return r}function f2(e,t){const a=[],n=[],l=[],r=Math.max(t.matched.length,e.matched.length);for(let o=0;o<r;o++){const i=t.matched[o];i&&(e.matched.find(c=>lo(c,i))?n.push(i):a.push(i));const u=e.matched[o];u&&(t.matched.find(c=>lo(c,u))||l.push(u))}return[a,n,l]}let p2=()=>location.protocol+"//"+location.host;function tb(e,t){const{pathname:a,search:n,hash:l}=t,r=e.indexOf("#");if(r>-1){let o=l.includes(e.slice(r))?e.slice(r).length:1,i=l.slice(o);return i[0]!=="/"&&(i="/"+i),Km(i,"")}return Km(a,e)+n+l}function m2(e,t,a,n){let l=[],r=[],o=null;const i=({state:v})=>{const m=tb(e,location),y=a.value,x=t.value;let C=0;if(v){if(a.value=m,t.value=v,o&&o===y){o=null;return}C=x?v.position-x.position:0}else n(m);l.forEach(w=>{w(a.value,y,{delta:C,type:"pop",direction:C?C>0?"forward":"back":""})})};function u(){o=a.value}function c(v){l.push(v);const m=()=>{const y=l.indexOf(v);y>-1&&l.splice(y,1)};return r.push(m),m}function d(){if(document.visibilityState==="hidden"){const{history:v}=window;if(!v.state)return;v.replaceState(xt({},v.state,{scroll:Au()}),"")}}function p(){for(const v of r)v();r=[],window.removeEventListener("popstate",i),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",i),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:u,listen:c,destroy:p}}function Jm(e,t,a,n=!1,l=!1){return{back:e,current:t,forward:a,replaced:n,position:window.history.length,scroll:l?Au():null}}function v2(e){const{history:t,location:a}=window,n={value:tb(e,a)},l={value:t.state};l.value||r(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(u,c,d){const p=e.indexOf("#"),v=p>-1?(a.host&&document.querySelector("base")?e:e.slice(p))+u:p2()+e+u;try{t[d?"replaceState":"pushState"](c,"",v),l.value=c}catch(m){console.error(m),a[d?"replace":"assign"](v)}}function o(u,c){r(u,xt({},t.state,Jm(l.value.back,u,l.value.forward,!0),c,{position:l.value.position}),!0),n.value=u}function i(u,c){const d=xt({},l.value,t.state,{forward:u,scroll:Au()});r(d.current,d,!0),r(u,xt({},Jm(n.value,u,null),{position:d.position+1},c),!1),n.value=u}return{location:n,state:l,push:i,replace:o}}function h2(e){e=t2(e);const t=v2(e),a=m2(e,t.state,t.location,t.replace);function n(r,o=!0){o||a.pauseListeners(),history.go(r)}const l=xt({location:"",base:e,go:n,createHref:n2.bind(null,e)},t,a);return Object.defineProperty(l,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(l,"state",{enumerable:!0,get:()=>t.state.value}),l}const g2={type:0,value:""},y2=/[a-zA-Z0-9_]/;function b2(e){if(!e)return[[]];if(e==="/")return[[g2]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${a})/"${c}": ${m}`)}let a=0,n=a;const l=[];let r;function o(){r&&l.push(r),r=[]}let i=0,u,c="",d="";function p(){c&&(a===0?r.push({type:0,value:c}):a===1||a===2||a===3?(r.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),r.push({type:1,value:c,regexp:d,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),c="")}function v(){c+=u}for(;i<e.length;)switch(u=e[i++],a){case 0:u==="\\"?(n=a,a=4):u==="/"?(c&&p(),o()):u===":"?(p(),a=1):v();break;case 4:v(),a=n;break;case 1:u==="("?a=2:y2.test(u)?v():(p(),a=0,u!=="*"&&u!=="?"&&u!=="+"&&i--);break;case 2:u===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+u:a=3:d+=u;break;case 3:p(),a=0,u!=="*"&&u!=="?"&&u!=="+"&&i--,d="";break;default:t("Unknown state");break}return a===2&&t(`Unfinished custom RegExp for param "${c}"`),p(),o(),l}const Zm="[^/]+?",_2={sensitive:!1,strict:!1,start:!0,end:!0},x2=/[.+*?^${}()[\]/\\]/g;function k2(e,t){const a=xt({},_2,t),n=[];let l=a.start?"^":"";const r=[];for(const c of e){const d=c.length?[]:[90];a.strict&&!c.length&&(l+="/");for(let p=0;p<c.length;p++){const v=c[p];let m=40+(a.sensitive?.25:0);if(v.type===0)p||(l+="/"),l+=v.value.replace(x2,"\\$&"),m+=40;else if(v.type===1){const{value:y,repeatable:x,optional:C,regexp:w}=v;r.push({name:y,repeatable:x,optional:C});const S=w||Zm;if(S!==Zm){m+=10;try{new RegExp(`(${S})`)}catch(O){throw new Error(`Invalid custom RegExp for param "${y}" (${S}): `+O.message)}}let q=x?`((?:${S})(?:/(?:${S}))*)`:`(${S})`;p||(q=C&&c.length<2?`(?:/${q})`:"/"+q),C&&(q+="?"),l+=q,m+=20,C&&(m+=-8),x&&(m+=-20),S===".*"&&(m+=-50)}d.push(m)}n.push(d)}if(a.strict&&a.end){const c=n.length-1;n[c][n[c].length-1]+=.7000000000000001}a.strict||(l+="/?"),a.end?l+="$":a.strict&&!l.endsWith("/")&&(l+="(?:/|$)");const o=new RegExp(l,a.sensitive?"":"i");function i(c){const d=c.match(o),p={};if(!d)return null;for(let v=1;v<d.length;v++){const m=d[v]||"",y=r[v-1];p[y.name]=m&&y.repeatable?m.split("/"):m}return p}function u(c){let d="",p=!1;for(const v of e){(!p||!d.endsWith("/"))&&(d+="/"),p=!1;for(const m of v)if(m.type===0)d+=m.value;else if(m.type===1){const{value:y,repeatable:x,optional:C}=m,w=y in c?c[y]:"";if(Ya(w)&&!x)throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);const S=Ya(w)?w.join("/"):w;if(!S)if(C)v.length<2&&(d.endsWith("/")?d=d.slice(0,-1):p=!0);else throw new Error(`Missing required param "${y}"`);d+=S}}return d||"/"}return{re:o,score:n,keys:r,parse:i,stringify:u}}function w2(e,t){let a=0;for(;a<e.length&&a<t.length;){const n=t[a]-e[a];if(n)return n;a++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function ab(e,t){let a=0;const n=e.score,l=t.score;for(;a<n.length&&a<l.length;){const r=w2(n[a],l[a]);if(r)return r;a++}if(Math.abs(l.length-n.length)===1){if(Xm(n))return 1;if(Xm(l))return-1}return l.length-n.length}function Xm(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const $2={strict:!1,end:!0,sensitive:!1};function C2(e,t,a){const n=k2(b2(e.path),a),l=xt(n,{record:e,parent:t,children:[],alias:[]});return t&&!l.record.aliasOf==!t.record.aliasOf&&t.children.push(l),l}function S2(e,t){const a=[],n=new Map;t=Um($2,t);function l(p){return n.get(p)}function r(p,v,m){const y=!m,x=ev(p);x.aliasOf=m&&m.record;const C=Um(t,p),w=[x];if("alias"in p){const O=typeof p.alias=="string"?[p.alias]:p.alias;for(const I of O)w.push(ev(xt({},x,{components:m?m.record.components:x.components,path:I,aliasOf:m?m.record:x})))}let S,q;for(const O of w){const{path:I}=O;if(v&&I[0]!=="/"){const B=v.record.path,L=B[B.length-1]==="/"?"":"/";O.path=v.record.path+(I&&L+I)}if(S=C2(O,v,C),m?m.alias.push(S):(q=q||S,q!==S&&q.alias.push(S),y&&p.name&&!tv(S)&&o(p.name)),nb(S)&&u(S),x.children){const B=x.children;for(let L=0;L<B.length;L++)r(B[L],S,m&&m.children[L])}m=m||S}return q?()=>{o(q)}:as}function o(p){if(Xy(p)){const v=n.get(p);v&&(n.delete(p),a.splice(a.indexOf(v),1),v.children.forEach(o),v.alias.forEach(o))}else{const v=a.indexOf(p);v>-1&&(a.splice(v,1),p.record.name&&n.delete(p.record.name),p.children.forEach(o),p.alias.forEach(o))}}function i(){return a}function u(p){const v=T2(p,a);a.splice(v,0,p),p.record.name&&!tv(p)&&n.set(p.record.name,p)}function c(p,v){let m,y={},x,C;if("name"in p&&p.name){if(m=n.get(p.name),!m)throw no(1,{location:p});C=m.record.name,y=xt(Qm(v.params,m.keys.filter(q=>!q.optional).concat(m.parent?m.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),p.params&&Qm(p.params,m.keys.map(q=>q.name))),x=m.stringify(y)}else if(p.path!=null)x=p.path,m=a.find(q=>q.re.test(x)),m&&(y=m.parse(x),C=m.record.name,m.keys.forEach(q=>{q.optional&&!y[q.name]&&delete y[q.name]}));else{if(m=v.name?n.get(v.name):a.find(q=>q.re.test(v.path)),!m)throw no(1,{location:p,currentLocation:v});C=m.record.name,y=xt({},v.params,p.params),x=m.stringify(y)}const w=[];let S=m;for(;S;)w.unshift(S.record),S=S.parent;return{name:C,path:x,params:y,matched:w,meta:A2(w)}}e.forEach(p=>r(p));function d(){a.length=0,n.clear()}return{addRoute:r,resolve:c,removeRoute:o,clearRoutes:d,getRoutes:i,getRecordMatcher:l}}function Qm(e,t){const a={};for(const n of t)n in e&&(a[n]=e[n]);return a}function ev(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:E2(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function E2(e){const t={},a=e.props||!1;if("component"in e)t.default=a;else for(const n in e.components)t[n]=typeof a=="object"?a[n]:a;return t}function tv(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function A2(e){return e.reduce((t,a)=>xt(t,a.meta),{})}function T2(e,t){let a=0,n=t.length;for(;a!==n;){const r=a+n>>1;ab(e,t[r])<0?n=r:a=r+1}const l=M2(e);return l&&(n=t.lastIndexOf(l,n-1)),n}function M2(e){let t=e;for(;t=t.parent;)if(nb(t)&&ab(e,t)===0)return t}function nb({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function av(e){const t=ct(Eu),a=ct($f),n=k(()=>{const u=s(e.to);return t.resolve(u)}),l=k(()=>{const{matched:u}=n.value,{length:c}=u,d=u[c-1],p=a.matched;if(!d||!p.length)return-1;const v=p.findIndex(lo.bind(null,d));if(v>-1)return v;const m=nv(u[c-2]);return c>1&&nv(d)===m&&p[p.length-1].path!==m?p.findIndex(lo.bind(null,u[c-2])):v}),r=k(()=>l.value>-1&&P2(a.params,n.value.params)),o=k(()=>l.value>-1&&l.value===a.matched.length-1&&Zy(a.params,n.value.params));function i(u={}){if(O2(u)){const c=t[s(e.replace)?"replace":"push"](s(e.to)).catch(as);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:n,href:k(()=>n.value.href),isActive:r,isExactActive:o,navigate:i}}function D2(e){return e.length===1?e[0]:e}const Sa=ae({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:av,setup(e,{slots:t}){const a=Ka(av(e)),{options:n}=ct(Eu),l=k(()=>({[lv(e.activeClass,n.linkActiveClass,"router-link-active")]:a.isActive,[lv(e.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:a.isExactActive}));return()=>{const r=t.default&&D2(t.default(a));return e.custom?r:qa("a",{"aria-current":a.isExactActive?e.ariaCurrentValue:null,href:a.href,onClick:a.navigate,class:l.value},r)}}});function O2(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function P2(e,t){for(const a in t){const n=t[a],l=e[a];if(typeof n=="string"){if(n!==l)return!1}else if(!Ya(l)||l.length!==n.length||n.some((r,o)=>r.valueOf()!==l[o].valueOf()))return!1}return!0}function nv(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const lv=(e,t,a)=>e??t??a,I2=ae({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:a}){const n=ct($c),l=k(()=>e.route||n.value),r=ct(Hm,0),o=k(()=>{let c=s(r);const{matched:d}=l.value;let p;for(;(p=d[c])&&!p.components;)c++;return c}),i=k(()=>l.value.matched[o.value]);yt(Hm,k(()=>o.value+1)),yt(wf,i),yt($c,l);const u=E();return ze(()=>[u.value,i.value,e.name],([c,d,p],[v,m,y])=>{d&&(d.instances[p]=c,m&&m!==d&&c&&c===v&&(d.leaveGuards.size||(d.leaveGuards=m.leaveGuards),d.updateGuards.size||(d.updateGuards=m.updateGuards))),c&&d&&(!m||!lo(d,m)||!v)&&(d.enterCallbacks[p]||[]).forEach(x=>x(c))},{flush:"post"}),()=>{const c=l.value,d=e.name,p=i.value,v=p&&p.components[d];if(!v)return rv(a.default,{Component:v,route:c});const m=p.props[d],y=m?m===!0?c.params:typeof m=="function"?m(c):m:null,C=qa(v,xt({},y,t,{onVnodeUnmounted:w=>{w.component.isUnmounted&&(p.instances[d]=null)},ref:u}));return rv(a.default,{Component:C,route:c})||C}}});function rv(e,t){if(!e)return null;const a=e(t);return a.length===1?a[0]:a}const Ec=I2;function R2(e){const t=S2(e.routes,e),a=e.parseQuery||u2,n=e.stringifyQuery||Ym,l=e.history,r=Do(),o=Do(),i=Do(),u=pr(pl);let c=pl;qr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=hd.bind(null,Z=>""+Z),p=hd.bind(null,Gw),v=hd.bind(null,Bi);function m(Z,he){let J,ee;return Xy(Z)?(J=t.getRecordMatcher(Z),ee=he):ee=Z,t.addRoute(ee,J)}function y(Z){const he=t.getRecordMatcher(Z);he&&t.removeRoute(he)}function x(){return t.getRoutes().map(Z=>Z.record)}function C(Z){return!!t.getRecordMatcher(Z)}function w(Z,he){if(he=xt({},he||u.value),typeof Z=="string"){const U=gd(a,Z,he.path),ce=t.resolve({path:U.path},he),X=l.createHref(U.fullPath);return xt(U,ce,{params:v(ce.params),redirectedFrom:void 0,href:X})}let J;if(Z.path!=null)J=xt({},Z,{path:gd(a,Z.path,he.path).path});else{const U=xt({},Z.params);for(const ce in U)U[ce]==null&&delete U[ce];J=xt({},Z,{params:p(U)}),he.params=p(he.params)}const ee=t.resolve(J,he),te=Z.hash||"";ee.params=d(v(ee.params));const $=Zw(n,xt({},Z,{hash:Hw(te),path:ee.path})),P=l.createHref($);return xt({fullPath:$,hash:te,query:n===Ym?d2(Z.query):Z.query||{}},ee,{redirectedFrom:void 0,href:P})}function S(Z){return typeof Z=="string"?gd(a,Z,u.value.path):xt({},Z)}function q(Z,he){if(c!==Z)return no(8,{from:he,to:Z})}function O(Z){return L(Z)}function I(Z){return O(xt(S(Z),{replace:!0}))}function B(Z,he){const J=Z.matched[Z.matched.length-1];if(J&&J.redirect){const{redirect:ee}=J;let te=typeof ee=="function"?ee(Z,he):ee;return typeof te=="string"&&(te=te.includes("?")||te.includes("#")?te=S(te):{path:te},te.params={}),xt({query:Z.query,hash:Z.hash,params:te.path!=null?{}:Z.params},te)}}function L(Z,he){const J=c=w(Z),ee=u.value,te=Z.state,$=Z.force,P=Z.replace===!0,U=B(J,ee);if(U)return L(xt(S(U),{state:typeof U=="object"?xt({},te,U.state):te,force:$,replace:P}),he||J);const ce=J;ce.redirectedFrom=he;let X;return!$&&Xw(n,ee,J)&&(X=no(16,{to:ce,from:ee}),xe(ee,ee,!0,!1)),(X?Promise.resolve(X):R(ce,ee)).catch(oe=>ln(oe)?ln(oe,2)?oe:_e(oe):ie(oe,ce,ee)).then(oe=>{if(oe){if(ln(oe,2))return L(xt({replace:P},S(oe.to),{state:typeof oe.to=="object"?xt({},te,oe.to.state):te,force:$}),he||ce)}else oe=A(ce,ee,!0,P,te);return G(ce,ee,oe),oe})}function W(Z,he){const J=q(Z,he);return J?Promise.reject(J):Promise.resolve()}function T(Z){const he=F.values().next().value;return he&&typeof he.runWithContext=="function"?he.runWithContext(Z):Z()}function R(Z,he){let J;const[ee,te,$]=f2(Z,he);J=yd(ee.reverse(),"beforeRouteLeave",Z,he);for(const U of ee)U.leaveGuards.forEach(ce=>{J.push(xl(ce,Z,he))});const P=W.bind(null,Z,he);return J.push(P),ve(J).then(()=>{J=[];for(const U of r.list())J.push(xl(U,Z,he));return J.push(P),ve(J)}).then(()=>{J=yd(te,"beforeRouteUpdate",Z,he);for(const U of te)U.updateGuards.forEach(ce=>{J.push(xl(ce,Z,he))});return J.push(P),ve(J)}).then(()=>{J=[];for(const U of $)if(U.beforeEnter)if(Ya(U.beforeEnter))for(const ce of U.beforeEnter)J.push(xl(ce,Z,he));else J.push(xl(U.beforeEnter,Z,he));return J.push(P),ve(J)}).then(()=>(Z.matched.forEach(U=>U.enterCallbacks={}),J=yd($,"beforeRouteEnter",Z,he,T),J.push(P),ve(J))).then(()=>{J=[];for(const U of o.list())J.push(xl(U,Z,he));return J.push(P),ve(J)}).catch(U=>ln(U,8)?U:Promise.reject(U))}function G(Z,he,J){i.list().forEach(ee=>T(()=>ee(Z,he,J)))}function A(Z,he,J,ee,te){const $=q(Z,he);if($)return $;const P=he===pl,U=qr?history.state:{};J&&(ee||P?l.replace(Z.fullPath,xt({scroll:P&&U&&U.scroll},te)):l.push(Z.fullPath,te)),u.value=Z,xe(Z,he,J,P),_e()}let D;function z(){D||(D=l.listen((Z,he,J)=>{if(!de.listening)return;const ee=w(Z),te=B(ee,de.currentRoute.value);if(te){L(xt(te,{replace:!0,force:!0}),ee).catch(as);return}c=ee;const $=u.value;qr&&o2(Gm($.fullPath,J.delta),Au()),R(ee,$).catch(P=>ln(P,12)?P:ln(P,2)?(L(xt(S(P.to),{force:!0}),ee).then(U=>{ln(U,20)&&!J.delta&&J.type==="pop"&&l.go(-1,!1)}).catch(as),Promise.reject()):(J.delta&&l.go(-J.delta,!1),ie(P,ee,$))).then(P=>{P=P||A(ee,$,!1),P&&(J.delta&&!ln(P,8)?l.go(-J.delta,!1):J.type==="pop"&&ln(P,20)&&l.go(-1,!1)),G(ee,$,P)}).catch(as)}))}let V=Do(),K=Do(),re;function ie(Z,he,J){_e(Z);const ee=K.list();return ee.length?ee.forEach(te=>te(Z,he,J)):console.error(Z),Promise.reject(Z)}function Ae(){return re&&u.value!==pl?Promise.resolve():new Promise((Z,he)=>{V.add([Z,he])})}function _e(Z){return re||(re=!Z,z(),V.list().forEach(([he,J])=>Z?J(Z):he()),V.reset()),Z}function xe(Z,he,J,ee){const{scrollBehavior:te}=e;if(!qr||!te)return Promise.resolve();const $=!J&&s2(Gm(Z.fullPath,0))||(ee||!J)&&history.state&&history.state.scroll||null;return Ge().then(()=>te(Z,he,$)).then(P=>P&&r2(P)).catch(P=>ie(P,Z,he))}const ne=Z=>l.go(Z);let fe;const F=new Set,de={currentRoute:u,listening:!0,addRoute:m,removeRoute:y,clearRoutes:t.clearRoutes,hasRoute:C,getRoutes:x,resolve:w,options:e,push:O,replace:I,go:ne,back:()=>ne(-1),forward:()=>ne(1),beforeEach:r.add,beforeResolve:o.add,afterEach:i.add,onError:K.add,isReady:Ae,install(Z){Z.component("RouterLink",Sa),Z.component("RouterView",Ec),Z.config.globalProperties.$router=de,Object.defineProperty(Z.config.globalProperties,"$route",{enumerable:!0,get:()=>s(u)}),qr&&!fe&&u.value===pl&&(fe=!0,O(l.location).catch(ee=>{}));const he={};for(const ee in pl)Object.defineProperty(he,ee,{get:()=>u.value[ee],enumerable:!0});Z.provide(Eu,de),Z.provide($f,Hg(he)),Z.provide($c,u);const J=Z.unmount;F.add(Z),Z.unmount=function(){F.delete(Z),F.size<1&&(c=pl,D&&D(),D=null,u.value=pl,fe=!1,re=!1),J()}}};function ve(Z){return Z.reduce((he,J)=>he.then(()=>T(J)),Promise.resolve())}return de}const q2=/^[A-Za-z0-9_-]+$/;function Tu(e){const t=e.split(".");if(t.length!==3||!t.every(r=>q2.test(r)))return null;const[a,n,l]=t;return{vendor:a,plugin:n,controller:l}}function Ja(e){const t=Tu(e);return t?`/${t.vendor}/${t.plugin}/${t.controller}`:null}function Os(e){return`${e.vendor}.${e.plugin}.${e.controller}`}function po(e){const t=e.replace(/^\/+|\/+$/g,"").split("/");if(t.length<3)return null;const a=t.slice(0,3).join(".");return Tu(a)?a:null}function ov(e){const t=Tu(e);return t?`${t.vendor}.${t.plugin}`:null}const L2=/\{[^{}]+\}/g,N2=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function B2(){return Math.random().toString(36).slice(2,11)}function F2(e){let{baseUrl:t="",Request:a=globalThis.Request,fetch:n=globalThis.fetch,querySerializer:l,bodySerializer:r,pathSerializer:o,headers:i,requestInitExt:u=void 0,...c}={...e};u=N2()?u:void 0,t=uv(t);const d=[];async function p(v,m){const{baseUrl:y,fetch:x=n,Request:C=a,headers:w,params:S={},parseAs:q="json",querySerializer:O,bodySerializer:I=r??z2,pathSerializer:B,body:L,middleware:W=[],...T}=m||{};let R=t;y&&(R=uv(y)??t);let G=typeof l=="function"?l:sv(l);O&&(G=typeof O=="function"?O:sv({...typeof l=="object"?l:{},...O}));const A=B||o||V2,D=L===void 0?void 0:I(L,iv(i,w,S.header)),z=iv(D===void 0||D instanceof FormData?{}:{"Content-Type":"application/json"},i,w,S.header),V=[...d,...W],K={redirect:"follow",...c,...T,body:D,headers:z};let re,ie,Ae=new C(j2(v,{baseUrl:R,params:S,querySerializer:G,pathSerializer:A}),K),_e;for(const fe in T)fe in Ae||(Ae[fe]=T[fe]);if(V.length){re=B2(),ie=Object.freeze({baseUrl:R,fetch:x,parseAs:q,querySerializer:G,bodySerializer:I,pathSerializer:A});for(const fe of V)if(fe&&typeof fe=="object"&&typeof fe.onRequest=="function"){const F=await fe.onRequest({request:Ae,schemaPath:v,params:S,options:ie,id:re});if(F)if(F instanceof C)Ae=F;else if(F instanceof Response){_e=F;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!_e){try{_e=await x(Ae,u)}catch(fe){let F=fe;if(V.length)for(let de=V.length-1;de>=0;de--){const ve=V[de];if(ve&&typeof ve=="object"&&typeof ve.onError=="function"){const Z=await ve.onError({request:Ae,error:F,schemaPath:v,params:S,options:ie,id:re});if(Z){if(Z instanceof Response){F=void 0,_e=Z;break}if(Z instanceof Error){F=Z;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(F)throw F}if(V.length)for(let fe=V.length-1;fe>=0;fe--){const F=V[fe];if(F&&typeof F=="object"&&typeof F.onResponse=="function"){const de=await F.onResponse({request:Ae,response:_e,schemaPath:v,params:S,options:ie,id:re});if(de){if(!(de instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");_e=de}}}}const xe=_e.headers.get("Content-Length");if(_e.status===204||Ae.method==="HEAD"||xe==="0"&&!_e.headers.get("Transfer-Encoding")?.includes("chunked"))return _e.ok?{data:void 0,response:_e}:{error:void 0,response:_e};if(_e.ok)return{data:await(async()=>{if(q==="stream")return _e.body;if(q==="json"&&!xe){const F=await _e.text();return F?JSON.parse(F):void 0}return await _e[q]()})(),response:_e};let ne=await _e.text();try{ne=JSON.parse(ne)}catch{}return{error:ne,response:_e}}return{request(v,m,y){return p(m,{...y,method:v.toUpperCase()})},GET(v,m){return p(v,{...m,method:"GET"})},PUT(v,m){return p(v,{...m,method:"PUT"})},POST(v,m){return p(v,{...m,method:"POST"})},DELETE(v,m){return p(v,{...m,method:"DELETE"})},OPTIONS(v,m){return p(v,{...m,method:"OPTIONS"})},HEAD(v,m){return p(v,{...m,method:"HEAD"})},PATCH(v,m){return p(v,{...m,method:"PATCH"})},TRACE(v,m){return p(v,{...m,method:"TRACE"})},use(...v){for(const m of v)if(m){if(typeof m!="object"||!("onRequest"in m||"onResponse"in m||"onError"in m))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");d.push(m)}},eject(...v){for(const m of v){const y=d.indexOf(m);y!==-1&&d.splice(y,1)}}}}function Mu(e,t,a){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${a?.allowReserved===!0?t:encodeURIComponent(t)}`}function lb(e,t,a){if(!t||typeof t!="object")return"";const n=[],l={simple:",",label:".",matrix:";"}[a.style]||"&";if(a.style!=="deepObject"&&a.explode===!1){for(const i in t)n.push(i,a.allowReserved===!0?t[i]:encodeURIComponent(t[i]));const o=n.join(",");switch(a.style){case"form":return`${e}=${o}`;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return o}}for(const o in t){const i=a.style==="deepObject"?`${e}[${o}]`:o;n.push(Mu(i,t[o],a))}const r=n.join(l);return a.style==="label"||a.style==="matrix"?`${l}${r}`:r}function rb(e,t,a){if(!Array.isArray(t))return"";if(a.explode===!1){const r={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[a.style]||",",o=(a.allowReserved===!0?t:t.map(i=>encodeURIComponent(i))).join(r);switch(a.style){case"simple":return o;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return`${e}=${o}`}}const n={simple:",",label:".",matrix:";"}[a.style]||"&",l=[];for(const r of t)a.style==="simple"||a.style==="label"?l.push(a.allowReserved===!0?r:encodeURIComponent(r)):l.push(Mu(e,r,a));return a.style==="label"||a.style==="matrix"?`${n}${l.join(n)}`:l.join(n)}function sv(e){return function(a){const n=[];if(a&&typeof a=="object")for(const l in a){const r=a[l];if(r!=null){if(Array.isArray(r)){if(r.length===0)continue;n.push(rb(l,r,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof r=="object"){n.push(lb(l,r,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(Mu(l,r,e))}}return n.join("&")}}function V2(e,t){let a=e;for(const n of e.match(L2)??[]){let l=n.substring(1,n.length-1),r=!1,o="simple";if(l.endsWith("*")&&(r=!0,l=l.substring(0,l.length-1)),l.startsWith(".")?(o="label",l=l.substring(1)):l.startsWith(";")&&(o="matrix",l=l.substring(1)),!t||t[l]===void 0||t[l]===null)continue;const i=t[l];if(Array.isArray(i)){a=a.replace(n,rb(l,i,{style:o,explode:r}));continue}if(typeof i=="object"){a=a.replace(n,lb(l,i,{style:o,explode:r}));continue}if(o==="matrix"){a=a.replace(n,`;${Mu(l,i)}`);continue}a=a.replace(n,o==="label"?`.${encodeURIComponent(i)}`:encodeURIComponent(i))}return a}function z2(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function j2(e,t){let a=`${t.baseUrl}${e}`;t.params?.path&&(a=t.pathSerializer(a,t.params.path));let n=t.querySerializer(t.params.query??{});return n.startsWith("?")&&(n=n.substring(1)),n&&(a+=`?${n}`),a}function iv(...e){const t=new Headers;for(const a of e){if(!a||typeof a!="object")continue;const n=a instanceof Headers?a.entries():Object.entries(a);for(const[l,r]of n)if(r===null)t.delete(l);else if(Array.isArray(r))for(const o of r)t.append(l,o);else r!==void 0&&t.set(l,r)}return t}function uv(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const dv="/backend",U2="__SUMMER_ADMIN_BASE__",H2="__SUMMER_ADMIN_BUILD__",K2=/^[0-9a-f]{6,64}$/;function W2(e=document){const t=e.querySelector('meta[name="summer-admin-base"]')?.content.trim()??"";if(t===""||t===U2||!t.startsWith("/"))return dv;const a=t.replace(/\/+$/,"");return a===""?dv:a}function G2(e=document){const t=e.querySelector('meta[name="summer-admin-build"]')?.content.trim()??"";return t===H2||!K2.test(t)?"":t}const cv=W2(),mr={base:cv,api:`${cv}/api/v1`,build:G2()},ob="XMLHttpRequest";let Fi=null,sb=null,Oo=null;const bd=new WeakMap;function Y2(e){Fi=e}function J2(){Fi?.()}function Z2(e){sb=e}function X2(e){return new URL(e.url,"http://local").pathname}function fv(e){const t=X2(e);return t.endsWith("/auth/login")||t.endsWith("/auth/refresh")}function Sf(){return Oo||(Oo=(async()=>{try{const{data:e,response:t}=await Le.POST("/auth/refresh");if(!t.ok||!e)return!1;const a=e.data.expires_in;return sb?.(typeof a=="number"?a:null),!0}catch{return!1}finally{Oo=null}})(),Oo)}const Q2={onRequest({request:e}){return e.headers.set("X-Requested-With",ob),fv(e)||bd.set(e,e.clone()),e},async onResponse({request:e,response:t}){if(t.status!==401||fv(e))return t;const a=bd.get(e);if(bd.delete(e),!a||!await Sf())return Fi?.(),t;const n=await globalThis.fetch(a);return n.status===401&&Fi?.(),n}},Le=F2({baseUrl:mr.api,credentials:"same-origin",fetch:e=>globalThis.fetch(e)});Le.use(Q2);const Ef=E({}),Af=E(typeof document>"u"?"pl":document.documentElement.lang||"pl"),Na=At(Af),ib=E([]),e$=At(ib);function t$(e,t){Ef.value=e,t&&(Af.value=t,typeof document<"u"&&(document.documentElement.lang=t))}async function ub(e){const{data:t,response:a}=await Le.GET("/lang",e?{params:{query:{locale:e}}}:{});!a.ok||!t||(ib.value=Array.isArray(t.meta.locales)?[...t.meta.locales]:[],t$(t.data,t.meta.locale))}function pv(e){const t=e.codePointAt(0);if(t===void 0)return e;const a=String.fromCodePoint(t);return a.toUpperCase()+e.slice(a.length)}function Vi(e,t={}){if(e==="")return e;const a=[];for(const[l,r]of Object.entries(t)){const o=l.replace(/^:/,"");if(o==="")continue;const i=String(r);a.push([`:${pv(o)}`,pv(i)]),a.push([`:${o.toUpperCase()}`,i.toUpperCase()]),a.push([`:${o}`,i])}a.sort((l,r)=>r[0].length-l[0].length);let n=e;for(const[l,r]of a)n=n.split(l).join(r);return n}const mv=new Map;function a$(e,t=Af.value){let a=mv.get(t);if(a===void 0){try{a=new Intl.PluralRules(t)}catch{a=null}mv.set(t,a)}return a?a.select(e):"other"}function tt(e,t,a={}){if(!e)return"";if(t===void 0)return Vi(e.other??"",a);const n=e[a$(t)]??e.other??"";return Vi(n,{count:t,...a})}function h(e,t={}){const a=Ef.value[e]?.other;return a===void 0?e:Vi(a,t)}function wa(e,t,a={}){const n=Ef.value[e];return n?tt(n,t,a):e}const Tf=E(""),Ko=At(Tf);function Mf(e){Tf.value=e}function Df(){Tf.value=""}const zi=E([]);async function db(){const{data:e,response:t}=await Le.GET("/navigation");return zi.value=t.ok&&e?e.data:[],zi.value}function n$(e){zi.value=e}const ji=k(()=>zi.value.filter(e=>e.sideMenu.length>0).map((e,t)=>({entry:e,index:t})).sort((e,t)=>e.entry.order-t.entry.order||e.index-t.index).map(({entry:e})=>e));function Of(e){for(const t of e.sideMenu){const a=Ja(t.controller);if(a)return a}return Ja(e.controller)}function Ps(e,t){const a=`${e}.${t}`;return ji.value.find(n=>ov(n.controller)===a||n.sideMenu.some(l=>ov(l.controller)===a))??null}function l$(){for(const e of ji.value){const t=Of(e);if(t)return t}return null}const Ml=E([]),r$=k(()=>Ml.value.length>0);async function cb(){const{data:e,response:t}=await Le.GET("/settings");return Ml.value=t.ok&&e?e.data:[],Ml.value}function o$(e){Ml.value=e}function gs(e){return Ml.value.find(t=>t.code===e)??null}function Pf(e){return e.path?e.path:e.controller?Ja(e.controller)??"/settings":`/settings/${encodeURIComponent(e.code)}`}function Du(e){return e?Ml.value.find(t=>t.controller!==""&&t.controller===e)??null:null}function fb(e){return Ml.value.find(t=>!!t.path&&t.path===e)??null}const Ac=k(()=>{const e=Ml.value.map((a,n)=>({entry:a,index:n})).sort((a,n)=>a.entry.order-n.entry.order||a.index-n.index).map(({entry:a})=>a),t=[];for(const a of e){let n=t.find(l=>l.category===a.category);n||(n={category:a.category,entries:[]},t.push(n)),n.entries.push(a)}return t});function _d(e){if(!e)return null;const t=Ac.value.find(a=>a.category===e.category);return!t||t.entries.length<2?null:{category:t.category,current:e,entries:t.entries}}const vv="SummerCMS";function s$(e){if(e.name==="login")return h("backend::lang.auth.title");if(e.name==="settings")return h("backend::lang.settings.title");if(e.name==="account")return h("backend::lang.myaccount.menu_label");if(e.name==="plugins")return h("backend::lang.plugins.title");if(e.name==="media")return h("backend::lang.media.title");if(e.name==="connect")return h("backend::lang.mcp_connect.page_title");if(e.name==="settings-form")return gs(String(e.params.code??""))?.label??String(e.params.code??"");if(e.name==="home")return h("backend::lang.nav.empty");if(e.name==="not-found")return h("backend::lang.page.not_found");const t=Ps(String(e.params.vendor??""),String(e.params.plugin??"")),a=po(e.path),l=t?.sideMenu.find(r=>r.controller===a)?.label??t?.label??Du(a)?.label??"";return(e.name==="create"||e.name==="record"||e.name==="preview")&&Ko.value||l}function i$(e){const t=s$(e).trim();return t===""?vv:`${t} | ${vv}`}const hv=e=>e==="";const u$=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();const gv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const d$=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());const c$=e=>{const t=d$(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ar={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"};const f$=Symbol("lucide-icons");function p$(){return ct(f$,{})}const m$=({name:e,iconNode:t,absoluteStrokeWidth:a,"absolute-stroke-width":n,strokeWidth:l,"stroke-width":r,size:o,color:i,...u},{slots:c})=>{const{size:d,color:p,strokeWidth:v=2,absoluteStrokeWidth:m=!1,class:y=""}=p$(),x=k(()=>{const C=hv(a)||hv(n)||a===!0||n===!0||m===!0,w=l||r||v||Ar["stroke-width"];return C?Number(w)*24/Number(o??d??Ar.width):w});return qa("svg",{...Ar,...u,width:o??d??Ar.width,height:o??d??Ar.height,stroke:i??p??Ar.stroke,"stroke-width":x.value,class:u$("lucide",y,...e?[`lucide-${gv(c$(e))}-icon`,`lucide-${gv(e)}`]:["lucide-icon"])},[...t.map(C=>qa(...C)),...c.default?[c.default()]:[]])};const we=(e,t)=>(a,{slots:n,attrs:l})=>qa(m$,{...l,...a,iconNode:t,name:e},n.default?{default:n.default}:void 0);const v$=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],h$=we("archive",v$);const g$=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],pb=we("arrow-down",g$);const y$=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],mo=we("arrow-left",y$);const b$=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],_$=we("arrow-right",b$);const x$=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],mb=we("arrow-up-down",x$);const k$=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],vb=we("arrow-up-right",k$);const w$=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],hb=we("arrow-up",w$);const $$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],gb=we("ban",$$);const C$=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],S$=we("bell",C$);const E$=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],A$=we("bold",E$);const T$=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],M$=we("book",T$);const D$=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],O$=we("bookmark",D$);const P$=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],yv=we("bot",P$);const I$=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],R$=we("box",I$);const q$=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],L$=we("briefcase",q$);const N$=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],B$=we("building",N$);const F$=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],yb=we("calendar",F$);const V$=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],z$=we("camera",V$);const j$=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["circle",{cx:"8",cy:"10",r:"2",key:"1xl4ub"}],["path",{d:"M8 12h8",key:"1wcyev"}],["circle",{cx:"16",cy:"10",r:"2",key:"r14t7q"}],["path",{d:"m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3",key:"l01ucn"}]],U$=we("cassette-tape",j$);const H$=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16h8",key:"srdodz"}],["path",{d:"M7 11h12",key:"127s9w"}],["path",{d:"M7 6h3",key:"w9rmul"}]],K$=we("chart-bar",H$);const W$=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ba=we("check",W$);const G$=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Gn=we("chevron-down",G$);const Y$=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Is=we("chevron-left",Y$);const J$=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],vr=we("chevron-right",J$);const Z$=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bb=we("chevron-up",Z$);const X$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],bt=we("circle-alert",X$);const Q$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],eC=we("circle-arrow-up",Q$);const tC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],aC=we("circle-check",tC);const nC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],lC=we("circle-question-mark",nC);const rC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],oC=we("circle",rC);const sC=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],iC=we("clipboard-list",sC);const uC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Ui=we("clock",uC);const dC=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],cC=we("cloud",dC);const fC=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],_b=we("code",fC);const pC=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],ro=we("copy",pC);const mC=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],vC=we("credit-card",mC);const hC=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],gC=we("database",hC);const yC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],bC=we("disc-3",yC);const _C=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],xC=we("disc",_C);const kC=[["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"}]],Tc=we("download",kC);const wC=[["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"}]],xb=we("external-link",wC);const $C=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],CC=we("eye-off",$C);const SC=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],EC=we("eye",SC);const AC=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ia=we("file-text",AC);const TC=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],MC=we("file",TC);const DC=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],OC=we("files",DC);const PC=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],IC=we("flag",PC);const RC=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],qC=we("folder-open",RC);const LC=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],bv=we("folder-plus",LC);const NC=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],kb=we("folder",NC);const BC=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],FC=we("funnel",BC);const VC=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],zC=we("gauge",VC);const jC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],UC=we("globe",jC);const HC=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],KC=we("graduation-cap",HC);const WC=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Hi=we("grip-vertical",WC);const GC=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],YC=we("heading-3",GC);const JC=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],ZC=we("heart",JC);const XC=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],QC=we("house",XC);const eS=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],_v=we("image-off",eS);const tS=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],wb=we("image-plus",tS);const aS=[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],nS=we("image-up",aS);const lS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],If=we("image",lS);const rS=[["path",{d:"m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16",key:"9kzy35"}],["path",{d:"M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2",key:"1t0f0t"}],["circle",{cx:"13",cy:"7",r:"1",fill:"currentColor",key:"1obus6"}],["rect",{x:"8",y:"2",width:"14",height:"14",rx:"2",key:"1gvhby"}]],$b=we("images",rS);const oS=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],Cb=we("inbox",oS);const sS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Vl=we("info",sS);const iS=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],uS=we("italic",iS);const dS=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],cS=we("key-round",dS);const fS=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],pS=we("key",fS);const mS=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],vS=we("languages",mS);const hS=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],Sb=we("layout-grid",hS);const gS=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],yS=we("leaf",gS);const bS=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],_S=we("library",bS);const xS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],kS=we("life-buoy",xS);const wS=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Eb=we("link",wS);const $S=[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]],CS=we("list-indent-decrease",$S);const SS=[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]],ES=we("list-indent-increase",SS);const AS=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],Ab=we("list-ordered",AS);const TS=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],Rf=we("list",TS);const MS=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Vn=we("loader-circle",MS);const DS=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],cn=we("lock",DS);const OS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Tb=we("log-out",OS);const PS=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],IS=we("mail",PS);const RS=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],qS=we("map-pin",RS);const LS=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],NS=we("message-circle",LS);const BS=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],FS=we("mic-vocal",BS);const VS=[["path",{d:"M5 12h14",key:"1ays0h"}]],Mb=we("minus",VS);const zS=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],jS=we("moon",zS);const US=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],HS=we("network",US);const KS=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],WS=we("palette",KS);const GS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],qf=we("panel-left-close",GS);const YS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],Db=we("panel-left-open",YS);const JS=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],ZS=we("paperclip",JS);const XS=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],QS=we("pause",XS);const e3=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Wr=we("pencil",e3);const t3=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],a3=we("phone",t3);const n3=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],l3=we("play",n3);const r3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],vo=we("plus",r3);const o3=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],Ob=we("puzzle",o3);const s3=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],i3=we("quote",s3);const u3=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],d3=we("redo-2",u3);const c3=[["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"}]],f3=we("refresh-cw",c3);const p3=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],ki=we("rotate-ccw",p3);const m3=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Pb=we("search-x",m3);const v3=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hr=we("search",v3);const h3=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],g3=we("send",h3);const y3=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ib=we("settings",y3);const b3=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],_3=we("shield-check",b3);const x3=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],k3=we("shopping-cart",x3);const w3=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Rb=we("sliders-horizontal",w3);const $3=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],qb=we("star",$3);const C3=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]],S3=we("sun-moon",C3);const E3=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Rs=we("sun",E3);const A3=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],T3=we("table",A3);const M3=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],D3=we("tags",M3);const O3=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Xa=we("trash-2",O3);const P3=[["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"}]],Ki=we("triangle-alert",P3);const I3=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],R3=we("trophy",I3);const q3=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],L3=we("underline",q3);const N3=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],Lb=we("undo-2",N3);const B3=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],F3=we("unlink",B3);const V3=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],ns=we("upload",V3);const z3=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Nb=we("user-minus",z3);const j3=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],Bb=we("user-plus",j3);const U3=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],H3=we("user-round",U3);const K3=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],W3=we("user",K3);const G3=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],Y3=we("users-round",G3);const J3=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Z3=we("users",J3);const X3=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],Q3=we("wand-sparkles",X3);const eE=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],tE=we("wrench",eE);const aE=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],qt=we("x",aE),xv={archive:h$,"arrow-down":pb,"arrow-left":mo,"arrow-right":_$,"arrow-up":hb,"arrow-up-right":vb,bell:S$,book:M$,bookmark:O$,box:R$,briefcase:L$,building:B$,calendar:yb,camera:z$,"cassette-tape":U$,"chart-bar":K$,check:Ba,"chevron-down":Gn,"chevron-left":Is,"chevron-right":vr,circle:oC,"circle-alert":bt,"circle-check":aC,"circle-question-mark":lC,"clipboard-list":iC,clock:Ui,cloud:cC,code:_b,copy:ro,"credit-card":vC,database:gC,disc:xC,"disc-3":bC,download:Tc,"external-link":xb,file:MC,"file-text":Ia,files:OC,flag:IC,folder:kb,funnel:FC,gauge:zC,globe:UC,"graduation-cap":KC,heart:ZC,house:QC,image:If,inbox:Cb,info:Vl,key:pS,languages:vS,"layout-grid":Sb,leaf:yS,library:_S,"life-buoy":kS,link:Eb,list:Rf,"list-ordered":Ab,lock:cn,"log-out":Tb,mail:IS,"map-pin":qS,"message-circle":NS,"mic-vocal":FS,minus:Mb,network:HS,palette:WS,"panel-left-close":qf,"panel-left-open":Db,paperclip:ZS,pause:QS,pencil:Wr,phone:a3,play:l3,plus:vo,puzzle:Ob,"refresh-cw":f3,search:hr,"search-x":Pb,settings:Ib,"shield-check":_3,"shopping-cart":k3,star:qb,sun:Rs,table:T3,tags:D3,"trash-2":Xa,"triangle-alert":Ki,trophy:R3,upload:ns,user:W3,"user-minus":Nb,"user-plus":Bb,users:Z3,"users-round":Y3,"wand-sparkles":Q3,wrench:tE,x:qt},nE={"icon-archive":"archive","icon-bar-chart":"chart-bar","icon-bell":"bell","icon-book":"book","icon-bookmark":"bookmark","icon-briefcase":"briefcase","icon-building":"building","icon-calendar":"calendar","icon-camera":"camera","icon-check":"check","icon-check-circle":"circle-check","icon-circle":"circle","icon-clock":"clock","icon-clock-o":"clock","icon-cloud":"cloud","icon-code":"code","icon-cog":"settings","icon-cogs":"settings","icon-comment":"message-circle","icon-comments":"message-circle","icon-comments-o":"message-circle","icon-copy":"copy","icon-credit-card":"credit-card","icon-cube":"box","icon-dashboard":"gauge","icon-database":"database","icon-download":"download","icon-edit":"pencil","icon-envelope":"mail","icon-envelope-o":"mail","icon-exclamation-triangle":"triangle-alert","icon-external-link":"external-link","icon-file":"file","icon-file-o":"file","icon-file-text":"file-text","icon-file-text-o":"file-text","icon-files-o":"files","icon-filter":"funnel","icon-flag":"flag","icon-folder":"folder","icon-folder-o":"folder","icon-globe":"globe","icon-graduation-cap":"graduation-cap","icon-group":"users","icon-heart":"heart","icon-home":"house","icon-inbox":"inbox","icon-info-circle":"info","icon-key":"key","icon-language":"languages","icon-leaf":"leaf","icon-life-ring":"life-buoy","icon-link":"link","icon-list":"list","icon-list-alt":"clipboard-list","icon-list-ol":"list-ordered","icon-list-ul":"list","icon-lock":"lock","icon-magic":"wand-sparkles","icon-map-marker":"map-pin","icon-minus":"minus","icon-paperclip":"paperclip","icon-pause":"pause","icon-pencil":"pencil","icon-phone":"phone","icon-photo":"image","icon-picture-o":"image","icon-play":"play","icon-plus":"plus","icon-question":"circle-question-mark","icon-question-circle":"circle-question-mark","icon-refresh":"refresh-cw","icon-search":"search","icon-shopping-cart":"shopping-cart","icon-sign-out":"log-out","icon-sitemap":"network","icon-star":"star","icon-table":"table","icon-tachometer":"gauge","icon-tags":"tags","icon-th":"layout-grid","icon-th-large":"layout-grid","icon-times":"x","icon-trash":"trash-2","icon-trash-o":"trash-2","icon-trophy":"trophy","icon-upload":"upload","icon-user":"user","icon-users":"users","icon-warning":"triangle-alert","icon-wrench":"wrench"},kv=Rs;function xd(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function qs(e){if(!e)return kv;const t=e.trim();return xd(xv,t)??xd(xv,xd(nE,t)??"")??kv}const Wi=E(!1),Mc=E(!1),lE=At(Wi);async function Fb(){const{data:e,response:t}=await Le.GET("/media/items",{params:{query:{per_page:1}}});return t.ok&&e?(Wi.value=!0,Mc.value=e.meta.can_manage===!0,!0):(Wi.value=!1,Mc.value=!1,!1)}function rE(e){Wi.value=e.canView,Mc.value=e.canManage===!0}const oE="(prefers-color-scheme: dark)",wi=["system","light","dark"];function Vb(e){return typeof e=="string"&&wi.includes(e)}function sE(e=window,t="system"){const a=e.document.documentElement;if(t!=="system")return a.classList.toggle("dark",t==="dark"),()=>{};if(typeof e.matchMedia!="function")return a.classList.remove("dark"),()=>{};const n=e.matchMedia(oE),l=o=>{a.classList.toggle("dark",o)};l(n.matches);const r=o=>l(o.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)}const iE=4e3,ys=E([]),Dc=new Map;let uE=1;const dE=At(ys);function Oe(e,t="success"){const a=uE++;return ys.value=[{id:a,text:e,tone:t},...ys.value],Dc.set(a,setTimeout(()=>zb(a),iE)),a}function zb(e){const t=Dc.get(e);t!==void 0&&(clearTimeout(t),Dc.delete(e)),ys.value=ys.value.filter(a=>a.id!==e)}const jb="summer-admin.theme",Lf="summer-admin.locale",cE=/^[A-Za-z]{2,8}(?:[-_][A-Za-z0-9]{1,8})?$/,oo=E("system");let wv=()=>{};const $v=At(oo),Gi=E(""),fE=At(Gi);function Yi(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function Nf(e,t){try{t===null?Yi()?.removeItem(e):Yi()?.setItem(e,t)}catch{}}function Oc(e){Nf(jb,e==="system"?null:e)}function pE(){try{const e=Yi()?.getItem(jb);return Vb(e)?e:"system"}catch{return"system"}}function mE(){try{const e=Yi()?.getItem(Lf)??"";return e.length<=16&&cE.test(e)?e:""}catch{return""}}const Ub={reload(){window.location.reload()}};function Ji(e){wv(),oo.value=e,wv=typeof window>"u"?()=>{}:sE(window,e)}function vE(e){const t=wi.indexOf(e);return wi[(t+1)%wi.length]??"system"}async function hE(e){const t=oo.value;Ji(e),Oc(e);let a=!1;try{const{response:n}=await Le.PUT("/account/preferences",{body:{theme:e}});a=n.ok}catch{a=!1}a||(oo.value===e&&(Ji(t),Oc(t)),Oe(h("backend::lang.myaccount.preferences_failed"),"danger"))}function Cv(){return hE(vE(oo.value))}async function gE(e){const t=e?.preferences;t&&(Vb(t.theme)&&(t.theme!==oo.value&&Ji(t.theme),Oc(t.theme)),typeof t.locale=="string"&&(Gi.value=t.locale,t.locale!==""&&t.locale!==Na.value&&await ub(t.locale).catch(()=>{}),Nf(Lf,t.locale===""?null:t.locale)))}async function yE(e){if(e===Gi.value)return;let t=!1;try{const{response:a}=await Le.PUT("/account/preferences",{body:{locale:e}});t=a.ok}catch{t=!1}if(!t){Oe(h("backend::lang.myaccount.preferences_failed"),"danger");return}Gi.value=e,Nf(Lf,e===""?null:e),Ub.reload()}const Hb="summer-admin.sidebar",bE="(max-width: 1099px)",Ou=E(!1),ls=E(!1),_E=k(()=>ls.value||Ou.value);function Kb(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function xE(){try{return Kb()?.getItem(Hb)==="true"}catch{return!1}}function Bf(e){Ou.value=e;try{Kb()?.setItem(Hb,e?"true":"false")}catch{}}function kE(){if(Ou.value=xE(),typeof window>"u"||typeof window.matchMedia!="function")return ls.value=!1,()=>{};const e=window.matchMedia(bE);ls.value=e.matches;const t=a=>{ls.value=a.matches};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}function Wb(){return{collapsed:_E,narrow:At(ls),manual:At(Ou),setCollapsed:Bf,watchViewport:kE}}const wE=["id","aria-label"],$E={class:"px-2.5 pt-1 pb-2 text-[14px] font-bold","aria-hidden":"true"},CE=ae({__name:"SectionFlyout",props:{entry:{},id:{}},emits:["escape","leave","navigate"],setup(e,{expose:t,emit:a}){const n=e,l=a,r=ga(),o=E(null),i=k(()=>po(r.path)),u=k(()=>n.entry.sideMenu.flatMap(m=>{const y=Ja(m.controller);return y?[{item:m,to:y,icon:qs(m.icon),current:i.value===m.controller}]:[]}));function c(){return[...o.value?.querySelectorAll('[role="menuitem"]')??[]]}async function d(){await Ge(),c()[0]?.focus()}function p(m){return!!m&&!!o.value?.contains(m)}function v(m){const y=c(),x=y.indexOf(document.activeElement);switch(m.key){case"ArrowDown":m.preventDefault(),y[(x+1)%y.length]?.focus();break;case"ArrowUp":m.preventDefault(),y[(x-1+y.length)%y.length]?.focus();break;case"Home":m.preventDefault(),y[0]?.focus();break;case"End":m.preventDefault(),y[y.length-1]?.focus();break;case"Escape":m.preventDefault(),l("escape");break;case"Tab":l("leave");break}}return t({focusFirst:d,contains:p}),(m,y)=>(f(),b("div",{id:e.id,ref_key:"root",ref:o,role:"menu","data-section-flyout":"","aria-label":e.entry.label,class:"fixed top-3 left-[calc(var(--spacing-rail)+8px)] z-40 flex w-[230px] flex-col gap-0.5 rounded-[14px] border border-border bg-surface p-2 text-text shadow-pop",onKeydown:v},[g("span",$E,_(e.entry.label),1),(f(!0),b(me,null,Ie(u.value,x=>(f(),j(s(Sa),{key:x.item.code,to:x.to,role:"menuitem",tabindex:"-1","aria-current":x.current?"page":void 0,class:pe([x.current?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-[38px] items-center gap-3 rounded-tab px-2.5 no-underline transition-colors duration-150 ease-out"]),onClick:y[0]||(y[0]=C=>l("navigate"))},{default:N(()=>[(f(),j(Wt(x.icon),{size:18,"aria-hidden":"true"})),g("span",null,_(x.item.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],40,wE))}}),SE=["aria-label"],EE=["aria-label","title"],AE={class:"max-w-full [overflow-wrap:anywhere]"},TE={class:"max-w-full [overflow-wrap:anywhere]"},ME=["aria-label","title"],DE={class:"max-w-full [overflow-wrap:anywhere]"},OE=200,PE=ae({__name:"PluginRail",setup(e){const t=ga(),{collapsed:a,narrow:n,setCollapsed:l}=Wb(),r={system:{icon:S3,key:"backend::lang.nav.theme_system"},light:{icon:Rs,key:"backend::lang.nav.theme_light"},dark:{icon:jS,key:"backend::lang.nav.theme_dark"}},o=k(()=>r[$v.value].icon),i=k(()=>h("backend::lang.nav.theme",{mode:h(r[$v.value].key)})),u=k(()=>Ps(String(t.params.vendor??""),String(t.params.plugin??""))),c=k(()=>t.path==="/media"||t.path.startsWith("/media/")),d=k(()=>t.path==="/settings"||t.path.startsWith("/settings/")||fb(t.path)!==null||u.value===null&&Du(po(t.path))!==null),p=k(()=>ji.value.map(A=>({entry:A,to:Of(A)??"/",icon:qs(A.icon),current:u.value?.code===A.code}))),v=E(null),m=E(null),y=k(()=>ji.value.find(A=>A.code===v.value)??null),x=new Map;let C=null,w=!1;function S(A){return`section-flyout-${A}`}function q(A,D){const z=D?.$el;z instanceof HTMLElement?x.set(A,z):x.delete(A)}function O(){C!==null&&(clearTimeout(C),C=null)}function I(){O(),v.value=null}function B(){O(),C=setTimeout(()=>{C=null;const A=document.activeElement,D=v.value;D!==null&&(x.get(D)===A||m.value?.contains(A))||(v.value=null)},OE)}function L(A){a.value&&(O(),v.value=A)}function W(A){w||L(A)}async function T(A,D){a.value&&(A.key==="Enter"||A.key==="ArrowDown"?(A.preventDefault(),L(D),await Ge(),await m.value?.focusFirst()):A.key==="Escape"&&v.value!==null&&(A.preventDefault(),I()))}function R(){const A=v.value;I(),A!==null&&(w=!0,x.get(A)?.focus(),w=!1)}function G(){l(!1),Ge(()=>document.querySelector("[data-sidebar-collapse]")?.focus())}return ze(a,A=>{A||I()}),Dt(O),(A,D)=>(f(),b("nav",{"aria-label":s(h)("backend::lang.nav.plugins"),class:"sticky top-0 flex h-screen w-rail shrink-0 flex-col items-center gap-1.5 self-start overflow-y-auto border-r border-side-border bg-side pt-3.5 pb-3"},[g("button",{type:"button","data-theme-toggle":"","aria-label":i.value,title:i.value,class:"mb-3.5 flex size-10 shrink-0 items-center justify-center rounded-inner bg-accent-soft transition-colors duration-150 ease-out hover:bg-side-hover",onClick:D[0]||(D[0]=(...z)=>s(Cv)&&s(Cv)(...z))},[(f(),j(Wt(o.value),{size:22,class:"text-accent","aria-hidden":"true"}))],8,EE),(f(!0),b(me,null,Ie(p.value,z=>(f(),j(s(Sa),{key:z.entry.code,ref_for:!0,ref:V=>q(z.entry.code,V),to:z.to,"data-rail-item":z.entry.code,"aria-current":z.current?"page":void 0,"aria-haspopup":s(a)?"menu":void 0,"aria-expanded":s(a)?v.value===z.entry.code?"true":"false":void 0,"aria-controls":s(a)&&v.value===z.entry.code?S(z.entry.code):void 0,class:pe([z.current?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"]),onMouseenter:V=>L(z.entry.code),onMouseleave:B,onFocus:V=>W(z.entry.code),onBlur:B,onKeydown:V=>T(V,z.entry.code)},{default:N(()=>[(f(),j(Wt(z.icon),{size:20,"aria-hidden":"true"})),g("span",AE,_(z.entry.label),1)]),_:2},1032,["to","data-rail-item","aria-current","aria-haspopup","aria-expanded","aria-controls","class","onMouseenter","onFocus","onKeydown"]))),128)),s(lE)?(f(),j(s(Sa),{key:0,to:"/media","data-rail-media":"","aria-current":c.value?"page":void 0,class:pe([c.value?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"])},{default:N(()=>[M(s($b),{size:20,"aria-hidden":"true"}),g("span",TE,_(s(h)("backend::lang.nav.media")),1)]),_:1},8,["aria-current","class"])):Y("",!0),s(a)&&y.value?(f(),j(CE,{key:1,id:S(y.value.code),ref_key:"flyout",ref:m,entry:y.value,onMouseenter:O,onMouseleave:B,onFocusin:O,onFocusout:B,onEscape:R,onLeave:B,onNavigate:I},null,8,["id","entry"])):Y("",!0),D[1]||(D[1]=g("span",{class:"flex-1","aria-hidden":"true"},null,-1)),s(a)&&!s(n)?(f(),b("button",{key:2,type:"button","data-sidebar-expand":"","aria-label":s(h)("backend::lang.nav.expand"),title:s(h)("backend::lang.nav.expand"),class:"mb-1 flex size-10 items-center justify-center rounded-inner text-side-text transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:G},[M(s(Db),{size:20,"aria-hidden":"true"})],8,ME)):Y("",!0),s(r$)?(f(),j(s(Sa),{key:3,to:"/settings","data-rail-settings":"","aria-current":d.value?"page":void 0,class:pe([d.value?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"])},{default:N(()=>[M(s(Ib),{size:20,"aria-hidden":"true"}),g("span",DE,_(s(h)("backend::lang.nav.settings")),1)]),_:1},8,["aria-current","class"])):Y("",!0)],8,SE))}}),IE=["aria-label"],RE={class:"mb-3.5 flex h-10 items-center justify-between gap-2 pl-2"},qE={class:"truncate text-[16px] font-bold"},LE=["aria-label","title"],NE=ae({__name:"SectionPanel",props:{entry:{}},setup(e){const t=e,a=ga(),n=k(()=>po(a.path)),l=k(()=>t.entry.sideMenu.flatMap(o=>{const i=Ja(o.controller);return i?[{item:o,to:i,icon:qs(o.icon),current:n.value===o.controller}]:[]}));function r(){Bf(!0),Ge(()=>document.querySelector("[data-sidebar-expand]")?.focus())}return(o,i)=>(f(),b("aside",{"aria-label":s(h)("backend::lang.nav.sections"),class:"sticky top-0 flex h-screen w-panel shrink-0 flex-col gap-0.5 self-start overflow-y-auto border-r border-border bg-surface px-3 py-3.5"},[g("div",RE,[g("span",qE,_(e.entry.label),1),g("button",{type:"button","data-sidebar-collapse":"","aria-label":s(h)("backend::lang.nav.collapse"),title:s(h)("backend::lang.nav.collapse"),class:"flex size-[30px] shrink-0 items-center justify-center rounded-tab text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:r},[M(s(qf),{size:18,"aria-hidden":"true"})],8,LE)]),(f(!0),b(me,null,Ie(l.value,u=>(f(),j(s(Sa),{key:u.item.code,to:u.to,"aria-current":u.current?"page":void 0,class:pe([u.current?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-nav items-center gap-3 rounded-control px-3 no-underline transition-colors duration-150 ease-out"])},{default:N(()=>[(f(),j(Wt(u.icon),{size:18,"aria-hidden":"true"})),g("span",null,_(u.item.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],8,IE))}}),BE=["aria-label"],FE={class:"mb-3.5 flex h-10 items-center justify-between gap-2 pl-2"},VE={class:"truncate text-[16px] font-bold"},zE=["aria-label","title"],jE=ae({__name:"SettingsPanel",props:{section:{}},setup(e){function t(){Bf(!0),Ge(()=>document.querySelector("[data-sidebar-expand]")?.focus())}return(a,n)=>(f(),b("aside",{"data-settings-panel":"","aria-label":s(h)("backend::lang.nav.sections"),class:"sticky top-0 flex h-screen w-panel shrink-0 flex-col gap-0.5 self-start overflow-y-auto border-r border-border bg-surface px-3 py-3.5"},[g("div",FE,[g("span",VE,_(e.section.category||s(h)("backend::lang.nav.settings")),1),g("button",{type:"button","data-sidebar-collapse":"","aria-label":s(h)("backend::lang.nav.collapse"),title:s(h)("backend::lang.nav.collapse"),class:"flex size-[30px] shrink-0 items-center justify-center rounded-tab text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:t},[M(s(qf),{size:18,"aria-hidden":"true"})],8,zE)]),(f(!0),b(me,null,Ie(e.section.entries,l=>(f(),j(s(Sa),{key:l.code,to:s(Pf)(l),"data-settings-panel-item":l.code,"aria-current":l.code===e.section.current.code?"page":void 0,class:pe([l.code===e.section.current.code?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-nav items-center gap-3 rounded-control px-3 no-underline transition-colors duration-150 ease-out"])},{default:N(()=>[(f(),j(Wt(s(qs)(l.icon)),{size:18,"aria-hidden":"true"})),g("span",null,_(l.label),1)]),_:2},1032,["to","data-settings-panel-item","aria-current","class"]))),128))],8,BE))}}),UE=["aria-label"],HE={class:"flex min-w-0 items-center gap-2"},KE=["aria-current"],WE=ae({__name:"Breadcrumbs",setup(e){const t=ga(),a=k(()=>{if(t.name==="account")return[{label:h("backend::lang.myaccount.menu_label")}];if(t.name==="media")return[{label:h("backend::lang.media.title")}];if(t.name==="plugins")return[{label:h("backend::lang.nav.settings"),to:"/settings"},{label:h("backend::lang.plugins.title")}];if(t.name==="settings"||t.name==="settings-form"){const i=[{label:h("backend::lang.nav.settings"),to:"/settings"}],u=t.name==="settings-form"?gs(String(t.params.code??"")):null;return u&&i.push({label:u.label}),i}const n=Ps(String(t.params.vendor??""),String(t.params.plugin??"")),l=po(t.path);if(!n){const i=Du(l);if(!i)return[];const u=[{label:h("backend::lang.nav.settings"),to:"/settings"},{label:i.label,to:Pf(i)}];return(t.name==="record"||t.name==="create")&&Ko.value!==""&&u.push({label:Ko.value}),u}const r=[{label:n.label,to:Of(n)??void 0}],o=n.sideMenu.find(i=>i.controller===l)??null;return o&&r.push({label:o.label,to:Ja(o.controller)??void 0}),(t.name==="record"||t.name==="create")&&Ko.value!==""&&r.push({label:Ko.value}),r});return(n,l)=>(f(),b("nav",{"aria-label":s(h)("backend::lang.nav.breadcrumbs"),class:"min-w-0"},[g("ol",HE,[(f(!0),b(me,null,Ie(a.value,(r,o)=>(f(),b("li",{key:o,"data-crumb":"",class:"flex min-w-0 items-center gap-2"},[o>0?(f(),j(s(vr),{key:0,size:14,class:"shrink-0 text-muted","aria-hidden":"true"})):Y("",!0),o===a.value.length-1||!r.to?(f(),b("span",{key:1,"aria-current":o===a.value.length-1?"page":void 0,class:pe([o===a.value.length-1?"font-semibold text-text":"text-muted","truncate"])},_(r.label),11,KE)):(f(),j(s(Sa),{key:2,to:r.to,class:"truncate text-muted no-underline transition-colors duration-150 ease-out hover:text-text"},{default:N(()=>[ye(_(r.label),1)]),_:2},1032,["to"]))]))),128))])],8,UE))}});function Sv(e){return typeof e=="string"?`'${e}'`:new YE().serialize(e)}const GE=" _-,;:!?.'\"()[]{}@*/\\&#%`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz",Xs=(function(){const e=new Uint8Array(128);for(let t=0;t<69;t++)e[GE.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function kd(e,t){if(e===t)return 0;const a=Math.min(e.length,t.length);let n=0;for(let l=0;l<a;l++){const r=e.charCodeAt(l),o=t.charCodeAt(l);if(r===o)continue;const i=r<128&&Xs[r]?Xs[r]:r+128,u=o<128&&Xs[o]?Xs[o]:o+128;if(i!==u)return i<u?-1:1;n===0&&(n=r>o?-1:1)}return e.length!==t.length?e.length<t.length?-1:1:n}const YE=(function(){class e{#e=new Map;compare(a,n){const l=typeof a,r=typeof n;return l==="string"&&r==="string"?kd(a,n):l==="number"&&r==="number"?a-n:kd(this.serialize(a,!0),this.serialize(n,!0))}serialize(a,n){if(a===null)return"null";switch(typeof a){case"string":return n?a:`'${a}'`;case"bigint":return`${a}n`;case"object":return this.$object(a);case"function":return this.$function(a)}return String(a)}serializeObject(a){const n=Object.prototype.toString.call(a);if(n!=="[object Object]")return this.serializeBuiltInType(n.length<10?`unknown:${n}`:n.slice(8,-1),a);const l=a.constructor,r=l===Object||l===void 0?"":l.name;if(r!==""&&globalThis[r]===l)return this.serializeBuiltInType(r,a);if("toJSON"in a&&typeof a.toJSON=="function"){const u=a.toJSON();return r+(u!==null&&typeof u=="object"?this.$object(u):`(${this.serialize(u)})`)}const o=Object.keys(a).sort(kd);let i=`${r}{`;for(let u=0;u<o.length;u++){const c=o[u];i+=`${c}:${this.serialize(a[c])}`,u<o.length-1&&(i+=",")}return i+"}"}serializeBuiltInType(a,n){const l=this["$"+a];if(l)return l.call(this,n);if(typeof n.entries=="function")return this.serializeObjectEntries(a,n.entries());throw new Error(`Cannot serialize ${a}`)}serializeObjectEntries(a,n){const l=Array.from(n).sort((o,i)=>this.compare(o[0],i[0]));let r=`${a}{`;for(let o=0;o<l.length;o++){const[i,u]=l[o];r+=`${this.serialize(i,!0)}:${this.serialize(u)}`,o<l.length-1&&(r+=",")}return r+"}"}$object(a){let n=this.#e.get(a);return n===void 0&&(this.#e.set(a,`#${this.#e.size}`),n=this.serializeObject(a),this.#e.set(a,n)),n}$function(a){const n=Function.prototype.toString.call(a);return n.slice(-15)==="[native code] }"?`${a.name||""}()[native]`:`${a.name}(${a.length})${n.replace(/\s*\n\s*/g,"")}`}$Array(a){let n="[";for(let l=0;l<a.length;l++)n+=this.serialize(a[l]),l<a.length-1&&(n+=",");return n+"]"}$Date(a){try{return`Date(${a.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(a){return`ArrayBuffer[${new Uint8Array(a).join(",")}]`}$Set(a){return`Set${this.$Array(Array.from(a).sort((n,l)=>this.compare(n,l)))}`}$Map(a){return this.serializeObjectEntries("Map",a.entries())}}for(const t of["Error","RegExp","URL"])e.prototype["$"+t]=function(a){return`${t}(${a})`};for(const t of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])e.prototype["$"+t]=function(a){return`${t}[${a.join(",")}]`};for(const t of["BigInt64Array","BigUint64Array"])e.prototype["$"+t]=function(a){return`${t}[${a.join("n,")}${a.length>0?"n":""}]`};return e})();function bs(e,t){return e===t||Sv(e)===Sv(t)}function Qs(e,t){let a=e;const n=t.toString(),l=n.indexOf("."),r=l>=0?n.length-l:0;if(r>0){const o=10**r;a=Math.round(a*o)/o}return a}function wd(e,t,a,n){t=Number(t),a=Number(a);const l=(e-(Number.isNaN(t)?0:t))%n;let r=Qs(Math.abs(l)*2>=n?e+Math.sign(l)*(n-Math.abs(l)):e-l,n);return Number.isNaN(t)?!Number.isNaN(a)&&r>a&&(r=Math.floor(Qs(a/n,n))*n):r<t?r=t:!Number.isNaN(a)&&r>a&&(r=t+Math.floor(Qs((a-t)/n,n))*n),r=Qs(r,n),r}function Pt(e,t){const a=typeof e=="string"&&!t?`${e}Context`:t,n=Symbol(a);return[o=>{const i=ct(n,o);if(i||i===null)return i;throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(yt(n,o),o)]}function Zt(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ff(e,t,a){const n=a.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&n.addEventListener(e,t,{once:!0}),n.dispatchEvent(l)}function $a(e){return e==null}function Ev(e,t){return $a(e)?!1:Array.isArray(e)?e.some(a=>bs(a,t)):bs(e,t)}function JE(e,t){var a;const n=pr();return Aa(()=>{n.value=e()},{...t,flush:(a=t?.flush)!==null&&a!==void 0?a:"sync"}),At(n)}function Gb(e,t){return ff()?(Ag(e,t),!0):!1}function ZE(e){let t=!1,a;const n=Eg(!0);return((...l)=>(t||(a=n.run(()=>e(...l)),t=!0),a))}const el=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const XE=e=>typeof e<"u",QE=Object.prototype.toString,e4=e=>QE.call(e)==="[object Object]",Av=t4();function t4(){var e,t,a;return el&&!!(!((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test((a=window)===null||a===void 0?void 0:a.navigator.userAgent))}function $d(e){return Array.isArray(e)?e:[e]}function a4(e){return kn()}function Yb(e){if(!el)return e;let t=0,a,n;const l=()=>{t-=1,n&&t<=0&&(n.stop(),a=void 0,n=void 0)};return((...r)=>(t+=1,n||(n=Eg(!0),a=n.run(()=>e(...r))),Gb(l),a))}function n4(e){return Ka(Ct(e)?new Proxy({},{get(t,a,n){return s(Reflect.get(e.value,a,n))},set(t,a,n){return Ct(e.value[a])&&!Ct(n)?e.value[a].value=n:e.value[a]=n,!0},deleteProperty(t,a){return Reflect.deleteProperty(e.value,a)},has(t,a){return Reflect.has(e.value,a)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function l4(e){return n4(k(e))}function Vf(e,...t){const a=t.flat(),n=a[0];return l4(()=>Object.fromEntries(typeof n=="function"?Object.entries(Kt(e)).filter(([l,r])=>!n(ca(r),l)):Object.entries(Kt(e)).filter(l=>!a.includes(l[0]))))}function r4(e,t=1e4){return Rx((a,n)=>{let l=ca(e),r;const o=()=>setTimeout(()=>{l=ca(e),n()},ca(t));return Gb(()=>{clearTimeout(r)}),{get(){return a(),l},set(i){l=i,n(),clearTimeout(r),r=o()}}})}function o4(e,t){a4()&&Dt(e,t)}function s4(e,t,a){return ze(e,t,{...a,immediate:!0})}const zf=el?window:void 0;function gr(e){var t;const a=ca(e);return(t=a?.$el)!==null&&t!==void 0?t:a}function so(...e){const t=(n,l,r,o)=>(n.addEventListener(l,r,o),()=>n.removeEventListener(l,r,o)),a=k(()=>{const n=$d(ca(e[0])).filter(l=>l!=null);return n.every(l=>typeof l!="string")?n:void 0});return s4(()=>{var n,l;return[(n=(l=a.value)===null||l===void 0?void 0:l.map(r=>gr(r)))!==null&&n!==void 0?n:[zf].filter(r=>r!=null),$d(ca(a.value?e[1]:e[0])),$d(s(a.value?e[2]:e[1])),ca(a.value?e[3]:e[2])]},([n,l,r,o],i,u)=>{if(!n?.length||!l?.length||!r?.length)return;const c=e4(o)?{...o}:o,d=n.flatMap(p=>l.flatMap(v=>r.map(m=>t(p,v,m,c))));u(()=>{d.forEach(p=>p())})},{flush:"post"})}function i4(){const e=pr(!1),t=kn();return t&&$t(()=>{e.value=!0},t),e}function u4(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function d4(...e){let t,a,n={};e.length===3?(t=e[0],a=e[1],n=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,a=e[0],n=e[1]):(t=e[0],a=e[1]):(t=!0,a=e[0]);const{target:l=zf,eventName:r="keydown",passive:o=!1,dedupe:i=!1}=n,u=u4(t);return so(l,r,d=>{d.repeat&&ca(i)||u(d)&&a(d)},o)}function c4(e){return JSON.parse(JSON.stringify(e))}function Ft(e,t,a,n={}){var l,r;const{clone:o=!1,passive:i=!1,eventName:u,deep:c=!1,defaultValue:d,shouldEmit:p}=n,v=kn(),m=a||v?.emit||(v==null||(l=v.$emit)===null||l===void 0?void 0:l.bind(v))||(v==null||(r=v.proxy)===null||r===void 0||(r=r.$emit)===null||r===void 0?void 0:r.bind(v?.proxy));let y=u;t||(t="modelValue"),y=y||`update:${t.toString()}`;const x=S=>o?typeof o=="function"?o(S):c4(S):S,C=()=>XE(e[t])?x(e[t]):d,w=S=>{p?p(S)&&m(y,S):m(y,S)};if(i){const S=E(C());let q=!1;return ze(()=>e[t],O=>{q||(q=!0,S.value=x(O),Ge(()=>q=!1))}),ze(S,O=>{!q&&(O!==e[t]||c)&&w(O)},{deep:c}),S}else return k({get(){return C()},set(S){w(S)}})}function jf(e){return e?e.flatMap(t=>t.type===me?jf(t.children):[t]):[]}const f4=["INPUT","TEXTAREA"];function Tv(e,t,a,n={}){if(!t||n.enableIgnoredElement&&f4.includes(t.nodeName))return null;const{arrowKeyOptions:l="both",attributeName:r="[data-reka-collection-item]",itemsArray:o=[],loop:i=!0,dir:u="ltr",preventScroll:c=!0,focus:d=!1}=n,[p,v,m,y,x,C]=[e.key==="ArrowRight",e.key==="ArrowLeft",e.key==="ArrowUp",e.key==="ArrowDown",e.key==="Home",e.key==="End"],w=m||y,S=p||v;if(!x&&!C&&(!w&&!S||l==="vertical"&&S||l==="horizontal"&&w))return null;const q=a?Array.from(a.querySelectorAll(r)):o;if(!q.length)return null;c&&e.preventDefault();let O=null;return S||w?O=Jb(q,t,{goForward:w?y:u==="ltr"?p:v,loop:i}):x?O=q.at(0)||null:C&&(O=q.at(-1)||null),d&&O?.focus(),O}function Jb(e,t,a,n=e.includes(t)?e.length:e.length+1){if(--n===0)return null;const l=e.indexOf(t);let r;if(l===-1?r=a.goForward?0:e.length-1:r=a.goForward?l+1:l-1,!a.loop&&(r<0||r>=e.length))return null;const o=(r+e.length)%e.length,i=e[o];return i?i.hasAttribute("disabled")&&i.getAttribute("disabled")!=="false"?Jb(e,i,a,n):i:null}const[Pu]=Pt("ConfigProvider");function Cd(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Pc(e,t,a=".",n){if(!Cd(t))return Pc(e,{},a,n);const l={...t};for(const r of Object.keys(e)){if(r==="__proto__"||r==="constructor")continue;const o=e[r];o!=null&&(n&&n(l,r,o,a)||(Array.isArray(o)&&Array.isArray(l[r])?l[r]=[...o,...l[r]]:Cd(o)&&Cd(l[r])?l[r]=Pc(o,l[r],(a?`${a}.`:"")+r.toString(),n):l[r]=o))}return l}function p4(e){return(...t)=>t.reduce((a,n)=>Pc(a,n,"",e),{})}const Zb=p4(),m4=Yb(()=>{const e=E(new Map),t=E(),a=k(()=>{for(const o of e.value.values())if(o)return!0;return!1}),n=Pu({scrollBody:E(!0)});let l=null;const r=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",Av&&l?.(),t.value=void 0};return ze(a,(o,i)=>{if(!el)return;if(!o){i&&r();return}t.value===void 0&&(t.value=document.body.style.overflow);const u=window.innerWidth-document.documentElement.clientWidth,c={padding:u,margin:0},d=n.scrollBody?.value?typeof n.scrollBody.value=="object"?Zb({padding:n.scrollBody.value.padding===!0?u:n.scrollBody.value.padding,margin:n.scrollBody.value.margin===!0?u:n.scrollBody.value.margin},c):c:{padding:0,margin:0};u>0&&(document.body.style.paddingRight=typeof d.padding=="number"?`${d.padding}px`:String(d.padding),document.body.style.marginRight=typeof d.margin=="number"?`${d.margin}px`:String(d.margin),document.documentElement.style.setProperty("--scrollbar-width",`${u}px`),document.body.style.overflow="hidden"),Av&&(l=so(document,"touchmove",p=>v4(p),{passive:!1})),Ge(()=>{a.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),e});function Uf(e){const t=Math.random().toString(36).substring(2,7),a=m4();a.value.set(t,e??!1);const n=k({get:()=>a.value.get(t)??!1,set:l=>a.value.set(t,l)});return o4(()=>{a.value.delete(t)}),n}function Xb(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const a=e.parentNode;return!(a instanceof Element)||a.tagName==="BODY"?!1:Xb(a)}}function v4(e){const t=e||window.event,a=t.target;return a instanceof Element&&Xb(a)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Gr(e,t){return e-t*Math.floor(e/t)}const Qb=1721426;function rr(e,t,a,n){t=Ls(e,t);let l=t-1,r=-2;return a<=2?r=0:$l(t)&&(r=-1),Qb-1+365*l+Math.floor(l/4)-Math.floor(l/100)+Math.floor(l/400)+Math.floor((367*a-362)/12+r+n)}function $l(e){return e%4===0&&(e%100!==0||e%400===0)}function Ls(e,t){return e==="BC"?1-t:t}function Iu(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const h4={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Za{fromJulianDay(t){let a=t,n=a-Qb,l=Math.floor(n/146097),r=Gr(n,146097),o=Math.floor(r/36524),i=Gr(r,36524),u=Math.floor(i/1461),c=Gr(i,1461),d=Math.floor(c/365),p=l*400+o*100+u*4+d+(o!==4&&d!==4?1:0),[v,m]=Iu(p),y=a-rr(v,m,1,1),x=2;a<rr(v,m,3,1)?x=0:$l(m)&&(x=1);let C=Math.floor(((y+x)*12+373)/367),w=a-rr(v,m,C,1)+1;return new wt(v,m,C,w)}toJulianDay(t){return rr(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return h4[$l(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return $l(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const g4={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Dl(e,t){return t=ma(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function Hf(e,t){return t=ma(t,e.calendar),e=Ic(e),t=Ic(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function Yr(e,t){return Kf(e.calendar,t.calendar)&&Dl(e,t)}function Mv(e,t){return Kf(e.calendar,t.calendar)&&Hf(e,t)}function Kf(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function y4(e,t){return Dl(e,Ns(t))}const b4={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Ru(e,t,a){let n=e.calendar.toJulianDay(e),l=a?b4[a]:w4(t),r=Math.ceil(n+1-l)%7;return r<0&&(r+=7),r}function _4(e){return Ln(Date.now(),e)}function Ns(e){return S4(_4(e))}function e1(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function t1(e,t){return Dv(e)-Dv(t)}function Dv(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let Sd=null,x4=!1;function Qa(){return Sd==null&&(Sd=new Intl.DateTimeFormat().resolvedOptions().timeZone),Sd}function a1(){return x4}function Ic(e){return e.subtract({days:e.day-1})}function Ov(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}const Pv=new Map,Ed=new Map;function k4(e){if(Intl.Locale){let a=Pv.get(e);return a||(a=new Intl.Locale(e).maximize().region,a&&Pv.set(e,a)),a}let t=e.split("-")[1];return t==="u"?void 0:t}function w4(e){let t=Ed.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if("getWeekInfo"in n&&(t=n.getWeekInfo(),t))return Ed.set(e,t),t.firstDay}let a=k4(e);if(e.includes("-fw-")){let n=e.split("-fw-")[1].split("-")[0];n==="mon"?t={firstDay:1}:n==="tue"?t={firstDay:2}:n==="wed"?t={firstDay:3}:n==="thu"?t={firstDay:4}:n==="fri"?t={firstDay:5}:n==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:a&&g4[a]||0};Ed.set(e,t)}return t.firstDay}function io(e){e=ma(e,new Za);let t=Ls(e.era,e.year);return n1(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function n1(e,t,a,n,l,r,o){let i=new Date;return i.setUTCHours(n,l,r,o),i.setUTCFullYear(e,t-1,a),i.getTime()}function Rc(e,t){if(t==="UTC")return 0;if(e>0&&t===Qa()&&!a1())return new Date(e).getTimezoneOffset()*-6e4;let{year:a,month:n,day:l,hour:r,minute:o,second:i}=l1(e,t);return n1(a,n,l,r,o,i,0)-Math.floor(e/1e3)*1e3}const Iv=new Map;function l1(e,t){let a=Iv.get(t);a||(a=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Iv.set(t,a));let n=a.formatToParts(new Date(e)),l={};for(let r of n)r.type!=="literal"&&(l[r.type]=r.value);return{year:l.era==="BC"||l.era==="B"?-l.year+1:+l.year,month:+l.month,day:+l.day,hour:l.hour==="24"?0:+l.hour,minute:+l.minute,second:+l.second}}const Rv=864e5;function $4(e,t,a,n){return(a===n?[a]:[a,n]).filter(r=>C4(e,t,r))}function C4(e,t,a){let n=l1(a,t);return e.year===n.year&&e.month===n.month&&e.day===n.day&&e.hour===n.hour&&e.minute===n.minute&&e.second===n.second}function qn(e,t,a="compatible"){let n=yn(e);if(t==="UTC")return io(n);if(t===Qa()&&a==="compatible"&&!a1()){n=ma(n,new Za);let u=new Date,c=Ls(n.era,n.year);return u.setFullYear(c,n.month-1,n.day),u.setHours(n.hour,n.minute,n.second,n.millisecond),u.getTime()}let l=io(n),r=Rc(l-Rv,t),o=Rc(l+Rv,t),i=$4(n,t,l-r,l-o);if(i.length===1)return i[0];if(i.length>1)switch(a){case"compatible":case"earlier":return i[0];case"later":return i[i.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(a){case"earlier":return Math.min(l-r,l-o);case"compatible":case"later":return Math.max(l-r,l-o);case"reject":throw new RangeError("No such absolute time found")}}function r1(e,t,a="compatible"){return new Date(qn(e,t,a))}function Ln(e,t){let a=Rc(e,t),n=new Date(e+a),l=n.getUTCFullYear(),r=n.getUTCMonth()+1,o=n.getUTCDate(),i=n.getUTCHours(),u=n.getUTCMinutes(),c=n.getUTCSeconds(),d=n.getUTCMilliseconds();return new Yn(l<1?"BC":"AD",l<1?-l+1:l,r,o,t,a,i,u,c,d)}function S4(e){return new wt(e.calendar,e.era,e.year,e.month,e.day)}function yn(e,t){let a=0,n=0,l=0,r=0;if("timeZone"in e)({hour:a,minute:n,second:l,millisecond:r}=e);else if("hour"in e&&!t)return e;return t&&({hour:a,minute:n,second:l,millisecond:r}=t),new Ol(e.calendar,e.era,e.year,e.month,e.day,a,n,l,r)}function ma(e,t){if(Kf(e.calendar,t))return e;let a=t.fromJulianDay(e.calendar.toJulianDay(e)),n=e.copy();return n.calendar=t,n.era=a.era,n.year=a.year,n.month=a.month,n.day=a.day,ur(n),n}function Wf(e,t,a){if(e instanceof Yn)return e.timeZone===t?e:qu(e,t);let n=qn(e,t,a);return Ln(n,t)}function E4(e){let t=io(e)-e.offset;return new Date(t)}function qu(e,t){let a=io(e)-e.offset;return ma(Ln(a,t),e.calendar)}const Po=36e5;function Lu(e,t){let a=e.copy(),n="hour"in a?u1(a,t):0;qc(a,t.years||0),a.calendar.balanceYearMonth&&a.calendar.balanceYearMonth(a,e),a.month+=t.months||0,Lc(a),o1(a),a.day+=(t.weeks||0)*7,a.day+=t.days||0,a.day+=n,A4(a),a.calendar.balanceDate&&a.calendar.balanceDate(a),a.year<1&&(a.year=1,a.month=1,a.day=1);let l=a.calendar.getYearsInEra(a);if(a.year>l){let o=a.calendar.isInverseEra?.(a);a.year=l,a.month=o?1:a.calendar.getMonthsInYear(a),a.day=o?1:a.calendar.getDaysInMonth(a)}a.month<1&&(a.month=1,a.day=1);let r=a.calendar.getMonthsInYear(a);return a.month>r&&(a.month=r,a.day=a.calendar.getDaysInMonth(a)),a.day=Math.max(1,Math.min(a.calendar.getDaysInMonth(a),a.day)),a}function qc(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Lc(e){for(;e.month<1;)qc(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,qc(e,1)}function A4(e){for(;e.day<1;)e.month--,Lc(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Lc(e)}function o1(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function ur(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),o1(e)}function Gf(e){let t={};for(let a in e)typeof e[a]=="number"&&(t[a]=-e[a]);return t}function s1(e,t){return Lu(e,Gf(t))}function Yf(e,t){let a=e.copy();return t.era!=null&&(a.era=t.era),t.year!=null&&(a.year=t.year),t.month!=null&&(a.month=t.month),t.day!=null&&(a.day=t.day),ur(a),a}function _s(e,t){let a=e.copy();return t.hour!=null&&(a.hour=t.hour),t.minute!=null&&(a.minute=t.minute),t.second!=null&&(a.second=t.second),t.millisecond!=null&&(a.millisecond=t.millisecond),i1(a),a}function T4(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=ei(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=ei(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=ei(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=ei(e.hour,24),t}function i1(e){e.millisecond=Math.max(0,Math.min(e.millisecond,999)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function ei(e,t){let a=e%t;return a<0&&(a+=t),a}function u1(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,T4(e)}function d1(e,t){let a=e.copy();return u1(a,t),a}function M4(e,t){return d1(e,Gf(t))}function Jf(e,t,a,n){let l=e.copy();switch(t){case"era":{let r=e.calendar.getEras(),o=r.indexOf(e.era);if(o<0)throw new Error("Invalid era: "+e.era);o=Nn(o,a,0,r.length-1,n?.round),l.era=r[o],ur(l);break}case"year":l.calendar.isInverseEra?.(l)&&(a=-a),l.year=Nn(e.year,a,-1/0,9999,n?.round),l.year===-1/0&&(l.year=1),l.calendar.balanceYearMonth&&l.calendar.balanceYearMonth(l,e);break;case"month":l.month=Nn(e.month,a,1,e.calendar.getMonthsInYear(e),n?.round);break;case"day":l.day=Nn(e.day,a,1,e.calendar.getDaysInMonth(e),n?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(l),ur(l),l}function Zf(e,t,a,n){let l=e.copy();switch(t){case"hour":{let r=e.hour,o=0,i=23;if(n?.hourCycle===12){let u=r>=12;o=u?12:0,i=u?23:11}l.hour=Nn(r,a,o,i,n?.round);break}case"minute":l.minute=Nn(e.minute,a,0,59,n?.round);break;case"second":l.second=Nn(e.second,a,0,59,n?.round);break;case"millisecond":l.millisecond=Nn(e.millisecond,a,0,999,n?.round);break;default:throw new Error("Unsupported field "+t)}return l}function Nn(e,t,a,n,l=!1){if(l){e+=Math.sign(t),e<a&&(e=n);let r=Math.abs(t);t>0?e=Math.ceil(e/r)*r:e=Math.floor(e/r)*r,e>n&&(e=a)}else e+=t,e<a?e=n-(a-e-1):e>n&&(e=a+(e-n-1));return e}function c1(e,t){let a;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let l=Lu(yn(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});a=qn(l,e.timeZone)}else a=io(e)-e.offset;a+=t.milliseconds||0,a+=(t.seconds||0)*1e3,a+=(t.minutes||0)*6e4,a+=(t.hours||0)*36e5;let n=Ln(a,e.timeZone);return ma(n,e.calendar)}function D4(e,t){return c1(e,Gf(t))}function O4(e,t,a,n){switch(t){case"hour":{let l=0,r=23;if(n?.hourCycle===12){let y=e.hour>=12;l=y?12:0,r=y?23:11}let o=yn(e),i=ma(_s(o,{hour:l}),new Za),u=[qn(i,e.timeZone,"earlier"),qn(i,e.timeZone,"later")].filter(y=>Ln(y,e.timeZone).day===i.day)[0],c=ma(_s(o,{hour:r}),new Za),d=[qn(c,e.timeZone,"earlier"),qn(c,e.timeZone,"later")].filter(y=>Ln(y,e.timeZone).day===c.day).pop(),p=io(e)-e.offset,v=Math.floor(p/Po),m=p%Po;return p=Nn(v,a,Math.floor(u/Po),Math.floor(d/Po),n?.round)*Po+m,ma(Ln(p,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Zf(e,t,a,n);case"era":case"year":case"month":case"day":{let l=Jf(yn(e),t,a,n),r=qn(l,e.timeZone);return ma(Ln(r,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function P4(e,t,a){let n=yn(e),l=_s(Yf(n,t),t);if(l.compare(n)===0)return e;let r=qn(l,e.timeZone,a);return ma(Ln(r,e.timeZone),e.calendar)}const I4=/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,R4=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,f1=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function q4(e){let t=e.match(I4);if(!t)throw new Error("Invalid ISO 8601 time string: "+e);return new fn(aa(t[1],0,23),t[2]?aa(t[2],0,59):0,t[3]?aa(t[3],0,59):0,t[4]?aa(t[4],0,1/0)*1e3:0)}function p1(e){let t=e.match(R4);if(!t)throw f1.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let a=new wt(aa(t[1],0,9999),aa(t[2],1,12),1);return a.day=aa(t[3],1,a.calendar.getDaysInMonth(a)),a}function qv(e,t){let a=e.match(f1);if(!a)throw new Error("Invalid ISO 8601 date time string: "+e);let n=aa(a[1],-9999,9999),l=n<1?"BC":"AD",r=new Yn(l,n<1?-n+1:n,aa(a[2],1,12),1,t,0,a[4]?aa(a[4],0,23):0,a[5]?aa(a[5],0,59):0,a[6]?aa(a[6],0,59):0,a[7]?aa(a[7],0,1/0)*1e3:0);return r.day=aa(a[3],0,r.calendar.getDaysInMonth(r)),a[8]&&(r.offset=aa(a[8],-23,23)*36e5+aa(a[9]??"0",0,59)*6e4),qu(r,t)}function aa(e,t,a){let n=Number(e);if(n<t||n>a)throw new RangeError(`Value out of range: ${t} <= ${n} <= ${a}`);return n}function m1(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function v1(e){let t=ma(e,new Za),a;return t.era==="BC"?a=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):a=String(t.year).padStart(4,"0"),`${a}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function h1(e){return`${v1(e)}T${m1(e)}`}function L4(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let a=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),l=Math.floor(e%36e5%6e4/1e3),r=`${t}${String(a).padStart(2,"0")}:${String(n).padStart(2,"0")}`;return l!==0&&(r+=`:${String(l).padStart(2,"0")}`),r}function N4(e){return`${h1(e)}${L4(e.offset)}[${e.timeZone}]`}function Xf(e){let t=typeof e[0]=="object"?e.shift():new Za,a;if(typeof e[0]=="string")a=e.shift();else{let o=t.getEras();a=o[o.length-1]}let n=e.shift(),l=e.shift(),r=e.shift();return[t,a,n,l,r]}class wt{#e;constructor(...t){let[a,n,l,r,o]=Xf(t);this.calendar=a,this.era=n,this.year=l,this.month=r,this.day=o,ur(this)}copy(){return this.era?new wt(this.calendar,this.era,this.year,this.month,this.day):new wt(this.calendar,this.year,this.month,this.day)}add(t){return Lu(this,t)}subtract(t){return s1(this,t)}set(t){return Yf(this,t)}cycle(t,a,n){return Jf(this,t,a,n)}toDate(t){return r1(this,t)}toString(){return v1(this)}compare(t){return e1(this,t)}}class fn{#e;constructor(t=0,a=0,n=0,l=0){this.hour=t,this.minute=a,this.second=n,this.millisecond=l,i1(this)}copy(){return new fn(this.hour,this.minute,this.second,this.millisecond)}add(t){return d1(this,t)}subtract(t){return M4(this,t)}set(t){return _s(this,t)}cycle(t,a,n){return Zf(this,t,a,n)}toString(){return m1(this)}compare(t){return t1(this,t)}}class Ol{#e;constructor(...t){let[a,n,l,r,o]=Xf(t);this.calendar=a,this.era=n,this.year=l,this.month=r,this.day=o,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ur(this)}copy(){return this.era?new Ol(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Ol(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Lu(this,t)}subtract(t){return s1(this,t)}set(t){return Yf(_s(this,t),t)}cycle(t,a,n){switch(t){case"era":case"year":case"month":case"day":return Jf(this,t,a,n);default:return Zf(this,t,a,n)}}toDate(t,a){return r1(this,t,a)}toString(){return h1(this)}compare(t){let a=e1(this,t);return a===0?t1(this,yn(t)):a}}class Yn{#e;constructor(...t){let[a,n,l,r,o]=Xf(t),i=t.shift(),u=t.shift();this.calendar=a,this.era=n,this.year=l,this.month=r,this.day=o,this.timeZone=i,this.offset=u,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ur(this)}copy(){return this.era?new Yn(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new Yn(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return c1(this,t)}subtract(t){return D4(this,t)}set(t,a){return P4(this,t,a)}cycle(t,a,n){return O4(this,t,a,n)}toDate(){return E4(this)}toString(){return N4(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Wf(t,this.timeZone).toDate().getTime()}}const Jr=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],B4=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],$i=[1867,1911,1925,1988,2018],kl=["meiji","taisho","showa","heisei","reiwa"];function Lv(e){const t=Jr.findIndex(([a,n,l])=>e.year<a||e.year===a&&e.month<n||e.year===a&&e.month===n&&e.day<l);return t===-1?Jr.length-1:t===0?0:t-1}function Ad(e){let t=$i[kl.indexOf(e.era)];if(!t)throw new Error("Unknown era: "+e.era);return new wt(e.year+t,e.month,e.day)}class F4 extends Za{fromJulianDay(t){let a=super.fromJulianDay(t),n=Lv(a);return new wt(this,kl[n],a.year-$i[n],a.month,a.day)}toJulianDay(t){return super.toJulianDay(Ad(t))}balanceDate(t){let a=Ad(t),n=Lv(a);kl[n]!==t.era&&(t.era=kl[n],t.year=a.year-$i[n]),this.constrainDate(t)}constrainDate(t){let a=kl.indexOf(t.era),n=B4[a];if(n!=null){let[l,r,o]=n,i=l-$i[a];t.year=Math.max(1,Math.min(i,t.year)),t.year===i&&(t.month=Math.min(r,t.month),t.month===r&&(t.day=Math.min(o,t.day)))}if(t.year===1&&a>=0){let[,l,r]=Jr[a];t.month=Math.max(l,t.month),t.month===l&&(t.day=Math.max(r,t.day))}}getEras(){return kl}getYearsInEra(t){let a=kl.indexOf(t.era),n=Jr[a],l=Jr[a+1];if(l==null)return 9999-n[0]+1;let r=l[0]-n[0];return(t.month<l[1]||t.month===l[1]&&t.day<l[2])&&r++,r}getDaysInMonth(t){return super.getDaysInMonth(Ad(t))}getMinimumMonthInYear(t){let a=Nv(t);return a?a[1]:1}getMinimumDayInMonth(t){let a=Nv(t);return a&&t.month===a[1]?a[2]:1}constructor(...t){super(...t),this.identifier="japanese"}}function Nv(e){if(e.year===1){let t=kl.indexOf(e.era);return Jr[t]}}const g1=-543;class V4 extends Za{fromJulianDay(t){let a=super.fromJulianDay(t),n=Ls(a.era,a.year);return new wt(this,n-g1,a.month,a.day)}toJulianDay(t){return super.toJulianDay(Bv(t))}getEras(){return["BE"]}getDaysInMonth(t){return super.getDaysInMonth(Bv(t))}balanceDate(){}constructor(...t){super(...t),this.identifier="buddhist"}}function Bv(e){let[t,a]=Iu(e.year+g1);return new wt(t,a,e.month,e.day)}const Zi=1911;function y1(e){return e.era==="minguo"?e.year+Zi:1-e.year+Zi}function Fv(e){let t=e-Zi;return t>0?["minguo",t]:["before_minguo",1-t]}class z4 extends Za{fromJulianDay(t){let a=super.fromJulianDay(t),n=Ls(a.era,a.year),[l,r]=Fv(n);return new wt(this,l,r,a.month,a.day)}toJulianDay(t){return super.toJulianDay(Vv(t))}getEras(){return["before_minguo","minguo"]}balanceDate(t){let[a,n]=Fv(y1(t));t.era=a,t.year=n}isInverseEra(t){return t.era==="before_minguo"}getDaysInMonth(t){return super.getDaysInMonth(Vv(t))}getYearsInEra(t){return t.era==="before_minguo"?9999:9999-Zi}constructor(...t){super(...t),this.identifier="roc"}}function Vv(e){let[t,a]=Iu(y1(e));return new wt(t,a,e.month,e.day)}const zv=1948320,jv=[0,31,62,93,124,155,186,216,246,276,306,336];class j4{fromJulianDay(t){let a=t-zv,n=1+Math.floor((33*a+3)/12053),l=365*(n-1)+Math.floor((8*n+21)/33),r=a-l,o=r<216?Math.floor(r/31):Math.floor((r-6)/30),i=r-jv[o]+1;return new wt(this,n,o+1,i)}toJulianDay(t){let a=zv-1+365*(t.year-1)+Math.floor((8*t.year+21)/33);return a+=jv[t.month-1],a+=t.day,a}getMonthsInYear(){return 12}getDaysInMonth(t){return t.month<=6?31:t.month<=11||Gr(25*t.year+11,33)<8?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}const Td=78,Uv=80;class U4 extends Za{fromJulianDay(t){let a=super.fromJulianDay(t),n=a.year-Td,l=t-rr(a.era,a.year,1,1),r;l<Uv?(n--,r=$l(a.year-1)?31:30,l+=r+155+90+10):(r=$l(a.year)?31:30,l-=Uv);let o,i;if(l<r)o=1,i=l+1;else{let u=l-r;u<155?(o=Math.floor(u/31)+2,i=u%31+1):(u-=155,o=Math.floor(u/30)+7,i=u%30+1)}return new wt(this,n,o,i)}toJulianDay(t){let a=t.year+Td,[n,l]=Iu(a),r,o;return $l(l)?(r=31,o=rr(n,l,3,21)):(r=30,o=rr(n,l,3,22)),t.month===1?o+t.day-1:(o+=r+Math.min(t.month-2,5)*31,t.month>=8&&(o+=(t.month-7)*30),o+=t.day-1,o)}getDaysInMonth(t){return t.month===1&&$l(t.year+Td)||t.month>=2&&t.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...t){super(...t),this.identifier="indian"}}const Xi=1948440,Hv=1948439,Oa=1300,Tr=1600,H4=460322;function Qi(e,t,a,n){return n+Math.ceil(29.5*(a-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function b1(e,t,a){let n=Math.floor((30*(a-t)+10646)/10631),l=Math.min(12,Math.ceil((a-(29+Qi(t,n,1,1)))/29.5)+1),r=a-Qi(t,n,l,1)+1;return new wt(e,n,l,r)}function Kv(e){return(14+11*e)%30<11}class Qf{fromJulianDay(t){return b1(this,Xi,t)}toJulianDay(t){return Qi(Xi,t.year,t.month,t.day)}getDaysInMonth(t){let a=29+t.month%2;return t.month===12&&Kv(t.year)&&a++,a}getMonthsInYear(){return 12}getDaysInYear(t){return Kv(t.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class K4 extends Qf{fromJulianDay(t){return b1(this,Hv,t)}toJulianDay(t){return Qi(Hv,t.year,t.month,t.day)}constructor(...t){super(...t),this.identifier="islamic-tbla"}}const W4="qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";let Nc,Zr;function Ci(e){return H4+Zr[e-Oa]}function Wo(e,t){let a=e-Oa,n=1<<11-(t-1);return(Nc[a]&n)===0?29:30}function Wv(e,t){let a=Ci(e);for(let n=1;n<t;n++)a+=Wo(e,n);return a}function Gv(e){return Zr[e+1-Oa]-Zr[e-Oa]}class G4 extends Qf{constructor(){if(super(),this.identifier="islamic-umalqura",Nc||(Nc=new Uint16Array(Uint8Array.from(atob(W4),t=>t.charCodeAt(0)).buffer)),!Zr){Zr=new Uint32Array(Tr-Oa+1);let t=0;for(let a=Oa;a<=Tr;a++){Zr[a-Oa]=t;for(let n=1;n<=12;n++)t+=Wo(a,n)}}}fromJulianDay(t){let a=t-Xi,n=Ci(Oa),l=Ci(Tr);if(a<n||a>l)return super.fromJulianDay(t);{let r=Oa-1,o=1,i=1;for(;i>0;){r++,i=a-Ci(r)+1;let u=Gv(r);if(i===u){o=12;break}else if(i<u){let c=Wo(r,o);for(o=1;i>c;)i-=c,o++,c=Wo(r,o);break}}return new wt(this,r,o,a-Wv(r,o)+1)}}toJulianDay(t){return t.year<Oa||t.year>Tr?super.toJulianDay(t):Xi+Wv(t.year,t.month)+(t.day-1)}getDaysInMonth(t){return t.year<Oa||t.year>Tr?super.getDaysInMonth(t):Wo(t.year,t.month)}getDaysInYear(t){return t.year<Oa||t.year>Tr?super.getDaysInYear(t):Gv(t.year)}}const Yv=347997,_1=1080,x1=24*_1,Y4=29,J4=12*_1+793,Z4=Y4*x1+J4;function lr(e){return Gr(e*7+1,19)<7}function Si(e){let t=Math.floor((235*e-234)/19),a=12084+13753*t,n=t*29+Math.floor(a/25920);return Gr(3*(n+1),7)<3&&(n+=1),n}function X4(e){let t=Si(e-1),a=Si(e);return Si(e+1)-a===356?2:a-t===382?1:0}function rs(e){return Si(e)+X4(e)}function k1(e){return rs(e+1)-rs(e)}function Q4(e){let t=k1(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function ti(e,t){if(t>=6&&!lr(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let a=Q4(e);return t===2?a===2?30:29:t===3?a===0?29:30:t===6?lr(e)?30:0:30}class eA{fromJulianDay(t){let a=t-Yv,n=a*x1/Z4,l=Math.floor((19*n+234)/235)+1,r=rs(l),o=Math.floor(a-r);for(;o<1;)l--,r=rs(l),o=Math.floor(a-r);let i=1,u=0;for(;u<o;)u+=ti(l,i),i++;i--,u-=ti(l,i);let c=o-u;return new wt(this,l,i,c)}toJulianDay(t){let a=rs(t.year);for(let n=1;n<t.month;n++)a+=ti(t.year,n);return a+t.day+Yv}getDaysInMonth(t){return ti(t.year,t.month)}getMonthsInYear(t){return lr(t.year)?13:12}getDaysInYear(t){return k1(t.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(t,a){a.year!==t.year&&(lr(a.year)&&!lr(t.year)&&a.month>6?t.month--:!lr(a.year)&&lr(t.year)&&a.month>6&&t.month++)}constructor(){this.identifier="hebrew"}}const Bc=1723856,Jv=1824665,Fc=5500;function os(e,t,a,n){return e+365*t+Math.floor(t/4)+30*(a-1)+n-1}function ep(e,t){let a=Math.floor(4*(t-e)/1461);t>=os(e,a+1,1,1)&&a++;let n=1+Math.floor((t-os(e,a,1,1))/30),l=t+1-os(e,a,n,1);return[a,n,l]}function w1(e){return Math.floor(e%4/3)}function $1(e,t){return t%13!==0?30:w1(e)+5}class tp{fromJulianDay(t){let[a,n,l]=ep(Bc,t),r="AM";return a<=0&&(r="AA",a+=Fc),new wt(this,r,a,n,l)}toJulianDay(t){let a=t.year;return t.era==="AA"&&(a-=Fc),os(Bc,a,t.month,t.day)}getDaysInMonth(t){return $1(t.year,t.month)}getMonthsInYear(){return 13}getDaysInYear(t){return 365+w1(t.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(t){return t.era==="AA"?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class tA extends tp{fromJulianDay(t){let[a,n,l]=ep(Bc,t);return a+=Fc,new wt(this,"AA",a,n,l)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...t){super(...t),this.identifier="ethioaa"}}class aA extends tp{fromJulianDay(t){let[a,n,l]=ep(Jv,t),r="CE";return a<=0&&(r="BCE",a=1-a),new wt(this,r,a,n,l)}toJulianDay(t){let a=t.year;return t.era==="BCE"&&(a=1-a),os(Jv,a,t.month,t.day)}getDaysInMonth(t){let a=t.year;return t.era==="BCE"&&(a=1-a),$1(a,t.month)}isInverseEra(t){return t.era==="BCE"}balanceDate(t){t.year<=0&&(t.era=t.era==="BCE"?"CE":"BCE",t.year=1-t.year)}getEras(){return["BCE","CE"]}getYearsInEra(t){return t.era==="BCE"?9999:9715}constructor(...t){super(...t),this.identifier="coptic"}}function nA(e){switch(e){case"buddhist":return new V4;case"ethiopic":return new tp;case"ethioaa":return new tA;case"coptic":return new aA;case"hebrew":return new eA;case"indian":return new U4;case"islamic-civil":return new Qf;case"islamic-tbla":return new K4;case"islamic-umalqura":return new G4;case"japanese":return new F4;case"persian":return new j4;case"roc":return new z4;default:return new Za}}let Md=new Map;class za{constructor(t,a={}){this.formatter=C1(t,a),this.options=a}format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,a){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,a);if(a<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(a)}`}formatRangeToParts(t,a){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,a);if(a<t)throw new RangeError("End date must be >= start date");let n=this.formatter.formatToParts(t),l=this.formatter.formatToParts(a);return[...n.map(r=>({...r,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...l.map(r=>({...r,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return oA()&&(this.resolvedHourCycle||(this.resolvedHourCycle=sA(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}}const lA={true:{ja:"h11"},false:{}};function C1(e,t={}){if(typeof t.hour12=="boolean"&&rA()){t={...t};let l=lA[String(t.hour12)][e.split("-")[0]],r=t.hour12?"h12":"h23";t.hourCycle=l??r,delete t.hour12}let a=e+(t?Object.entries(t).sort((l,r)=>l[0]<r[0]?-1:1).join():"");if(Md.has(a))return Md.get(a);let n=new Intl.DateTimeFormat(e,t);return Md.set(a,n),n}let Dd=null;function rA(){return Dd==null&&(Dd=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Dd}let Od=null;function oA(){return Od==null&&(Od=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Od}function sA(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let a=C1(e,{...t,timeZone:void 0}),n=parseInt(a.formatToParts(new Date(2020,2,3,0)).find(r=>r.type==="hour").value,10),l=parseInt(a.formatToParts(new Date(2020,2,3,23)).find(r=>r.type==="hour").value,10);if(n===0&&l===23)return"h23";if(n===24&&l===23)return"h24";if(n===0&&l===11)return"h11";if(n===12&&l===11)return"h12";throw new Error("Unexpected hour cycle result")}function Pa(e,t=Qa()){return xs(e)?e.toDate():e.toDate(t)}function iA(e){return e instanceof Ol}function xs(e){return e instanceof Yn}function Vc(e){return iA(e)||xs(e)}function Al(e){if(e instanceof Date){const t=e.getFullYear(),a=e.getMonth()+1;return new Date(t,a,0).getDate()}else return e.set({day:100}).day}function Cl(e,t){return e.compare(t)<0}function Pd(e,t){return e.compare(t)>0}function uA(e,t,a){const n=Ru(e,a,"sun");return t>n?e.subtract({days:n+7-t}):t===n?e:e.subtract({days:n-t})}function dA(e,t,a){const n=Ru(e,a,"sun"),l=t===0?6:t-1;return n===l?e:n>l?e.add({days:7-n+l}):e.add({days:l-n})}function ap(e){const{defaultValue:t,defaultPlaceholder:a,granularity:n="day",locale:l="en"}=e;if(Array.isArray(t)&&t.length)return t.at(-1).copy();if(t&&!Array.isArray(t))return t.copy();if(a)return a.copy();const r=new Date,o=r.getFullYear(),i=r.getMonth()+1,u=r.getDate(),c=["hour","minute","second"],d=new za(l),p=nA(d.resolvedOptions().calendar);return c.includes(n??"day")?ma(new Ol(o,i,u,0,0,0),p):ma(new wt(o,i,u),p)}function cA(e){const{defaultValue:t,defaultPlaceholder:a}=e;return t?t.copy():a?a.copy():new fn(0,0,0)}function fA(e,t){const a=[];for(let n=0;n<e.length;n+=t)a.push(e.slice(n,n+t));return a}function pA(e,t,a=!1){const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short",hourCycle:ks(t),hour12:mA(t)};return a&&(delete n.year,delete n.month,delete n.day),e==="day"&&(delete n.second,delete n.hour,delete n.minute,delete n.timeZoneName),e==="hour"&&(delete n.minute,delete n.second),e==="minute"&&delete n.second,n}function S1(e){return Zb(e?.step,{year:1,month:1,day:1,hour:1,minute:1,second:1,millisecond:1})}function E1(e){const t=e.querySelector("[data-selected]");if(t)return t.focus();const a=e.querySelector("[data-today]");if(a)return a.focus();const n=e.querySelector("[data-reka-calendar-day]");if(n)return n.focus()}function ks(e){if(e===24)return"h23";if(e===12)return"h11"}function mA(e){if(e===24)return!1;if(e===12)return!0}function A1(e){return e==="day"?"date":"datetime-local"}function Id(e,t){if(!e)return"";const a=A1(t),n=String(e.year).padStart(4,"0"),l=String(e.month).padStart(2,"0"),r=String(e.day).padStart(2,"0");if(a==="date")return`${n}-${l}-${r}`;const o=String("hour"in e?e.hour:0).padStart(2,"0"),i=String("minute"in e?e.minute:0).padStart(2,"0");if(t==="second"){const u=String("second"in e?e.second:0).padStart(2,"0");return`${n}-${l}-${r}T${o}:${i}:${u}`}return`${n}-${l}-${r}T${o}:${i}`}function Zv(e,t){const a=[];let n=e.add({days:1});const l=t;for(;n.compare(l)<0;)a.push(n),n=n.add({days:1});return a}function Rd(e){const{dateObj:t,weekStartsOn:a,fixedWeeks:n,locale:l}=e,r=Al(t),o=Array.from({length:r},(C,w)=>t.set({day:w+1})),i=Ic(t),u=Ov(t),c=uA(i,a,l),d=dA(u,a,l),p=Zv(c.subtract({days:1}),i),v=Zv(u,d.add({days:1})),m=p.length+o.length+v.length;if(n&&m<42){const C=42-m;let w=v.at(-1);w||(w=Ov(t));const S=Array.from({length:C},(q,O)=>{const I=O+1;return w.add({days:I})});v.push(...S)}const y=p.concat(o,v),x=fA(y,7);return{value:t,cells:y,rows:x}}function Zl(e){const{numberOfMonths:t,dateObj:a,...n}=e,l=[];if(!t||t===1)return l.push(Rd({...n,dateObj:a})),l;l.push(Rd({...n,dateObj:a}));for(let r=1;r<t;r++){const o=a.add({months:r});l.push(Rd({...n,dateObj:o}))}return l}function T1(e){const t=new wt(2025,1,6);return(1-Ru(t,e)+7)%7}function np(e,t={}){const a=E(e);function n(){return a.value}function l(C){a.value=C}function r(C,w){return new za(a.value,{...t,...w}).format(C)}function o(C,w=!0){return Vc(C)&&w?r(Pa(C),{dateStyle:"long",timeStyle:"long"}):r(Pa(C),{dateStyle:"long"})}function i(C,w={}){return new za(a.value,{...t,month:"long",year:"numeric",...w}).format(C)}function u(C,w={}){return new za(a.value,{...t,month:"long",...w}).format(C)}function c(){const C=Ns(Qa());return[1,2,3,4,5,6,7,8,9,10,11,12].map(S=>({label:u(Pa(C.set({month:S}))),value:S}))}function d(C,w={}){return new za(a.value,{...t,year:"numeric",...w}).format(C)}function p(C,w){return xs(C)?new za(a.value,{...t,...w,timeZone:C.timeZone}).formatToParts(Pa(C)):new za(a.value,{...t,...w}).formatToParts(Pa(C))}function v(C,w="narrow"){return new za(a.value,{...t,weekday:w}).format(C)}function m(C){const S=new za(a.value,{...t,hour:"numeric",minute:"numeric"}).formatToParts(C).find(q=>q.type==="dayPeriod")?.value;return S==="PM"||S==="pm"||S==="p.m."?"PM":"AM"}const y={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};function x(C,w,S={}){const q={...y,...S},I=p(C,q).find(B=>B.type===w);return I?I.value:""}return{setLocale:l,getLocale:n,fullMonth:u,fullYear:d,fullMonthAndYear:i,toParts:p,custom:r,part:x,dayPeriod:m,selectedDate:o,dayOfWeek:v,getMonths:c}}function $n(e){const t=Pu({dir:E("ltr")});return k(()=>e?.value||t.dir?.value||"ltr")}function yr(e){const t=kn(),a=t?.type.emits,n={};return a?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),a?.forEach(l=>{n[Jo(ea(l))]=(...r)=>e(l,...r)}),n}let qd=0;function M1(){Aa(e=>{if(!el)return;const t=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",t[0]??Xv()),document.body.insertAdjacentElement("beforeend",t[1]??Xv()),qd++,e(()=>{qd===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(a=>a.remove()),qd--})})}function Xv(){const e=document.createElement("span");return e.setAttribute("data-reka-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function lp(e){return k(()=>ca(e)?!!gr(e)?.closest("form"):!0)}function lt(){const e=kn(),t=E(),a=k(()=>n());yf(()=>{a.value!==n()&&Ox(t)});function n(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:gr(t)}const l=Object.assign({},e.exposed),r={};for(const i in e.props)Object.defineProperty(r,i,{enumerable:!0,configurable:!0,get:()=>e.props[i]});if(Object.keys(l).length>0)for(const i in l)Object.defineProperty(r,i,{enumerable:!0,configurable:!0,get:()=>l[i]});Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=r;function o(i){if(t.value=i,!!i&&(Object.defineProperty(r,"$el",{enumerable:!0,configurable:!0,get:()=>i instanceof Element?i:i.$el}),!(i instanceof Element)&&!Object.hasOwn(i,"$el"))){const u=i.$.exposed,c=Object.assign({},r);for(const d in u)Object.defineProperty(c,d,{enumerable:!0,configurable:!0,get:()=>u[d]});e.exposed=c}}return{forwardRef:o,currentRef:t,currentElement:a}}function Nu(e){const t=kn(),a=Object.keys(t?.type.props??{}).reduce((l,r)=>{const o=(t?.type.props[r]).default;return o!==void 0&&(l[r]=o),l},{}),n=Nx(e);return k(()=>{const l={},r=t?.vnode.props??{};return Object.keys(r).forEach(o=>{l[ea(o)]=r[o]}),Object.keys({...a,...l}).reduce((o,i)=>(n.value[i]!==void 0&&(o[i]=n.value[i]),o),{})})}function Cn(e,t){const a=Nu(e),n=t?yr(t):{};return k(()=>({...a.value,...n}))}var vA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Mr=new WeakMap,ai=new WeakMap,ni={},Ld=0,D1=function(e){return e&&(e.host||D1(e.parentNode))},hA=function(e,t){return t.map(function(a){if(e.contains(a))return a;var n=D1(a);return n&&e.contains(n)?n:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},gA=function(e,t,a,n){var l=hA(t,Array.isArray(e)?e:[e]);ni[a]||(ni[a]=new WeakMap);var r=ni[a],o=[],i=new Set,u=new Set(l),c=function(p){!p||i.has(p)||(i.add(p),c(p.parentNode))};l.forEach(c);var d=function(p){!p||u.has(p)||Array.prototype.forEach.call(p.children,function(v){if(i.has(v))d(v);else try{var m=v.getAttribute(n),y=m!==null&&m!=="false",x=(Mr.get(v)||0)+1,C=(r.get(v)||0)+1;Mr.set(v,x),r.set(v,C),o.push(v),x===1&&y&&ai.set(v,!0),C===1&&v.setAttribute(a,"true"),y||v.setAttribute(n,"true")}catch(w){console.error("aria-hidden: cannot operate on ",v,w)}})};return d(t),i.clear(),Ld++,function(){o.forEach(function(p){var v=Mr.get(p)-1,m=r.get(p)-1;Mr.set(p,v),r.set(p,m),v||(ai.has(p)||p.removeAttribute(n),ai.delete(p)),m||p.removeAttribute(a)}),Ld--,Ld||(Mr=new WeakMap,Mr=new WeakMap,ai=new WeakMap,ni={})}},yA=function(e,t,a){a===void 0&&(a="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),l=vA(e);return l?(n.push.apply(n,Array.from(l.querySelectorAll("[aria-live], script"))),gA(n,l,a,"aria-hidden")):function(){return null}};function rp(e){let t;ze(()=>gr(e),a=>{let n=!1;try{n=!!a?.closest("[popover]:not(:popover-open)")}catch{}a&&!n?t=yA(a):t&&t()}),Qn(()=>{t&&t()})}function Jn(e,t="reka"){let a;const n=Pu({useId:void 0});return n.useId?a=n.useId():a=gf?.(),t?`${t}-${a}`:a}function ho(){return{ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",SPACE_CODE:"Space"}}function Bu(e){const t=Pu({locale:E("en")});return k(()=>e?.value||t.locale?.value||"en")}function bA(e){const t=E(),a=k(()=>t.value?.width??0),n=k(()=>t.value?.height??0);return $t(()=>{const l=gr(e);if(l){t.value={width:l.offsetWidth,height:l.offsetHeight};const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let u,c;if("borderBoxSize"in i){const d=i.borderBoxSize,p=Array.isArray(d)?d[0]:d;u=p.inlineSize,c=p.blockSize}else u=l.offsetWidth,c=l.offsetHeight;t.value={width:u,height:c}});return r.observe(l,{box:"border-box"}),()=>r.unobserve(l)}else t.value=void 0}),{width:a,height:n}}function _A(e,t){const a=E(e);function n(r){return t[a.value][r]??a.value}return{state:a,dispatch:r=>{a.value=n(r)}}}function xA(e){const t=r4("",1e3);return{search:t,handleTypeaheadSearch:(l,r)=>{t.value=t.value+l;{const o=Zt(),i=r.map(v=>({...v,textValue:v.value?.textValue??v.ref.textContent?.trim()??""})),u=i.find(v=>v.ref===o),c=i.map(v=>v.textValue),d=wA(c,t.value,u?.textValue),p=i.find(v=>v.textValue===d);return p&&p.ref.focus(),p?.ref}},resetTypeahead:()=>{t.value=""}}}function kA(e,t){return e.map((a,n)=>e[(t+n)%e.length])}function wA(e,t,a){const l=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,r=a?e.indexOf(a):-1;let o=kA(e,Math.max(r,0));l.length===1&&(o=o.filter(c=>c!==a));const u=o.find(c=>c.toLowerCase().startsWith(l.toLowerCase()));return u!==a?u:void 0}function $A(e,t){const a=E({}),n=E("none"),l=E(e),r=e.value?"mounted":"unmounted";let o;const i=t.value?.ownerDocument.defaultView??zf,{state:u,dispatch:c}=_A(r,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),d=C=>{if(el){const w=new CustomEvent(C,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(w)}};ze(e,async(C,w)=>{const S=w!==C;if(await Ge(),S){const q=n.value,O=li(t.value);C?(c("MOUNT"),d("enter"),O==="none"&&d("after-enter")):O==="none"||O==="undefined"||a.value?.display==="none"?(c("UNMOUNT"),d("leave"),d("after-leave")):w&&q!==O?(c("ANIMATION_OUT"),d("leave")):(c("UNMOUNT"),d("after-leave"))}},{immediate:!0});const p=C=>{const w=li(t.value),S=w.includes(CSS.escape(C.animationName)),q=u.value==="mounted"?"enter":"leave";if(C.target===t.value&&S&&(d(`after-${q}`),c("ANIMATION_END"),!l.value)){const O=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",o=i?.setTimeout(()=>{t.value?.style.animationFillMode==="forwards"&&(t.value.style.animationFillMode=O)})}C.target===t.value&&w==="none"&&c("ANIMATION_END")},v=C=>{C.target===t.value&&(n.value=li(t.value))},m=ze(t,(C,w)=>{C?(a.value=getComputedStyle(C),C.addEventListener("animationstart",v),C.addEventListener("animationcancel",p),C.addEventListener("animationend",p)):(c("ANIMATION_END"),o!==void 0&&i?.clearTimeout(o),w?.removeEventListener("animationstart",v),w?.removeEventListener("animationcancel",p),w?.removeEventListener("animationend",p))},{immediate:!0}),y=ze(u,()=>{const C=li(t.value);n.value=u.value==="mounted"?C:"none"});return Qn(()=>{m(),y()}),{isPresent:k(()=>["mounted","unmountSuspended"].includes(u.value))}}function li(e){return e&&getComputedStyle(e).animationName||"none"}var br=ae({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:a}){const{present:n,forceMount:l}=Kt(e),r=E(),{isPresent:o}=$A(n,r);a({present:o});let i=t.default({present:o.value});i=jf(i||[]);const u=kn();if(i&&i?.length>1){const c=u?.parent?.type.name?`<${u.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${c}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(d=>` - ${d}`).join(`
|
||
`)].join(`
|
||
`))}return()=>l.value||n.value||o.value?qa(t.default({present:o.value})[0],{ref:c=>{const d=gr(c);return typeof d?.hasAttribute>"u"||(d?.hasAttribute("data-reka-popper-content-wrapper")?r.value=d.firstElementChild:r.value=d),d}}):null}});const zc=ae({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:a}){return()=>{if(!a.default)return null;const n=jf(a.default()),l=n.findIndex(u=>u.type!==Ga);if(l===-1)return n;const r=n[l];delete r.props?.ref;const o=r.props?Ye(t,r.props):t,i=Tl({...r,props:{}},o);return n.length===1?i:(n[l]=i,n)}}}),CA=["area","img","input"],rt=ae({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:a}){const n=e.asChild?"template":e.as;return typeof n=="string"&&CA.includes(n)?()=>qa(n,t):n!=="template"?()=>qa(e.as,t,{default:a.default}):()=>qa(zc,t,{default:a.default})}});function dr(){const e=E(),t=k(()=>["#text","#comment"].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:gr(e));return{primitiveElement:e,currentElement:t}}const[tl,SA]=Pt("DialogRoot");var EA=ae({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const a=e,l=Ft(a,"open",t,{defaultValue:a.defaultOpen,passive:a.open===void 0}),r=E(),o=E(),{modal:i}=Kt(a);return SA({open:l,modal:i,openModal:()=>{l.value=!0},onOpenChange:u=>{l.value=u},onOpenToggle:()=>{l.value=!l.value},contentId:"",titleId:"",descriptionId:"",triggerElement:r,contentElement:o}),(u,c)=>Ee(u.$slots,"default",{open:s(l),close:()=>l.value=!1})}}),al=EA,AA=ae({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e;lt();const a=tl();return(n,l)=>(f(),j(s(rt),Ye(t,{type:n.as==="button"?"button":void 0,onClick:l[0]||(l[0]=r=>s(a).onOpenChange(!1))}),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["type"]))}}),Pl=AA;const TA="dismissableLayer.pointerDownOutside",MA="dismissableLayer.focusOutside";function O1(e,t){if(!(t instanceof Element))return!1;const a=t.closest("[data-dismissable-layer]"),n=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),l=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(a&&(n===a||l.indexOf(n)<l.indexOf(a)))}function DA(e,t,a=!0){const n=t?.value?.ownerDocument??globalThis?.document,l=E(!1),r=E(()=>{});return Aa(o=>{if(!el||!ca(a))return;const i=async c=>{const d=c.target;if(!(!t?.value||!d)){if(O1(t.value,d)){l.value=!1;return}if(c.target&&!l.value){let v=function(){Ff(TA,e,p)};const p={originalEvent:c};c.pointerType==="touch"?(n.removeEventListener("click",r.value),r.value=v,n.addEventListener("click",r.value,{once:!0})):v()}else n.removeEventListener("click",r.value);l.value=!1}},u=window.setTimeout(()=>{n.addEventListener("pointerdown",i)},0);o(()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",i),n.removeEventListener("click",r.value)})}),{onPointerDownCapture:()=>{ca(a)&&(l.value=!0)}}}function OA(e,t,a=!0){const n=t?.value?.ownerDocument??globalThis?.document,l=E(!1);return Aa(r=>{if(!el||!ca(a))return;const o=async i=>{if(!t?.value)return;await Ge(),await Ge();const u=i.target;!t.value||!u||O1(t.value,u)||i.target&&!l.value&&Ff(MA,e,{originalEvent:i})};n.addEventListener("focusin",o),r(()=>n.removeEventListener("focusin",o))}),{onFocusCapture:()=>{ca(a)&&(l.value=!0)},onBlurCapture:()=>{ca(a)&&(l.value=!1)}}}const ba=Ka({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var PA=ae({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:l,currentElement:r}=lt(),o=k(()=>r.value?.ownerDocument??globalThis.document),i=k(()=>ba.layersRoot),u=k(()=>r.value?Array.from(i.value).indexOf(r.value):-1),c=k(()=>ba.layersWithOutsidePointerEventsDisabled.size>0),d=k(()=>{const m=Array.from(i.value),[y]=[...ba.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(y);return u.value>=x}),p=DA(async m=>{const y=[...ba.branches].some(x=>x?.contains(m.target));!d.value||y||(n("pointerDownOutside",m),n("interactOutside",m),await Ge(),m.defaultPrevented||n("dismiss"))},r),v=OA(m=>{[...ba.branches].some(x=>x?.contains(m.target))||(n("focusOutside",m),n("interactOutside",m),m.defaultPrevented||n("dismiss"))},r);return d4("Escape",m=>{u.value===i.value.size-1&&(n("escapeKeyDown",m),m.defaultPrevented||n("dismiss"))}),ze([r,()=>a.disableOutsidePointerEvents],([m,y],x,C)=>{m&&(y&&(ba.layersWithOutsidePointerEventsDisabled.size===0&&(ba.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),ba.layersWithOutsidePointerEventsDisabled.add(m),C(()=>{ba.layersWithOutsidePointerEventsDisabled.delete(m),ba.layersWithOutsidePointerEventsDisabled.size===0&&!$a(ba.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=ba.originalBodyPointerEvents)})),i.value.add(m))},{immediate:!0}),Aa(m=>{m(()=>{r.value&&(i.value.delete(r.value),ba.layersWithOutsidePointerEventsDisabled.delete(r.value))})}),(m,y)=>(f(),j(s(rt),{ref:s(l),"as-child":m.asChild,as:m.as,"data-dismissable-layer":"",style:oa({pointerEvents:c.value?d.value?"auto":"none":void 0}),onFocusCapture:s(v).onFocusCapture,onBlurCapture:s(v).onBlurCapture,onPointerdownCapture:s(p).onPointerDownCapture},{default:N(()=>[Ee(m.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),op=PA;const IA=ZE(()=>E([]));function RA(){const e=IA();return{add(t){const a=e.value[0];t!==a&&a?.pause(),e.value=Qv(e.value,t),e.value.unshift(t)},remove(t){e.value=Qv(e.value,t),e.value[0]?.resume()}}}function Qv(e,t){const a=[...e],n=a.indexOf(t);return n!==-1&&a.splice(n,1),a}const Nd="focusScope.autoFocusOnMount",Bd="focusScope.autoFocusOnUnmount",eh={bubbles:!1,cancelable:!0};function qA(e,{select:t=!1}={}){const a=Zt();for(const n of e)if(bl(n,{select:t}),Zt()!==a)return!0}function LA(e){const t=P1(e),a=th(t,e),n=th(t.reverse(),e);return[a,n]}function P1(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const l=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||l?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function th(e,t){for(const a of e)if(!NA(a,{upTo:t}))return a}function NA(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function BA(e){return e instanceof HTMLInputElement&&"select"in e}function bl(e,{select:t=!1}={}){if(e&&e.focus){const a=Zt();e.focus({preventScroll:!0}),e!==a&&BA(e)&&t&&e.select()}}var FA=ae({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const a=e,n=t,{currentRef:l,currentElement:r}=lt(),o=E(null),i=RA(),u=Ka({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Aa(d=>{if(!el)return;const p=r.value;if(!a.trapped)return;function v(C){if(u.paused||!p)return;const w=C.target;p.contains(w)?o.value=w:bl(o.value,{select:!0})}function m(C){if(u.paused||!p)return;const w=C.relatedTarget;w!==null&&(p.contains(w)||bl(o.value,{select:!0}))}function y(C){const w=o.value;if(w===null||!C.some(O=>O.removedNodes.length>0))return;p.contains(w)||bl(p)}document.addEventListener("focusin",v),document.addEventListener("focusout",m);const x=new MutationObserver(y);p&&x.observe(p,{childList:!0,subtree:!0}),d(()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),x.disconnect()})}),Aa(async d=>{const p=r.value;if(await Ge(),!p)return;i.add(u);const v=Zt();if(!p.contains(v)){const y=new CustomEvent(Nd,eh);p.addEventListener(Nd,x=>n("mountAutoFocus",x)),p.dispatchEvent(y),y.defaultPrevented||(qA(P1(p),{select:!0}),Zt()===v&&bl(p))}d(()=>{p.removeEventListener(Nd,C=>n("mountAutoFocus",C));const y=new CustomEvent(Bd,eh),x=C=>{n("unmountAutoFocus",C)};p.addEventListener(Bd,x),p.dispatchEvent(y),p.setAttribute("data-focus-scope-unmounting",""),setTimeout(()=>{y.defaultPrevented||bl(v??document.body,{select:!0}),p.removeEventListener(Bd,x),i.remove(u),p.removeAttribute("data-focus-scope-unmounting")},0)})});function c(d){if(!a.loop&&!a.trapped||u.paused)return;const p=d.key==="Tab"&&!d.altKey&&!d.ctrlKey&&!d.metaKey,v=Zt();if(p&&v){const m=d.currentTarget,[y,x]=LA(m);y&&x?!d.shiftKey&&v===x?(d.preventDefault(),a.loop&&bl(y,{select:!0})):d.shiftKey&&v===y&&(d.preventDefault(),a.loop&&bl(x,{select:!0})):v===m&&d.preventDefault()}}return(d,p)=>(f(),j(s(rt),{ref_key:"currentRef",ref:l,tabindex:"-1","as-child":d.asChild,as:d.as,onKeydown:c},{default:N(()=>[Ee(d.$slots,"default")]),_:3},8,["as-child","as"]))}}),sp=FA;const VA="menu.itemSelect",jc=["Enter"," "],zA=["ArrowDown","PageUp","Home"],I1=["ArrowUp","PageDown","End"],jA=[...zA,...I1];[...jc],[...jc];function R1(e){return e?"open":"closed"}function q1(e){return e==="indeterminate"}function L1(e){return q1(e)?"indeterminate":e?"checked":"unchecked"}function UA(e){const t=Zt();for(const a of e)if(a===t||(a.focus(),Zt()!==t))return}function HA(e,t){const{x:a,y:n}=e;let l=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){const i=t[r].x,u=t[r].y,c=t[o].x,d=t[o].y;u>n!=d>n&&a<(c-i)*(n-u)/(d-u)+i&&(l=!l)}return l}function KA(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return HA(a,t)}function eu(e){return e.pointerType==="mouse"}var WA=ae({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=tl(),{forwardRef:r,currentElement:o}=lt();return l.titleId||=Jn(void 0,"reka-dialog-title"),l.descriptionId||=Jn(void 0,"reka-dialog-description"),$t(()=>{l.contentElement=o,Zt()!==document.body&&(l.triggerElement.value=Zt())}),(i,u)=>(f(),j(s(sp),{"as-child":"",loop:"",trapped:a.trapFocus,onMountAutoFocus:u[5]||(u[5]=c=>n("openAutoFocus",c)),onUnmountAutoFocus:u[6]||(u[6]=c=>n("closeAutoFocus",c))},{default:N(()=>[M(s(op),Ye({id:s(l).contentId,ref:s(r),as:i.as,"as-child":i.asChild,"disable-outside-pointer-events":i.disableOutsidePointerEvents,role:"dialog","aria-describedby":s(l).descriptionId,"aria-labelledby":s(l).titleId,"data-state":s(R1)(s(l).open.value)},i.$attrs,{onDismiss:u[0]||(u[0]=c=>s(l).onOpenChange(!1)),onEscapeKeyDown:u[1]||(u[1]=c=>n("escapeKeyDown",c)),onFocusOutside:u[2]||(u[2]=c=>n("focusOutside",c)),onInteractOutside:u[3]||(u[3]=c=>n("interactOutside",c)),onPointerDownOutside:u[4]||(u[4]=c=>n("pointerDownOutside",c))}),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),N1=WA,GA=ae({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=tl(),r=yr(n),{forwardRef:o,currentElement:i}=lt();return rp(i),(u,c)=>(f(),j(N1,Ye({...a,...s(r)},{ref:s(o),"trap-focus":s(l).open.value,"disable-outside-pointer-events":a.disableOutsidePointerEvents,onCloseAutoFocus:c[0]||(c[0]=d=>{d.defaultPrevented||(d.preventDefault(),s(l).triggerElement.value?.focus())}),onPointerDownOutside:c[1]||(c[1]=d=>{const p=d.detail.originalEvent,v=p.button===0&&p.ctrlKey===!0;(p.button===2||v)&&d.preventDefault()}),onFocusOutside:c[2]||(c[2]=d=>{d.preventDefault()})}),{default:N(()=>[Ee(u.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),YA=GA,JA=ae({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,l=yr(t);lt();const r=tl(),o=E(!1),i=E(!1);return(u,c)=>(f(),j(N1,Ye({...a,...s(l)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=d=>{d.defaultPrevented||(o.value||s(r).triggerElement.value?.focus(),d.preventDefault()),o.value=!1,i.value=!1}),onInteractOutside:c[1]||(c[1]=d=>{d.defaultPrevented||(o.value=!0,d.detail.originalEvent.type==="pointerdown"&&(i.value=!0));const p=d.target;s(r).triggerElement.value?.contains(p)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&i.value&&d.preventDefault()})}),{default:N(()=>[Ee(u.$slots,"default")]),_:3},16))}}),ZA=JA,XA=ae({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=tl(),r=yr(n),{forwardRef:o}=lt();return(i,u)=>(f(),j(s(br),{present:i.forceMount||s(l).open.value},{default:N(()=>[s(l).modal.value?(f(),j(YA,Ye({key:0,ref:s(o)},{...a,...s(r),...i.$attrs}),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16)):(f(),j(ZA,Ye({key:1,ref:s(o)},{...a,...s(r),...i.$attrs}),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),nl=XA,QA=ae({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(e){const t=e;lt();const a=tl();return(n,l)=>(f(),j(s(rt),Ye(t,{id:s(a).descriptionId}),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["id"]))}}),hn=QA,e5=ae({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=tl();return Uf(!0),lt(),(a,n)=>(f(),j(s(rt),{as:a.as,"as-child":a.asChild,"data-state":s(t).open.value?"open":"closed",style:{"pointer-events":"auto"},onPointerdown:n[0]||(n[0]=mt(()=>{},["left","self","prevent"]))},{default:N(()=>[Ee(a.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),t5=e5,a5=ae({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=tl(),{forwardRef:a}=lt();return(n,l)=>s(t)?.modal.value?(f(),j(s(br),{key:0,present:n.forceMount||s(t).open.value},{default:N(()=>[M(t5,Ye(n.$attrs,{ref:s(a),as:n.as,"as-child":n.asChild}),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):Y("v-if",!0)}}),ll=a5,n5=ae({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=i4();return(a,n)=>s(t)||a.forceMount?(f(),j(Qx,{key:0,to:a.to,disabled:a.disabled,defer:a.defer},[Ee(a.$slots,"default")],8,["to","disabled","defer"])):Y("v-if",!0)}}),Fu=n5,l5=ae({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(Fu),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),zl=l5,r5=ae({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(e){const t=e,a=tl();return lt(),(n,l)=>(f(),j(s(rt),Ye(t,{id:s(a).titleId}),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["id"]))}}),bn=r5;const[o5,s5]=Pt("AlertDialogContent");var i5=ae({__name:"AlertDialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,l=yr(t);lt();const r=E();return s5({onCancelElementChange:o=>{r.value=o}}),(o,i)=>(f(),j(s(nl),Ye({...a,...s(l)},{role:"alertdialog",onPointerDownOutside:i[0]||(i[0]=mt(()=>{},["prevent"])),onInteractOutside:i[1]||(i[1]=mt(()=>{},["prevent"])),onOpenAutoFocus:i[2]||(i[2]=()=>{Ge(()=>{r.value?.focus({preventScroll:!0})})})}),{default:N(()=>[Ee(o.$slots,"default")]),_:3},16))}}),u5=i5,d5=ae({__name:"AlertDialogCancel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=o5(),{forwardRef:n,currentElement:l}=lt();return $t(()=>{a.onCancelElementChange(l.value)}),(r,o)=>(f(),j(s(Pl),Ye(t,{ref:s(n)}),{default:N(()=>[Ee(r.$slots,"default")]),_:3},16))}}),c5=d5,f5=ae({__name:"AlertDialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(e){const t=e;return lt(),(a,n)=>(f(),j(s(hn),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),p5=f5,m5=ae({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return lt(),(a,n)=>(f(),j(s(ll),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),v5=m5,h5=ae({__name:"AlertDialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(Fu),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),g5=h5,y5=ae({__name:"AlertDialogRoot",props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1}},emits:["update:open"],setup(e,{emit:t}){const l=Cn(e,t);return lt(),(r,o)=>(f(),j(s(al),Ye(s(l),{modal:!0}),{default:N(i=>[Ee(r.$slots,"default",ut(ft(i)))]),_:3},16))}}),b5=y5,_5=ae({__name:"AlertDialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(e){const t=e;return lt(),(a,n)=>(f(),j(s(bn),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),x5=_5;const ah="data-reka-collection-item";function ip(e={}){const{key:t="",isProvider:a=!1}=e,n=`${t}CollectionProvider`;let l;a?(l={collectionRef:E(),itemMap:E(new Map)},yt(n,l)):l=ct(n);const r=(d=!1)=>{const p=l.collectionRef.value;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${ah}]`)),y=Array.from(l.itemMap.value.values()).sort((x,C)=>v.indexOf(x.ref)-v.indexOf(C.ref));return d?y:y.filter(x=>x.ref.dataset.disabled!=="")},o=ae({name:"CollectionSlot",inheritAttrs:!1,setup(d,{slots:p,attrs:v}){const{primitiveElement:m,currentElement:y}=dr();return ze(y,()=>{l.collectionRef.value=y.value}),()=>qa(zc,{ref:m,...v},p)}}),i=ae({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(d,{slots:p,attrs:v}){const{primitiveElement:m,currentElement:y}=dr();return Aa(x=>{if(y.value){const C=Ti(y.value);l.itemMap.value.set(C,{ref:y.value,value:d.value}),x(()=>l.itemMap.value.delete(C))}}),()=>qa(zc,{...v,[ah]:"",ref:m},p)}}),u=k(()=>Array.from(l.itemMap.value.values())),c=k(()=>l.itemMap.value.size);return{getItems:r,reactiveItems:u,itemMapSize:c,CollectionSlot:o,CollectionItem:i}}var k5=ae({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,a)=>(f(),j(s(rt),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:N(()=>[Ee(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),up=k5,w5=ae({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,{primitiveElement:a,currentElement:n}=dr(),l=k(()=>t.checked??t.value);return ze(l,(r,o)=>{if(!n.value)return;const i=n.value,u=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(u,"value").set;if(d&&r!==o){const p=new Event("input",{bubbles:!0}),v=new Event("change",{bubbles:!0});d.call(i,r),i.dispatchEvent(p),i.dispatchEvent(v)}}),(r,o)=>(f(),j(up,Ye({ref_key:"primitiveElement",ref:a},{...t,...r.$attrs},{as:"input"}),null,16))}}),nh=w5,$5=ae({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,a=k(()=>typeof t.value=="object"&&Array.isArray(t.value)&&t.value.length===0&&t.required),n=k(()=>typeof t.value=="string"||typeof t.value=="number"||typeof t.value=="boolean"||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value=="object"&&Array.isArray(t.value)?t.value.flatMap((l,r)=>typeof l=="object"?Object.entries(l).map(([o,i])=>({name:`${t.name}[${r}][${o}]`,value:i})):{name:`${t.name}[${r}]`,value:l}):t.value!==null&&typeof t.value=="object"&&!Array.isArray(t.value)?Object.entries(t.value).map(([l,r])=>({name:`${t.name}[${l}]`,value:r})):[]);return(l,r)=>(f(),b(me,null,[Y(" We render single input if it's required "),a.value?(f(),j(nh,Ye({key:l.name},{...t,...l.$attrs},{name:l.name,value:l.value}),null,16,["name","value"])):(f(!0),b(me,{key:1},Ie(n.value,o=>(f(),j(nh,Ye({key:o.name},{ref_for:!0},{...t,...l.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),dp=$5;const C5="rovingFocusGroup.onEntryFocus",S5={bubbles:!1,cancelable:!0},E5={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function A5(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function T5(e,t,a){const n=A5(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return E5[n]}function B1(e,t=!1){const a=Zt();for(const n of e)if(n===a||(n.focus({preventScroll:t}),Zt()!==a))return}function M5(e,t){return e.map((a,n)=>e[(t+n)%e.length])}const[F1,D5]=Pt("PopperRoot");var O5=ae({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=E();return D5({anchor:t,onAnchorChange:a=>t.value=a}),(a,n)=>Ee(a.$slots,"default")}}),V1=O5,P5=ae({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:a,currentElement:n}=lt(),l=F1();return ey(()=>{l.onAnchorChange(t.reference??n.value)}),(r,o)=>(f(),j(s(rt),{ref:s(a),as:r.as,"as-child":r.asChild},{default:N(()=>[Ee(r.$slots,"default")]),_:3},8,["as","as-child"]))}}),cp=P5;function I5(e){return e!==null}function R5(e){return{name:"transformOrigin",options:e,fn(t){const{placement:a,rects:n,middlewareData:l}=t,o=l.arrow?.centerOffset!==0,i=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[c,d]=Uc(a),p={start:"0%",center:"50%",end:"100%"}[d],v=(l.arrow?.x??0)+i/2,m=(l.arrow?.y??0)+u/2;let y="",x="";return c==="bottom"?(y=o?p:`${v}px`,x=`${-u}px`):c==="top"?(y=o?p:`${v}px`,x=`${n.floating.height+u}px`):c==="right"?(y=`${-u}px`,x=o?p:`${m}px`):c==="left"&&(y=`${n.floating.width+u}px`,x=o?p:`${m}px`),{data:{x:y,y:x}}}}}function Uc(e){const[t,a="center"]=e.split("-");return[t,a]}const q5=["top","right","bottom","left"],Il=Math.min,zn=Math.max,tu=Math.round,ri=Math.floor,jn=e=>({x:e,y:e}),L5={left:"right",right:"left",bottom:"top",top:"bottom"};function z1(e,t,a){return zn(e,Il(t,a))}function Zn(e,t){return typeof e=="function"?e(t):e}function Rl(e){return e.split("-")[0]}function go(e){return e.split("-")[1]}function fp(e){return e==="x"?"y":"x"}function pp(e){return e==="y"?"height":"width"}function pn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function mp(e){return fp(pn(e))}function N5(e,t,a){a===void 0&&(a=!1);const n=go(e),l=mp(e),r=pp(l);let o=l==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=au(o)),[o,au(o)]}function B5(e){const t=au(e);return[Hc(e),t,Hc(t)]}function Hc(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const lh=["left","right"],rh=["right","left"],F5=["top","bottom"],V5=["bottom","top"];function z5(e,t,a){switch(e){case"top":case"bottom":return a?t?rh:lh:t?lh:rh;case"left":case"right":return t?F5:V5;default:return[]}}function j5(e,t,a,n){const l=go(e);let r=z5(Rl(e),a==="start",n);return l&&(r=r.map(o=>o+"-"+l),t&&(r=r.concat(r.map(Hc)))),r}function au(e){const t=Rl(e);return L5[t]+e.slice(t.length)}function U5(e){var t,a,n,l;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(n=e.bottom)!=null?n:0,left:(l=e.left)!=null?l:0}}function j1(e){return typeof e!="number"?U5(e):{top:e,right:e,bottom:e,left:e}}function nu(e){const{x:t,y:a,width:n,height:l}=e;return{width:n,height:l,top:a,left:t,right:t+n,bottom:a+l,x:t,y:a}}function oh(e,t,a){let{reference:n,floating:l}=e;const r=pn(t),o=mp(t),i=pp(o),u=Rl(t),c=r==="y",d=n.x+n.width/2-l.width/2,p=n.y+n.height/2-l.height/2,v=n[i]/2-l[i]/2;let m;switch(u){case"top":m={x:d,y:n.y-l.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-l.width,y:p};break;default:m={x:n.x,y:n.y}}const y=go(t);return y&&(m[o]+=v*(y==="end"?1:-1)*(a&&c?-1:1)),m}async function H5(e,t){var a;t===void 0&&(t={});const{x:n,y:l,platform:r,rects:o,elements:i,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:v=!1,padding:m=0}=Zn(t,e),y=j1(m),C=i[v?p==="floating"?"reference":"floating":p],w=nu(await r.getClippingRect({element:(a=await(r.isElement==null?void 0:r.isElement(C)))==null||a?C:C.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(i.floating)),boundary:c,rootBoundary:d,strategy:u})),S=p==="floating"?{x:n,y:l,width:o.floating.width,height:o.floating.height}:o.reference,q=await(r.getOffsetParent==null?void 0:r.getOffsetParent(i.floating)),O=await(r.isElement==null?void 0:r.isElement(q))&&await(r.getScale==null?void 0:r.getScale(q))||{x:1,y:1},I=nu(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:S,offsetParent:q,strategy:u}):S);return{top:(w.top-I.top+y.top)/O.y,bottom:(I.bottom-w.bottom+y.bottom)/O.y,left:(w.left-I.left+y.left)/O.x,right:(I.right-w.right+y.right)/O.x}}const K5=50,W5=async(e,t,a)=>{const{placement:n="bottom",strategy:l="absolute",middleware:r=[],platform:o}=a,i=o.detectOverflow?o:{...o,detectOverflow:H5},u=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:l}),{x:d,y:p}=oh(c,n,u),v=n,m=0;const y={};for(let x=0;x<r.length;x++){const C=r[x];if(!C)continue;const{name:w,fn:S}=C,{x:q,y:O,data:I,reset:B}=await S({x:d,y:p,initialPlacement:n,placement:v,strategy:l,middlewareData:y,rects:c,platform:i,elements:{reference:e,floating:t}});d=q??d,p=O??p,y[w]={...y[w],...I},B&&m<K5&&(m++,typeof B=="object"&&(B.placement&&(v=B.placement),B.rects&&(c=B.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:l}):B.rects),{x:d,y:p}=oh(c,v,u)),x=-1)}return{x:d,y:p,placement:v,strategy:l,middlewareData:y}},G5=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:n,placement:l,rects:r,platform:o,elements:i,middlewareData:u}=t,{element:c,padding:d=0}=Zn(e,t)||{};if(c==null)return{};const p=j1(d),v={x:a,y:n},m=mp(l),y=pp(m),x=await o.getDimensions(c),C=m==="y",w=C?"top":"left",S=C?"bottom":"right",q=C?"clientHeight":"clientWidth",O=r.reference[y]+r.reference[m]-v[m]-r.floating[y],I=v[m]-r.reference[m],B=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let L=B?B[q]:0;(!L||!await(o.isElement==null?void 0:o.isElement(B)))&&(L=i.floating[q]||r.floating[y]);const W=O/2-I/2,T=L/2-x[y]/2-1,R=Il(p[w],T),G=Il(p[S],T),A=L-x[y]-G,D=L/2-x[y]/2+W,z=z1(R,D,A),V=!u.arrow&&go(l)!=null&&D!==z&&r.reference[y]/2-(D<R?R:G)-x[y]/2<0,K=V?D<R?D-R:D-A:0;return{[m]:v[m]+K,data:{[m]:z,centerOffset:D-z-K,...V&&{alignmentOffset:K}},reset:V}}}),Y5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,n;const{placement:l,middlewareData:r,rects:o,initialPlacement:i,platform:u,elements:c}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:v,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...C}=Zn(e,t);if((a=r.arrow)!=null&&a.alignmentOffset)return{};const w=Rl(l),S=pn(i),q=Rl(i)===i,O=await(u.isRTL==null?void 0:u.isRTL(c.floating)),I=v||(q||!x?[au(i)]:B5(i)),B=y!=="none";!v&&B&&I.push(...j5(i,x,y,O));const L=[i,...I],W=await u.detectOverflow(t,C),T=[];let R=((n=r.flip)==null?void 0:n.overflows)||[];if(d&&T.push(W[w]),p){const z=N5(l,o,O);T.push(W[z[0]],W[z[1]])}if(R=[...R,{placement:l,overflows:T}],!T.every(z=>z<=0)){var G,A;const z=(((G=r.flip)==null?void 0:G.index)||0)+1,V=L[z];if(V&&(!(p==="alignment"?S!==pn(V):!1)||R.every(ie=>pn(ie.placement)===S?ie.overflows[0]>0:!0)))return{data:{index:z,overflows:R},reset:{placement:V}};let K=(A=R.filter(re=>re.overflows[0]<=0).sort((re,ie)=>re.overflows[1]-ie.overflows[1])[0])==null?void 0:A.placement;if(!K)switch(m){case"bestFit":{var D;const re=(D=R.filter(ie=>{if(B){const Ae=pn(ie.placement);return Ae===S||Ae==="y"}return!0}).map(ie=>[ie.placement,ie.overflows.filter(Ae=>Ae>0).reduce((Ae,_e)=>Ae+_e,0)]).sort((ie,Ae)=>ie[1]-Ae[1])[0])==null?void 0:D[0];re&&(K=re);break}case"initialPlacement":K=i;break}if(l!==K)return{reset:{placement:K}}}return{}}}};function sh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ih(e){return q5.some(t=>e[t]>=0)}const J5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:n}=t,{strategy:l="referenceHidden",...r}=Zn(e,t);switch(l){case"referenceHidden":{const o=await n.detectOverflow(t,{...r,elementContext:"reference"}),i=sh(o,a.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:ih(i)}}}case"escaped":{const o=await n.detectOverflow(t,{...r,altBoundary:!0}),i=sh(o,a.floating);return{data:{escapedOffsets:i,escaped:ih(i)}}}default:return{}}}}},U1=new Set(["left","top"]);async function Z5(e,t){const{placement:a,platform:n,elements:l}=e,r=await(n.isRTL==null?void 0:n.isRTL(l.floating)),o=Rl(a),i=go(a),u=pn(a)==="y",c=U1.has(o)?-1:1,d=r&&u?-1:1,p=Zn(t,e);let{mainAxis:v,crossAxis:m,alignmentAxis:y}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof y=="number"&&(m=i==="end"?y*-1:y),u?{x:m*d,y:v*c}:{x:v*c,y:m*d}}const X5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,n;const{x:l,y:r,placement:o,middlewareData:i}=t,u=await Z5(t,e);return o===((a=i.offset)==null?void 0:a.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:l+u.x,y:r+u.y,data:{...u,placement:o}}}}},Q5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:n,placement:l,platform:r}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:u={fn:S=>{let{x:q,y:O}=S;return{x:q,y:O}}},...c}=Zn(e,t),d={x:a,y:n},p=await r.detectOverflow(t,c),v=pn(l),m=fp(v);let y=d[m],x=d[v];const C=(S,q)=>z1(q+p[S==="y"?"top":"left"],q,q-p[S==="y"?"bottom":"right"]);o&&(y=C(m,y)),i&&(x=C(v,x));const w=u.fn({...t,[m]:y,[v]:x});return{...w,data:{x:w.x-a,y:w.y-n,enabled:{[m]:o,[v]:i}}}}}},eT=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,n;const{x:l,y:r,placement:o,rects:i,middlewareData:u}=t,{offset:c=0,mainAxis:d=!0,crossAxis:p=!0}=Zn(e,t),v={x:l,y:r},m=pn(o),y=fp(m);let x=v[y],C=v[m];const w=Zn(c,t),S=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(a=w.mainAxis)!=null?a:0,crossAxis:(n=w.crossAxis)!=null?n:0};if(d){const I=y==="y"?"height":"width",B=i.reference[y]-i.floating[I]+S.mainAxis,L=i.reference[y]+i.reference[I]-S.mainAxis;x<B?x=B:x>L&&(x=L)}if(p){var q,O;const I=y==="y"?"width":"height",B=U1.has(Rl(o)),L=i.reference[m]-i.floating[I]+(B&&((q=u.offset)==null?void 0:q[m])||0)+(B?0:S.crossAxis),W=i.reference[m]+i.reference[I]+(B?0:((O=u.offset)==null?void 0:O[m])||0)-(B?S.crossAxis:0);C<L?C=L:C>W&&(C=W)}return{[y]:x,[m]:C}}}},tT=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:a,rects:n,platform:l,elements:r}=t,{apply:o=()=>{},...i}=Zn(e,t),u=await l.detectOverflow(t,i),c=Rl(a),d=go(a),p=pn(a)==="y",{width:v,height:m}=n.floating;let y,x;c==="top"||c==="bottom"?(y=c,x=d===(await(l.isRTL==null?void 0:l.isRTL(r.floating))?"start":"end")?"left":"right"):(x=c,y=d==="end"?"top":"bottom");const C=m-u.top-u.bottom,w=v-u.left-u.right,S=Il(m-u[y],C),q=Il(v-u[x],w),O=t.middlewareData.shift,I=!O;let B=S,L=q;O!=null&&O.enabled.x&&(L=w),O!=null&&O.enabled.y&&(B=C),I&&!d&&(p?L=v-2*zn(u.left,u.right):B=m-2*zn(u.top,u.bottom)),await o({...t,availableWidth:L,availableHeight:B});const W=await l.getDimensions(r.floating);return v!==W.width||m!==W.height?{reset:{rects:!0}}:{}}}};function Vu(){return typeof window<"u"}function _r(e){return vp(e)?(e.nodeName||"").toLowerCase():"#document"}function ha(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rl(e){var t;return(t=(vp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vp(e){return Vu()?e instanceof Node||e instanceof ha(e).Node:!1}function _n(e){return Vu()?e instanceof Element||e instanceof ha(e).Element:!1}function jl(e){return Vu()?e instanceof HTMLElement||e instanceof ha(e).HTMLElement:!1}function uh(e){return!Vu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ha(e).ShadowRoot}function zu(e){const{overflow:t,overflowX:a,overflowY:n,display:l}=xn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&l!=="inline"&&l!=="contents"}function aT(e){return/^(table|td|th)$/.test(_r(e))}function ju(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const nT=/transform|translate|scale|rotate|perspective|filter/,lT=/paint|layout|strict|content/,Xl=e=>!!e&&e!=="none";let Fd;function hp(e){const t=_n(e)?xn(e):e;return Xl(t.transform)||Xl(t.translate)||Xl(t.scale)||Xl(t.rotate)||Xl(t.perspective)||!gp()&&(Xl(t.backdropFilter)||Xl(t.filter))||nT.test(t.willChange||"")||lT.test(t.contain||"")}function rT(e){let t=cr(e);for(;jl(t)&&!ws(t);){if(hp(t))return t;if(ju(t))return null;t=cr(t)}return null}function gp(){return Fd==null&&(Fd=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Fd}function ws(e){return/^(html|body|#document)$/.test(_r(e))}function xn(e){return ha(e).getComputedStyle(e)}function Uu(e){return _n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cr(e){if(_r(e)==="html")return e;const t=e.assignedSlot||e.parentNode||uh(e)&&e.host||rl(e);return uh(t)?t.host:t}function H1(e){const t=cr(e);return ws(t)?(e.ownerDocument||e).body:jl(t)&&zu(t)?t:H1(t)}function $s(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);const l=H1(e),r=l===((n=e.ownerDocument)==null?void 0:n.body),o=ha(l);if(r){const i=Kc(o);return t.concat(o,o.visualViewport||[],zu(l)?l:[],i&&a?$s(i):[])}else return t.concat(l,$s(l,[],a))}function Kc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function K1(e){const t=xn(e);let a=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const l=jl(e),r=l?e.offsetWidth:a,o=l?e.offsetHeight:n,i=tu(a)!==r||tu(n)!==o;return i&&(a=r,n=o),{width:a,height:n,$:i}}function yp(e){return _n(e)?e:e.contextElement}function Xr(e){const t=yp(e);if(!jl(t))return jn(1);const a=t.getBoundingClientRect(),{width:n,height:l,$:r}=K1(t);let o=(r?tu(a.width):a.width)/n,i=(r?tu(a.height):a.height)/l;return(!o||!Number.isFinite(o))&&(o=1),(!i||!Number.isFinite(i))&&(i=1),{x:o,y:i}}const oT=jn(0);function W1(e){const t=ha(e);return!gp()||!t.visualViewport?oT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sT(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===ha(e)}function fr(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);const l=e.getBoundingClientRect(),r=yp(e);let o=jn(1);t&&(n?_n(n)&&(o=Xr(n)):o=Xr(e));const i=sT(r,a,n)?W1(r):jn(0);let u=(l.left+i.x)/o.x,c=(l.top+i.y)/o.y,d=l.width/o.x,p=l.height/o.y;if(r&&n){const v=ha(r),m=_n(n)?ha(n):n;let y=v,x=Kc(y);for(;x&&m!==y;){const C=Xr(x),w=x.getBoundingClientRect(),S=xn(x),q=w.left+(x.clientLeft+parseFloat(S.paddingLeft))*C.x,O=w.top+(x.clientTop+parseFloat(S.paddingTop))*C.y;u*=C.x,c*=C.y,d*=C.x,p*=C.y,u+=q,c+=O,y=ha(x),x=Kc(y)}}return nu({width:d,height:p,x:u,y:c})}function Hu(e,t){const a=Uu(e).scrollLeft;return t?t.left+a:fr(rl(e)).left+a}function G1(e,t){const a=e.getBoundingClientRect(),n=a.left+t.scrollLeft-Hu(e,a),l=a.top+t.scrollTop;return{x:n,y:l}}function iT(e){let{elements:t,rect:a,offsetParent:n,strategy:l}=e;const r=l==="fixed",o=rl(n),i=t?ju(t.floating):!1;if(n===o||i&&r)return a;let u={scrollLeft:0,scrollTop:0},c=jn(1);const d=jn(0),p=jl(n);if((p||!r)&&((_r(n)!=="body"||zu(o))&&(u=Uu(n)),p)){const m=fr(n);c=Xr(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}const v=o&&!p&&!r?G1(o,u):jn(0);return{width:a.width*c.x,height:a.height*c.y,x:a.x*c.x-u.scrollLeft*c.x+d.x+v.x,y:a.y*c.y-u.scrollTop*c.y+d.y+v.y}}function uT(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function dT(e){const t=Uu(e),a=e.ownerDocument.body,n=zn(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),l=zn(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let r=-t.scrollLeft+Hu(e);const o=-t.scrollTop;return xn(a).direction==="rtl"&&(r+=zn(e.clientWidth,a.clientWidth)-n),{width:n,height:l,x:r,y:o}}const cT=25;function fT(e,t,a){a===void 0&&(a="viewport");const n=a==="layoutViewport",l=ha(e),r=rl(e),o=l.visualViewport;let i=r.clientWidth,u=r.clientHeight,c=0,d=0;if(o){const v=!gp()||t==="fixed";n?v||(c=-o.offsetLeft,d=-o.offsetTop):(i=o.width,u=o.height,v&&(c=o.offsetLeft,d=o.offsetTop))}if(Hu(r)<=0){const v=r.ownerDocument,m=v.body,y=getComputedStyle(m),x=v.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,C=Math.abs(r.clientWidth-m.clientWidth-x),w=getComputedStyle(r).scrollbarGutter==="stable both-edges"?C/2:C;w<=cT&&(i-=w)}return{width:i,height:u,x:c,y:d}}function pT(e,t){const a=fr(e,!0,t==="fixed"),n=a.top+e.clientTop,l=a.left+e.clientLeft,r=Xr(e),o=e.clientWidth*r.x,i=e.clientHeight*r.y,u=l*r.x,c=n*r.y;return{width:o,height:i,x:u,y:c}}function dh(e,t,a){let n;if(t==="viewport"||t==="layoutViewport")n=fT(e,a,t);else if(t==="document")n=dT(rl(e));else if(_n(t))n=pT(t,a);else{const l=W1(e);n={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return nu(n)}function mT(e,t){const a=t.get(e);if(a)return a;let n=$s(e,[],!1).filter(i=>_n(i)&&_r(i)!=="body"),l=null;const r=xn(e).position==="fixed";let o=r?cr(e):e;for(;_n(o)&&!ws(o);){const i=xn(o),u=hp(o),c=l?l.position:r?"fixed":"";!u&&(c==="fixed"||c==="absolute"&&i.position==="static")?n=n.filter(p=>p!==o):l=i,o=cr(o)}return t.set(e,n),n}function vT(e){let{element:t,boundary:a,rootBoundary:n,strategy:l}=e;const o=[...a==="clippingAncestors"?ju(t)?[]:mT(t,this._c):[].concat(a),n],i=dh(t,o[0],l);let u=i.top,c=i.right,d=i.bottom,p=i.left;for(let v=1;v<o.length;v++){const m=dh(t,o[v],l);u=zn(m.top,u),c=Il(m.right,c),d=Il(m.bottom,d),p=zn(m.left,p)}return{width:c-p,height:d-u,x:p,y:u}}function hT(e){const{width:t,height:a}=K1(e);return{width:t,height:a}}function gT(e,t,a){const n=jl(t),l=rl(t),r=a==="fixed",o=fr(e,!0,r,t);let i={scrollLeft:0,scrollTop:0};const u=jn(0);if((n||!r)&&((_r(t)!=="body"||zu(l))&&(i=Uu(t)),n)){const v=fr(t,!0,r,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}!n&&l&&(u.x=Hu(l));const c=l&&!n&&!r?G1(l,i):jn(0),d=o.left+i.scrollLeft-u.x-c.x,p=o.top+i.scrollTop-u.y-c.y;return{x:d,y:p,width:o.width,height:o.height}}function Vd(e){return xn(e).position==="static"}function ch(e,t){if(!jl(e)||xn(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return rl(e)===a&&(a=a.ownerDocument.body),a}function Y1(e,t){const a=ha(e);if(ju(e))return a;if(!jl(e)){let l=cr(e);for(;l&&!ws(l);){if(_n(l)&&!Vd(l))return l;l=cr(l)}return a}let n=ch(e,t);for(;n&&aT(n)&&Vd(n);)n=ch(n,t);return n&&ws(n)&&Vd(n)&&!hp(n)?a:n||rT(e)||a}const yT=async function(e){const t=this.getOffsetParent||Y1,a=this.getDimensions,n=await a(e.floating);return{reference:gT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function bT(e){return xn(e).direction==="rtl"}const _T={convertOffsetParentRelativeRectToViewportRelativeRect:iT,getDocumentElement:rl,getClippingRect:vT,getOffsetParent:Y1,getElementRects:yT,getClientRects:uT,getDimensions:hT,getScale:Xr,isElement:_n,isRTL:bT};function J1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xT(e,t,a){let n=null,l;const r=rl(e);function o(){var d;clearTimeout(l),(d=n)==null||d.disconnect(),n=null}function i(d,p){d===void 0&&(d=!1),p===void 0&&(p=1),o();const v=e.getBoundingClientRect(),{left:m,top:y,width:x,height:C}=v;if(d||t(),!x||!C)return;const w=ri(y),S=ri(r.clientWidth-(m+x)),q=ri(r.clientHeight-(y+C)),O=ri(m),B={rootMargin:-w+"px "+-S+"px "+-q+"px "+-O+"px",threshold:zn(0,Il(1,p))||1};let L=!0;function W(T){const R=T[0].intersectionRatio;if(!J1(v,e.getBoundingClientRect()))return i();if(R!==p){if(!L)return i();R?i(!1,R):l=setTimeout(()=>{i(!1,1e-7)},1e3)}L=!1}try{n=new IntersectionObserver(W,{...B,root:r.ownerDocument})}catch{n=new IntersectionObserver(W,B)}n.observe(e)}const u=ha(e),c=()=>i(a);return u.addEventListener("resize",c),i(!0),()=>{u.removeEventListener("resize",c),o()}}function kT(e,t,a,n){n===void 0&&(n={});const{ancestorScroll:l=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,c=yp(e),d=l||r?[...c?$s(c):[],...t?$s(t):[]]:[];d.forEach(w=>{l&&w.addEventListener("scroll",a),r&&w.addEventListener("resize",a)});const p=c&&i?xT(c,a,r):null;let v=-1,m=null;o&&(m=new ResizeObserver(w=>{let[S]=w;S&&S.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var q;(q=m)==null||q.observe(t)})),a()}),c&&!u&&m.observe(c),t&&m.observe(t));let y,x=u?fr(e):null;u&&C();function C(){const w=fr(e);x&&!J1(x,w)&&a(),x=w,y=requestAnimationFrame(C)}return a(),()=>{var w;d.forEach(S=>{l&&S.removeEventListener("scroll",a),r&&S.removeEventListener("resize",a)}),p?.(),(w=m)==null||w.disconnect(),m=null,u&&cancelAnimationFrame(y)}}const wT=X5,$T=Q5,fh=Y5,CT=tT,ST=J5,ET=G5,AT=eT,TT=(e,t,a)=>{const n=new Map,l=a??{},r={..._T,...l.platform,_c:n};return W5(e,t,{...l,platform:r})};function MT(e){return e!=null&&typeof e=="object"&&"$el"in e}function Wc(e){if(MT(e)){const t=e.$el;return vp(t)&&_r(t)==="#comment"?null:t}return e}function Lr(e){return typeof e=="function"?e():s(e)}function DT(e){return{name:"arrow",options:e,fn(t){const a=Wc(Lr(e.element));return a==null?{}:ET({element:a,padding:e.padding}).fn(t)}}}function Z1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ph(e,t){const a=Z1(e);return Math.round(t*a)/a}function OT(e,t,a){a===void 0&&(a={});const n=a.whileElementsMounted,l=k(()=>{var L;return(L=Lr(a.open))!=null?L:!0}),r=k(()=>Lr(a.middleware)),o=k(()=>{var L;return(L=Lr(a.placement))!=null?L:"bottom"}),i=k(()=>{var L;return(L=Lr(a.strategy))!=null?L:"absolute"}),u=k(()=>{var L;return(L=Lr(a.transform))!=null?L:!0}),c=k(()=>Wc(e.value)),d=k(()=>Wc(t.value)),p=E(0),v=E(0),m=E(i.value),y=E(o.value),x=pr({}),C=E(!1),w=k(()=>{const L={position:m.value,left:"0",top:"0"};if(!d.value)return L;const W=ph(d.value,p.value),T=ph(d.value,v.value);return u.value?{...L,transform:"translate("+W+"px, "+T+"px)",...Z1(d.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:W+"px",top:T+"px"}});let S;function q(){if(c.value==null||d.value==null)return;const L=l.value;TT(c.value,d.value,{middleware:r.value,placement:o.value,strategy:i.value}).then(W=>{p.value=W.x,v.value=W.y,m.value=W.strategy,y.value=W.placement,x.value=W.middlewareData,C.value=L!==!1})}function O(){typeof S=="function"&&(S(),S=void 0)}function I(){if(O(),n===void 0){q();return}if(c.value!=null&&d.value!=null){S=n(c.value,d.value,q);return}}function B(){l.value||(C.value=!1)}return ze([r,o,i,l],q,{flush:"sync"}),ze([c,d],I,{flush:"sync"}),ze(l,B,{flush:"sync"}),ff()&&Ag(O),{x:Er(p),y:Er(v),strategy:Er(m),placement:Er(y),middlewareData:Er(x),isPositioned:Er(C),floatingStyles:w,update:q}}const X1={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[pZ,PT]=Pt("PopperContent");var IT=ae({inheritAttrs:!1,__name:"PopperContent",props:vy({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...X1}),emits:["placed"],setup(e,{emit:t}){const a=e,n=t,l=F1(),{forwardRef:r,currentElement:o}=lt(),i=E(),u=E(),{width:c,height:d}=bA(u),p=k(()=>a.side+(a.align!=="center"?`-${a.align}`:"")),v=k(()=>typeof a.collisionPadding=="number"?a.collisionPadding:{top:0,right:0,bottom:0,left:0,...a.collisionPadding}),m=k(()=>Array.isArray(a.collisionBoundary)?a.collisionBoundary:[a.collisionBoundary]),y=k(()=>({padding:v.value,boundary:m.value.filter(I5),altBoundary:m.value.length>0})),x=k(()=>({mainAxis:a.sideFlip,crossAxis:a.alignFlip})),C=JE(()=>[wT({mainAxis:a.sideOffset+d.value,alignmentAxis:a.alignOffset}),a.prioritizePosition&&a.avoidCollisions&&fh({...y.value,...x.value}),a.avoidCollisions&&$T({mainAxis:!0,crossAxis:!!a.prioritizePosition,limiter:a.sticky==="partial"?AT():void 0,...y.value}),!a.prioritizePosition&&a.avoidCollisions&&fh({...y.value,...x.value}),CT({...y.value,apply:({elements:A,rects:D,availableWidth:z,availableHeight:V})=>{const{width:K,height:re}=D.reference,ie=A.floating.style;ie.setProperty("--reka-popper-available-width",`${z}px`),ie.setProperty("--reka-popper-available-height",`${V}px`),ie.setProperty("--reka-popper-anchor-width",`${K}px`),ie.setProperty("--reka-popper-anchor-height",`${re}px`)}}),u.value&&DT({element:u.value,padding:a.arrowPadding}),R5({arrowWidth:c.value,arrowHeight:d.value}),a.hideWhenDetached&&ST({strategy:"referenceHidden",...y.value})]),w=k(()=>a.reference??l.anchor.value),{floatingStyles:S,placement:q,isPositioned:O,middlewareData:I}=OT(w,i,{strategy:a.positionStrategy,placement:p,whileElementsMounted:(...A)=>kT(...A,{layoutShift:!a.disableUpdateOnLayoutShift,animationFrame:a.updatePositionStrategy==="always"}),middleware:C}),B=k(()=>Uc(q.value)[0]),L=k(()=>Uc(q.value)[1]);ey(()=>{O.value&&n("placed")});const W=k(()=>{const A=I.value.arrow?.centerOffset!==0;return a.hideShiftedArrow&&A}),T=E("");Aa(()=>{o.value&&(T.value=window.getComputedStyle(o.value).zIndex)});const R=k(()=>I.value.arrow?.x??0),G=k(()=>I.value.arrow?.y??0);return PT({placedSide:B,onArrowChange:A=>u.value=A,arrowX:R,arrowY:G,shouldHideArrow:W}),(A,D)=>(f(),b("div",{ref_key:"floatingRef",ref:i,"data-reka-popper-content-wrapper":"",style:oa({...s(S),transform:s(O)?s(S).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:T.value,"--reka-popper-transform-origin":[s(I).transformOrigin?.x,s(I).transformOrigin?.y].join(" "),...s(I).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[M(s(rt),Ye({ref:s(r)},A.$attrs,{"as-child":a.asChild,as:A.as,"data-side":B.value,"data-align":L.value,style:{animation:s(O)?void 0:"none"}}),{default:N(()=>[Ee(A.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Q1=IT;const bp=["day","month","year"],_p=["hour","minute","second","dayPeriod"],e0=[...bp,..._p];function RT(e){return bp.includes(e)}function t0(e){return e0.includes(e)}const qT=["ach","af","am","an","ar","ast","az","be","bg","bn","br","bs","ca","cak","ckb","cs","cy","da","de","dsb","el","en","eo","es","et","eu","fa","ff","fi","fr","fy","ga","gd","gl","he","hr","hsb","hu","ia","id","it","ja","ka","kk","kn","ko","lb","lo","lt","lv","meh","ml","ms","nl","nn","no","oc","pl","pt","rm","ro","ru","sc","scn","sk","sl","sr","sv","szl","tg","th","tr","uk","zh-CN","zh-TW"],LT=["year","month","day"],zd={ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"ዓዓዓዓ",month:"ሚሜ",day:"ቀቀ"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"سنة",month:"شهر",day:"يوم"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"гггг",month:"мм",day:"дд"},bg:{year:"гггг",month:"мм",day:"дд"},bn:{year:"yyyy",month:"মিমি",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"ساڵ",month:"مانگ",day:"ڕۆژ"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"åååå",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"źź"},el:{year:"εεεε",month:"μμ",day:"ηη"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"سال",month:"ماه",day:"روز"},ff:{year:"hhhh",month:"ll",day:"ññ"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"שנה",month:"חודש",day:"יום"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"éééé",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:" 年 ",month:"月",day:"日"},ka:{year:"წწწწ",month:"თთ",day:"რრ"},kk:{year:"жжжж",month:"аа",day:"кк"},kn:{year:"ವವವವ",month:"ಮಿಮೀ",day:"ದಿದಿ"},ko:{year:"연도",month:"월",day:"일"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"ປປປປ",month:"ດດ",day:"ວວ"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"വർഷം",month:"മാസം",day:"തീയതി"},ms:{year:"tttt",month:"mm",day:"hh"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"åååå",month:"mm",day:"dd"},no:{year:"åååå",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"гггг",month:"мм",day:"дд"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"гггг",month:"мм",day:"дд"},sv:{year:"åååå",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"сссс",month:"мм",day:"рр"},th:{year:"ปปปป",month:"ดด",day:"วว"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"рррр",month:"мм",day:"дд"},"zh-CN":{year:"年",month:"月",day:"日"},"zh-TW":{year:"年",month:"月",day:"日"}};function NT(e){if(mh(e))return zd[e];{const t=zT(e);return mh(t)?zd[t]:zd.en}}function jd(e,t,a){return BT(e)?NT(a)[e]:VT(e)?t:FT(e)?"––":""}function mh(e){return qT.includes(e)}function BT(e){return LT.includes(e)}function FT(e){return e==="hour"||e==="minute"||e==="second"}function VT(e){return e==="era"||e==="dayPeriod"}function zT(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const jT=["hour","minute","second"];function Gc(e){return Object.fromEntries(_p.map(t=>t==="dayPeriod"?[t,e.formatter.dayPeriod(Pa(e.value))]:[t,e.value[t]]))}function vh(e){const{formatter:t}=e,a=bp.map(n=>[n,e.value[n]]);if("hour"in e.value){const n=Gc({value:e.value,formatter:t});return{...Object.fromEntries(a),...n}}return Object.fromEntries(a)}function UT(e){return Object.fromEntries(_p.map(t=>t==="dayPeriod"?[t,"AM"]:[t,null]).filter(([t])=>!(t==="literal"||t===null||e==="minute"&&t==="second"||e==="hour"&&(t==="second"||t==="minute"))))}function HT(e){const t=e0.map(a=>a==="dayPeriod"?[a,"AM"]:[a,null]).filter(([a])=>a==="literal"||a===null||e==="minute"&&a==="second"||e==="hour"&&(a==="second"||a==="minute")?!1:e==="day"?!jT.includes(a)&&a!=="dayPeriod":!0);return Object.fromEntries(t)}function KT(e){const{segmentValues:t,formatter:a,locale:n}=e;function l(o){if("hour"in t){const i=t[o];return i!==null?o==="day"?a.part(e.dateRef.set({[o]:i,month:t.month??1}),o,{hourCycle:ks(e.hourCycle)}):a.part(e.dateRef.set({[o]:i}),o,{hourCycle:ks(e.hourCycle)}):jd(o,"",n.value)}else{if(RT(o)){const i=t[o];return i!==null?o==="day"?a.part(e.dateRef.set({[o]:i,month:t.month??1}),o):a.part(e.dateRef.set({[o]:i}),o):jd(o,"",n.value)}return""}}return Object.keys(t).reduce((o,i)=>{if(!t0(i))return o;if("hour"in t&&i==="dayPeriod"){const u=t[i];u!==null?o[i]=u:o[i]=jd(i,"AM",n.value)}else o[i]=l(i);return o},{})}function WT(e){const{granularity:t,formatter:a,contentObj:n,hideTimeZone:l,hourCycle:r,isTimeValue:o}=e;return a.toParts(e.dateRef,pA(t,r,o)).map(c=>["literal","timeZoneName",null].includes(c.type)||!t0(c.type)?{part:c.type,value:c.value}:{part:c.type,value:n[c.type]}).filter(c=>!(c.part===null||c.value===null||c.part==="timeZoneName"&&(!xs(e.dateRef)||l)||(!xs(e.dateRef)||l)&&c.part==="literal"&&["[","]"].includes(c.value.trim())))}function a0(e){const t=KT(e),a=WT({contentObj:t,...e});return{obj:t,arr:a}}function On(e){const t=ho();return e===t.ARROW_RIGHT||e===t.ARROW_LEFT}function tr(e){return!Number.isNaN(Number.parseInt(e))}function ml(e){const t=ho();return!!([t.ENTER,t.ARROW_UP,t.ARROW_DOWN,t.ARROW_LEFT,t.ARROW_RIGHT,t.BACKSPACE,t.SPACE,"a","A","p","P"].includes(e)||tr(e))}function hh(e){return Array.from(e.querySelectorAll("[data-reka-date-field-segment]")).filter(t=>t.getAttribute("data-reka-date-field-segment")!=="literal")}function gh(e){return Array.from(e.querySelectorAll("[data-reka-time-field-segment]")).filter(t=>t.getAttribute("data-reka-time-field-segment")!=="literal")}const GT=/^\d$/;function Ul(e){return{role:"spinbutton",contenteditable:!0,tabindex:e.disabled?void 0:0,spellcheck:!1,inputmode:"numeric",autocorrect:"off",enterkeyhint:"next",style:"caret-color: transparent;"}}function YT(e){const{segmentValues:t,placeholder:a}=e,n=t.day===null,l={};t.day&&(l.day=t.day),t.month&&(l.month=t.month);const r=Object.keys(l).length>0?a.set(l):a,o=r.day,i=1,u=Al(r),c=n?"Empty":`${o}`;return{...Ul(e),"aria-label":"day,","aria-valuemin":i,"aria-valuemax":u,"aria-valuenow":o,"aria-valuetext":c,"data-placeholder":n?"":void 0}}function JT(e){const{segmentValues:t,placeholder:a,formatter:n}=e,l=t.month===null,r=t.month?a.set({month:t.month}):a,o=r.month,i=1,u=12,c=l?"Empty":`${o} - ${n.fullMonth(Pa(r))}`;return{...Ul(e),"aria-label":"month, ",contenteditable:!0,"aria-valuemin":i,"aria-valuemax":u,"aria-valuenow":o,"aria-valuetext":c,"data-placeholder":l?"":void 0}}function ZT(e){const{segmentValues:t,placeholder:a}=e,n=t.year===null,l=t.year?a.set({year:t.year}):a,r=1,o=9999,i=l.year,u=n?"Empty":`${i}`;return{...Ul(e),"aria-label":"year, ","aria-valuemin":r,"aria-valuemax":o,"aria-valuenow":i,"aria-valuetext":u,"data-placeholder":n?"":void 0}}function XT(e){const{segmentValues:t,hourCycle:a,placeholder:n}=e;if(!("hour"in t)||!("hour"in n))return{};const l=t.hour===null,r=t.hour?n.set({hour:t.hour}):n,o=a===12?1:0,i=a===12?12:23,u=r.hour,c=l?"Empty":`${u} ${t.dayPeriod??""}`;return{...Ul(e),"aria-label":"hour, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":u,"aria-valuetext":c,"data-placeholder":l?"":void 0}}function QT(e){const{segmentValues:t,placeholder:a}=e;if(!("minute"in t)||!("minute"in a))return{};const n=t.minute===null,r=(t.minute?a.set({minute:t.minute}):a).minute,o=0,i=59,u=n?"Empty":`${r}`;return{...Ul(e),"aria-label":"minute, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":r,"aria-valuetext":u,"data-placeholder":n?"":void 0}}function e8(e){const{segmentValues:t,placeholder:a}=e;if(!("second"in t)||!("second"in a))return{};const n=t.second===null,r=(t.second?a.set({second:t.second}):a).second,o=0,i=59,u=n?"Empty":`${r}`;return{...Ul(e),"aria-label":"second, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":r,"aria-valuetext":u,"data-placeholder":n?"":void 0}}function t8(e){const{segmentValues:t}=e;if(!("dayPeriod"in t))return{};const a=0,n=12,l=t.hour?t.hour>12?t.hour-12:t.hour:0,r=t.dayPeriod??"AM";return{...Ul(e),inputmode:"text","aria-label":"AM/PM","aria-valuemin":a,"aria-valuemax":n,"aria-valuenow":l,"aria-valuetext":r}}function a8(e){return{"aria-hidden":!0,"data-segment":"literal"}}function n8(e){return{role:"textbox","aria-label":"timezone, ","data-readonly":!0,"data-segment":"timeZoneName",tabindex:e.disabled?void 0:0,style:"caret-color: transparent;"}}function l8(e){const{segmentValues:t,placeholder:a}=e,n=0,l=0,r=0,o="era"in t?t.era:a.era;return{...Ul(e),"aria-label":"era","aria-valuemin":n,"aria-valuemax":l,"aria-valuenow":r,"aria-valuetext":o}}const r8={day:{attrs:YT},month:{attrs:JT},year:{attrs:ZT},hour:{attrs:XT},minute:{attrs:QT},second:{attrs:e8},dayPeriod:{attrs:t8},literal:{attrs:a8},timeZoneName:{attrs:n8},era:{attrs:l8}};function n0(e){const t=ho();function a({e:T,part:R,dateRef:G,prevValue:A}){const D=e.step.value[R]??1,z=T.key===t.ARROW_UP?D:-D,V=0,K=59;if(A===null)return z>0?V:K;const re=[R,z];return G.set({[R]:A}).cycle(...re)[R]}function n(T){if(e.hasLeftFocus.value=!1,T===null)return T;const R=T.toString();return R.length===1?(e.modelValue.value=void 0,null):Number.parseInt(R.slice(0,-1))}function l({e:T,part:R,dateRef:G,prevValue:A}){const D=e.step.value[R]??1,z=T.key===t.ARROW_UP?D:-D;if(A===null)return G[R];if(R==="hour"&&"hour"in G){const K=[R,z];return G.set({[R]:A}).cycle(...K)[R]}const V=[R,z];return R==="day"?G.set({[R]:A,month:e.segmentValues.value.month??1}).cycle(...V)[R]:G.set({[R]:A}).cycle(...V)[R]}function r(T,R,G){let A=!1;const D=Math.floor(T/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,G=null),G===null)return R===0?(e.lastKeyZero.value=!0,{value:null,moveToNext:A}):((e.lastKeyZero.value||R>D)&&(A=!0),e.lastKeyZero.value=!1,{value:R,moveToNext:A});const z=G.toString().length,V=Number.parseInt(G.toString()+R.toString());return z===2||V>T?((R>D||V>T)&&(A=!0),{value:R,moveToNext:A}):(A=!0,{value:V,moveToNext:A})}function o(T,R){let A=!1;const D=Math.floor(59/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,R=null),R===null)return T===0?(e.lastKeyZero.value=!0,{value:0,moveToNext:A}):((e.lastKeyZero.value||T>D)&&(A=!0),e.lastKeyZero.value=!1,{value:T,moveToNext:A});const z=R.toString().length,V=Number.parseInt(R.toString()+T.toString());return z===2||V>59?(T>D&&(A=!0),{value:T,moveToNext:A}):(A=!0,{value:V,moveToNext:A})}function i(T,R,G){let A=!1;const D=Math.floor(T/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,G=null),G===null)return R===0?(e.lastKeyZero.value=!0,{value:0,moveToNext:A}):((e.lastKeyZero.value||R>D)&&(A=!0),e.lastKeyZero.value=!1,{value:R,moveToNext:A});const z=G.toString().length,V=Number.parseInt(G.toString()+R.toString());return z===2||V>T?(R>D&&(A=!0),{value:R,moveToNext:A}):(A=!0,{value:V,moveToNext:A})}function u(T,R){let G=!1;if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,R=null),R===null)return{value:T===0?1:T,moveToNext:G};const A=R.toString()+T.toString();return A.length>4?{value:T===0?1:T,moveToNext:G}:(A.length===4&&(G=!0),{value:Number.parseInt(A),moveToNext:G})}const c=k(()=>r8[e.part]?.attrs({disabled:e.disabled.value,placeholder:e.placeholder.value,hourCycle:e.hourCycle,segmentValues:e.segmentValues.value,formatter:e.formatter})??{});function d(T){if(!ml(T.key)||On(T.key))return;const R=e.segmentValues.value.day;if(T.key===t.ARROW_DOWN||T.key===t.ARROW_UP){e.segmentValues.value.day=l({e:T,part:"day",dateRef:e.placeholder.value,prevValue:R});return}if(tr(T.key)){const G=Number.parseInt(T.key),A=e.segmentValues.value.month,D=A?Al(e.placeholder.value.set({month:A})):31,{value:z,moveToNext:V}=r(D,G,R);e.segmentValues.value.day=z,V&&e.focusNext()}T.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.day=n(R))}function p(T){if(!ml(T.key)||On(T.key))return;const R=e.segmentValues.value.month;if(T.key===t.ARROW_DOWN||T.key===t.ARROW_UP){e.segmentValues.value.month=l({e:T,part:"month",dateRef:e.placeholder.value,prevValue:R});return}if(tr(T.key)){const G=Number.parseInt(T.key),{value:A,moveToNext:D}=r(12,G,R);e.segmentValues.value.month=A,D&&e.focusNext()}T.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.month=n(R))}function v(T){if(!ml(T.key)||On(T.key))return;const R=e.segmentValues.value.year;if(T.key===t.ARROW_DOWN||T.key===t.ARROW_UP){e.segmentValues.value.year=l({e:T,part:"year",dateRef:e.placeholder.value,prevValue:R});return}if(tr(T.key)){const G=Number.parseInt(T.key),{value:A,moveToNext:D}=u(G,R);e.segmentValues.value.year=A,D&&e.focusNext()}T.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.year=n(R))}function m(T){const R=new za(T,{hour:"numeric"}).resolvedOptions().hourCycle;return R==="h11"||R==="h12"}function y(T){const R=e.placeholder.value;if(!ml(T.key)||On(T.key)||!("hour"in R)||!("hour"in e.segmentValues.value))return;const G=e.segmentValues.value.hour;if(T.key===t.ARROW_UP||T.key===t.ARROW_DOWN){const A=l({e:T,part:"hour",dateRef:e.placeholder.value,prevValue:G});e.segmentValues.value.hour=A,"dayPeriod"in e.segmentValues.value&&A!==null&&(e.segmentValues.value.dayPeriod=A>=12?"PM":"AM");return}if(tr(T.key)){const A=Number.parseInt(T.key),D=e.hourCycle!==void 0?e.hourCycle===12:m(e.formatter.getLocale()),z=D?12:24;let V=G;D&&G!==null&&(V=G%12===0?0:G>12?G-12:G);const{value:K,moveToNext:re}=i(z,A,V);let ie=K;if(D&&K!==null){const Ae=e.segmentValues.value.dayPeriod||"AM";K===12?ie=Ae==="AM"?0:12:ie=Ae==="PM"?K+12:K}e.segmentValues.value.hour=ie,re&&e.focusNext()}T.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.hour=n(G))}function x(T){const R=e.placeholder.value;if(!ml(T.key)||On(T.key)||!("minute"in R)||!("minute"in e.segmentValues.value))return;const G=e.segmentValues.value.minute;if((T.key===t.ARROW_UP||T.key===t.ARROW_DOWN)&&(e.segmentValues.value.minute=a({e:T,part:"minute",dateRef:e.placeholder.value,prevValue:G})),tr(T.key)){const A=Number.parseInt(T.key),{value:D,moveToNext:z}=o(A,G);e.segmentValues.value.minute=D,z&&e.focusNext()}T.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.minute=n(G))}function C(T){const R=e.placeholder.value;if(!ml(T.key)||On(T.key)||!("second"in R)||!("second"in e.segmentValues.value))return;const G=e.segmentValues.value.second;if((T.key===t.ARROW_UP||T.key===t.ARROW_DOWN)&&(e.segmentValues.value.second=a({e:T,part:"second",dateRef:e.placeholder.value,prevValue:G})),tr(T.key)){const A=Number.parseInt(T.key),{value:D,moveToNext:z}=o(A,G);e.segmentValues.value.second=D,z&&e.focusNext()}T.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.second=n(G))}function w(T){if(!((!ml(T.key)||On(T.key))&&T.key!=="a"&&T.key!=="p"||!("hour"in e.placeholder.value)||!("dayPeriod"in e.segmentValues.value))){if(T.key===t.ARROW_UP||T.key===t.ARROW_DOWN){if(e.segmentValues.value.dayPeriod==="AM"){e.segmentValues.value.dayPeriod="PM",e.segmentValues.value.hour=e.segmentValues.value.hour+12;return}e.segmentValues.value.dayPeriod="AM",e.segmentValues.value.hour=e.segmentValues.value.hour-12;return}if(["a","A"].includes(T.key)&&e.segmentValues.value.dayPeriod!=="AM"){e.segmentValues.value.dayPeriod="AM",e.segmentValues.value.hour=e.segmentValues.value.hour-12;return}["p","P"].includes(T.key)&&e.segmentValues.value.dayPeriod!=="PM"&&(e.segmentValues.value.dayPeriod="PM",e.segmentValues.value.hour=e.segmentValues.value.hour+12)}}function S(T){e.disabled.value&&T.preventDefault()}function q(T){if(T.isComposing||T.key==="Process")return;const R=e.disabled.value,G=e.readonly.value;if(R||G)return;if(T.key!==t.TAB&&T.preventDefault(),{day:d,month:p,year:v,hour:y,minute:x,second:C,dayPeriod:w,timeZoneName:()=>{}}[e.part](T),![t.ARROW_LEFT,t.ARROW_RIGHT].includes(T.key)&&T.key!==t.TAB&&T.key!==t.SHIFT&&ml(T.key)&&Object.values(e.segmentValues.value).every(D=>D!==null)){const D={...e.segmentValues.value},z=e.placeholder.value.set(D);e.modelValue.value=z.copy()}}function O(){if(e.stepSnapping?.value&&(e.part==="hour"&&"hour"in e.segmentValues.value&&e.segmentValues.value.hour!==null&&e.step.value.hour&&e.step.value.hour>1?(e.segmentValues.value.hour=wd(e.segmentValues.value.hour,0,23,e.step.value.hour),"dayPeriod"in e.segmentValues.value&&(e.segmentValues.value.hour<12?e.segmentValues.value.dayPeriod="AM":e.segmentValues.value.hour&&(e.segmentValues.value.dayPeriod="PM"))):e.part==="minute"&&"minute"in e.segmentValues.value&&e.segmentValues.value.minute!==null&&e.step.value.minute&&e.step.value.minute>1?e.segmentValues.value.minute=wd(e.segmentValues.value.minute,0,59,e.step.value.minute):e.part==="second"&&"second"in e.segmentValues.value&&e.segmentValues.value.second!==null&&e.step.value.second&&e.step.value.second>1&&(e.segmentValues.value.second=wd(e.segmentValues.value.second,0,59,e.step.value.second)),Object.values(e.segmentValues.value).every(T=>T!==null))){const T=e.placeholder.value.set({...e.segmentValues.value});e.modelValue.value=T.copy()}}let I=null;function B(T){T.isComposing||T.preventDefault()}function L(T){const R=T.target;I=Array.from(R.childNodes,G=>({node:G,value:G.nodeValue}))}function W(T){const R=T.target,G=I;if(I=null,G){for(const{node:D,value:z}of G)D.nodeValue=z;R.replaceChildren(...G.map(D=>D.node))}const A=T.data;if(A)for(const D of A){if(!GT.test(D))continue;const z=Zt();if(!(z instanceof HTMLElement))break;z.dispatchEvent(new KeyboardEvent("keydown",{key:D,bubbles:!0,cancelable:!0}))}}return{handleSegmentClick:S,handleSegmentKeydown:q,handleSegmentBeforeInput:B,handleSegmentCompositionStart:L,handleSegmentCompositionEnd:W,handleSegmentFocusOut:O,attributes:c}}function o8(e){function t(r){return Array.isArray(e.date.value)?e.date.value.some(o=>Dl(o,r)):e.date.value?Dl(e.date.value,r):!1}const a=k(()=>{if(Array.isArray(e.date.value)){if(!e.date.value.length)return!1;for(const r of e.date.value)if(e.isDateDisabled?.(r)||e.isDateUnavailable?.(r))return!0}else{if(!e.date.value)return!1;if(e.isDateDisabled?.(e.date.value)||e.isDateUnavailable?.(e.date.value))return!0}return!1}),n=k(()=>Array.isArray(e.date.value)?e.date.value.length>0:!!e.date.value),l=k(()=>Array.isArray(e.date.value)?e.date.value.length?e.date.value.some(r=>e.isDateDisabled?.(r)):!1:e.date.value?!!e.isDateDisabled?.(e.date.value):!1);return{isDateSelected:t,isInvalid:a,hasSelectedDate:n,isSelectedDateDisabled:l}}function s8(e,t){const a=t(e),n=a.compare(e),l={};return n>=7&&(l.day=1),n>=Al(e)&&(l.month=1),a.set({...l})}function i8(e,t){const a=t(e),n=e.compare(a),l={};return n>=7&&(l.day=35),n>=Al(e)&&(l.month=13),a.set({...l})}function u8(e,t){return t(e)}function d8(e,t){return t(e)}function c8(e){const t=np(e.locale.value),a=k(()=>{const w={calendar:e.placeholder.value.calendar.identifier};return e.placeholder.value.calendar.identifier==="gregory"&&e.placeholder.value.era==="BC"&&(w.era="short"),w}),n=E(Zl({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})),l=k(()=>n.value.map(w=>w.value));function r(w){return!l.value.some(S=>Mv(w,S))}const o=w=>{if(!e.maxValue.value||!n.value.length)return!1;if(e.disabled.value)return!0;const S=n.value.at(-1).value;if(!w&&!e.nextPage.value){const O=S.add({months:1}).set({day:1});return Pd(O,e.maxValue.value)}const q=s8(S,w||e.nextPage.value);return Pd(q,e.maxValue.value)},i=w=>{if(!e.minValue.value||!n.value.length)return!1;if(e.disabled.value)return!0;const S=n.value[0].value;if(!w&&!e.prevPage.value){const O=S.subtract({months:1}).set({day:35});return Cl(O,e.minValue.value)}const q=i8(S,w||e.prevPage.value);return Cl(q,e.minValue.value)};function u(w){return!!(e.isDateDisabled?.(w)||e.disabled.value||e.maxValue.value&&Pd(w,e.maxValue.value)||e.minValue.value&&Cl(w,e.minValue.value))}const c=w=>!!e.isDateUnavailable?.(w),d=k(()=>n.value.length?n.value[0].rows[0].map(w=>t.dayOfWeek(Pa(w),e.weekdayFormat.value)):[]),p=w=>{const S=n.value[0].value;if(!w&&!e.nextPage.value){const B=S.add({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),L=Zl({dateObj:B,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});n.value=L,e.placeholder.value=L[0].value.set({day:1});return}const q=u8(S,w||e.nextPage.value),O=Zl({dateObj:q,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});n.value=O;const I={};if(!w){const B=O[0].value.compare(S);B>=Al(S)&&(I.day=1),B>=365&&(I.month=1)}e.placeholder.value=O[0].value.set({...I})},v=w=>{const S=n.value[0].value;if(!w&&!e.prevPage.value){const B=S.subtract({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),L=Zl({dateObj:B,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});n.value=L,e.placeholder.value=L[0].value.set({day:1});return}const q=d8(S,w||e.prevPage.value),O=Zl({dateObj:q,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});n.value=O;const I={};if(!w){const B=S.compare(O[0].value);B>=Al(S)&&(I.day=1),B>=365&&(I.month=1)}e.placeholder.value=O[0].value.set({...I})};ze(e.placeholder,w=>{l.value.some(S=>Mv(S,w))||(n.value=Zl({dateObj:w,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value}))}),ze([e.locale,e.weekStartsOn,e.fixedWeeks,e.numberOfMonths],()=>{n.value=Zl({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})});const m=k(()=>{if(!n.value.length)return"";if(e.locale.value!==t.getLocale()&&t.setLocale(e.locale.value),n.value.length===1){const W=n.value[0].value;return`${t.fullMonthAndYear(Pa(W),a.value)}`}const w=Pa(n.value[0].value),S=Pa(n.value.at(-1).value),q=t.fullMonth(w,a.value),O=t.fullMonth(S,a.value),I=t.fullYear(w,a.value),B=t.fullYear(S,a.value);return I===B?`${q} - ${O} ${B}`:`${q} ${I} - ${O} ${B}`}),y=k(()=>`${e.calendarLabel.value??"Event Date"}, ${m.value}`),x=k(()=>!(u(e.placeholder.value)||c(e.placeholder.value)||r(e.placeholder.value))),C=k(()=>{for(const w of n.value){if(e.minValue.value&&Cl(w.value,e.minValue.value))continue;const S=Al(w.value),q=e.minValue.value&&Hf(e.minValue.value,w.value)?e.minValue.value.day:1;for(let O=q;O<=S;O++){const I=w.value.set({day:O});if(!(u(I)||c(I)))return I}}});return{isDateDisabled:u,isDateUnavailable:c,isNextButtonDisabled:o,isPrevButtonDisabled:i,grid:n,weekdays:d,visibleView:l,isOutsideVisibleView:r,formatter:t,nextPage:p,prevPage:v,headingValue:m,fullCalendarLabel:y,isPlaceholderFocusable:x,firstFocusableDate:C}}const f8={style:{border:"0px",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute","white-space":"nowrap",width:"1px"}},p8={role:"heading","aria-level":"2"},[yo,m8]=Pt("CalendarRoot");var v8=ae({__name:"CalendarRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},pagedNavigation:{type:Boolean,required:!1,default:!1},preventDeselect:{type:Boolean,required:!1,default:!1},weekStartsOn:{type:Number,required:!1},weekdayFormat:{type:String,required:!1,default:"narrow"},calendarLabel:{type:String,required:!1},fixedWeeks:{type:Boolean,required:!1,default:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},numberOfMonths:{type:Number,required:!1,default:1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},initialFocus:{type:Boolean,required:!1,default:!1},isDateDisabled:{type:Function,required:!1,default:void 0},isDateUnavailable:{type:Function,required:!1,default:void 0},dir:{type:String,required:!1},nextPage:{type:Function,required:!1},prevPage:{type:Function,required:!1},modelValue:{type:null,required:!1},multiple:{type:Boolean,required:!1,default:!1},disableDaysOutsideCurrentView:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},emits:["update:modelValue","update:placeholder"],setup(e,{emit:t}){const a=e,n=t,{disabled:l,readonly:r,initialFocus:o,pagedNavigation:i,weekdayFormat:u,fixedWeeks:c,multiple:d,minValue:p,maxValue:v,numberOfMonths:m,preventDeselect:y,isDateDisabled:x,isDateUnavailable:C,calendarLabel:w,defaultValue:S,nextPage:q,prevPage:O,dir:I,locale:B,disableDaysOutsideCurrentView:L}=Kt(a),{primitiveElement:W,currentElement:T}=dr(),R=Bu(B),G=$n(I),A=k(()=>a.weekStartsOn??T1(R.value)),D=Ft(a,"modelValue",n,{defaultValue:S.value,passive:a.modelValue===void 0}),z=ap({defaultPlaceholder:a.placeholder,defaultValue:D.value,locale:a.locale}),V=Ft(a,"placeholder",n,{defaultValue:a.defaultPlaceholder??z.copy(),passive:a.placeholder===void 0});function K(X){V.value=X.copy()}const{fullCalendarLabel:re,headingValue:ie,isDateDisabled:Ae,isDateUnavailable:_e,isNextButtonDisabled:xe,isPrevButtonDisabled:ne,weekdays:fe,isOutsideVisibleView:F,nextPage:de,prevPage:ve,formatter:Z,grid:he,isPlaceholderFocusable:J,firstFocusableDate:ee}=c8({locale:R,placeholder:V,weekStartsOn:A,fixedWeeks:c,numberOfMonths:m,minValue:p,maxValue:v,disabled:l,weekdayFormat:u,pagedNavigation:i,isDateDisabled:x.value,isDateUnavailable:C.value,calendarLabel:w,nextPage:q,prevPage:O}),{isInvalid:te,isDateSelected:$,hasSelectedDate:P,isSelectedDateDisabled:U}=o8({date:D,isDateDisabled:Ae,isDateUnavailable:_e});ze(D,X=>{if(Array.isArray(X)&&X.length){const oe=X.at(-1);oe&&!Yr(V.value,oe)&&K(oe)}else!Array.isArray(X)&&X&&!Yr(V.value,X)&&K(X)});function ce(X){if(d.value){if(!D.value)D.value=[X.copy()];else if(Array.isArray(D.value)){if(D.value.findIndex(ke=>Dl(ke,X))===-1)D.value=[...D.value,X];else if(!y.value){const ke=D.value.filter(Se=>!Dl(Se,X));if(!ke.length){V.value=X.copy(),D.value=void 0;return}D.value=ke.map(Se=>Se.copy())}}}else{if(!D.value){D.value=X.copy();return}!y.value&&Yr(D.value,X)?(V.value=X.copy(),D.value=void 0):D.value=X.copy()}}return $t(()=>{o.value&&E1(T.value)}),m8({isDateUnavailable:_e,dir:G,isDateDisabled:Ae,locale:R,formatter:Z,modelValue:D,placeholder:V,disabled:l,initialFocus:o,pagedNavigation:i,grid:he,weekDays:fe,weekStartsOn:A,weekdayFormat:u,fixedWeeks:c,multiple:d,numberOfMonths:m,readonly:r,preventDeselect:y,fullCalendarLabel:re,headingValue:ie,isInvalid:te,isDateSelected:$,isNextButtonDisabled:xe,isPrevButtonDisabled:ne,isOutsideVisibleView:F,nextPage:de,prevPage:ve,parentElement:T,onPlaceholderChange:K,onDateChange:ce,disableDaysOutsideCurrentView:L,minValue:p,maxValue:v,isPlaceholderFocusable:J,firstFocusableDate:ee,hasSelectedDate:P,isSelectedDateDisabled:U}),(X,oe)=>(f(),j(s(rt),{ref_key:"primitiveElement",ref:W,as:X.as,"as-child":X.asChild,"aria-label":s(re),"data-readonly":s(r)?"":void 0,"data-disabled":s(l)?"":void 0,"data-invalid":s(te)?"":void 0,dir:s(G)},{default:N(()=>[Ee(X.$slots,"default",{date:s(V),grid:s(he),weekDays:s(fe),weekStartsOn:A.value,locale:s(R),fixedWeeks:s(c),modelValue:s(D)}),g("div",f8,[g("div",p8,_(s(re)),1)])]),_:3},8,["as","as-child","aria-label","data-readonly","data-disabled","data-invalid","dir"]))}}),h8=v8,g8=ae({__name:"CalendarCell",props:{date:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"td"}},setup(e){const t=yo();return(a,n)=>(f(),j(s(rt),{as:a.as,"as-child":a.asChild,role:"gridcell","aria-selected":s(t).isDateSelected(a.date)?!0:void 0,"aria-disabled":s(t).isDateDisabled(a.date)||s(t).isDateUnavailable?.(a.date)||s(t).disableDaysOutsideCurrentView.value,"data-disabled":s(t).isDateDisabled(a.date)||s(t).disableDaysOutsideCurrentView.value?"":void 0},{default:N(()=>[Ee(a.$slots,"default")]),_:3},8,["as","as-child","aria-selected","aria-disabled","data-disabled"]))}}),y8=g8,b8=ae({__name:"CalendarCellTrigger",props:{day:{type:null,required:!0},month:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,a=ho(),n=yo(),{primitiveElement:l}=dr(),r=k(()=>t.day.day.toLocaleString(n.locale.value)),o=k(()=>n.formatter.custom(Pa(t.day),{weekday:"long",month:"long",day:"numeric",year:"numeric"})),i=k(()=>n.isDateUnavailable?.(t.day)??!1),u=k(()=>y4(t.day,Qa())),c=k(()=>!Hf(t.day,t.month)),d=k(()=>n.isOutsideVisibleView(t.day)),p=k(()=>n.isDateDisabled(t.day)||n.disableDaysOutsideCurrentView.value&&c.value),v=k(()=>c.value||p.value?!1:!n.disabled.value&&n.isPlaceholderFocusable.value&&Dl(t.day,n.placeholder.value)?!0:(!n.hasSelectedDate.value||n.isSelectedDateDisabled.value)&&!n.isPlaceholderFocusable.value?n.firstFocusableDate.value&&Dl(t.day,n.firstFocusableDate.value):!1),m=k(()=>n.isDateSelected(t.day));function y(w){n.readonly.value||n.isDateDisabled(w)||n.isDateUnavailable?.(w)||n.onDateChange(w)}function x(){p.value||y(t.day)}function C(w){if(p.value)return;w.preventDefault(),w.stopPropagation();const S=n.parentElement.value,q=7,O=n.dir.value==="rtl"?-1:1;switch(w.code){case a.ARROW_RIGHT:I(t.day,O);break;case a.ARROW_LEFT:I(t.day,-O);break;case a.ARROW_UP:I(t.day,-q);break;case a.ARROW_DOWN:I(t.day,q);break;case a.ENTER:case a.SPACE_CODE:y(t.day)}function I(B,L){const W=B.add({days:L});if(n.minValue.value&&W.compare(n.minValue.value)<0||n.maxValue.value&&W.compare(n.maxValue.value)>0)return;const T=S.querySelector(`[data-value='${W.toString()}']:not([data-outside-view])`);if(!T){if(L>0){if(n.isNextButtonDisabled())return;n.nextPage()}else{if(n.isPrevButtonDisabled())return;n.prevPage()}Ge(()=>{I(B,L)});return}if(T&&T.hasAttribute("data-disabled"))return I(W,L);n.onPlaceholderChange(W),T?.focus()}}return(w,S)=>(f(),j(s(rt),{ref_key:"primitiveElement",ref:l,as:t.as,"as-child":t.asChild,role:"button","aria-label":o.value,"data-reka-calendar-cell-trigger":"","aria-disabled":p.value||i.value?!0:void 0,"data-selected":m.value?!0:void 0,"data-value":w.day.toString(),"data-disabled":p.value?"":void 0,"data-unavailable":i.value?"":void 0,"data-today":u.value?"":void 0,"data-outside-view":c.value?"":void 0,"data-outside-visible-view":d.value?"":void 0,"data-focused":v.value?"":void 0,tabindex:v.value?0:c.value||p.value?void 0:-1,onClick:x,onKeydown:[gn(C,["up","down","left","right","space","enter"]),S[0]||(S[0]=gn(mt(()=>{},["prevent"]),["enter"]))]},{default:N(()=>[Ee(w.$slots,"default",{dayValue:r.value,disabled:p.value,today:u.value,selected:m.value,outsideView:c.value,outsideVisibleView:d.value,unavailable:i.value},()=>[ye(_(r.value),1)])]),_:3},8,["as","as-child","aria-label","aria-disabled","data-selected","data-value","data-disabled","data-unavailable","data-today","data-outside-view","data-outside-visible-view","data-focused","tabindex"]))}}),_8=b8,x8=ae({__name:"CalendarGrid",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"table"}},setup(e){const t=e,a=yo(),n=k(()=>a.disabled.value?!0:void 0),l=k(()=>a.readonly.value?!0:void 0);return(r,o)=>(f(),j(s(rt),Ye(t,{tabindex:"-1",role:"application","aria-readonly":l.value,"aria-disabled":n.value,"data-readonly":l.value&&"","data-disabled":n.value&&""}),{default:N(()=>[Ee(r.$slots,"default")]),_:3},16,["aria-readonly","aria-disabled","data-readonly","data-disabled"]))}}),k8=x8,w8=ae({__name:"CalendarGridBody",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"tbody"}},setup(e){const t=e;return(a,n)=>(f(),j(s(rt),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),$8=w8,C8=ae({__name:"CalendarGridHead",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"thead"}},setup(e){const t=e;return(a,n)=>(f(),j(s(rt),Ye(t,{"aria-hidden":"true"}),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),S8=C8,E8=ae({__name:"CalendarGridRow",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"tr"}},setup(e){const t=e;return(a,n)=>(f(),j(s(rt),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),A8=E8,T8=ae({__name:"CalendarHeadCell",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"th"}},setup(e){const t=e;return(a,n)=>(f(),j(s(rt),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),M8=T8,D8=ae({__name:"CalendarHeader",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e;return(a,n)=>(f(),j(s(rt),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),O8=D8,P8=ae({__name:"CalendarHeading",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,a=yo();return(n,l)=>(f(),j(s(rt),Ye(t,{"data-disabled":s(a).disabled.value?"":void 0}),{default:N(()=>[Ee(n.$slots,"default",{headingValue:s(a).headingValue.value},()=>[ye(_(s(a).headingValue.value),1)])]),_:3},16,["data-disabled"]))}}),I8=P8,R8=ae({__name:"CalendarNext",props:{nextPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=k(()=>n.disabled.value||n.isNextButtonDisabled(t.nextPage)),n=yo();function l(){a.value||n.nextPage(t.nextPage)}return(r,o)=>(f(),j(s(rt),{as:t.as,"as-child":t.asChild,"aria-label":"Next page",type:t.as==="button"?"button":void 0,"aria-disabled":a.value||void 0,"data-disabled":a.value||void 0,disabled:a.value,onClick:l},{default:N(()=>[Ee(r.$slots,"default",{disabled:a.value},()=>[o[0]||(o[0]=ye(" Next page "))])]),_:3},8,["as","as-child","type","aria-disabled","data-disabled","disabled"]))}}),q8=R8,L8=ae({__name:"CalendarPrev",props:{prevPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=k(()=>n.disabled.value||n.isPrevButtonDisabled(t.prevPage)),n=yo();function l(){a.value||n.prevPage(t.prevPage)}return(r,o)=>(f(),j(s(rt),{"aria-label":"Previous page",as:t.as,"as-child":t.asChild,type:t.as==="button"?"button":void 0,"aria-disabled":a.value||void 0,"data-disabled":a.value||void 0,disabled:a.value,onClick:l},{default:N(()=>[Ee(r.$slots,"default",{disabled:a.value},()=>[o[0]||(o[0]=ye(" Prev page "))])]),_:3},8,["as","as-child","type","aria-disabled","data-disabled","disabled"]))}}),N8=L8;const[B8,F8]=Pt("RovingFocusGroup");var V8=ae({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(e,{expose:t,emit:a}){const n=e,l=a,{loop:r,orientation:o,dir:i}=Kt(n),u=$n(i),c=Ft(n,"currentTabStopId",l,{defaultValue:n.defaultCurrentTabStopId,passive:n.currentTabStopId===void 0}),d=E(!1),p=E(!1),v=E(0),{getItems:m,CollectionSlot:y}=ip({isProvider:!0});function x(w){const S=!p.value;if(w.currentTarget&&w.target===w.currentTarget&&S&&!d.value){const q=new CustomEvent(C5,S5);if(w.currentTarget.dispatchEvent(q),l("entryFocus",q),!q.defaultPrevented){const O=m().map(T=>T.ref).filter(T=>T.dataset.disabled!==""),I=O.find(T=>T.getAttribute("data-active")===""),B=O.find(T=>T.getAttribute("data-highlighted")===""),L=O.find(T=>T.id===c.value),W=[I,B,L,...O].filter(Boolean);B1(W,n.preventScrollOnEntryFocus)}}p.value=!1}function C(){setTimeout(()=>{p.value=!1},1)}return t({getItems:m}),F8({loop:r,dir:u,orientation:o,currentTabStopId:c,onItemFocus:w=>{c.value=w},onItemShiftTab:()=>{d.value=!0},onFocusableItemAdd:()=>{v.value++},onFocusableItemRemove:()=>{v.value--}}),(w,S)=>(f(),j(s(y),null,{default:N(()=>[M(s(rt),{tabindex:d.value||v.value===0?-1:0,"data-orientation":s(o),as:w.as,"as-child":w.asChild,dir:s(u),style:{outline:"none"},onMousedown:S[0]||(S[0]=q=>p.value=!0),onMouseup:C,onFocus:x,onBlur:S[1]||(S[1]=q=>d.value=!1)},{default:N(()=>[Ee(w.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),Ku=V8,z8=ae({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,a=B8(),n=Jn(),l=k(()=>t.tabStopId||n),r=k(()=>a.currentTabStopId.value===l.value),{getItems:o,CollectionItem:i}=ip();$t(()=>{t.focusable&&a.onFocusableItemAdd()}),Qn(()=>{t.focusable&&a.onFocusableItemRemove()});function u(c){if(c.key==="Tab"&&c.shiftKey){a.onItemShiftTab();return}if(c.target!==c.currentTarget)return;const d=T5(c,a.orientation.value,a.dir.value);if(d!==void 0){if(c.metaKey||c.ctrlKey||c.altKey||!t.allowShiftKey&&c.shiftKey)return;c.preventDefault();let p=[...o().map(v=>v.ref).filter(v=>v.dataset.disabled!=="")];if(d==="last")p.reverse();else if(d==="prev"||d==="next"){d==="prev"&&p.reverse();const v=p.indexOf(c.currentTarget);p=a.loop.value?M5(p,v+1):p.slice(v+1)}Ge(()=>B1(p))}}return(c,d)=>(f(),j(s(i),null,{default:N(()=>[M(s(rt),{tabindex:r.value?0:-1,"data-orientation":s(a).orientation.value,"data-active":c.active?"":void 0,"data-disabled":c.focusable?void 0:"",as:c.as,"as-child":c.asChild,onMousedown:d[0]||(d[0]=p=>{c.focusable?s(a).onItemFocus(l.value):p.preventDefault()}),onFocus:d[1]||(d[1]=p=>s(a).onItemFocus(l.value)),onKeydown:u},{default:N(()=>[Ee(c.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),Wu=z8;const[j8]=Pt("CheckboxGroupRoot");function xp(e){return e==="indeterminate"}function l0(e){return xp(e)?"indeterminate":e?"checked":"unchecked"}const[U8,H8]=Pt("CheckboxRoot");var K8=ae({inheritAttrs:!1,__name:"CheckboxRoot",props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:"on"},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:l,currentElement:r}=lt(),o=j8(null),i=Ft(a,"modelValue",n,{defaultValue:a.defaultValue??a.falseValue,passive:a.modelValue===void 0}),u=k(()=>o?.disabled.value||a.disabled),c=k(()=>bs(i.value,a.trueValue)),d=k(()=>$a(o?.modelValue.value)?i.value==="indeterminate"?"indeterminate":c.value:Ev(o.modelValue.value,a.value));function p(){if($a(o?.modelValue.value))i.value==="indeterminate"?i.value=a.trueValue:i.value=c.value?a.falseValue:a.trueValue;else{const y=[...o.modelValue.value||[]];if(Ev(y,a.value)){const x=y.findIndex(C=>bs(C,a.value));y.splice(x,1)}else y.push(a.value);o.modelValue.value=y}}const v=lp(r),m=k(()=>a.id&&r.value?document.querySelector(`[for="${a.id}"]`)?.innerText:void 0);return H8({disabled:u,state:d}),(y,x)=>(f(),j(Wt(s(o)?.rovingFocus.value?s(Wu):s(rt)),Ye(y.$attrs,{id:y.id,ref:s(l),role:"checkbox","as-child":y.asChild,as:y.as,type:y.as==="button"?"button":void 0,"aria-checked":s(xp)(d.value)?"mixed":d.value,"aria-required":y.required,"aria-label":y.$attrs["aria-label"]||m.value,"data-state":s(l0)(d.value),"data-disabled":u.value?"":void 0,disabled:u.value,focusable:s(o)?.rovingFocus.value?!u.value:void 0,onKeydown:gn(mt(()=>{},["prevent"]),["enter"]),onClick:p}),{default:N(()=>[Ee(y.$slots,"default",{modelValue:s(i),state:d.value}),s(v)&&y.name&&!s(o)?(f(),j(s(dp),{key:0,type:"checkbox",checked:!!d.value,name:y.name,value:y.value,disabled:u.value,required:y.required},null,8,["checked","name","value","disabled","required"])):Y("v-if",!0)]),_:3},16,["id","as-child","as","type","aria-checked","aria-required","aria-label","data-state","data-disabled","disabled","focusable","onKeydown"]))}}),W8=K8,G8=ae({__name:"CheckboxIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const{forwardRef:t}=lt(),a=U8();return(n,l)=>(f(),j(s(br),{present:n.forceMount||s(xp)(s(a).state.value)||s(a).state.value===!0},{default:N(()=>[M(s(rt),Ye({ref:s(t),"data-state":s(l0)(s(a).state.value),"data-disabled":s(a).disabled.value?"":void 0,style:{pointerEvents:"none"},"as-child":n.asChild,as:n.as},n.$attrs),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),Y8=G8,J8=ae({__name:"MenuAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(cp),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),Z8=J8;function X8(){const e=E(!1);return $t(()=>{so("keydown",()=>{e.value=!0},{capture:!0,passive:!0}),so(["pointerdown","pointermove"],()=>{e.value=!1},{capture:!0,passive:!0})}),e}const Q8=Yb(X8),[Gu,e6]=Pt(["MenuRoot","MenuSub"],"MenuContext"),[kp,t6]=Pt("MenuRoot");var a6=ae({__name:"MenuRoot",props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const a=e,n=t,{modal:l,dir:r}=Kt(a),o=$n(r),i=Ft(a,"open",n),u=E(),c=Q8();return e6({open:i,onOpenChange:d=>{i.value=d},content:u,onContentChange:d=>{u.value=d}}),t6({onClose:()=>{i.value=!1},isUsingKeyboardRef:c,dir:o,modal:l}),(d,p)=>(f(),j(s(V1),null,{default:N(()=>[Ee(d.$slots,"default")]),_:3}))}}),n6=a6;const[r0,l6]=Pt("MenuContent");var r6=ae({__name:"MenuContentImpl",props:vy({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...X1}),emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus","dismiss"],setup(e,{emit:t}){const a=e,n=t,l=Gu(),r=kp(),{trapFocus:o,disableOutsidePointerEvents:i,loop:u}=Kt(a);M1(),Uf(i.value);const c=E(""),d=E(0),p=E(0),v=E(null),m=E("right"),y=E(0),x=E(null),C=E(),{forwardRef:w,currentElement:S}=lt(),{handleTypeaheadSearch:q}=xA(),O=E();function I(V){const K=Tv(V,O.value||Zt(),S.value,{loop:u.value,arrowKeyOptions:"vertical",dir:r?.dir.value,focus:!1,attributeName:"[data-reka-collection-item]:not([data-disabled])"});K&&(O.value=K,K.scrollIntoView({block:"nearest"}))}function B(){O.value&&O.value.click()}const L=E(),W=E();ze(O,V=>{W.value&&(V===void 0||V!==W.value.trigger.value)&&(W.value.onOpenChange(!1),W.value=void 0)}),ze(S,V=>{l.onContentChange(V)}),Qn(()=>{window.clearTimeout(d.value)});function T(V){return m.value===v.value?.side&&KA(V,v.value?.area)}async function R(V){n("openAutoFocus",V),!V.defaultPrevented&&(V.preventDefault(),S.value?.focus({preventScroll:!0}))}function G(V){if(V.defaultPrevented)return;const K=V.target,re=K.closest("[data-reka-menu-content]")===V.currentTarget,ie=["input","textarea"].includes(K.tagName.toLowerCase()),Ae=V.ctrlKey||V.altKey||V.metaKey,_e=V.key.length===1,xe=Tv(V,Zt(),S.value,{loop:u.value,arrowKeyOptions:"vertical",dir:r?.dir.value,focus:!0,attributeName:"[data-reka-collection-item]:not([data-disabled])"});if(xe)return xe?.focus();if(V.code==="Space")return;const ne=C.value?.getItems()??[];if(re&&(V.key==="Tab"&&V.preventDefault(),!Ae&&_e&&!ie&&q(V.key,ne)),V.target!==S.value||!jA.includes(V.key))return;V.preventDefault();const fe=[...ne.map(F=>F.ref)];I1.includes(V.key)&&fe.reverse(),UA(fe)}function A(V){V?.currentTarget?.contains?.(V.target)||(window.clearTimeout(d.value),c.value="")}function D(V){if(!eu(V))return;const K=V.target,re=y.value!==V.clientX;if(V?.currentTarget?.contains(K)&&re){const ie=V.clientX>y.value?"right":"left";m.value=ie,y.value=V.clientX}}function z(V){eu(V)&&L.value&&L.value.focus()}return l6({onItemEnter:V=>!!T(V),onItemLeave:V=>T(V)?!0:(["INPUT","TEXTAREA"].includes(Zt()?.tagName||"")||S.value?.focus(),x.value=null,!1),onTriggerLeave:V=>!!T(V),searchRef:c,highlightedElement:O,onKeydownNavigation:I,onKeydownEnter:B,filterElement:L,onFilterElementChange:V=>{L.value=V},activeSubmenuContext:W,pointerGraceTimerRef:p,onPointerGraceIntentChange:V=>{v.value=V}}),(V,K)=>(f(),j(s(sp),{"as-child":"",trapped:s(o),onMountAutoFocus:R,onUnmountAutoFocus:K[7]||(K[7]=re=>n("closeAutoFocus",re))},{default:N(()=>[M(s(op),{"as-child":"","disable-outside-pointer-events":s(i),onEscapeKeyDown:K[2]||(K[2]=re=>n("escapeKeyDown",re)),onPointerDownOutside:K[3]||(K[3]=re=>n("pointerDownOutside",re)),onFocusOutside:K[4]||(K[4]=re=>n("focusOutside",re)),onInteractOutside:K[5]||(K[5]=re=>n("interactOutside",re)),onDismiss:K[6]||(K[6]=re=>n("dismiss"))},{default:N(()=>[M(s(Ku),{ref_key:"rovingFocusGroupRef",ref:C,"current-tab-stop-id":x.value,"onUpdate:currentTabStopId":K[0]||(K[0]=re=>x.value=re),"as-child":"",orientation:"vertical",dir:s(r).dir.value,loop:s(u),onEntryFocus:K[1]||(K[1]=re=>{n("entryFocus",re),s(r).isUsingKeyboardRef.value||re.preventDefault()})},{default:N(()=>[M(s(Q1),{ref:s(w),role:"menu",as:V.as,"as-child":V.asChild,"aria-orientation":"vertical","data-reka-menu-content":"","data-state":s(R1)(s(l).open.value),dir:s(r).dir.value,side:V.side,"side-offset":V.sideOffset,align:V.align,"align-offset":V.alignOffset,"avoid-collisions":V.avoidCollisions,"collision-boundary":V.collisionBoundary,"collision-padding":V.collisionPadding,"arrow-padding":V.arrowPadding,"prioritize-position":V.prioritizePosition,"position-strategy":V.positionStrategy,"update-position-strategy":V.updatePositionStrategy,sticky:V.sticky,"hide-when-detached":V.hideWhenDetached,reference:V.reference,onKeydown:G,onBlur:A,onPointermove:D,onPointerenter:z},{default:N(()=>[Ee(V.$slots,"default")]),_:3},8,["as","as-child","data-state","dir","side","side-offset","align","align-offset","avoid-collisions","collision-boundary","collision-padding","arrow-padding","prioritize-position","position-strategy","update-position-strategy","sticky","hide-when-detached","reference"])]),_:3},8,["current-tab-stop-id","dir","loop"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),o0=r6,o6=ae({inheritAttrs:!1,__name:"MenuItemImpl",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=r0(),{forwardRef:n,currentElement:l}=lt(),{CollectionItem:r}=ip(),o=E(!1),i=k(()=>o.value||l.value!=null&&a.highlightedElement.value===l.value);async function u(d){if(!(d.defaultPrevented||!eu(d))){if(t.disabled)a.onItemLeave(d);else if(!a.onItemEnter(d)){const v=d.currentTarget;a.highlightedElement.value=v,["INPUT","TEXTAREA"].includes(Zt()?.tagName||"")||v.focus({preventScroll:!0})}}}async function c(d){if(await Ge(),d.defaultPrevented||!eu(d)||a.highlightedElement.value!==l.value)return;!a.onItemLeave(d)&&a.highlightedElement.value===l.value&&(a.highlightedElement.value=void 0)}return(d,p)=>(f(),j(s(r),{value:{textValue:d.textValue}},{default:N(()=>[M(s(rt),Ye({ref:s(n),role:"menuitem",tabindex:"-1"},d.$attrs,{as:d.as,"as-child":d.asChild,"aria-disabled":d.disabled||void 0,"data-disabled":d.disabled?"":void 0,"data-highlighted":i.value?"":void 0,onPointermove:u,onPointerleave:c,onFocus:p[0]||(p[0]=async v=>{await Ge(),!(v.defaultPrevented||d.disabled)&&(o.value=!0,s(a).highlightedElement.value=v.currentTarget)}),onBlur:p[1]||(p[1]=async v=>{await Ge(),!v.defaultPrevented&&(o.value=!1)})}),{default:N(()=>[Ee(d.$slots,"default")]),_:3},16,["as","as-child","aria-disabled","data-disabled","data-highlighted"])]),_:3},8,["value"]))}}),s6=o6,i6=ae({__name:"MenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:l,currentElement:r}=lt(),o=kp(),i=r0(),u=E(!1);async function c(){const d=r.value;if(!a.disabled&&d){const p=new CustomEvent(VA,{bubbles:!0,cancelable:!0});n("select",p),await Ge(),p.defaultPrevented?u.value=!1:o.onClose()}}return(d,p)=>(f(),j(s6,Ye(a,{ref:s(l),onClick:c,onPointerdown:p[0]||(p[0]=()=>{u.value=!0}),onPointerup:p[1]||(p[1]=async v=>{await Ge(),!v.defaultPrevented&&(u.value||v.currentTarget?.click())}),onKeydown:p[2]||(p[2]=async v=>{const m=s(i).searchRef.value!=="";d.disabled||m&&v.key===" "||s(jc).includes(v.key)&&(v.currentTarget?.click(),v.preventDefault())})}),{default:N(()=>[Ee(d.$slots,"default")]),_:3},16))}}),s0=i6;const[u6,d6]=Pt(["MenuCheckboxItem","MenuRadioItem"],"MenuItemIndicatorContext");var c6=ae({__name:"MenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=u6({modelValue:E(!1)});return(a,n)=>(f(),j(s(br),{present:a.forceMount||s(q1)(s(t).modelValue.value)||s(t).modelValue.value===!0},{default:N(()=>[M(s(rt),{as:a.as,"as-child":a.asChild,"data-state":s(L1)(s(t).modelValue.value)},{default:N(()=>[Ee(a.$slots,"default")]),_:3},8,["as","as-child","data-state"])]),_:3},8,["present"]))}}),f6=c6,p6=ae({__name:"MenuRootContentModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=Cn(a,n),r=Gu(),{forwardRef:o,currentElement:i}=lt();return rp(i),(u,c)=>(f(),j(o0,Ye(s(l),{ref:s(o),"trap-focus":s(r).open.value,"disable-outside-pointer-events":s(r).open.value,"disable-outside-scroll":!0,onDismiss:c[0]||(c[0]=d=>s(r).onOpenChange(!1)),onFocusOutside:c[1]||(c[1]=mt(d=>n("focusOutside",d),["prevent"]))}),{default:N(()=>[Ee(u.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),m6=p6,v6=ae({__name:"MenuRootContentNonModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const l=Cn(e,t),r=Gu();return(o,i)=>(f(),j(o0,Ye(s(l),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:i[0]||(i[0]=u=>s(r).onOpenChange(!1))}),{default:N(()=>[Ee(o.$slots,"default")]),_:3},16))}}),h6=v6,g6=ae({__name:"MenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const l=Cn(e,t),r=Gu(),o=kp();return(i,u)=>(f(),j(s(br),{present:i.forceMount||s(r).open.value},{default:N(()=>[s(o).modal.value?(f(),j(m6,ut(Ye({key:0},{...i.$attrs,...s(l)})),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16)):(f(),j(h6,ut(Ye({key:1},{...i.$attrs,...s(l)})),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),y6=g6;const[b6,_6]=Pt("MenuGroup");var x6=ae({__name:"MenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=Jn(void 0,"reka-menu-group");return _6({id:a}),(n,l)=>(f(),j(s(rt),Ye({role:"group"},t,{"aria-labelledby":s(a)}),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),k6=x6,w6=ae({__name:"MenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,a=b6({id:""});return(n,l)=>(f(),j(s(rt),Ye(t,{id:s(a).id||void 0}),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["id"]))}}),$6=w6,C6=ae({__name:"MenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(Fu),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),S6=C6;const[E6,A6]=Pt("MenuRadioGroup");var T6=ae({__name:"MenuRadioGroup",props:{modelValue:{type:null,required:!1,default:""},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=Vf(a,["modelValue"]),r=Nu(l),o=Ft(a,"modelValue",n);return A6({modelValue:o,onValueChange:i=>{o.value=i}}),(i,u)=>(f(),j(k6,ut(ft(s(r))),{default:N(()=>[Ee(i.$slots,"default",{modelValue:s(o)})]),_:3},16))}}),M6=T6,D6=ae({__name:"MenuRadioItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const a=e,n=t,l=Vf(a,["value"]),r=Nu(l),{value:o}=Kt(a),i=E6(),u=k(()=>i.modelValue.value===o?.value);return d6({modelValue:u}),(c,d)=>(f(),j(s0,Ye({role:"menuitemradio"},s(r),{"aria-checked":u.value,"data-state":s(L1)(u.value),onSelect:d[0]||(d[0]=async p=>{n("select",p),s(i).onValueChange(s(o))})}),{default:N(()=>[Ee(c.$slots,"default")]),_:3},16,["aria-checked","data-state"]))}}),O6=D6,P6=ae({__name:"MenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(rt),Ye(t,{role:"separator","aria-orientation":"horizontal"}),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),I6=P6;const[R6,q6]=Pt("DateFieldRoot");var L6=ae({inheritAttrs:!1,__name:"DateFieldRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},modelValue:{type:null,required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},isDateUnavailable:{type:Function,required:!1,default:void 0},id:{type:String,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:placeholder"],setup(e,{expose:t,emit:a}){const n=e,l=a,{disabled:r,readonly:o,isDateUnavailable:i,granularity:u,defaultValue:c,dir:d,locale:p}=Kt(n),v=Bu(p),m=$n(d),y=np(v.value,{hourCycle:ks(n.hourCycle)}),{primitiveElement:x,currentElement:C}=dr(),w=E(new Set);$t(()=>{hh(C.value).forEach(F=>w.value.add(F))});const S=Ft(n,"modelValue",l,{defaultValue:c.value,passive:n.modelValue===void 0}),q=ap({defaultPlaceholder:n.placeholder,granularity:u.value,defaultValue:S.value,locale:n.locale}),O=Ft(n,"placeholder",l,{defaultValue:n.defaultPlaceholder??q.copy(),passive:n.placeholder===void 0}),I=k(()=>S1(n)),B=k(()=>n.granularity?Vc(O.value)?n.granularity:"day":Vc(O.value)?"minute":"day"),L=k(()=>S.value?!!(i.value?.(S.value)||n.minValue&&Cl(S.value,n.minValue)||n.maxValue&&Cl(n.maxValue,S.value)):!1),W=HT(B.value),T=E(S.value?{...vh({value:S.value,formatter:y})}:{...W}),R=k(()=>a0({granularity:B.value,dateRef:O.value,formatter:y,hideTimeZone:n.hideTimeZone,hourCycle:n.hourCycle,segmentValues:T.value,locale:v})),G=k(()=>R.value.arr),A=k(()=>G.value.filter(({part:F})=>F!=="literal"));ze(v,F=>{y.getLocale()!==F&&(y.setLocale(F),Ge(()=>{w.value.clear(),hh(C.value).forEach(de=>w.value.add(de))}))}),ze(S,F=>{!$a(F)&&O.value.compare(F)!==0&&(O.value=F.copy())}),ze([S,v],([F])=>{$a(F)?Object.values(T.value).every(de=>de!==null)&&$a(F)&&(T.value={...W}):T.value={...vh({value:F,formatter:y})}});const D=E(null),z=k(()=>Array.from(w.value).findIndex(F=>F.getAttribute("data-reka-date-field-segment")===D.value?.getAttribute("data-reka-date-field-segment"))),V=k(()=>{const F=m.value==="rtl"?-1:1;return(F<0?z.value<0:z.value>w.value.size-1)?null:Array.from(w.value)[z.value+F]}),K=k(()=>{const F=m.value==="rtl"?-1:1;return(F>0?z.value<0:z.value>w.value.size-1)?null:Array.from(w.value)[z.value-F]}),re=k(()=>A1(B.value)),ie=k(()=>Id(S.value,B.value)),Ae=k(()=>n.maxValue?Id(n.maxValue,B.value):void 0),_e=k(()=>n.minValue?Id(n.minValue,B.value):void 0),xe=ho();function ne(F){F.isComposing||On(F.key)&&(F.key===xe.ARROW_LEFT&&K.value?.focus(),F.key===xe.ARROW_RIGHT&&V.value?.focus())}function fe(F){D.value=F}return q6({isDateUnavailable:i.value,locale:v,modelValue:S,placeholder:O,disabled:r,formatter:y,hourCycle:n.hourCycle,step:I,readonly:o,segmentValues:T,isInvalid:L,segmentContents:A,elements:w,setFocusedElement:fe,focusNext(){V.value?.focus()}}),t({setFocusedElement:fe}),(F,de)=>(f(),j(s(rt),Ye(F.$attrs,{ref_key:"primitiveElement",ref:x,role:"group","aria-disabled":s(r)?!0:void 0,"data-disabled":s(r)?"":void 0,"data-readonly":s(o)?"":void 0,"data-invalid":L.value?"":void 0,dir:s(m),onKeydown:gn(ne,["left","right"])}),{default:N(()=>[Ee(F.$slots,"default",{modelValue:s(S),segments:G.value,isInvalid:L.value}),M(s(up),{id:F.id,as:"input",type:re.value,feature:"focusable",tabindex:"-1",value:ie.value,name:F.name,disabled:s(r),required:F.required,max:Ae.value,min:_e.value,onFocus:de[0]||(de[0]=ve=>Array.from(w.value)?.[0]?.focus())},null,8,["id","type","value","name","disabled","required","max","min"])]),_:3},16,["aria-disabled","data-disabled","data-readonly","data-invalid","dir"]))}}),N6=L6,B6=ae({__name:"DateFieldInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=R6(),n=E(!0),l=E(!1),{handleSegmentClick:r,handleSegmentKeydown:o,handleSegmentBeforeInput:i,handleSegmentCompositionStart:u,handleSegmentCompositionEnd:c,attributes:d}=n0({hasLeftFocus:n,lastKeyZero:l,placeholder:a.placeholder,hourCycle:a.hourCycle,step:a.step,segmentValues:a.segmentValues,formatter:a.formatter,part:t.part,disabled:a.disabled,readonly:a.readonly,focusNext:a.focusNext,modelValue:a.modelValue}),p=k(()=>a.disabled.value),v=k(()=>a.readonly.value),m=k(()=>a.isInvalid.value);return(y,x)=>(f(),j(s(rt),Ye({as:y.as,"as-child":y.asChild},s(d),{contenteditable:p.value||v.value?!1:y.part!=="literal","data-reka-date-field-segment":y.part,"aria-disabled":p.value?!0:void 0,"aria-readonly":v.value?!0:void 0,"data-disabled":p.value?"":void 0,"data-invalid":m.value?"":void 0,"aria-invalid":m.value?!0:void 0},my(y.part!=="literal"?{mousedown:s(r),keydown:s(o),beforeinput:s(i),compositionstart:s(u),compositionend:s(c),focusout:()=>{n.value=!0},focusin:C=>{s(a).setFocusedElement(C.target)}}:{})),{default:N(()=>[Ee(y.$slots,"default")]),_:3},16,["as","as-child","contenteditable","data-reka-date-field-segment","aria-disabled","aria-readonly","data-disabled","data-invalid","aria-invalid"]))}}),F6=B6;const[bo,V6]=Pt("PopoverRoot");var z6=ae({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(e,{emit:t}){const a=e,n=t,{modal:l}=Kt(a),r=Ft(a,"open",n,{defaultValue:a.defaultOpen,passive:a.open===void 0});return V6({contentId:"",triggerId:"",modal:l,open:r,onOpenChange:u=>{r.value=u},onOpenToggle:()=>{r.value=!r.value},triggerElement:E(),hasCustomAnchor:E(!1)}),(u,c)=>(f(),j(s(V1),null,{default:N(()=>[Ee(u.$slots,"default",{open:s(r),close:()=>r.value=!1})]),_:3}))}}),i0=z6,j6=ae({__name:"PopoverAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;lt();const a=bo();return uy(()=>{a.hasCustomAnchor.value=!0}),Qn(()=>{a.hasCustomAnchor.value=!1}),(n,l)=>(f(),j(s(cp),ut(ft(t)),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16))}}),U6=j6;const[wp,H6]=Pt("DatePickerRoot");var K6=ae({inheritAttrs:!1,__name:"DatePickerRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},modelValue:{type:null,required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},isDateUnavailable:{type:Function,required:!1,default:void 0},id:{type:String,required:!1},dir:{type:String,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1},isDateDisabled:{type:Function,required:!1,default:void 0},pagedNavigation:{type:Boolean,required:!1,default:!1},weekStartsOn:{type:Number,required:!1},weekdayFormat:{type:String,required:!1,default:"narrow"},fixedWeeks:{type:Boolean,required:!1,default:!1},numberOfMonths:{type:Number,required:!1,default:1},preventDeselect:{type:Boolean,required:!1,default:!1},closeOnSelect:{type:Boolean,required:!1,default:!1}},emits:["update:open","update:modelValue","update:placeholder"],setup(e,{emit:t}){const a=e,n=t,{locale:l,disabled:r,readonly:o,pagedNavigation:i,weekdayFormat:u,fixedWeeks:c,numberOfMonths:d,preventDeselect:p,isDateDisabled:v,isDateUnavailable:m,defaultOpen:y,modal:x,id:C,name:w,required:S,minValue:q,maxValue:O,granularity:I,hideTimeZone:B,hourCycle:L,defaultValue:W,dir:T,step:R,closeOnSelect:G}=Kt(a),A=$n(T),D=Bu(l),z=k(()=>a.weekStartsOn??T1(D.value)),V=Ft(a,"modelValue",n,{defaultValue:W.value,passive:a.modelValue===void 0}),K=k(()=>ap({defaultPlaceholder:a.placeholder,granularity:a.granularity,defaultValue:V.value,locale:D.value})),re=Ft(a,"placeholder",n,{defaultValue:a.defaultPlaceholder??K.value.copy(),passive:a.placeholder===void 0}),ie=Ft(a,"open",n,{defaultValue:y.value,passive:a.open===void 0}),Ae=E();function _e(xe){return"hour"in xe?xe.set({hour:0,minute:0,second:0,millisecond:0}):xe}return ze(V,xe=>{xe&&xe.compare(re.value)!==0?re.value=xe.copy():!xe&&"hour"in re.value&&(re.value=_e(re.value)),G.value&&(ie.value=!1)}),H6({isDateUnavailable:m.value,isDateDisabled:v.value,locale:D,disabled:r,pagedNavigation:i,weekStartsOn:z,weekdayFormat:u,fixedWeeks:c,numberOfMonths:d,readonly:o,preventDeselect:p,modelValue:V,placeholder:re,defaultOpen:y,modal:x,open:ie,id:C,name:w,required:S,minValue:q,maxValue:O,granularity:I,hideTimeZone:B,hourCycle:L,dateFieldRef:Ae,dir:A,step:R,onDateChange(xe){xe?V.value&&!p.value&&xe&&V.value.compare(xe)===0?V.value=void 0:V.value=xe.copy():V.value=void 0},onPlaceholderChange(xe){re.value=xe.copy()},closeOnSelect:G}),(xe,ne)=>(f(),j(s(i0),{open:s(ie),"onUpdate:open":ne[0]||(ne[0]=fe=>Ct(ie)?ie.value=fe:null),"default-open":s(y),modal:s(x)},{default:N(()=>[Ee(xe.$slots,"default")]),_:3},8,["open","default-open","modal"]))}}),W6=K6,G6=ae({__name:"DatePickerCalendar",setup(e){const t=wp();return(a,n)=>(f(),j(s(h8),Ye({isDateDisabled:s(t).isDateDisabled,isDateUnavailable:s(t).isDateUnavailable,minValue:s(t).minValue.value,maxValue:s(t).maxValue.value,locale:s(t).locale.value,disabled:s(t).disabled.value,pagedNavigation:s(t).pagedNavigation.value,weekStartsOn:s(t).weekStartsOn.value,weekdayFormat:s(t).weekdayFormat.value,fixedWeeks:s(t).fixedWeeks.value,numberOfMonths:s(t).numberOfMonths.value,readonly:s(t).readonly.value,preventDeselect:s(t).preventDeselect.value,dir:s(t).dir.value},{"model-value":s(t).modelValue.value,placeholder:s(t).placeholder.value,multiple:!1,"onUpdate:modelValue":n[0]||(n[0]=l=>{l&&s(t).modelValue.value&&s(Yr)(l,s(t).modelValue.value)||s(t).onDateChange(l)}),"onUpdate:placeholder":n[1]||(n[1]=l=>{s(Yr)(l,s(t).placeholder.value)||s(t).onPlaceholderChange(l)})}),{default:N(({weekDays:l,grid:r,date:o,weekStartsOn:i,locale:u,fixedWeeks:c})=>[Ee(a.$slots,"default",{date:o,grid:r,weekDays:l,weekStartsOn:i,locale:u,fixedWeeks:c})]),_:3},16,["model-value","placeholder"]))}}),Y6=G6,J6=ae({__name:"DatePickerCell",props:{date:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(y8),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),Z6=J6,X6=ae({__name:"DatePickerCellTrigger",props:{day:{type:null,required:!0},month:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(_8),ut(ft(t)),{default:N(l=>[Ee(a.$slots,"default",ut(ft(l)))]),_:3},16))}}),Q6=X6,eM=ae({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=Nu(Vf(a,"trapFocus","disableOutsidePointerEvents")),{forwardRef:r}=lt(),o=bo();return M1(),(i,u)=>(f(),j(s(sp),{"as-child":"",loop:"",trapped:i.trapFocus,onMountAutoFocus:u[5]||(u[5]=c=>n("openAutoFocus",c)),onUnmountAutoFocus:u[6]||(u[6]=c=>n("closeAutoFocus",c))},{default:N(()=>[M(s(op),{"as-child":"","disable-outside-pointer-events":i.disableOutsidePointerEvents,onPointerDownOutside:u[0]||(u[0]=c=>n("pointerDownOutside",c)),onInteractOutside:u[1]||(u[1]=c=>n("interactOutside",c)),onEscapeKeyDown:u[2]||(u[2]=c=>n("escapeKeyDown",c)),onFocusOutside:u[3]||(u[3]=c=>n("focusOutside",c)),onDismiss:u[4]||(u[4]=c=>s(o).onOpenChange(!1))},{default:N(()=>[M(s(Q1),Ye(s(l),{id:s(o).contentId,ref:s(r),"data-state":s(o).open.value?"open":"closed","aria-labelledby":s(o).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),u0=eM,tM=ae({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=bo(),r=E(!1);Uf(!0);const o=Cn(a,n),{forwardRef:i,currentElement:u}=lt();return rp(u),(c,d)=>(f(),j(u0,Ye(s(o),{ref:s(i),"trap-focus":s(l).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:d[0]||(d[0]=mt(p=>{n("closeAutoFocus",p),r.value||s(l).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:d[1]||(d[1]=p=>{n("pointerDownOutside",p);const v=p.detail.originalEvent,m=v.button===0&&v.ctrlKey===!0,y=v.button===2||m;r.value=y}),onFocusOutside:d[2]||(d[2]=mt(()=>{},["prevent"]))}),{default:N(()=>[Ee(c.$slots,"default")]),_:3},16,["trap-focus"]))}}),aM=tM,nM=ae({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=bo(),r=E(!1),o=E(!1),i=Cn(a,n);return(u,c)=>(f(),j(u0,Ye(s(i),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:c[0]||(c[0]=d=>{n("closeAutoFocus",d),d.defaultPrevented||(r.value||s(l).triggerElement.value?.focus(),d.preventDefault()),r.value=!1,o.value=!1}),onInteractOutside:c[1]||(c[1]=async d=>{n("interactOutside",d),d.defaultPrevented||(r.value=!0,d.detail.originalEvent.type==="pointerdown"&&(o.value=!0));const p=d.target;s(l).triggerElement.value?.contains(p)&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&o.value&&d.preventDefault()})}),{default:N(()=>[Ee(u.$slots,"default")]),_:3},16))}}),lM=nM,rM=ae({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=bo(),r=Cn(a,n),{forwardRef:o}=lt();return l.contentId||=Jn(void 0,"reka-popover-content"),(i,u)=>(f(),j(s(br),{present:i.forceMount||s(l).open.value},{default:N(()=>[s(l).modal.value?(f(),j(aM,Ye({key:0},s(r),{ref:s(o)}),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16)):(f(),j(lM,Ye({key:1},s(r),{ref:s(o)}),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),d0=rM,oM=ae({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(Fu),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),c0=oM,sM=ae({__name:"DatePickerContent",props:{portal:{type:Object,required:!1},forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>({...a,portal:void 0})),r=Cn(l,n);return(o,i)=>(f(),j(s(c0),ut(ft(o.portal)),{default:N(()=>[M(s(d0),Ye({...s(r),...o.$attrs},{onOpenAutoFocus:i[0]||(i[0]=u=>{n("openAutoFocus",u),!u.defaultPrevented&&u.target&&(s(E1)(u.target),u.preventDefault())})}),{default:N(()=>[Ee(o.$slots,"default")]),_:3},16)]),_:3},16))}}),iM=sM,uM=ae({__name:"DatePickerField",setup(e){const t=wp();return(a,n)=>(f(),j(s(N6),Ye({ref:s(t).dateFieldRef,"model-value":s(t).modelValue.value,placeholder:s(t).placeholder.value},{id:s(t).id.value,name:s(t).name.value,disabled:s(t).disabled.value,minValue:s(t).minValue.value,maxValue:s(t).maxValue.value,readonly:s(t).readonly.value,hourCycle:s(t).hourCycle.value,granularity:s(t).granularity.value,hideTimeZone:s(t).hideTimeZone.value,locale:s(t).locale.value,isDateUnavailable:s(t).isDateUnavailable,required:s(t).required.value,dir:s(t).dir.value,step:s(t).step.value},{"onUpdate:modelValue":n[0]||(n[0]=l=>{l&&s(t).modelValue.value&&l.compare(s(t).modelValue.value)===0||s(t).onDateChange(l)}),"onUpdate:placeholder":n[1]||(n[1]=l=>{l.compare(s(t).placeholder.value)!==0&&s(t).onPlaceholderChange(l)})}),{default:N(({segments:l,modelValue:r})=>[Ee(a.$slots,"default",{segments:l,modelValue:r})]),_:3},16,["model-value","placeholder"]))}}),dM=uM,cM=ae({__name:"DatePickerGrid",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(k8),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),fM=cM,pM=ae({__name:"DatePickerGridBody",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s($8),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),mM=pM,vM=ae({__name:"DatePickerGridHead",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(S8),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),hM=vM,gM=ae({__name:"DatePickerGridRow",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(A8),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),yh=gM,yM=ae({__name:"DatePickerHeadCell",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(M8),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),bM=yM,_M=ae({__name:"DatePickerHeader",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(O8),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),xM=_M,kM=ae({__name:"DatePickerHeading",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(I8),ut(ft(t)),{default:N(({headingValue:l})=>[Ee(a.$slots,"default",{headingValue:l},()=>[ye(_(l),1)])]),_:3},16))}}),wM=kM,$M=ae({__name:"DatePickerInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(F6),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),CM=$M,SM=ae({__name:"DatePickerNext",props:{nextPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(q8),ut(ft(t)),{default:N(l=>[Ee(a.$slots,"default",ut(ft(l)))]),_:3},16))}}),EM=SM,AM=ae({__name:"DatePickerPrev",props:{prevPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(N8),ut(ft(t)),{default:N(l=>[Ee(a.$slots,"default",ut(ft(l)))]),_:3},16))}}),TM=AM,MM=ae({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=bo(),{forwardRef:n,currentElement:l}=lt();return a.triggerId||=Jn(void 0,"reka-popover-trigger"),$t(()=>{a.triggerElement.value=l.value}),(r,o)=>(f(),j(Wt(s(a).hasCustomAnchor.value?s(rt):s(cp)),{"as-child":""},{default:N(()=>[M(s(rt),{id:s(a).triggerId,ref:s(n),type:r.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":s(a).open.value,"aria-controls":s(a).contentId,"data-state":s(a).open.value?"open":"closed",as:r.as,"as-child":t.asChild,onClick:s(a).onOpenToggle},{default:N(()=>[Ee(r.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),DM=MM,OM=ae({__name:"DatePickerTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=wp();return(n,l)=>(f(),j(s(DM),Ye({"data-reka-date-field-segment":"trigger"},t,{disabled:s(a).disabled.value,onFocusin:l[0]||(l[0]=r=>{s(a).dateFieldRef.value?.setFocusedElement(r.target)})}),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["disabled"]))}}),PM=OM;const[f0,IM]=Pt("DropdownMenuRoot");var RM=ae({__name:"DropdownMenuRoot",props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const a=e,n=t;lt();const l=Ft(a,"open",n,{defaultValue:a.defaultOpen,passive:a.open===void 0}),r=E(),{modal:o,dir:i}=Kt(a),u=$n(i);return IM({open:l,onOpenChange:c=>{l.value=c},onOpenToggle:()=>{l.value=!l.value},triggerId:"",triggerElement:r,contentId:"",modal:o,dir:u}),(c,d)=>(f(),j(s(n6),{open:s(l),"onUpdate:open":d[0]||(d[0]=p=>Ct(l)?l.value=p:null),dir:s(u),modal:s(o)},{default:N(()=>[Ee(c.$slots,"default",{open:s(l)})]),_:3},8,["open","dir","modal"]))}}),p0=RM,qM=ae({__name:"DropdownMenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(e,{emit:t}){const l=Cn(e,t);lt();const r=f0(),o=E(!1);function i(u){u.defaultPrevented||(o.value||setTimeout(()=>{r.triggerElement.value?.focus()},0),o.value=!1,u.preventDefault())}return r.contentId||=Jn(void 0,"reka-dropdown-menu-content"),(u,c)=>(f(),j(s(y6),Ye(s(l),{id:s(r).contentId,"aria-labelledby":s(r)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-dropdown-menu-content-available-width":"var(--reka-popper-available-width)","--reka-dropdown-menu-content-available-height":"var(--reka-popper-available-height)","--reka-dropdown-menu-trigger-width":"var(--reka-popper-anchor-width)","--reka-dropdown-menu-trigger-height":"var(--reka-popper-anchor-height)"},onCloseAutoFocus:i,onInteractOutside:c[0]||(c[0]=d=>{if(d.defaultPrevented)return;const p=d.detail.originalEvent,v=p.button===0&&p.ctrlKey===!0,m=p.button===2||v;(!s(r).modal.value||m)&&(o.value=!0),s(r).triggerElement.value?.contains(d.target)&&d.preventDefault()})}),{default:N(()=>[Ee(u.$slots,"default")]),_:3},16,["id","aria-labelledby"]))}}),m0=qM,LM=ae({__name:"DropdownMenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const a=e,l=yr(t);return lt(),(r,o)=>(f(),j(s(s0),ut(ft({...a,...s(l)})),{default:N(()=>[Ee(r.$slots,"default")]),_:3},16))}}),Yc=LM,NM=ae({__name:"DropdownMenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return lt(),(a,n)=>(f(),j(s(f6),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),BM=NM,FM=ae({__name:"DropdownMenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return lt(),(a,n)=>(f(),j(s($6),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),VM=FM,zM=ae({__name:"DropdownMenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(f(),j(s(S6),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),v0=zM,jM=ae({__name:"DropdownMenuRadioGroup",props:{modelValue:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,l=yr(t);return lt(),(r,o)=>(f(),j(s(M6),ut(ft({...a,...s(l)})),{default:N(()=>[Ee(r.$slots,"default")]),_:3},16))}}),UM=jM,HM=ae({__name:"DropdownMenuRadioItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const l=Cn(e,t);return lt(),(r,o)=>(f(),j(s(O6),ut(ft(s(l))),{default:N(()=>[Ee(r.$slots,"default")]),_:3},16))}}),KM=HM,WM=ae({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return lt(),(a,n)=>(f(),j(s(I6),ut(ft(t)),{default:N(()=>[Ee(a.$slots,"default")]),_:3},16))}}),bh=WM,GM=ae({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=f0(),{forwardRef:n,currentElement:l}=lt();return $t(()=>{a.triggerElement=l}),a.triggerId||=Jn(void 0,"reka-dropdown-menu-trigger"),(r,o)=>(f(),j(s(Z8),{"as-child":""},{default:N(()=>[M(s(rt),{id:s(a).triggerId,ref:s(n),type:r.as==="button"?"button":void 0,"as-child":t.asChild,as:r.as,"aria-haspopup":"menu","aria-expanded":s(a).open.value,"aria-controls":s(a).open.value?s(a).contentId:void 0,"data-disabled":r.disabled?"":void 0,disabled:r.disabled,"data-state":s(a).open.value?"open":"closed",onClick:o[0]||(o[0]=async i=>{!r.disabled&&i.button===0&&i.ctrlKey===!1&&(s(a)?.onOpenToggle(),await Ge(),s(a).open.value&&i.preventDefault())}),onKeydown:o[1]||(o[1]=gn(i=>{r.disabled||(["Enter"," "].includes(i.key)&&s(a).onOpenToggle(),i.key==="ArrowDown"&&s(a).onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())},["enter","space","arrow-down"]))},{default:N(()=>[Ee(r.$slots,"default")]),_:3},8,["id","type","as-child","as","aria-expanded","aria-controls","data-disabled","disabled","data-state"])]),_:3}))}}),h0=GM;const Cs=100,[YM,JM]=Pt("ProgressRoot"),lu=e=>typeof e=="number";function ZM(e,t){return $a(e)||lu(e)&&!Number.isNaN(e)&&e<=t&&e>=0?e:(console.error(`Invalid prop \`value\` of value \`${e}\` supplied to \`ProgressRoot\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${Cs} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`),null)}function XM(e){return lu(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Cs}\`.`),Cs)}var QM=ae({__name:"ProgressRoot",props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:Cs},getValueLabel:{type:Function,required:!1,default:(e,t)=>lu(e)?`${Math.round(e/t*Cs)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue","update:max"],setup(e,{emit:t}){const a=e,n=t;lt();const l=Ft(a,"modelValue",n,{passive:a.modelValue===void 0}),r=Ft(a,"max",n,{passive:a.max===void 0});ze(()=>l.value,async i=>{const u=ZM(i,a.max);u!==i&&(await Ge(),l.value=u)},{immediate:!0}),ze(()=>a.max,i=>{const u=XM(a.max);u!==i&&(r.value=u)},{immediate:!0});const o=k(()=>$a(l.value)?"indeterminate":l.value===r.value?"complete":"loading");return JM({modelValue:l,max:r,progressState:o}),(i,u)=>(f(),j(s(rt),{"as-child":i.asChild,as:i.as,"aria-valuemax":s(r),"aria-valuemin":0,"aria-valuenow":lu(s(l))?s(l):void 0,"aria-valuetext":i.getValueText?.(s(l),s(r)),"aria-label":i.getValueLabel(s(l),s(r)),role:"progressbar","data-state":o.value,"data-value":s(l)??void 0,"data-max":s(r)},{default:N(()=>[Ee(i.$slots,"default",{modelValue:s(l)})]),_:3},8,["as-child","as","aria-valuemax","aria-valuenow","aria-valuetext","aria-label","data-state","data-value","data-max"]))}}),Ud=QM,eD=ae({__name:"ProgressIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=YM();return lt(),(n,l)=>(f(),j(s(rt),Ye(t,{"data-state":s(a).progressState.value,"data-value":s(a).modelValue?.value??void 0,"data-max":s(a).max.value}),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["data-state","data-value","data-max"]))}}),Hd=eD;const tD="radio.select";function aD(e,t,a){Ff(tD,a,{originalEvent:e,value:t})}var nD=ae({__name:"Radio",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:checked","select"],setup(e,{emit:t}){const a=e,n=t,l=Ft(a,"checked",n,{passive:a.checked===void 0}),{value:r}=Kt(a),{forwardRef:o,currentElement:i}=lt(),u=lp(i),c=k(()=>a.id&&i.value?document.querySelector(`[for="${a.id}"]`)?.innerText??a.value:void 0);function d(p){a.disabled||aD(p,a.value,v=>{n("select",v),!v?.defaultPrevented&&(l.value=!0,u.value&&v.stopPropagation())})}return(p,v)=>(f(),j(s(rt),Ye(p.$attrs,{id:p.id,ref:s(o),role:"radio",type:p.as==="button"?"button":void 0,as:p.as,"aria-checked":s(l),"aria-label":c.value,"as-child":p.asChild,disabled:p.disabled?"":void 0,"data-state":s(l)?"checked":"unchecked","data-disabled":p.disabled?"":void 0,value:s(r),required:p.required,name:p.name,onClick:mt(d,["stop"])}),{default:N(()=>[Ee(p.$slots,"default",{checked:s(l)}),s(u)&&p.name?(f(),j(s(dp),{key:0,type:"radio",tabindex:"-1",value:s(r),checked:!!s(l),name:p.name,disabled:p.disabled,required:p.required},null,8,["value","checked","name","disabled","required"])):Y("v-if",!0)]),_:3},16,["id","type","as","aria-checked","aria-label","as-child","disabled","data-state","data-disabled","value","required","name"]))}}),lD=nD;const[rD,oD]=Pt("RadioGroupRoot");var sD=ae({__name:"RadioGroupRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:l,currentElement:r}=lt(),o=Ft(a,"modelValue",n,{defaultValue:a.defaultValue,passive:a.modelValue===void 0}),{disabled:i,loop:u,orientation:c,name:d,required:p,dir:v}=Kt(a),m=$n(v),y=lp(r);return oD({modelValue:o,changeModelValue:x=>{o.value=x},disabled:i,loop:u,orientation:c,name:d?.value,required:p}),(x,C)=>(f(),j(s(Ku),{"as-child":"",orientation:s(c),dir:s(m),loop:s(u)},{default:N(()=>[M(s(rt),{ref:s(l),role:"radiogroup","data-disabled":s(i)?"":void 0,"as-child":x.asChild,as:x.as,"aria-orientation":s(c),"aria-required":s(p),dir:s(m)},{default:N(()=>[Ee(x.$slots,"default",{modelValue:s(o)}),s(y)&&s(d)?(f(),j(s(dp),{key:0,required:s(p),disabled:s(i),value:s(o),name:s(d)},null,8,["required","disabled","value","name"])):Y("v-if",!0)]),_:3},8,["data-disabled","as-child","as","aria-orientation","aria-required","dir"])]),_:3},8,["orientation","dir","loop"]))}}),$p=sD;const[mZ,iD]=Pt("RadioGroupItem");var uD=ae({inheritAttrs:!1,__name:"RadioGroupItem",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["select"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:l,currentElement:r}=lt(),o=rD(),i=k(()=>o.disabled.value||a.disabled),u=k(()=>o.required.value||a.required),c=k(()=>bs(o.modelValue?.value,a.value));iD({disabled:i,checked:c});const d=E(!1),p=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];so("keydown",m=>{p.includes(m.key)&&(d.value=!0)}),so("keyup",()=>{d.value=!1});function v(){setTimeout(()=>{d.value&&r.value?.click()},0)}return(m,y)=>(f(),j(s(Wu),{checked:c.value,disabled:i.value,"as-child":"",focusable:!i.value,active:c.value},{default:N(()=>[M(lD,Ye({...m.$attrs,...a},{ref:s(l),checked:c.value,required:u.value,disabled:i.value,"onUpdate:checked":y[0]||(y[0]=x=>s(o).changeModelValue(m.value)),onSelect:y[1]||(y[1]=x=>n("select",x)),onKeydown:y[2]||(y[2]=gn(mt(()=>{},["prevent"]),["enter"])),onFocus:v}),{default:N(()=>[Ee(m.$slots,"default",{checked:c.value,required:u.value,disabled:i.value})]),_:3},16,["checked","required","disabled"])]),_:3},8,["checked","disabled","focusable","active"]))}}),Cp=uD,dD=ae({__name:"BaseSeparator",props:{orientation:{type:String,required:!1,default:"horizontal"},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=["horizontal","vertical"];function n(i){return a.includes(i)}const l=k(()=>n(t.orientation)?t.orientation:"horizontal"),r=k(()=>l.value==="vertical"?t.orientation:void 0),o=k(()=>t.decorative?{role:"none"}:{"aria-orientation":r.value,role:"separator"});return(i,u)=>(f(),j(s(rt),Ye({as:i.as,"as-child":i.asChild,"data-orientation":l.value},o.value),{default:N(()=>[Ee(i.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),cD=dD;const[Sp,fD]=Pt("TabsRoot");var pD=ae({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,{orientation:l,unmountOnHide:r,dir:o}=Kt(a),i=$n(o);lt();const u=Ft(a,"modelValue",n,{defaultValue:a.defaultValue,passive:a.modelValue===void 0}),c=E(),d=pr(new Set);return fD({modelValue:u,changeModelValue:p=>{u.value=p},orientation:l,dir:i,unmountOnHide:r,activationMode:a.activationMode,baseId:Jn(void 0,"reka-tabs"),tabsList:c,contentIds:d,registerContent:p=>{d.value=new Set([...d.value,p])},unregisterContent:p=>{const v=new Set(d.value);v.delete(p),d.value=v}}),(p,v)=>(f(),j(s(rt),{dir:s(i),"data-orientation":s(l),"as-child":p.asChild,as:p.as},{default:N(()=>[Ee(p.$slots,"default",{modelValue:s(u)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),mD=pD;function g0(e,t){return`${e}-trigger-${t}`}function y0(e,t){return`${e}-content-${t}`}var vD=ae({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:a}=lt(),n=Sp(),l=k(()=>g0(n.baseId,t.value)),r=k(()=>y0(n.baseId,t.value)),o=k(()=>t.value===n.modelValue.value),i=E(o.value);return $t(()=>{n.registerContent(t.value),requestAnimationFrame(()=>{i.value=!1})}),Dt(()=>{n.unregisterContent(t.value)}),(u,c)=>(f(),j(s(br),{present:u.forceMount||o.value,"force-mount":""},{default:N(({present:d})=>[M(s(rt),{id:r.value,ref:s(a),"as-child":u.asChild,as:u.as,role:"tabpanel","data-state":o.value?"active":"inactive","data-orientation":s(n).orientation.value,"aria-labelledby":l.value,hidden:!d,tabindex:"0",style:oa({animationDuration:i.value?"0s":void 0})},{default:N(()=>[!s(n).unmountOnHide.value||d?Ee(u.$slots,"default",{key:0}):Y("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),_h=vD,hD=ae({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{loop:a}=Kt(t),{forwardRef:n,currentElement:l}=lt(),r=Sp();return r.tabsList=l,(o,i)=>(f(),j(s(Ku),{"as-child":"",orientation:s(r).orientation.value,dir:s(r).dir.value,loop:s(a)},{default:N(()=>[M(s(rt),{ref:s(n),role:"tablist","as-child":o.asChild,as:o.as,"aria-orientation":s(r).orientation.value},{default:N(()=>[Ee(o.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),gD=hD,yD=ae({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,{forwardRef:a}=lt(),n=Sp(),l=k(()=>g0(n.baseId,t.value)),r=k(()=>n.contentIds.value.has(t.value)?y0(n.baseId,t.value):void 0),o=k(()=>t.value===n.modelValue.value);return(i,u)=>(f(),j(s(Wu),{"as-child":"",focusable:!i.disabled,active:o.value},{default:N(()=>[M(s(rt),{id:l.value,ref:s(a),role:"tab",type:i.as==="button"?"button":void 0,as:i.as,"as-child":i.asChild,"aria-selected":o.value?"true":"false","aria-controls":r.value,"data-state":o.value?"active":"inactive",disabled:i.disabled,"data-disabled":i.disabled?"":void 0,"data-orientation":s(n).orientation.value,onMousedown:u[0]||(u[0]=mt(c=>{!i.disabled&&c.ctrlKey===!1?s(n).changeModelValue(i.value):c.preventDefault()},["left"])),onKeydown:u[1]||(u[1]=gn(c=>s(n).changeModelValue(i.value),["enter","space"])),onFocus:u[2]||(u[2]=()=>{const c=s(n).activationMode!=="manual";!o.value&&!i.disabled&&c&&s(n).changeModelValue(i.value)})},{default:N(()=>[Ee(i.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),xh=yD;const[bD,_D]=Pt("TimeFieldRoot");function oi(e,t=Ns(Qa())){return e&&"day"in e?e:yn(t,e)}var xD=ae({inheritAttrs:!1,__name:"TimeFieldRoot",props:{defaultValue:{type:Object,required:!1,default:void 0},defaultPlaceholder:{type:Object,required:!1},placeholder:{type:Object,required:!1,default:void 0},modelValue:{type:[Object,null],required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},stepSnapping:{type:Boolean,required:!1,default:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:Object,required:!1},minValue:{type:Object,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},id:{type:String,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:placeholder"],setup(e,{expose:t,emit:a}){const n=e,l=a,{disabled:r,readonly:o,granularity:i,defaultValue:u,minValue:c,maxValue:d,stepSnapping:p,dir:v,locale:m}=Kt(n),y=Bu(m),x=$n(v),C=np(y.value,{hourCycle:ks(n.hourCycle)}),{primitiveElement:w,currentElement:S}=dr(),q=E(new Set),O=k(()=>S1(n)),I=k(()=>c.value?oi(c.value):void 0),B=k(()=>d.value?oi(d.value):void 0);$t(()=>{gh(S.value).forEach(ve=>q.value.add(ve))});const L=Ft(n,"modelValue",l,{defaultValue:u.value,passive:n.modelValue===void 0}),W=k({get(){return $a(L.value)?L.value:oi(L.value)},set(ve){return ve?L.value=L.value&&"day"in L.value?ve:new fn(ve.hour,ve.minute,ve.second,L.value?.millisecond):L.value=ve,ve}}),T=cA({defaultPlaceholder:n.placeholder,defaultValue:L.value}),R=Ft(n,"placeholder",l,{defaultValue:n.defaultPlaceholder??T.copy(),passive:n.placeholder===void 0}),G=k({get(){return oi(R.value)},set(ve){return ve&&(R.value="day"in R.value?ve.copy():new fn(ve.hour,ve.minute,ve.second,R.value?.millisecond)),ve}}),A=k(()=>i.value?i.value:"minute"),D=k(()=>L.value?!!(I.value&&Cl(W.value,I.value)||B.value&&Cl(B.value,W.value)):!1),z=UT(A.value),V=E(L.value?{...Gc({value:W.value,formatter:C})}:{...z}),K=k(()=>a0({granularity:A.value,dateRef:G.value,formatter:C,hideTimeZone:n.hideTimeZone,hourCycle:n.hourCycle,segmentValues:V.value,locale:y,isTimeValue:!0})),re=k(()=>{const ve=K.value.arr;return n.hourCycle===12?ve.map(Z=>{if(Z.part==="hour"&&"hour"in V.value){const he=V.value.hour;if(he!==null){const J=he===0?12:he>12?he-12:he;return{...Z,value:J.toString()}}}return Z}):ve}),ie=k(()=>re.value.filter(({part:ve})=>ve!=="literal"));ze(y,ve=>{C.getLocale()!==ve&&(C.setLocale(ve),Ge(()=>{q.value.clear(),gh(S.value).forEach(Z=>q.value.add(Z))}))}),ze(W,ve=>{!$a(ve)&&(!Yr(G.value,ve)||G.value.compare(ve)!==0)&&(R.value=ve.copy())}),ze([W,y],([ve])=>{$a(ve)?Object.values(V.value).every(Z=>Z!==null)&&$a(ve)&&(V.value={...z}):V.value={...Gc({value:ve,formatter:C})}});const Ae=E(null),_e=k(()=>Array.from(q.value).findIndex(ve=>ve.getAttribute("data-reka-time-field-segment")===Ae.value?.getAttribute("data-reka-time-field-segment"))),xe=k(()=>{const ve=x.value==="rtl"?-1:1;return(ve<0?_e.value<0:_e.value>q.value.size-1)?null:Array.from(q.value)[_e.value+ve]}),ne=k(()=>{const ve=x.value==="rtl"?-1:1;return(ve>0?_e.value<0:_e.value>q.value.size-1)?null:Array.from(q.value)[_e.value-ve]}),fe=ho();function F(ve){ve.isComposing||On(ve.key)&&(ve.key===fe.ARROW_LEFT&&ne.value?.focus(),ve.key===fe.ARROW_RIGHT&&xe.value?.focus())}function de(ve){Ae.value=ve}return _D({locale:y,modelValue:W,placeholder:G,disabled:r,formatter:C,hourCycle:n.hourCycle,step:O,stepSnapping:p,readonly:o,segmentValues:V,isInvalid:D,segmentContents:ie,elements:q,setFocusedElement:de,focusNext(){xe.value?.focus()}}),t({setFocusedElement:de}),(ve,Z)=>(f(),j(s(rt),Ye(ve.$attrs,{ref_key:"primitiveElement",ref:w,role:"group","aria-disabled":s(r)?!0:void 0,"data-disabled":s(r)?"":void 0,"data-readonly":s(o)?"":void 0,"data-invalid":D.value?"":void 0,dir:s(x),onKeydown:gn(F,["left","right"])}),{default:N(()=>[Ee(ve.$slots,"default",{modelValue:s(L),segments:re.value,isInvalid:D.value}),M(s(up),{id:ve.id,as:"input",feature:"focusable",tabindex:"-1",value:s(L)?s(L).toString():"",name:ve.name,disabled:s(r),required:ve.required,onFocus:Z[0]||(Z[0]=he=>Array.from(q.value)?.[0]?.focus())},null,8,["id","value","name","disabled","required"])]),_:3},16,["aria-disabled","data-disabled","data-readonly","data-invalid","dir"]))}}),kh=xD,kD=ae({__name:"TimeFieldInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=bD(),n=E(!0),l=E(!1),{handleSegmentClick:r,handleSegmentKeydown:o,handleSegmentBeforeInput:i,handleSegmentCompositionStart:u,handleSegmentCompositionEnd:c,handleSegmentFocusOut:d,attributes:p}=n0({hasLeftFocus:n,lastKeyZero:l,placeholder:a.placeholder,hourCycle:a.hourCycle,step:a.step,stepSnapping:a.stepSnapping,segmentValues:a.segmentValues,formatter:a.formatter,part:t.part,disabled:a.disabled,readonly:a.readonly,focusNext:a.focusNext,modelValue:a.modelValue}),v=k(()=>a.disabled.value),m=k(()=>a.readonly.value),y=k(()=>a.isInvalid.value);return(x,C)=>(f(),j(s(rt),Ye({as:x.as,"as-child":x.asChild},s(p),{contenteditable:v.value||m.value?!1:x.part!=="literal","data-reka-time-field-segment":x.part,"aria-disabled":v.value?!0:void 0,"aria-readonly":m.value?!0:void 0,"data-disabled":v.value?"":void 0,"data-invalid":y.value?"":void 0,"aria-invalid":y.value?!0:void 0},my(x.part!=="literal"?{mousedown:s(r),keydown:s(o),beforeinput:s(i),compositionstart:s(u),compositionend:s(c),focusout:()=>{n.value=!0,s(d)()},focusin:w=>{s(a).setFocusedElement(w.target)}}:{})),{default:N(()=>[Ee(x.$slots,"default")]),_:3},16,["as","as-child","contenteditable","data-reka-time-field-segment","aria-disabled","aria-readonly","data-disabled","data-invalid","aria-invalid"]))}}),wh=kD,wD=ae({__name:"ToolbarButton",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,{forwardRef:a}=lt();return(n,l)=>(f(),j(s(Wu),{"as-child":"",focusable:!n.disabled},{default:N(()=>[M(s(rt),Ye({ref:s(a),type:n.as==="button"?"button":void 0},t),{default:N(()=>[Ee(n.$slots,"default")]),_:3},16,["type"])]),_:3},8,["focusable"]))}}),Io=wD;const[$D,CD]=Pt("ToolbarRoot");var SD=ae({__name:"ToolbarRoot",props:{orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},loop:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{orientation:a,dir:n}=Kt(t),l=$n(n),{forwardRef:r}=lt();return CD({orientation:a,dir:l}),(o,i)=>(f(),j(s(Ku),{"as-child":"",orientation:s(a),dir:s(l),loop:o.loop},{default:N(()=>[M(s(rt),{ref:s(r),role:"toolbar","aria-orientation":s(a),"as-child":o.asChild,as:o.as},{default:N(()=>[Ee(o.$slots,"default")]),_:3},8,["aria-orientation","as-child","as"])]),_:3},8,["orientation","dir","loop"]))}}),ED=SD,AD=ae({__name:"ToolbarSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=$D();return lt(),(n,l)=>(f(),j(cD,{orientation:s(a).orientation.value,"as-child":t.asChild,as:n.as},{default:N(()=>[Ee(n.$slots,"default")]),_:3},8,["orientation","as-child","as"]))}}),Kd=AD;const TD=/^filter\[(.+)\]$/,MD=/^[1-9]\d*$/;function Dr(e){const t=Array.isArray(e)?e[e.length-1]:e;return typeof t=="string"?t:""}function $h(e){return MD.test(e)?Number(e):void 0}function b0(e){const t={},a=Dr(e.search).trim();a!==""&&(t.search=a);const n=Dr(e.sort).trim();if(n!==""){t.sort=n;const i=Dr(e.dir);t.dir=i==="desc"?"desc":"asc"}const l=$h(Dr(e.page));l!==void 0&&(t.page=l);const r=$h(Dr(e.per_page));r!==void 0&&(t.per_page=r);const o={};for(const i of Object.keys(e).sort()){const u=TD.exec(i)?.[1],c=Dr(e[i]);u&&c!==""&&(o[u]=c)}return Object.keys(o).length>0&&(t.filter=o),t}function ru(e){const t={};e.search&&(t.search=e.search),e.sort&&(t.sort=e.sort,t.dir=e.dir==="desc"?"desc":"asc"),e.page!==void 0&&e.page>1&&(t.page=String(e.page)),e.per_page!==void 0&&(t.per_page=String(e.per_page));for(const a of Object.keys(e.filter??{}).sort()){const n=e.filter?.[a];n!==void 0&&n!==""&&(t[`filter[${a}]`]=n)}return t}function Vr(e){return JSON.stringify(ru(e))}const _0="summer-admin.list:",DD=Vr({});let Jc=null;function Yu(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function x0(e){return`${_0}${e}:`}function k0(e){return Jc===null?null:x0(Jc)+e}function Zc(e){try{Yu()?.removeItem(e)}catch{}}function Ch(e){const t=Yu();if(t)try{const a=[];for(let n=0;n<t.length;n++){const l=t.key(n);l!==null&&l.startsWith(_0)&&e(l)&&a.push(l)}for(const n of a)t.removeItem(n)}catch{}}function Ep(e){const t=e===null||String(e)===""?null:String(e);if(Jc=t,t===null){Ch(()=>!0);return}const a=x0(t);Ch(n=>!n.startsWith(a))}function OD(e){const t=k0(e);if(t===null)return{};let a=null;try{a=Yu()?.getItem(t)??null}catch{return{}}if(a===null)return{};let n;try{n=JSON.parse(a)}catch{return Zc(t),{}}return typeof n!="object"||n===null||Array.isArray(n)||Object.getPrototypeOf(n)!==Object.prototype||!Object.values(n).every(l=>typeof l=="string")?(Zc(t),{}):b0(n)}function si(e,t){const a=k0(e);if(a!==null){if(Vr(t)===DD){Zc(a);return}try{Yu()?.setItem(a,JSON.stringify(ru(t)))}catch{}}}const or=E(null),w0=E(null);let ss=null;function $0(e){C0(),w0.value=e,!(e===null||e<=0)&&(ss=setTimeout(()=>{ss=null,Sf()},e*800))}function C0(){ss!==null&&(clearTimeout(ss),ss=null)}Z2($0);const na=At(or);async function PD(e,t){const{data:a,response:n}=await Le.POST("/auth/login",{body:{login:e,password:t}});return!n.ok||!a?!1:($0(typeof a.data.expires_in=="number"?a.data.expires_in:null),!0)}async function S0(){const{data:e,response:t}=await Le.GET("/auth/me");return or.value=t.ok&&e?e.data:null,Ep(or.value?.id??null),await gE(or.value),or.value}function E0(e){if(!e)return"";const t=[e.first_name,e.last_name].map(a=>a.trim()).filter(Boolean);return t.length>0?t.slice(0,2).map(a=>a.charAt(0).toUpperCase()).join(""):e.login.slice(0,2).toUpperCase()}function Wd(e){or.value=e,Ep(e.id)}function A0(){C0(),or.value=null,w0.value=null,Ep(null)}function Xc(e){A0();const t=e.currentRoute.value;t.name!=="login"&&e.push({name:"login",query:{redirect:t.fullPath}}).catch(()=>{})}async function T0(e){try{await Le.POST("/auth/logout")}catch{}finally{A0(),n$([]),o$([]),rE({canView:!1,canManage:!1})}e&&await e.replace({name:"login"}).catch(()=>{})}const ID=["src"],RD={key:1,class:"flex size-[34px] shrink-0 items-center justify-center rounded-full bg-accent text-[13px] font-bold text-on-accent","aria-hidden":"true","data-user-initials":""},qD={class:"flex flex-col leading-tight max-[1099px]:hidden","data-user-identity":""},LD={class:"font-semibold"},ND={key:0,class:"text-[12px] text-muted","data-user-role":""},BD={class:"flex items-center gap-3 px-2 py-2"},FD=["src"],VD={key:1,class:"flex size-10 shrink-0 items-center justify-center rounded-full bg-accent text-[14px] font-bold text-on-accent","aria-hidden":"true"},zD={class:"flex min-w-0 flex-col leading-tight"},jD={class:"truncate font-bold"},UD={class:"truncate text-[13px] text-muted"},HD={class:"flex size-[18px] items-center justify-center"},KD=ae({__name:"UserMenu",setup(e){const t=wn(),a=k(()=>{const v=na.value;if(!v)return"";const m=`${v.first_name} ${v.last_name}`.trim();return m===""?v.login:m}),n=k(()=>E0(na.value)),l=k(()=>na.value?.avatar?.thumb_url||na.value?.avatar?.url||""),r=k(()=>na.value?.role?.name??""),o=k(()=>fE.value||Na.value);function i(v){try{const m=new Intl.DisplayNames([v],{type:"language"}).of(v);if(m&&m!==v)return m.charAt(0).toLocaleUpperCase(v)+m.slice(1)}catch{}return v.toUpperCase()}const u=k(()=>e$.value.map(v=>({code:v,name:i(v)})));function c(v){typeof v=="string"&&v!==""&&yE(v)}async function d(){await t.push({name:"account"}).catch(()=>{})}async function p(){await T0(t)}return(v,m)=>(f(),j(s(p0),{modal:!1},{default:N(()=>[M(s(h0),{"data-user-menu":"",disabled:!s(na),"aria-label":`${s(h)("backend::lang.nav.user_menu")}: ${a.value}`,class:"flex h-input items-center gap-2.5 rounded-inner px-2 text-left transition-colors duration-150 ease-out hover:bg-hover"},{default:N(()=>[l.value?(f(),b("img",{key:0,src:l.value,alt:"","data-user-avatar":"",class:"size-[34px] shrink-0 rounded-full object-cover"},null,8,ID)):(f(),b("span",RD,_(n.value),1)),g("span",qD,[g("span",LD,_(a.value),1),r.value?(f(),b("span",ND,_(r.value),1)):Y("",!0)]),M(s(Gn),{size:16,class:"text-muted","aria-hidden":"true"})]),_:1},8,["disabled","aria-label"]),M(s(v0),null,{default:N(()=>[M(s(m0),{"data-user-menu-content":"",align:"end","side-offset":8,class:"z-50 flex w-[280px] flex-col rounded-[14px] border border-border bg-surface p-2 text-text shadow-menu"},{default:N(()=>[g("div",BD,[l.value?(f(),b("img",{key:0,src:l.value,alt:"","data-user-avatar":"",class:"size-10 shrink-0 rounded-full object-cover"},null,8,FD)):(f(),b("span",VD,_(n.value),1)),g("span",zD,[g("span",jD,_(a.value),1),g("span",UD,_(s(na)?.email),1)])]),M(s(Yc),{"data-action":"account",class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:d},{default:N(()=>[M(s(H3),{size:18,"aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.myaccount.menu_label")),1)]),_:1}),u.value.length>1?(f(),b(me,{key:0},[M(s(bh),{class:"my-1 h-px bg-border"}),M(s(VM),{class:"px-3 pt-1 pb-1 text-[12px] font-semibold text-muted","data-language-label":""},{default:N(()=>[ye(_(s(h)("backend::lang.nav.language")),1)]),_:1}),M(s(UM),{"model-value":o.value,"onUpdate:modelValue":c},{default:N(()=>[(f(!0),b(me,null,Ie(u.value,y=>(f(),j(s(KM),{key:y.code,value:y.code,"data-locale-option":y.code,lang:y.code,class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover"},{default:N(()=>[g("span",HD,[M(s(BM),null,{default:N(()=>[M(s(Ba),{size:18,"aria-hidden":"true"})]),_:1})]),g("span",null,_(y.name),1)]),_:2},1032,["value","data-locale-option","lang"]))),128))]),_:1},8,["model-value"])],64)):Y("",!0),M(s(bh),{class:"my-1 h-px bg-border"}),M(s(Yc),{"data-action":"logout",class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:p},{default:N(()=>[M(s(Tb),{size:18,"aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.auth.logout")),1)]),_:1})]),_:1})]),_:1})]),_:1}))}}),WD=["role","data-tone"],GD={class:"font-medium"},YD=["aria-label","onClick"],JD=ae({__name:"Toast",setup(e){return(t,a)=>(f(),j(bw,{tag:"div",name:"toast",class:"pointer-events-none fixed inset-x-0 bottom-[88px] z-50 flex flex-col items-center gap-2 px-4"},{default:N(()=>[(f(!0),b(me,null,Ie(s(dE),n=>(f(),b("div",{key:n.id,role:n.tone==="danger"?"alert":"status","data-tone":n.tone,class:"pointer-events-auto flex max-w-[560px] items-center gap-3 rounded-[14px] bg-[#1d2740] py-3 pr-2.5 pl-3.5 text-white shadow-toast"},[g("span",{class:pe([n.tone==="danger"?"bg-[#f58a8a] text-[#1d2740]":"bg-accent text-on-accent","flex size-[26px] shrink-0 items-center justify-center rounded-full"]),"aria-hidden":"true"},[n.tone==="danger"?(f(),j(s(bt),{key:0,size:16})):(f(),j(s(Ba),{key:1,size:16}))],2),g("span",GD,_(n.text),1),g("button",{type:"button","aria-label":s(h)("backend::lang.form.close"),class:"flex size-8 items-center justify-center rounded-pager text-[#c3cbda] transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:l=>s(zb)(n.id)},[M(s(qt),{size:16,"aria-hidden":"true"})],8,YD)],8,WD))),128))]),_:1}))}}),ZD=[{combo:"mod+s",labelKey:"backend::lang.form.save"},{combo:"mod+enter",labelKey:"backend::lang.form.save_and_close"},{combo:"mod+shift+s",labelKey:"backend::lang.form.create_and_new"},{combo:"escape",labelKey:"backend::lang.shortcuts.leave"},{combo:"/",labelKey:"backend::lang.shortcuts.search"},{combo:"?",labelKey:"backend::lang.shortcuts.help"}],XD=new Set(["mod+s","mod+enter","mod+shift+s"]);function Ap(e){const t=typeof navigator>"u"?"":navigator.platform||"";return/mac|iphone|ipad|ipod/i.test(t)}function QD(e){if(/^[a-z]$/i.test(e.key))return e.key.toLowerCase();const t=/^Key([A-Z])$/.exec(e.code??"");return t?t[1].toLowerCase():""}function M0(e){if(e.isComposing)return null;if(e.ctrlKey||e.metaKey)return e.altKey?null:e.key==="Enter"?e.shiftKey?null:"mod+enter":QD(e)==="s"?e.shiftKey?"mod+shift+s":"mod+s":null;if(e.altKey)return null;switch(e.key){case"Escape":return"escape";case"/":return"/";case"?":return"?";default:return null}}function eO(e){if(!e||typeof e.closest!="function")return!1;const t=e;return t.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])')!==null?!0:t.tagName.includes("-")&&t.closest('form, [role="form"]')!==null}function tO(e){return(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target}function D0(e,t=Ap()){switch(e){case"mod+s":return t?["⌘","S"]:["Ctrl","S"];case"mod+enter":return t?["⌘","↩"]:["Ctrl","Enter"];case"mod+shift+s":return t?["⇧","⌘","S"]:["Ctrl","Shift","S"];case"escape":return["Esc"];default:return[e]}}function aO(e,t=Ap()){return D0(e,t).join(t?"":"+")}function Ha(e,t,a=Ap()){return h("backend::lang.shortcuts.hint",{label:e,keys:aO(t,a)})}const Sh={"mod+s":"Control+S Meta+S","mod+enter":"Control+Enter Meta+Enter","mod+shift+s":"Control+Shift+S Meta+Shift+S",escape:"Escape","/":"/","?":"?"};function Ju(e){return e.split(/\s+/).filter(t=>t in Sh).map(t=>Sh[t]).join(" ")}function O0(e=document){return Array.from(e.querySelectorAll('[role="dialog"][aria-modal="true"], [role="alertdialog"]')).filter(a=>a.getAttribute("data-state")!=="closed").at(-1)??e}function Tp(e,t){return t.querySelector(`[data-hotkey~="${e}"]`)}function nO(e=document){const t=O0(e);return ZD.filter(a=>a.combo==="?"||Tp(a.combo,t)!==null)}const Mp=E(null),Eh=At(Mp);function lO(){Mp.value=nO()}function P0(){Mp.value=null}function I0(e){return e.disabled===!0||e.getAttribute("aria-disabled")==="true"}function Ah(e){const t=M0(e);if(!t||!XD.has(t))return;t==="mod+s"&&e.preventDefault();const a=e.target?.ownerDocument??document,n=Tp(t,O0(a));if(!n||(e.preventDefault(),e.stopPropagation(),e.repeat||I0(n)))return;const l=Th(a),r=l instanceof HTMLElement&&l!==n&&l!==a.body?l:null;r&&(n.focus({preventScroll:!0}),Th(a)===r&&r.blur()),n.click();const o=a.activeElement;r?.isConnected&&(o===n||o===a.body||o===null)&&r.focus({preventScroll:!0})}function Th(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function Mh(e){const t=M0(e);if(t!=="escape"&&t!=="/"&&t!=="?"||e.defaultPrevented||eO(tO(e)))return;const a=e.target?.ownerDocument??document;if(a.querySelector("[data-dismissable-layer]"))return;if(t==="?"){e.preventDefault(),lO();return}const n=Tp(t,a);!n||I0(n)||(e.preventDefault(),n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?(n.focus(),n.select()):n.click())}let ii=0;function rO(){ii===0&&(window.addEventListener("keydown",Ah,!0),window.addEventListener("keydown",Mh)),ii++;let e=!1;return()=>{e||(e=!0,ii--,ii===0&&(window.removeEventListener("keydown",Ah,!0),window.removeEventListener("keydown",Mh)))}}const oO={class:"flex items-start gap-3"},sO={class:"flex min-w-0 flex-1 flex-col gap-1"},iO={class:"flex flex-col gap-2.5"},uO=["data-shortcut"],dO={class:"flex shrink-0 items-center gap-1"},cO={class:"text-right text-muted"},fO=ae({__name:"ShortcutHelpDialog",setup(e){function t(a){a||P0()}return(a,n)=>(f(),j(s(al),{open:s(Eh)!==null,"onUpdate:open":t},{default:N(()=>[M(s(zl),null,{default:N(()=>[M(s(ll),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),M(s(nl),{"data-shortcut-help":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop"},{default:N(()=>[g("div",oO,[g("div",sO,[M(s(bn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(s(h)("backend::lang.shortcuts.title")),1)]),_:1}),M(s(hn),{class:"text-muted"},{default:N(()=>[ye(_(s(h)("backend::lang.shortcuts.description")),1)]),_:1})]),M(s(Pl),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:N(()=>[M(s(qt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),g("dl",iO,[(f(!0),b(me,null,Ie(s(Eh)??[],l=>(f(),b("div",{key:l.combo,"data-shortcut":l.combo,class:"flex items-center justify-between gap-4"},[g("dt",dO,[(f(!0),b(me,null,Ie(s(D0)(l.combo),r=>(f(),b("kbd",{key:r,class:"inline-flex min-w-6 items-center justify-center rounded-pager border border-border bg-subtle px-1.5 font-mono text-[13px]"},_(r),1))),128))]),g("dd",cO,_(s(h)(l.labelKey)),1)],8,uO))),128))])]),_:1})]),_:1})]),_:1},8,["open"]))}}),pO={class:"flex min-w-0 flex-1 flex-col"},mO={class:"flex h-header shrink-0 items-center justify-between gap-4 border-b border-border bg-surface pr-6 pl-8"},vO={class:"flex shrink-0 items-center gap-1"},hO=["title","aria-label"],gO={class:"min-w-0 flex-1 px-8 py-7"},yO=ae({__name:"AppShell",setup(e){const t=ga(),{collapsed:a,watchViewport:n}=Wb(),l=n();Dt(l);const r=rO();Dt(()=>{r(),P0()});const o=`${window.location.origin}/`,i=k(()=>Ps(String(t.params.vendor??""),String(t.params.plugin??""))),u=k(()=>i.value?null:t.name==="settings-form"?_d(gs(String(t.params.code??""))):t.name==="plugins"?_d(fb(t.path)):_d(Du(po(t.path)))),c=k(()=>(i.value||u.value)&&!a.value?"calc(var(--spacing-rail) + var(--spacing-panel))":"var(--spacing-rail)");return(d,p)=>(f(),b("div",{class:"flex min-h-screen bg-bg text-text",style:oa({"--shell-offset":c.value})},[M(PE),i.value&&!s(a)?(f(),j(NE,{key:0,entry:i.value},null,8,["entry"])):u.value&&!s(a)?(f(),j(jE,{key:1,section:u.value},null,8,["section"])):Y("",!0),g("div",pO,[g("header",mO,[M(WE),g("div",vO,[g("a",{"data-view-site":"",href:o,target:"_blank",rel:"noopener noreferrer",title:s(h)("backend::lang.nav.view_site"),"aria-label":s(h)("backend::lang.nav.view_site"),class:"flex size-input items-center justify-center rounded-inner text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text"},[M(s(xb),{class:"size-[18px]","aria-hidden":"true"})],8,hO),M(KD)])]),g("main",gO,[Ee(d.$slots,"default")])]),M(JD),M(fO)],4))}}),bO=300*1e3,_O=30*1e3;function xO(e,t){return e!==""&&t!==""&&e!==t}async function kO(){try{const e=await globalThis.fetch(`${mr.base}/build.json`,{cache:"no-store",credentials:"same-origin"});if(!e.ok)return"";const t=await e.json();if(typeof t!="object"||t===null)return"";const a=t.build;return typeof a=="string"?a:""}catch{return""}}const Dp=E(!1);let R0="",q0="";const wO=At(Dp);function $O(e,t=mr.build){xO(t,e)&&e!==q0&&(R0=e,Dp.value=!0)}function CO(){q0=R0,Dp.value=!1}function SO(e={}){const t=e.booted??mr.build;if(t==="")return()=>{};const a=e.check??kO,n=e.interval??bO,l=e.minGap??_O,r=e.win??window,o=e.doc??document,i=e.now??Date.now;let u=!1,c=Number.NEGATIVE_INFINITY;const d=async()=>{if(!(o.visibilityState==="hidden"||u||i()-c<l)){c=i(),u=!0;try{$O(await a(),t)}finally{u=!1}}},p=()=>{d().catch(()=>{})};o.addEventListener("visibilitychange",p),r.addEventListener("focus",p);const v=r.setInterval(p,n);return()=>{o.removeEventListener("visibilitychange",p),r.removeEventListener("focus",p),r.clearInterval(v)}}const EO={key:0,"data-update-banner":"",role:"status","aria-live":"polite",class:"fixed right-4 bottom-[88px] z-50 flex max-w-[420px] items-center gap-3 rounded-[14px] bg-[#1d2740] py-3 pr-2.5 pl-3.5 text-white shadow-toast"},AO={class:"font-medium"},TO=["aria-label"],MO=ae({__name:"UpdateBanner",setup(e){return(t,a)=>s(wO)?(f(),b("div",EO,[g("span",AO,_(s(h)("backend::lang.version.available")),1),g("button",{type:"button","data-update-reload":"",class:"shrink-0 rounded-pager bg-accent px-3 py-1.5 font-medium text-on-accent transition-opacity duration-150 ease-out hover:opacity-90",onClick:a[0]||(a[0]=n=>s(Ub).reload())},_(s(h)("backend::lang.version.reload")),1),g("button",{type:"button","data-update-close":"","aria-label":s(h)("backend::lang.form.close"),class:"flex size-8 shrink-0 items-center justify-center rounded-pager text-[#c3cbda] transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:a[1]||(a[1]=n=>s(CO)())},[M(s(qt),{size:16,"aria-hidden":"true"})],8,TO)])):Y("",!0)}}),L0=E(0),DO=At(L0);function OO(){L0.value++}const PO=ae({__name:"App",setup(e){const t=ga(),a=k(()=>t.meta.shell===!0);return Aa(()=>{document.title=i$(t)}),(n,l)=>(f(),b(me,null,[a.value?(f(),j(yO,{key:0},{default:N(()=>[M(s(Ec),null,{default:N(({Component:r,route:o})=>[(f(),j(Wt(r),{key:`${o.path}#${s(DO)}`}))]),_:1})]),_:1})):(f(),j(s(Ec),{key:1})),M(MO)],64))}}),IO="data-summer-controller",N0="*",Gd=new Map,Qc=new Map;let B0="";function F0(){return`${mr.base}/assets/`}function V0(e){if(!e.startsWith(F0())||e.includes("\\"))return!1;for(const a of e){const n=a.codePointAt(0)??0;if(n<=32||n===127)return!1}return!(e.split(/[?#]/,1)[0]??"").split("/").some(a=>{const n=a.toLowerCase().replaceAll("%2e",".");return n==="."||n===".."})}function z0(e){if(!V0(e))return Promise.reject(new Error(`plugin script outside ${F0()}: ${e}`));const t=Gd.get(e);if(t)return t;const a=new Promise((n,l)=>{const r=document.createElement("script");r.type="module",r.addEventListener("load",()=>n(),{once:!0}),r.addEventListener("error",()=>{Gd.delete(e),r.remove(),l(new Error(`plugin script failed to load: ${e}`))},{once:!0}),r.src=e,document.head.appendChild(r)});return Gd.set(e,a),a}function j0(e,t){for(const a of t){const n=`${e}
|
||
${a}`;if(!V0(a)||Qc.has(n))continue;const l=document.createElement("link");l.rel="stylesheet",l.setAttribute(IO,e),l.disabled=!U0(e),l.href=a,Qc.set(n,{owner:e,link:l}),document.head.appendChild(l)}}function RO(e){B0=e;for(const{owner:t,link:a}of Qc.values())a.disabled=!U0(t)}function U0(e){return e===N0||e===B0}function qO(e){j0(N0,e)}async function Op(e,t){j0(e,t?.styles??[]);const a=t?.scripts??[],n=await Promise.allSettled(a.map(l=>z0(l)));return a.filter((l,r)=>n[r]?.status==="rejected")}const H0=new Map;async function K0(){let e=[];try{const{data:t,response:a}=await Le.GET("/field-types");e=a.ok&&t?t.data:[]}catch{return[]}for(const t of e){qO(t.styles??[]);const a=t.scripts??[];H0.set(t.element,Promise.allSettled(a.map(n=>z0(n))).then(n=>a.filter((l,r)=>n[r]?.status==="rejected")))}return e}function LO(e){return H0.get(e)??Promise.resolve([])}const NO={class:"flex min-h-screen items-center justify-center px-4",style:{background:"radial-gradient(ellipse at 50% 35%, #2b3a5c 0%, #1d2740 60%)"}},BO={class:"flex w-full max-w-[400px] flex-col gap-6"},FO={class:"flex items-center justify-center gap-3"},VO={class:"flex size-[34px] items-center justify-center rounded-full bg-accent-soft"},zO={class:"text-[22px] font-bold tracking-[-0.02em]"},jO={key:0,"data-login-hint":"",class:"text-[13px] text-[#566175]"},UO={class:"flex flex-col gap-1.5"},HO={class:"font-semibold"},KO={class:"flex flex-col gap-1.5"},WO={class:"font-semibold"},GO=["aria-invalid"],YO={key:1,role:"alert",class:"flex items-center gap-2.5 rounded-control bg-[#fdf0f0] px-3.5 py-3 text-[#c62828]"},JO=["disabled"],ZO=ae({__name:"LoginView",setup(e){const t=ga(),a=wn(),n=E(""),l=E(""),r=E(!1),o=E(!1),i=k(()=>{const c=sf(t.query.redirect);return c!==null&&new URL(c,"http://admin.invalid").pathname==="/connect"});async function u(){if(!o.value){o.value=!0,r.value=!1;try{if(!await PD(n.value.trim(),l.value)||!await S0()){r.value=!0;return}l.value="",await Promise.all([db(),cb().catch(()=>[]),Fb().catch(()=>!1),K0()]),await a.replace(sf(t.query.redirect)??"/")}finally{o.value=!1}}}return(c,d)=>(f(),b("main",NO,[g("div",BO,[g("div",FO,[g("span",VO,[M(s(Rs),{size:20,class:"text-accent","aria-hidden":"true"})]),d[2]||(d[2]=g("span",{class:"text-[18px] font-bold text-white"},[ye("Summer"),g("span",{class:"text-accent"},"CMS")],-1))]),g("form",{class:"flex flex-col gap-[18px] rounded-card bg-white p-8 text-[#141b2d] shadow-login",novalidate:"",onSubmit:mt(u,["prevent"])},[g("h1",zO,_(s(h)("backend::lang.auth.title")),1),i.value?(f(),b("p",jO,_(s(h)("backend::lang.mcp_connect.login_hint")),1)):Y("",!0),g("label",UO,[g("span",HO,_(s(h)("backend::lang.auth.login")),1),Jt(g("input",{"onUpdate:modelValue":d[0]||(d[0]=p=>n.value=p),name:"login",type:"text",autocomplete:"username",required:"",class:"h-input rounded-control border border-[#d2d8e2] bg-white px-3.5"},null,512),[[Ua,n.value]])]),g("label",KO,[g("span",WO,_(s(h)("backend::lang.auth.password")),1),Jt(g("input",{"onUpdate:modelValue":d[1]||(d[1]=p=>l.value=p),name:"password",type:"password",autocomplete:"current-password",required:"","aria-invalid":r.value?"true":void 0,class:pe([r.value?"border-[#c62828]":"border-[#d2d8e2]","h-input rounded-control border bg-white px-3.5"])},null,10,GO),[[Ua,l.value]])]),r.value?(f(),b("div",YO,[M(s(bt),{size:18,"aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.auth.invalid")),1)])):Y("",!0),g("button",{type:"submit",disabled:o.value,class:"h-input rounded-control bg-[#22304d] font-semibold text-white disabled:opacity-60"},_(s(h)("backend::lang.auth.submit")),9,JO)],32)])]))}}),Dh=/^\d+$/;function W0(e,t,a){const n=Tu(t),l=Ja(t);if(!n||!l)return"/";const o=((e??"").trim().split(/[?#]/,1)[0]??"").split("/").filter(d=>d!==""),i=[n.vendor,n.plugin,n.controller];if(!i.every((d,p)=>o[p]?.toLowerCase()===d.toLowerCase()))return l;const c=o.slice(i.length);if(c.length===0)return l;if(c.length===1&&c[0]==="create")return`${l}/create`;if(c.length===2&&c[0]==="update"){const d=c[1]===":id"?String(a??""):c[1]??"";return Dh.test(d)?`${l}/${d}`:l}if(c.length===2&&c[0]==="preview"){const d=c[1]===":id"?String(a??""):c[1]??"";return Dh.test(d)?`${l}/${d}/preview`:l}return l}const Oh=/^[0-9]+$/;function XO(e,t){const a=e.replace(/[\s ]/g,"");if(a==="")return{value:null,error:null};let n=a,l=!1;n.startsWith("-")&&(l=!0,n=n.slice(1));const r=n.match(/[.,]/g)??[];if(r.length>1)return{value:null,error:"invalid"};const[o,i=""]=n.split(/[.,]/);if(!Oh.test(o??"")||r.length===1&&!Oh.test(i))return{value:null,error:"invalid"};if(i.replace(/0+$/,"").length>t)return{value:null,error:"too_precise"};const u=i===""?o:`${o}.${i}`;return{value:`${l?"-":""}${u}`,error:null}}function QO(e){const[t,a]=e.split(".");if(a===void 0||a.length<=2)return e;let n=a.length;for(;n>2&&a.charAt(n-1)==="0";)n-=1;return`${t}.${a.slice(0,n)}`}function eP(e){return new Intl.NumberFormat(e).formatToParts(1.1).find(a=>a.type==="decimal")?.value??"."}function G0(e,t,a,n=4){const l={minimumFractionDigits:2,maximumFractionDigits:Math.max(2,n)},r=t===""?{style:"decimal",...l}:{style:"currency",currency:t,currencyDisplay:"code",...l};let o;try{o=new Intl.NumberFormat(a,r)}catch{return`${new Intl.NumberFormat(a,{style:"decimal",...l}).format(e)} ${t}`.trim()}return o.format(e)}const tP={key:0,"data-switch":"true",class:"inline-flex h-6 items-center gap-1 rounded-pill bg-ok-bg px-2.5 text-[12px] font-semibold text-ok-text"},aP={key:1,"data-switch":"false",class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[12px] font-semibold text-muted"},nP={key:1,class:"text-muted","data-empty":""},lP={key:2,class:"text-[13px] text-muted tabular-nums"},rP={key:3,"data-money":"",class:"tabular-nums whitespace-nowrap"},Or=ae({__name:"CellValue",props:{column:{},value:{},row:{}},setup(e){const t=e;function a(m){return m==null||m===""}function n(m){return a(m)?"":Array.isArray(m)?m.map(n).filter(y=>y!=="").join(", "):typeof m=="boolean"?h(m?"backend::lang.list.column_switch_true":"backend::lang.list.column_switch_false"):typeof m=="object"?"":String(m)}function l(m){return String(m).padStart(2,"0")}function r(m){if(typeof m!="string"&&typeof m!="number")return"";const y=new Date(m);return Number.isNaN(y.getTime())?String(m):`${y.getFullYear()}-${l(y.getMonth()+1)}-${l(y.getDate())} ${l(y.getHours())}:${l(y.getMinutes())}`}function o(m){if(typeof m!="string")return"";const y=/^\d{4}-\d{2}-\d{2}/.exec(m.trim());return y?y[0]:m.trim()}function i(m){if(typeof m!="string")return"";const y=/(\d{2}):(\d{2})/.exec(m);return y?`${y[1]}:${y[2]}`:m.trim()}function u(m){return typeof m=="string"?m!==""&&m!=="0"&&m.toLowerCase()!=="false":!!m}function c(){if(t.column.currencyFrom){const m=t.row?.[t.column.currencyFrom];return typeof m=="string"?m.trim():""}return t.column.currency??""}function d(m){return typeof m!="string"||m.trim()===""?"":G0(m.trim(),c(),Na.value,4)}const p=k(()=>t.column.type==="switch"?"switch":t.column.type==="money"?"money":t.column.type==="datetime"?"datetime":t.column.type==="date"?"date":t.column.type==="time"?"time":"text"),v=k(()=>{switch(p.value){case"datetime":return r(t.value);case"date":return o(t.value);case"time":return i(t.value);case"money":return d(t.value);default:return n(t.value)}});return(m,y)=>p.value==="switch"&&!a(e.value)?(f(),b(me,{key:0},[u(e.value)?(f(),b("span",tP,[M(s(vb),{size:14,"aria-hidden":"true"}),ye(_(s(h)("backend::lang.list.column_switch_true")),1)])):(f(),b("span",aP,_(s(h)("backend::lang.list.column_switch_false")),1))],64)):v.value===""?(f(),b("span",nP,"—")):p.value==="datetime"||p.value==="date"||p.value==="time"?(f(),b("span",lP,_(v.value),1)):p.value==="money"?(f(),b("span",rP,_(v.value),1)):(f(),b(me,{key:4},[ye(_(v.value),1)],64))}}),oP={key:0,class:"flex shrink-0 gap-2"},sP=["data-row-state"],iP=ae({__name:"RowStateBadges",props:{states:{},labels:{}},setup(e){const t=e,a={deleted:"border border-border-strong text-muted",negative:"bg-danger-soft text-danger",disabled:"bg-subtle text-muted",customized:"border border-border-strong text-text",outdated:"bg-sel text-text"},n=["deleted","negative","disabled","customized","outdated"],l=k(()=>n.filter(r=>t.states.includes(r)));return(r,o)=>l.value.length>0?(f(),b("span",oP,[(f(!0),b(me,null,Ie(l.value,i=>(f(),b("span",{key:i,"data-row-state":i,class:pe([a[i],"inline-flex h-6 shrink-0 items-center rounded-pill px-2.5 text-[12px] font-semibold whitespace-nowrap"])},_(e.labels[i]??i),11,sP))),128))])):Y("",!0)}}),uP={class:"overflow-x-auto"},dP={class:"sticky top-0 z-10"},cP={class:"h-row-head border-y border-border bg-subtle"},fP={key:0,scope:"col","data-select":"",class:"w-[52px] pl-5"},pP=["aria-checked","aria-label","disabled"],mP=["aria-sort"],vP=["data-sort","onClick"],hP={key:1,class:"w-[56px] pr-5"},gP=["aria-busy"],yP={key:0,class:"pl-5"},bP={key:1,class:"pr-5"},_P={key:1},xP=["colspan"],kP={class:"text-muted"},wP=["aria-selected","data-row-states","onClick"],$P={key:0,"data-select":"",class:"pl-5"},CP=["aria-checked","aria-label","onClick"],SP={key:0,class:"flex items-center gap-3"},EP={"data-avatar":"",class:"flex size-[30px] shrink-0 items-center justify-center rounded-full bg-subtle text-[12px] font-bold text-text","aria-hidden":"true"},AP=["onClick"],TP={key:1,class:"flex items-center gap-2"},MP={key:1,"data-trailing":"",class:"w-[56px] pr-5"},Y0=ae({__name:"DataTable",props:{columns:{},rows:{},loading:{type:Boolean,default:!1},rowLink:{type:Function,default:void 0},selectable:{type:Boolean,default:!1},selected:{default:()=>[]},sortable:{type:Boolean,default:!1},sort:{default:null},variant:{default:"list"},openable:{type:Boolean,default:!1},trailing:{type:Boolean,default:!1},rowStates:{default:()=>({})},stateLabels:{default:()=>({})}},emits:["update:selected","sort","open"],setup(e,{emit:t}){const a=e,n=t,l=wn();function r(z){const V=z.id;return typeof V=="number"||typeof V=="string"?V:null}function o(z,V){const K=r(z);return K===null?`row-${V}`:String(K)}function i(z){return a.rowLink?a.rowLink(z):null}function u(z,V){if(z.target?.closest("a, button, input, label, select"))return;if(a.openable){const ie=z.currentTarget?.querySelector("[data-row-open]")??null;n("open",V,ie);return}const re=i(V);re&&l.push(re)}const c=k(()=>a.rows.map(r).filter(z=>z!==null)),d=k(()=>new Set(a.selected.map(String))),p=k(()=>{const z=c.value,V=z.filter(K=>d.value.has(String(K))).length;return V===0?"false":V===z.length?"true":"mixed"});function v(z){const V=r(z);return V!==null&&d.value.has(String(V))}function m(){n("update:selected",p.value==="true"?[]:[...c.value])}function y(z){const V=r(z);V!==null&&(d.value.has(String(V))?n("update:selected",a.selected.filter(K=>String(K)!==String(V))):n("update:selected",[...a.selected,V]))}function x(z){if(a.sort?.column===z.key)return a.sort.dir==="desc"?"descending":"ascending"}function C(z){return a.sortable&&z.sortable}const w=k(()=>a.variant==="relation"),S=k(()=>w.value?"h-[56px]":"h-row"),q=k(()=>w.value?3:8);function O(z){return(typeof z=="string"||typeof z=="number"?String(z):"").split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(K=>K.charAt(0).toUpperCase()).join("")}const I=["deleted","negative","disabled","customized","outdated"];function B(z){const V=r(z),K=V===null?void 0:a.rowStates[String(V)];return Array.isArray(K)?I.filter(re=>K.includes(re)):[]}function L(z,V,K=[]){const re=K.includes("deleted")||K.includes("disabled"),ie=W(z);return V===0?[re?"font-semibold text-muted":"font-semibold",ie].filter(Boolean).join(" "):[re||w.value||z.relation?"text-muted":"",ie].filter(Boolean).join(" ")}function W(z){return z.type==="money"?"text-right":""}function T(z){return["min-w-0 truncate",z.includes("deleted")?"line-through":"no-underline",z.includes("negative")?"text-danger":z.includes("deleted")||z.includes("disabled")?"text-muted":"text-text"]}const R=k(()=>a.columns.filter(z=>!z.invisible)),G=k(()=>Math.max(R.value.length+(a.selectable?1:0)+(a.trailing?1:0),1));function A(z,V){n("open",V,z.currentTarget)}const D=["w-3/5","w-2/5","w-1/2","w-3/4","w-1/3","w-2/3","w-1/2","w-2/5"];return(z,V)=>(f(),b("div",uP,[g("table",{class:pe([w.value?"min-w-[480px]":"min-w-[640px]","w-full border-collapse text-left"])},[g("thead",dP,[g("tr",cP,[e.selectable?(f(),b("th",fP,[g("button",{type:"button",role:"checkbox","aria-checked":p.value,"aria-label":s(h)("backend::lang.list.select_all"),disabled:e.loading||c.value.length===0,class:pe([p.value==="false"?"border-border-strong bg-surface":"border-primary bg-primary text-on-primary","flex size-[18px] items-center justify-center rounded-checkbox border disabled:opacity-60"]),onClick:m},[p.value==="mixed"?(f(),j(s(Mb),{key:0,size:14,"aria-hidden":"true"})):p.value==="true"?(f(),j(s(Ba),{key:1,size:14,"aria-hidden":"true"})):Y("",!0)],10,pP)])):Y("",!0),(f(!0),b(me,null,Ie(R.value,K=>(f(),b("th",{key:K.key,scope:"col","aria-sort":C(K)?x(K)??"none":void 0,class:pe([[x(K)?"text-text":"text-muted",W(K)],"px-3.5 text-[12px] font-semibold first:pl-5 last:pr-5"])},[C(K)?(f(),b("button",{key:0,type:"button","data-sort":K.key,class:"inline-flex items-center gap-1 font-semibold",onClick:re=>n("sort",K.key)},[ye(_(K.label)+" ",1),x(K)==="ascending"?(f(),j(s(hb),{key:0,size:14,"aria-hidden":"true"})):x(K)==="descending"?(f(),j(s(pb),{key:1,size:14,"aria-hidden":"true"})):Y("",!0)],8,vP)):(f(),b(me,{key:1},[ye(_(K.label),1)],64))],10,mP))),128)),e.trailing?(f(),b("td",hP)):Y("",!0)])]),g("tbody",{"aria-busy":e.loading?"true":void 0},[e.loading?(f(!0),b(me,{key:0},Ie(q.value,K=>(f(),b("tr",{key:`skeleton-${K}`,"data-skeleton":"",class:pe([S.value,"border-b border-border"])},[e.selectable?(f(),b("td",yP,[...V[0]||(V[0]=[g("span",{class:"block size-[18px] rounded-checkbox bg-skel"},null,-1)])])):Y("",!0),(f(!0),b(me,null,Ie(R.value,re=>(f(),b("td",{key:re.key,class:"px-3.5 first:pl-5 last:pr-5"},[g("span",{class:pe([D[(K-1)%D.length],"block h-3 rounded-[6px] bg-skel"])},null,2)]))),128)),e.trailing?(f(),b("td",bP)):Y("",!0)],2))),128)):e.rows.length===0?(f(),b("tr",_P,[g("td",{colspan:G.value,class:"px-5 py-20 text-center"},[Ee(z.$slots,"empty",{},()=>[g("span",kP,_(s(h)("backend::lang.list.no_records")),1)])],8,xP)])):(f(!0),b(me,{key:2},Ie(e.rows,(K,re)=>(f(),b("tr",{key:o(K,re),class:pe([[S.value,v(K)?"bg-sel":i(K)||e.openable?"hover:bg-hover":"",i(K)||e.openable?"cursor-pointer":""],"border-b border-border transition-colors duration-150 ease-out"]),"aria-selected":e.selectable?v(K)?"true":"false":void 0,"data-row-states":B(K).length>0?B(K).join(" "):void 0,onClick:ie=>u(ie,K)},[e.selectable?(f(),b("td",$P,[g("button",{type:"button",role:"checkbox","aria-checked":v(K)?"true":"false","aria-label":s(h)("backend::lang.list.select_row"),class:pe([v(K)?"border-primary bg-primary text-on-primary":"border-border-strong bg-surface","flex size-[18px] items-center justify-center rounded-checkbox border"]),onClick:ie=>y(K)},[v(K)?(f(),j(s(Ba),{key:0,size:14,"aria-hidden":"true"})):Y("",!0)],10,CP)])):Y("",!0),(f(!0),b(me,null,Ie(R.value,(ie,Ae)=>(f(),b("td",{key:ie.key,class:pe([L(ie,Ae,B(K)),"px-3.5 first:pl-5 last:pr-5"])},[w.value&&Ae===0?(f(),b("span",SP,[g("span",EP,_(O(K[ie.key])),1),e.openable?(f(),b("button",{key:0,type:"button","data-row-open":"",class:"min-w-0 truncate text-left font-semibold text-text",onClick:_e=>A(_e,K)},[M(Or,{column:ie,value:K[ie.key],row:K},null,8,["column","value","row"])],8,AP)):(f(),j(Or,{key:1,column:ie,value:K[ie.key],row:K},null,8,["column","value","row"]))])):Ae===0&&B(K).length>0?(f(),b("span",TP,[i(K)?(f(),j(s(Sa),{key:0,to:i(K),class:pe(T(B(K)))},{default:N(()=>[M(Or,{column:ie,value:K[ie.key],row:K},null,8,["column","value","row"])]),_:2},1032,["to","class"])):(f(),b("span",{key:1,class:pe(T(B(K)))},[M(Or,{column:ie,value:K[ie.key],row:K},null,8,["column","value","row"])],2)),M(iP,{states:B(K),labels:e.stateLabels},null,8,["states","labels"])])):Ae===0&&i(K)?(f(),j(s(Sa),{key:2,to:i(K),class:"text-text no-underline"},{default:N(()=>[M(Or,{column:ie,value:K[ie.key],row:K},null,8,["column","value","row"])]),_:2},1032,["to"])):(f(),j(Or,{key:3,column:ie,value:K[ie.key],row:K},null,8,["column","value","row"]))],2))),128)),e.trailing?(f(),b("td",MP,[Ee(z.$slots,"trailing",{row:K})])):Y("",!0)],10,wP))),128))],8,gP)],2)]))}}),DP=["aria-label"],OP={key:0,class:"flex flex-col gap-1 text-[13px]"},PP={class:"font-semibold text-muted"},IP=["data-filter","value","onChange"],RP=["value"],qP={key:1,class:"flex flex-col gap-1 text-[13px]"},LP={class:"mb-1 font-semibold text-muted"},NP={class:"flex items-center gap-2"},BP=["data-filter","aria-label","value","onChange"],FP=["data-filter","aria-label","value","onChange"],VP={key:2,class:"flex flex-col gap-1 text-[13px]"},zP={class:"font-semibold text-muted"},jP=["data-filter","value","onChange"],UP=["value"],Ro="",ui="h-button rounded-control border border-border-strong bg-surface px-3 text-text",HP=ae({__name:"FilterBar",props:{filters:{},values:{},source:{}},emits:["update"],setup(e,{emit:t}){const a=e,n=t;function l(p){if(p.options&&p.options.length>0)return p.options.map(m=>({value:JSON.stringify(m.value),label:m.label}));const v=[];return p.trueValue!==void 0&&v.push({value:JSON.stringify(p.trueValue),label:h("backend::lang.list.column_switch_true")}),p.falseValue!==void 0&&v.push({value:JSON.stringify(p.falseValue),label:h("backend::lang.list.column_switch_false")}),v}const r=E({});async function o(p){const{data:v}=await Le.GET("/{vendor}/{plugin}/{controller}/filters/{scope}/options",{params:{path:{...a.source,scope:p.name}}});r.value={...r.value,[p.name]:v?.data??[]}}$t(()=>{for(const p of a.filters)p.type==="scope"&&o(p)});const i=Ka({});function u(){for(const p of a.filters){if(p.type!=="daterange")continue;const[v="",m=""]=(a.values[p.name]??"").split(".."),y=i[p.name];(!y||a.values[p.name]!==void 0||y.from!==""&&y.to!=="")&&(i[p.name]={from:v,to:m})}}ze(()=>a.values,u,{immediate:!0,deep:!0});function c(p,v,m){const y={...i[p.name]??{from:"",to:""},[v]:m};i[p.name]=y,y.from!==""&&y.to!==""?n("update",p.name,`${y.from}..${y.to}`):(y.from===""&&y.to===""||a.values[p.name]!==void 0)&&n("update",p.name,null)}function d(p,v){n("update",p.name,v===Ro?null:v)}return(p,v)=>(f(),b("div",{role:"group","aria-label":s(h)("backend::lang.list.filters"),"data-filter-bar":"",class:"flex flex-wrap items-end gap-4 border-t border-border px-5 py-3.5"},[(f(!0),b(me,null,Ie(e.filters,m=>(f(),b(me,{key:m.name},[m.type==="switch"?(f(),b("label",OP,[g("span",PP,_(m.label||m.name),1),g("select",{"data-filter":m.name,value:e.values[m.name]??Ro,class:pe(ui),onChange:y=>d(m,y.target.value)},[g("option",{value:Ro},_(s(h)("backend::lang.list.filter_all")),1),(f(!0),b(me,null,Ie(l(m),y=>(f(),b("option",{key:y.value,value:y.value},_(y.label),9,RP))),128))],40,IP)])):m.type==="daterange"?(f(),b("fieldset",qP,[g("legend",LP,_(m.label||m.name),1),g("div",NP,[g("input",{type:"date","data-filter":`${m.name}-from`,"aria-label":s(h)("backend::lang.list.filter_from"),value:i[m.name]?.from??"",class:pe(ui),onChange:y=>c(m,"from",y.target.value)},null,40,BP),v[0]||(v[0]=g("span",{"aria-hidden":"true"},"–",-1)),g("input",{type:"date","data-filter":`${m.name}-to`,"aria-label":s(h)("backend::lang.list.filter_to"),value:i[m.name]?.to??"",class:pe(ui),onChange:y=>c(m,"to",y.target.value)},null,40,FP)])])):m.type==="scope"?(f(),b("label",VP,[g("span",zP,_(m.label||m.name),1),(f(),b("select",{key:`${m.name}-${r.value[m.name]?.length??-1}`,"data-filter":m.name,value:e.values[m.name]??Ro,class:pe(ui),onChange:y=>d(m,y.target.value)},[g("option",{value:Ro},_(s(h)("backend::lang.list.filter_all")),1),(f(!0),b(me,null,Ie(r.value[m.name]??[],y=>(f(),b("option",{key:y.value,value:y.value},_(y.label),9,UP))),128))],40,jP))])):Y("",!0)],64))),128))],8,DP))}}),KP=["type","disabled","data-hotkey","aria-keyshortcuts"],Ke=ae({__name:"Button",props:{variant:{default:"outline"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},icon:{default:void 0},to:{default:void 0},hotkey:{default:void 0}},setup(e){const t=e,a={primary:"bg-primary text-on-primary hover:opacity-90",outline:"border border-border-strong bg-surface text-text hover:bg-hover",ghost:"text-muted hover:bg-hover hover:text-text",danger:"border border-danger bg-surface text-danger hover:bg-danger-soft"},n=k(()=>t.hotkey?Ju(t.hotkey):void 0),l=k(()=>["inline-flex shrink-0 items-center justify-center gap-2 rounded-control px-4 font-semibold whitespace-nowrap no-underline transition-colors duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-60",t.size==="sm"?"h-[38px]":"h-button",a[t.variant]]);return(r,o)=>e.to!==void 0?(f(),j(s(Sa),{key:0,to:e.to,class:pe(l.value),"data-hotkey":e.hotkey,"aria-keyshortcuts":n.value},{default:N(()=>[e.icon?(f(),j(Wt(e.icon),{key:0,size:16,"aria-hidden":"true"})):Y("",!0),Ee(r.$slots,"default")]),_:3},8,["to","class","data-hotkey","aria-keyshortcuts"])):(f(),b("button",{key:1,type:e.type,disabled:e.disabled,class:pe(l.value),"data-hotkey":e.hotkey,"aria-keyshortcuts":n.value},[e.icon?(f(),j(Wt(e.icon),{key:0,size:16,"aria-hidden":"true"})):Y("",!0),Ee(r.$slots,"default")],10,KP))}}),WP=ae({__name:"BulkActionsMenu",props:{actions:{},disabled:{type:Boolean}},emits:["select"],setup(e,{expose:t,emit:a}){const n=a,l=E(null);function r(){const o=l.value?.$el;o instanceof HTMLElement&&o.focus()}return t({focus:r}),(o,i)=>(f(),j(s(p0),{modal:!1},{default:N(()=>[M(s(h0),{"as-child":"",disabled:e.disabled},{default:N(()=>[M(Ke,{ref_key:"trigger",ref:l,variant:"outline",size:"md","data-action":"bulk-actions",disabled:e.disabled},{default:N(()=>[ye(_(s(h)("backend::lang.list.bulk_actions"))+" ",1),M(s(Gn),{size:16,class:"text-muted","aria-hidden":"true"})]),_:1},8,["disabled"])]),_:1},8,["disabled"]),M(s(v0),null,{default:N(()=>[M(s(m0),{"data-bulk-menu":"",align:"end","side-offset":8,class:"z-50 flex w-[240px] max-w-[320px] flex-col rounded-[14px] border border-border bg-surface p-2 text-text shadow-menu"},{default:N(()=>[(f(!0),b(me,null,Ie(e.actions,u=>(f(),j(s(Yc),{key:u.name,"data-bulk-action":u.name,class:"flex min-h-10 cursor-pointer items-center rounded-control px-3 py-2 outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:c=>n("select",u.name)},{default:N(()=>[ye(_(u.label),1)]),_:2},1032,["data-bulk-action","onSelect"]))),128))]),_:1})]),_:1})]),_:1}))}}),GP={class:"flex flex-wrap items-center justify-between gap-3 px-5 py-4"},YP={key:0,class:"relative block w-[320px] max-w-full"},JP={class:"sr-only"},ZP=["value","placeholder"],XP={key:1},QP={class:"flex flex-wrap items-center justify-end gap-2.5"},eI={key:0,"data-selected-pill":"",class:"inline-flex h-8 items-center gap-1.5 rounded-pill bg-sel px-3 text-[13px] font-semibold"},tI=ae({__name:"ListToolbar",props:{showSearch:{type:Boolean},search:{},searchPrompt:{},buttons:{},selectedCount:{},selectedLabel:{},deleteLabel:{},actions:{default:()=>[]},busyAction:{default:null},bulkActions:{default:()=>[]},bulkBusy:{type:Boolean,default:!1}},emits:["update:search","delete","action","bulk"],setup(e,{expose:t,emit:a}){const n=e,l=a,r=k(()=>new Map(n.actions.map(u=>[u.name,u.label]))),o=E(null);function i(){o.value?.focus()}return t({focusBulk:i}),(u,c)=>(f(),b("div",GP,[e.showSearch?(f(),b("label",YP,[g("span",JP,_(s(h)("backend::lang.list.search")),1),M(s(hr),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{type:"search","data-list-search":"","data-hotkey":"/","aria-keyshortcuts":"/",value:e.search,placeholder:e.searchPrompt,class:"h-button w-full rounded-control border border-transparent bg-subtle pr-3.5 pl-10",onInput:c[0]||(c[0]=d=>l("update:search",d.target.value))},null,40,ZP)])):(f(),b("span",XP)),g("div",QP,[e.selectedCount>0?(f(),b("span",eI,[M(s(Ba),{size:14,"aria-hidden":"true"}),ye(_(e.selectedLabel),1)])):Y("",!0),e.bulkActions.length>0?(f(),j(WP,{key:1,ref_key:"bulkMenu",ref:o,actions:e.bulkActions,disabled:e.selectedCount===0||e.bulkBusy,onSelect:c[1]||(c[1]=d=>l("bulk",d))},null,8,["actions","disabled"])):Y("",!0),(f(!0),b(me,null,Ie(e.buttons,d=>(f(),b(me,{key:d},[d==="delete"?(f(),j(Ke,{key:0,"data-action":"delete",variant:e.selectedCount>0?"danger":"outline",icon:s(Xa),disabled:e.selectedCount===0,onClick:c[2]||(c[2]=p=>l("delete"))},{default:N(()=>[ye(_(e.deleteLabel),1)]),_:1},8,["variant","icon","disabled"])):r.value.has(d)?(f(),j(Ke,{key:1,variant:"outline",size:"md","data-action":d,disabled:e.busyAction===d,"aria-busy":e.busyAction===d?"true":void 0,onClick:p=>l("action",d)},{default:N(()=>[ye(_(r.value.get(d)),1)]),_:2},1032,["data-action","disabled","aria-busy","onClick"])):Y("",!0)],64))),128))])]))}}),aI={class:"flex flex-wrap items-center gap-x-6 gap-y-3 border-t border-border px-5 py-3.5 text-[13px] text-muted"},nI={"data-range":""},lI={key:0,class:"flex items-center gap-2"},rI=["value"],oI=["value"],sI=["aria-label"],iI=["disabled"],uI={key:0,"aria-hidden":"true",class:"px-1"},dI=["data-page","aria-current","onClick"],cI=["disabled"],Yd="inline-flex h-pager min-w-pager items-center justify-center gap-1 rounded-pager border border-border px-2.5 text-[13px] text-text disabled:cursor-not-allowed disabled:opacity-60 hover:bg-hover",J0=ae({__name:"Pagination",props:{meta:{},loading:{type:Boolean},perPageOptions:{},perPage:{}},emits:["page","perPage"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>a.meta?.total??0),r=k(()=>a.meta?.page??1),o=k(()=>Math.max(a.meta?.last_page??1,1)),i=k(()=>{const d=a.meta;if(!d||d.total===0)return wa("backend::lang.list.results",0);const p=(d.page-1)*d.per_page+1,v=Math.min(d.page*d.per_page,d.total);return h("backend::lang.list.pagination_range",{from:p,to:v,total:d.total})}),u=k(()=>{const d=o.value,p=r.value,v=new Set([1,d,p-1,p,p+1].filter(x=>x>=1&&x<=d));p<=3&&[2,3].forEach(x=>x<=d&&v.add(x)),p>=d-2&&[d-1,d-2].forEach(x=>x>=1&&v.add(x));const m=[...v].sort((x,C)=>x-C),y=[];return m.forEach((x,C)=>{const w=m[C-1];w!==void 0&&x-w>1&&y.push(null),y.push(x)}),y});function c(d){const p=Number(d.target.value);Number.isFinite(p)&&p>0&&n("perPage",p)}return(d,p)=>(f(),b("footer",aI,[g("span",nI,_(e.loading?s(h)("backend::lang.list.loading"):i.value),1),e.perPageOptions.length>1?(f(),b("label",lI,[g("span",null,_(s(h)("backend::lang.list.records_per_page")),1),g("select",{"data-per-page":"",value:String(e.perPage),class:"h-pager rounded-pager border border-border-strong bg-surface px-2 text-text",onChange:c},[(f(!0),b(me,null,Ie(e.perPageOptions,v=>(f(),b("option",{key:v,value:String(v)},_(v),9,oI))),128))],40,rI)])):Y("",!0),!e.loading&&l.value>0?(f(),b("nav",{key:1,"aria-label":s(h)("backend::lang.list.pagination"),class:"ml-auto flex items-center gap-1.5"},[g("button",{type:"button","data-page":"prev",class:pe(Yd),disabled:r.value<=1,onClick:p[0]||(p[0]=v=>n("page",r.value-1))},[M(s(Is),{size:14,"aria-hidden":"true"}),ye(_(s(h)("backend::lang.list.prev_page")),1)],8,iI),(f(!0),b(me,null,Ie(u.value,(v,m)=>(f(),b(me,{key:v??`gap-${m}`},[v===null?(f(),b("span",uI,"…")):(f(),b("button",{key:1,type:"button","data-page":v,"aria-current":v===r.value?"page":void 0,class:pe([Yd,v===r.value?"border-transparent bg-sel font-bold":""]),onClick:y=>v!==r.value&&n("page",v)},_(v),11,dI))],64))),128)),g("button",{type:"button","data-page":"next",class:pe(Yd),disabled:r.value>=o.value,onClick:p[1]||(p[1]=v=>n("page",r.value+1))},[ye(_(s(h)("backend::lang.list.next_page")),1),M(s(vr),{size:14,"aria-hidden":"true"})],8,cI)],8,sI)):Y("",!0)]))}}),fI={role:"alert","data-extension-failure":"",class:"flex min-h-input items-center rounded-control border-[1.5px] border-dashed border-border-strong bg-subtle px-3.5 py-2.5 text-[13px] text-muted"},pI={class:"flex min-w-0 items-start gap-2.5"},mI={class:"min-w-0 [overflow-wrap:anywhere]"},Zu=ae({__name:"ExtensionFailure",props:{text:{}},setup(e){return(t,a)=>(f(),b("div",fI,[g("span",pI,[M(s(bt),{size:16,class:"mt-0.5 shrink-0 text-danger","aria-hidden":"true"}),g("span",mI,_(e.text),1)])]))}}),vI=new Set(["div","span","p","strong","em","b","i","u","s","small","mark","code","pre","br","hr","ul","ol","li","dl","dt","dd","h2","h3","h4","h5","h6","table","thead","tbody","tfoot","tr","th","td","caption","section","header","footer","figure","figcaption","blockquote","q","abbr","time","data","meter","progress","sup","sub","a","img"]),hI=new Set(["script","style","template","iframe","object","embed","noscript","textarea","title","xmp","svg","math","form","input","button","select","link","meta","base"]),gI=32,yI=2e3,bI=new Set(["class","title","lang","dir","role"]),_I={a:new Set(["href"]),img:new Set(["src","alt","width","height"]),td:new Set(["colspan","rowspan","scope"]),th:new Set(["colspan","rowspan","scope"]),time:new Set(["datetime"]),data:new Set(["value"]),meter:new Set(["value","min","max","low","high","optimum"]),progress:new Set(["value","max"])},xI=/^(aria|data)-[a-z0-9_-]+$/;function kI(e,t){if(e==="")return!1;for(const a of e){const n=a.codePointAt(0)??0;if(n<=32||n===127)return!1}return e.startsWith("#")?t:e.startsWith("/")?e.length===1||e[1]!=="/"&&e[1]!=="\\":!1}function wI(e,t,a){return bI.has(t)||_I[e]?.has(t)===!0||xI.test(t)?e==="a"&&t==="href"||e==="img"&&t==="src"?kI(a,e==="a"):!0:!1}function $I(e,t){const a={};for(const[n,l]of Object.entries(t??{})){const r=n.toLowerCase();typeof l=="string"&&wI(e,r,l)&&(a[r]=l)}return a}function ef(e,t,a){const n=[];for(const l of e??[]){if(a.left<=0)break;if(l.tag===void 0||l.tag===""){typeof l.text=="string"&&l.text!==""&&(a.left-=1,n.push(l.text));continue}const r=l.tag.toLowerCase();if(hI.has(r))continue;if(!vI.has(r)){n.push(...ef(l.children,t,a));continue}if(t+1>gI)continue;a.left-=1;const o=ef(l.children,t+1,a);n.push(qa(r,$I(r,l.attrs),o.length>0?o:void 0))}return n}function CI(e){return ef(e,0,{left:yI})}const SI={key:1,"data-partial-loading":"","aria-busy":"true"},EI=["data-partial","aria-busy"],Pp=ae({__name:"PartialHost",props:{source:{},name:{},recordId:{default:null},variant:{},reloadKey:{default:0},hint:{type:Boolean,default:!1}},setup(e){const t=e,a=E(null),n=E(!1),l=E(!1);let r=0;const o=u=>CI(u.nodes);o.props=["nodes"];async function i(){const u=++r;l.value=!0;let c=null;try{c=(await Le.GET("/{vendor}/{plugin}/{controller}/partials/{name}",{params:{path:{...t.source,name:t.name},query:t.recordId!=null?{id:t.recordId}:void 0}})).data?.data.nodes??null}catch{c=null}u===r&&(l.value=!1,n.value=c===null,a.value=c)}return ze(()=>t.reloadKey,()=>{i()}),i(),(u,c)=>n.value?(f(),j(Zu,{key:0,"data-partial-failed":"",text:s(h)("backend::lang.extension.partial_failed")},null,8,["text"])):a.value===null?(f(),b("div",SI,[g("div",{"data-partial-skeleton":"",class:pe([e.hint?"h-[68px] w-full rounded-inner":e.variant==="header"?"h-[80px] w-full rounded-card":"h-[44px] w-full rounded-control","bg-skel"]),"aria-hidden":"true"},null,2)])):a.value.length>0?(f(),b("div",{key:2,class:"summer-partial","data-partial":e.variant,"aria-busy":l.value?"true":void 0},[M(o,{nodes:a.value},null,8,["nodes"])],8,EI)):Y("",!0)}}),AI={key:0,class:"flex flex-col gap-1.5","data-confirm-prompt":""},TI=["for"],MI=["id","maxlength","placeholder","aria-describedby","disabled","value","onKeydown"],DI=["id"],OI={class:"flex gap-2.5"},PI=["disabled","aria-busy"],Sn=ae({__name:"ConfirmDialog",props:{open:{type:Boolean},message:{},title:{default:void 0},confirmLabel:{default:void 0},cancelLabel:{default:void 0},danger:{type:Boolean,default:!1},busy:{type:Boolean,default:!1},prompt:{default:null},value:{default:""}},emits:["update:open","update:value","confirm","cancel"],setup(e,{emit:t}){const a=e,n=t,l=`confirm-${gf()}`,r=E(null),o=k(()=>!!a.prompt&&a.value.trim()==="");function i(d){!d&&a.busy||(n("update:open",d),d||n("cancel"))}function u(){a.busy||o.value||(n("confirm"),n("update:open",!1))}function c(d){n("update:value",d.target.value)}return ze(()=>a.open&&!!a.prompt,async d=>{d&&(await Ge(),r.value?.focus())}),(d,p)=>(f(),j(s(b5),{open:e.open,"onUpdate:open":i},{default:N(()=>[M(s(g5),null,{default:N(()=>[M(s(v5),{class:"pointer-events-auto fixed inset-0 z-[80] bg-overlay"}),M(s(u5),{"data-confirm-dialog":"",class:"pointer-events-auto fixed top-1/2 left-1/2 z-[90] flex w-[calc(100%-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-modal bg-surface p-6 text-text shadow-pop"},{default:N(()=>[M(s(x5),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(e.title??s(h)("backend::lang.form.confirm")),1)]),_:1}),M(s(p5),{class:"text-muted [overflow-wrap:anywhere]"},{default:N(()=>[ye(_(e.message),1)]),_:1}),e.prompt?(f(),b("div",AI,[g("label",{for:`${l}-value`,class:"text-[13px] font-semibold"},_(e.prompt.label),9,TI),g("input",{id:`${l}-value`,ref_key:"promptInput",ref:r,type:"text",autocomplete:"off",maxlength:e.prompt.maxLength,placeholder:e.prompt.placeholder,"aria-describedby":e.prompt.comment?`${l}-comment`:void 0,disabled:e.busy,value:e.value,class:"h-control w-full rounded-control border border-border-strong bg-surface px-3 text-text outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-60",onInput:c,onKeydown:gn(mt(u,["prevent"]),["enter"])},null,40,MI),e.prompt.comment?(f(),b("p",{key:0,id:`${l}-comment`,class:"text-[13px] text-muted"},_(e.prompt.comment),9,DI)):Y("",!0)])):Y("",!0),g("div",OI,[M(s(c5),{"data-action":"cancel",disabled:e.busy,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60"},{default:N(()=>[ye(_(e.cancelLabel??s(h)("backend::lang.form.cancel")),1)]),_:1},8,["disabled"]),g("button",{type:"button","data-action":"confirm",disabled:e.busy||o.value,"aria-busy":e.busy?"true":void 0,class:pe([e.danger?"bg-danger text-white":"bg-primary text-on-primary","inline-flex h-button flex-1 items-center justify-center gap-2 rounded-control font-semibold hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"]),onClick:mt(u,["prevent"])},[e.busy?(f(),j(s(Vn),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Y("",!0),ye(" "+_(e.confirmLabel??s(h)("backend::lang.form.confirm")),1)],10,PI)])]),_:1})]),_:1})]),_:1},8,["open"]))}});function ol(){const e=E(null),t=E(!1),a=E("");let n=null,l=null;function r(d){const p=n;n=null,l=null,e.value=null,p?.(d)}function o(d,p){return r(!1),a.value="",e.value=d,l=p??null,new Promise(v=>{n=v})}async function i(){if(t.value||e.value?.prompt&&a.value.trim()==="")return;const d=l;if(d){t.value=!0;try{await d()}finally{t.value=!1}}r(!0)}function u(){t.value||r(!1)}function c(d){a.value=d}return{request:e,busy:t,value:a,ask:o,confirm:i,cancel:u,setValue:c}}const II={class:"flex flex-col gap-5"},RI={class:"flex flex-wrap items-end justify-between gap-4"},qI={class:"flex flex-col"},LI={class:"text-[26px] font-bold tracking-[-0.02em]"},NI={key:0,"data-record-count":"",class:"text-muted"},BI={key:0,class:"flex items-center gap-2.5"},FI={class:"overflow-hidden rounded-card border border-border bg-surface shadow-card"},VI={key:2,"data-list-failed":"",class:"flex flex-wrap items-center justify-between gap-3 border-t border-border px-5 py-4"},zI={role:"alert",class:"text-danger"},jI={key:0,"data-empty-search":"",class:"flex flex-col items-center gap-3"},UI={class:"flex size-14 items-center justify-center rounded-full bg-subtle text-muted"},HI={class:"text-[17px] font-bold"},KI={class:"max-w-[420px] text-muted"},WI={key:1,"data-empty-list":"",class:"text-muted"},GI=300,YI=ae({__name:"ListView",setup(e){const t=ga(),a=wn(),n={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},l=Os(n),r=Ja(l)??"/",o=E(null),i=E([]),u=E(null),c=E(!0),d=E(!1),p=E(!1),v=k(()=>d.value||p.value),m=E([]),y=E(!1),x=E(0),C=ol(),w=k(()=>b0(t.query)),S=E(w.value.search??""),q=k(()=>o.value?.messages),O=k(()=>o.value?.title?o.value.title:Ps(n.vendor,n.plugin)?.sideMenu.find(Me=>Me.controller===l)?.label??l),I=k(()=>u.value?tt(q.value?.recordCount,u.value.total):""),B=k(()=>o.value?.toolbarButtons??[]),L=k(()=>B.value.filter(se=>se==="create")),W=k(()=>{const se=o.value?.reorder;if(!se)return null;const Me=se.partition?.column,Ce=Me?o.value?.filters.find(Ue=>Ue.column===Me||Ue.name===Me):void 0,Fe=Ce?w.value.filter?.[Ce.name]:void 0;return{path:`${r}/reorder`,query:Fe!==void 0&&Fe!==""?{partition:String(Fe)}:{}}}),T=k(()=>o.value?.toolbarActions??[]),R=k(()=>B.value.filter(se=>se==="delete"||T.value.some(Me=>Me.name===se))),G=E(null),A=k(()=>u.value?.row_states??{}),D=k(()=>({deleted:tt(q.value?.rowStateDeleted),negative:tt(q.value?.rowStateNegative),disabled:tt(q.value?.rowStateDisabled),customized:tt(q.value?.rowStateCustomized),outdated:tt(q.value?.rowStateOutdated)})),z=k(()=>(o.value?.bulkActions??[]).filter(se=>se.name!=="delete")),V=E(!1),K=E(null),re=k(()=>{const se=o.value?.perPageOptions??[];return se.length>0?se:[o.value?.recordsPerPage||20]}),ie=k(()=>w.value.per_page??u.value?.per_page??o.value?.recordsPerPage??20),Ae=k(()=>w.value.sort?{column:w.value.sort,dir:w.value.dir==="desc"?"desc":"asc"}:null);function _e(se){const Me=o.value?.recordUrl,Ce=se.id;return!Me||typeof Ce!="number"&&typeof Ce!="string"?null:W0(Me,l,Ce)}function xe(se){si(l,se),a.replace({path:t.path,query:ru(se)})}const ne=Vr({}),fe=k(()=>Vr(w.value)!==ne);let F=0,de=null;function ve(){xe({})}async function Z(se=!1){const Me=++F;c.value=!0,p.value=!1;let Ce=null;try{Ce=await J()}catch{Ce=null}if(Me!==F)return;if(!Ce?.data&&se){si(l,{}),a.replace({path:t.path,query:{}});return}if(!Ce?.data&&Ce?.response?.status===404&&await he(Me))return;if(i.value=Ce?.data?.data??[],u.value=Ce?.data?.meta??null,p.value=!Ce?.data,c.value=!1,Ce?.response?.status===422){si(l,{});return}const Fe=u.value?.last_page??0;Fe>=1&&(u.value?.page??0)>Fe&&xe({...w.value,page:Fe})}async function he(se){try{const{data:Me}=await Le.GET("/{vendor}/{plugin}/{controller}/singleton",{params:{path:n}});return se!==F?!0:Me?(await a.replace(`${r}/${Me.data.id}`),!0):!1}catch{return!1}}function J(){return Le.GET("/{vendor}/{plugin}/{controller}",{params:{path:n,query:w.value}})}async function ee(){const se=await Le.GET("/{vendor}/{plugin}/{controller}/schema/list",{params:{path:n}});o.value=se.data?.data??null,d.value=!o.value,o.value&&Op(l,o.value.assets)}ee(),ze(()=>Vr(w.value),se=>{if(se===ne){const Ce=OD(l),Fe=Vr(Ce);if(Fe!==ne){de=Fe,a.replace({path:t.path,query:ru(Ce)});return}}const Me=de!==null&&de===se;de=null,si(l,w.value),m.value=[],S.value=w.value.search??"",Z(Me)},{immediate:!0});let te=null;function $(se){S.value=se,te!==null&&clearTimeout(te),te=setTimeout(()=>{te=null;const Me=se.trim();xe({...w.value,search:Me===""?void 0:Me,page:void 0})},GI)}Dt(()=>{te!==null&&clearTimeout(te)});function P(){S.value="",xe({...w.value,search:void 0,page:void 0})}function U(se){const Me=Ae.value;Me?.column!==se?xe({...w.value,sort:se,dir:"asc",page:void 0}):Me.dir==="asc"?xe({...w.value,sort:se,dir:"desc",page:void 0}):xe({...w.value,sort:void 0,dir:void 0,page:void 0})}function ce(se){xe({...w.value,page:se})}function X(se){xe({...w.value,per_page:se,page:void 0})}function oe(se,Me){const Ce={...w.value.filter??{}};Me===null?delete Ce[se]:Ce[se]=Me,xe({...w.value,filter:Ce,page:void 0})}async function ke(){const se=m.value.map(Number).filter(Ce=>Number.isInteger(Ce)&&Ce>0);if(!(se.length===0||y.value||!await C.ask({message:tt(q.value?.deleteConfirm,se.length),confirmLabel:h("backend::lang.form.delete"),danger:!0}))){y.value=!0;try{const Ce=await Le.POST("/{vendor}/{plugin}/{controller}/bulk-delete",{params:{path:n},body:{ids:se}});if(Ce.data){Oe(tt(q.value?.deleted,Ce.data.data.deleted)),m.value=[],await Z(),x.value+=1;return}Oe(Ce.error?.error.message||h("backend::lang.list.delete_failed"),"danger")}catch{Oe(h("backend::lang.list.delete_failed"),"danger")}finally{y.value=!1}}}async function Se(se){const Me=z.value.find(ge=>ge.name===se),Ce=m.value.map(Number).filter(ge=>Number.isInteger(ge)&&ge>0);if(!Me||Ce.length===0||V.value)return;const Fe=Me.label??se;let Ue=0,Ze=null,at="";const nt=await C.ask({message:Me.confirm||wa("backend::lang.list.bulk_confirm",Ce.length,{action:Fe}),confirmLabel:Fe,danger:!1},async()=>{V.value=!0;try{const ge=await Le.POST("/{vendor}/{plugin}/{controller}/bulk/{action}",{params:{path:{...n,action:se}},body:{ids:Ce}});Ue=ge.response.status,Ze=ge.data?.data??null,at=ge.error?.error.message??""}catch{Ue=0}finally{V.value=!1}});if(await new Promise(ge=>setTimeout(ge,0)),K.value?.focusBulk(),!nt)return;const $e=Ze;if($e){Oe($e.message||wa("backend::lang.list.bulk_done",$e.affected)),m.value=[],await Z(),x.value+=1;return}if(Ue===409){Oe(h("backend::lang.list.bulk_stale"),"danger"),m.value=[],await Z();return}if(Ue===403){Oe(at||h("backend::lang.list.action_forbidden"),"danger");return}Oe(at||h("backend::lang.extension.action_failed"),"danger")}async function Te(se){if(G.value===null){G.value=se;try{const Me=await Le.POST("/{vendor}/{plugin}/{controller}/toolbar/{action}",{params:{path:{...n,action:se}},body:{}});if(Me.data){Me.data.data.message&&Oe(Me.data.data.message),await Z(),x.value+=1;return}Oe(Me.error?.error.message||h("backend::lang.extension.action_failed"),"danger")}catch{Oe(h("backend::lang.extension.action_failed"),"danger")}finally{G.value=null}}}return(se,Me)=>(f(),b("section",II,[g("header",RI,[g("div",qI,[g("h1",LI,_(O.value),1),I.value?(f(),b("p",NI,_(I.value),1)):Y("",!0)]),L.value.length>0||W.value?(f(),b("div",BI,[W.value?(f(),j(Ke,{key:0,"data-action":"reorder",variant:"outline",icon:s(mb),to:W.value},{default:N(()=>[ye(_(s(h)("backend::lang.messages.list.reorder")),1)]),_:1},8,["icon","to"])):Y("",!0),(f(!0),b(me,null,Ie(L.value,Ce=>(f(),j(Ke,{key:Ce,"data-action":"create",variant:"primary",icon:s(vo),to:`${s(r)}/create`},{default:N(()=>[ye(_(s(tt)(q.value?.create)),1)]),_:1},8,["icon","to"]))),128))])):Y("",!0)]),o.value?.headerPartial?(f(),j(Pp,{key:0,variant:"header",source:n,name:o.value.headerPartial,"reload-key":x.value},null,8,["name","reload-key"])):Y("",!0),g("div",FI,[o.value?(f(),j(tI,{key:0,ref_key:"toolbar",ref:K,"show-search":o.value.showSearch,search:S.value,"search-prompt":s(tt)(q.value?.searchPrompt),buttons:R.value,"selected-count":m.value.length,"selected-label":s(tt)(q.value?.selected,m.value.length),"delete-label":s(tt)(q.value?.deleteSelected,m.value.length),actions:T.value,"busy-action":G.value,"bulk-actions":z.value,"bulk-busy":V.value,"onUpdate:search":$,onDelete:ke,onAction:Te,onBulk:Se},null,8,["show-search","search","search-prompt","buttons","selected-count","selected-label","delete-label","actions","busy-action","bulk-actions","bulk-busy"])):Y("",!0),o.value&&o.value.filters.length>0?(f(),j(HP,{key:1,filters:o.value.filters,values:w.value.filter??{},source:n,onUpdate:oe},null,8,["filters","values"])):Y("",!0),v.value&&!c.value?(f(),b("div",VI,[g("p",zI,_(s(h)("backend::lang.list.load_failed")),1),p.value&&fe.value?(f(),j(Ke,{key:0,"data-action":"reset-list",onClick:ve},{default:N(()=>[ye(_(s(h)("backend::lang.list.reset_list")),1)]),_:1})):Y("",!0)])):(f(),j(Y0,{key:3,columns:o.value?.columns??[],rows:i.value,loading:c.value||!o.value,"row-link":_e,selectable:o.value?.showCheckboxes??!1,selected:m.value,sortable:o.value?.showSorting??!1,sort:Ae.value,"row-states":A.value,"state-labels":D.value,"onUpdate:selected":Me[0]||(Me[0]=Ce=>m.value=Ce),onSort:U},{empty:N(()=>[w.value.search?(f(),b("div",jI,[g("span",UI,[M(s(Pb),{size:24,"aria-hidden":"true"})]),g("p",HI,_(s(tt)(q.value?.emptySearch,void 0,{term:w.value.search})),1),g("p",KI,_(s(tt)(q.value?.emptySearchHint,void 0,{term:w.value.search})),1),M(Ke,{"data-action":"clear-search",onClick:P},{default:N(()=>[ye(_(s(h)("backend::lang.list.clear_search")),1)]),_:1})])):(f(),b("p",WI,_(s(tt)(q.value?.empty)||o.value?.noRecordsMessage||s(h)("backend::lang.list.no_records")),1))]),_:1},8,["columns","rows","loading","selectable","selected","sortable","sort","row-states","state-labels"])),M(J0,{meta:u.value,loading:c.value||!o.value,"per-page-options":re.value,"per-page":ie.value,onPage:ce,onPerPage:X},null,8,["meta","loading","per-page-options","per-page"])]),M(Sn,{open:s(C).request.value!==null,message:s(C).request.value?.message??"","confirm-label":s(C).request.value?.confirmLabel,danger:s(C).request.value?.danger,busy:s(C).busy.value,onConfirm:s(C).confirm,onCancel:s(C).cancel},null,8,["open","message","confirm-label","danger","busy","onConfirm","onCancel"])]))}}),ql="X-Session-Key",Z0="X-Child-Session-Key",JI=32;function Ss(){const e=new Uint8Array(JI);globalThis.crypto.getRandomValues(e);let t="";for(const a of e)t+=String.fromCharCode(a);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const ZI="X-Upload-Id";async function Sl(e){try{const t=await e();return{data:t.data?t.data.data:null,status:t.response.status,error:t.error?.error??null}}catch{return{data:null,status:0,error:null}}}async function ou(e){try{const t=await e();return t.response.ok&&t.data instanceof Blob?t.data:null}catch{return null}}function Bn(e){return encodeURIComponent(String(e))}function X0(e){return`${mr.api}/${Bn(e.vendor)}/${Bn(e.plugin)}/${Bn(e.controller)}`}function XI(e){try{return e===""?null:JSON.parse(e)}catch{return null}}function Ip(e){if(!e)return"";for(const t of Object.values(e.details??{})){const a=Array.isArray(t)?t.find(n=>typeof n=="string"&&n!==""):t;if(typeof a=="string"&&a!=="")return a}return e.message??""}function QI(e,t){const a=t;if((e===200||e===201)&&a?.data)return{ok:!0,item:a.data};const n=Ip(a?.error);return e===413?{ok:!1,reason:"too_large",status:e,message:n}:e===422?{ok:!1,reason:"invalid",status:e,message:n}:e===0?{ok:!1,reason:"network",status:e,message:n}:{ok:!1,reason:"failed",status:e,message:n}}function Q0(e,t,a,n,l){let r=null,o=!1;const i=()=>new Promise(c=>{const d=new XMLHttpRequest;r=d,d.open("POST",e),d.setRequestHeader("X-Requested-With",ob),d.setRequestHeader("Accept","application/json");for(const[v,m]of Object.entries(a))d.setRequestHeader(v,m);l&&d.setRequestHeader(ZI,l),d.upload.onprogress=v=>{v.lengthComputable&&n?.(v.loaded,v.total)},d.onload=()=>c({status:d.status,body:XI(d.responseText)}),d.onerror=()=>c("network"),d.ontimeout=()=>c("network"),d.onabort=()=>c("aborted");const p=new FormData;p.append("file_data",t,t.name),d.send(p)});return{promise:(async()=>{let c=await i();return typeof c=="object"&&c.status===401&&!o&&(await Sf()&&(c=o?"aborted":await i()),typeof c=="object"&&c.status===401&&J2()),c==="aborted"||o?{ok:!1,reason:"aborted",status:0,message:""}:c==="network"?{ok:!1,reason:"network",status:0,message:""}:QI(c.status,c.body)})(),abort(){o=!0,r?.abort()}}}function e_(e,t,a,n){const l={...e,id:t,field:a},r={[ql]:n},o=`${X0(e)}/${Bn(t)}/files/${Bn(a)}`;return{list:()=>Sl(()=>Le.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}",{params:{path:l,header:r}})),upload:(i,u,c)=>Q0(o,i,{...r},u,c),update:(i,u)=>Sl(()=>Le.PUT("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}",{params:{path:{...l,file:i},header:r},body:u})),remove:i=>Sl(()=>Le.DELETE("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}",{params:{path:{...l,file:i},header:r}})),reorder:i=>Sl(()=>Le.POST("/{vendor}/{plugin}/{controller}/{id}/files/{field}/reorder",{params:{path:l,header:r},body:{ids:i}})),download:i=>ou(()=>Le.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}/download",{params:{path:{...l,file:i},header:r},parseAs:"blob"})),thumb:i=>ou(()=>Le.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}/thumb",{params:{path:{...l,file:i},header:r},parseAs:"blob"}))}}function eR(e,t,a,n,l,r,o){const i={...e,id:t,name:a,child:n,field:l},u={[ql]:r,[Z0]:o},c=`${X0(e)}/${Bn(t)}/relations/${Bn(a)}/records/${Bn(n)}/files/${Bn(l)}`;return{list:()=>Sl(()=>Le.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}",{params:{path:i,header:u}})),upload:(d,p,v)=>Q0(c,d,{...u},p,v),update:(d,p)=>Sl(()=>Le.PUT("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}",{params:{path:{...i,file:d},header:u},body:p})),remove:d=>Sl(()=>Le.DELETE("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}",{params:{path:{...i,file:d},header:u}})),reorder:d=>Sl(()=>Le.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/reorder",{params:{path:i,header:u},body:{ids:d}})),download:d=>ou(()=>Le.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}/download",{params:{path:{...i,file:d},header:u},parseAs:"blob"})),thumb:d=>ou(()=>Le.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}/thumb",{params:{path:{...i,file:d},header:u},parseAs:"blob"}))}}const tR=new Set(["readonly","placeholder","maxlength","minlength","min","max","step","autocomplete","spellcheck","pattern"]);function Hl(e){const t={};for(const[a,n]of Object.entries(e.attributes??{})){const l=a.toLowerCase();!tR.has(l)||n===null||n===!1||(t[l]=n)}return t}function Lt(e){return["w-full rounded-control border bg-surface px-3.5 text-text transition-colors duration-150 ease-out",e?"border-danger":"border-border-strong"].join(" ")}function Xu(e){return typeof e=="string"?e!==""&&e!=="0"&&e.toLowerCase()!=="false":!!e}function t_(e,t){return typeof e=="number"?t?1:0:t}function a_(e,t,a){const n={};if(t===null||typeof t!="object"||Array.isArray(t))return n;const l=t;for(const r of e.permissionOptions??[]){if(a?.has(r.code))continue;const o=Number(l[r.code]);(o===1||e.mode==="radio"&&o===-1)&&(n[r.code]=o)}return n}const aR=new Set(["mltext","mltextarea","mlmarkdown"]);function nR(e){return e!==void 0&&aR.has(e)}function Ll(e){return e?nR(e.type)||!!e.element&&e.translatable===!0:!1}const Es="summer:ml-locale";function lR(e){typeof window>"u"||e===""||window.dispatchEvent(new CustomEvent(Es,{detail:e}))}function mn(e){const t={};if(e===null||typeof e!="object"||Array.isArray(e))return t;for(const[a,n]of Object.entries(e))typeof n=="string"&&(t[a]=n);return t}const rR={class:"flex min-w-0 flex-col"},oR=["for"],sR={key:0,class:"text-danger","aria-hidden":"true"},iR=["id"],uR=["id","name","checked","aria-invalid","aria-describedby"],dR=ae({__name:"CheckboxField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>Xu(a.modelValue));function r(o){n("update:modelValue",t_(a.modelValue,o.target.checked))}return(o,i)=>(f(),b("div",{class:pe([e.invalid?"border-danger":"border-border","flex items-center justify-between gap-4 rounded-inner border px-4 py-3.5"]),"data-toggle-card":""},[g("div",rR,[g("label",{for:e.controlId,class:"font-semibold"},[ye(_(e.field.label||e.field.name),1),e.field.required?(f(),b("span",sR," *")):Y("",!0)],8,oR),e.field.comment?(f(),b("p",{key:0,id:`${e.controlId}-comment`,class:"text-[13px] text-muted"},_(e.field.comment),9,iR)):Y("",!0)]),g("input",{id:e.controlId,type:"checkbox",name:e.field.name,checked:l.value,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"size-5 shrink-0 rounded-[6px] accent-primary",onChange:r},null,40,uR)],2))}});function cR(e){return e==="date"||e==="time"?e:"datetime"}function pa(e,t=2){return String(e).padStart(t,"0")}const fR=/(Z|[+-]\d{2}:?\d{2})$/i;function pR(e,t,a=!1){if(typeof t!="string"||t.trim()==="")return null;const n=t.trim();try{if(e==="date")return p1(n.slice(0,10));if(e==="time"){const r=/(\d{2}:\d{2}(:\d{2})?)/.exec(n.includes("T")?n.slice(n.indexOf("T")):n);return r?q4(r[1]):null}const l=fR.test(n)?n.replace(" ","T"):`${n.replace(" ","T")}Z`;return a?yn(qv(l,"UTC")):qv(l,Qa())}catch{return null}}function Jd(e){return`${pa(e.year,4)}-${pa(e.month)}-${pa(e.day)}`}function Zd(e){return`${pa(e.hour)}:${pa(e.minute)}:${pa(e.second)}`}function Ph(e,t,a=!1){if(!t)return null;if(e==="time")return"hour"in t?Zd(t):null;if(!("year"in t))return null;if(e==="date")return Jd(t);if(a){const r=t instanceof Yn?yn(t):t,o="hour"in r?Zd(r):"00:00:00";return`${Jd(r)}T${o}Z`}const n=t instanceof Yn?t:Wf(t instanceof wt?yn(t):t,Qa()),l=qu(n,"UTC");return`${Jd(l)}T${Zd(l)}Z`}const mR={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm",time:"HH:mm"},vR=/\[([^\]]*)\]|YYYY|YY|MMMM|MMM|MM|M|dddd|ddd|DD|D|HH|H|hh|h|mm|ss|A|a/g;function hR(e){return"year"in e?new wt(e.year,e.month,e.day):null}function Xd(e,t,a,n){return new za(e,{...a,timeZone:"UTC"}).formatToParts(t.toDate("UTC")).find(r=>r.type===n)?.value??""}function gR(e,t,a,n){if(!e)return"";const l=a||mR[t],r=hR(e),o="hour"in e?e:null,i=/D/.test(l.replace(/\[[^\]]*\]/g,""));return l.replace(vR,(u,c)=>{if(c!==void 0)return c;switch(u){case"YYYY":return r?pa(r.year,4):"";case"YY":return r?pa(r.year%100):"";case"MMMM":case"MMM":{if(!r)return"";const d=u==="MMMM"?"long":"short";return i?Xd(n,r,{day:"numeric",month:d},"month"):Xd(n,r,{month:d},"month")}case"MM":return r?pa(r.month):"";case"M":return r?String(r.month):"";case"dddd":case"ddd":return r?Xd(n,r,{weekday:u==="dddd"?"long":"short"},"weekday"):"";case"DD":return r?pa(r.day):"";case"D":return r?String(r.day):"";case"HH":return o?pa(o.hour):"";case"H":return o?String(o.hour):"";case"hh":return o?pa(o.hour%12||12):"";case"h":return o?String(o.hour%12||12):"";case"mm":return o?pa(o.minute):"";case"ss":return o?pa(o.second):"";case"A":return o?o.hour<12?"AM":"PM":"";case"a":return o?o.hour<12?"am":"pm":"";default:return u}})}const yR=new wt(2026,10,4);function bR(e,t){if(typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=6)return t;try{return(7-Ru(yR,e))%7}catch{return 1}}function Ih(e){if(e)try{return p1(e.slice(0,10))}catch{return}}function _R(e,t=Ns(Qa())){const a=Ih(e.minDate),n=Ih(e.maxDate);if(a||n)return{min:a,max:n};const l=e.yearRange??[];return l.length===1&&typeof l[0]=="number"?{min:new wt(t.year-l[0],1,1),max:new wt(t.year+l[0],12,31)}:l.length===2&&typeof l[0]=="number"&&typeof l[1]=="number"?{min:new wt(l[0],1,1),max:new wt(l[1],12,31)}:{}}function tf(e,t,a,n){if(!e||t==="time")return;if(t==="date")return e;const l=new Ol(e.year,e.month,e.day,n?23:0,n?59:0,n?59:0);return a?l:qu(Wf(l,"UTC"),Qa())}function xR(e,t){const a=Ns(Qa());return tf(a,e==="time"?"datetime":e,t,!1)??a}const kR=["id","aria-describedby"],wR={key:0},$R={key:1,class:"text-muted","data-empty":""},CR=["aria-label"],SR={class:"flex size-8 shrink-0 items-center justify-center text-muted","aria-hidden":"true"},ER=["data-mode"],AR=["aria-label"],TR={key:0,"data-datepicker-time":"",class:"mt-3 flex items-center gap-2 border-t border-border pt-3"},qo="flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",MR=ae({__name:"DatepickerField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>cR(a.field.mode)),r=k(()=>l.value==="datetime"&&!!a.field.ignoreTimezone),o=k(()=>Na.value||"pl"),i=k(()=>{const ne=a.field.attributes?.readonly;return!!a.field.readOnly||ne!=null&&ne!==!1}),u=k(()=>pR(l.value,a.modelValue,r.value)),c=k(()=>l.value==="time"?null:u.value),d=k(()=>l.value==="time"?u.value:null),p=k(()=>_R(a.field)),v=k(()=>tf(p.value.min,l.value,r.value,!1)),m=k(()=>tf(p.value.max,l.value,r.value,!0)),y=xR(l.value,r.value),x=k(()=>bR(o.value,a.field.firstDay)),C=k(()=>a.field.twelveHour?12:24),w=k(()=>l.value==="date"?"day":"minute"),S=k(()=>gR(u.value,l.value,a.field.displayFormat,o.value)),q=k(()=>!a.field.required&&u.value!==null&&!i.value),O=k(()=>{const ne=c.value;return ne?!!v.value&&ne.compare(v.value)<0||!!m.value&&ne.compare(m.value)>0:!1}),I=new Set(["day","month","year","hour","minute","second"]),B=E(null),L=E(!1);function W(){const ne=B.value;if(!ne){L.value=!1;return}const fe=Array.from(ne.querySelectorAll("[data-reka-date-field-segment], [data-reka-time-field-segment]")).filter(de=>I.has(de.dataset.rekaDateFieldSegment??de.dataset.rekaTimeFieldSegment??"")),F=fe.filter(de=>!de.hasAttribute("data-placeholder")).length;L.value=F>0&&F<fe.length}function T(){Ge(W)}ze(u,T);const R=k(()=>!!a.invalid||O.value||L.value),G=k(()=>Ph(l.value,u.value,r.value));function A(ne){const fe=Ph(l.value,ne??null,r.value);T(),!(fe===G.value&&(fe!==null||a.modelValue===null))&&n("update:modelValue",fe)}function D(ne){if(!ne||l.value!=="datetime"){A(ne);return}const fe=c.value,F=K.value,de=!fe||fe.year!==ne.year||fe.month!==ne.month||fe.day!==ne.day,ve=!("hour"in ne)||ne.hour!==F.hour||ne.minute!==F.minute;de&&ve&&(ne=re(ne,F)),V.value=ne,A(ne)}function z(){n("update:modelValue",null),T()}const V=E(null);ze(c,ne=>{V.value=ne},{immediate:!0});const K=k(()=>{const ne=V.value??c.value;return ne&&"hour"in ne?new fn(ne.hour,ne.minute):new fn(0,0)});function re(ne,fe){return"hour"in ne?ne.set({hour:fe.hour,minute:fe.minute,second:0,millisecond:0}):new Ol(ne.year,ne.month,ne.day,fe.hour,fe.minute)}function ie(ne){if(!ne)return;const fe=ne instanceof fn?ne:new fn(ne.hour,ne.minute),F=V.value??c.value??y,de=re(F,fe);V.value=de,A(de)}function Ae(ne){return ne.charAt(0).toLocaleUpperCase(o.value)+ne.slice(1)}const _e=k(()=>[Lt(R.value),"h-input flex min-w-0 items-center gap-1 pl-3.5 pr-1.5","focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]","has-[[data-invalid]]:border-danger"]);function xe(ne){return ne==="literal"?"text-muted":ne==="timeZoneName"?"ml-2 min-w-0 truncate text-[13px] text-muted":"rounded-[4px] px-0.5 tabular-nums outline-none focus:bg-sel focus:text-text focus-visible:outline-none data-[placeholder]:text-placeholder focus:data-[placeholder]:text-text"}return(ne,fe)=>i.value?(f(),b("p",{key:0,id:e.controlId,"data-datepicker-readonly":"","aria-describedby":e.describedBy||void 0,class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 tabular-nums"},[S.value!==""?(f(),b("span",wR,_(S.value),1)):(f(),b("span",$R,"—"))],8,kR)):l.value==="time"?(f(),b("div",{key:1,ref_key:"container",ref:B,"data-datepicker":"","data-mode":"time",class:pe(_e.value),onKeyup:T,onFocusout:T},[M(s(kh),{id:e.controlId,"model-value":d.value,locale:o.value,"hour-cycle":C.value,granularity:"minute",name:e.field.name,required:e.field.required||void 0,"aria-invalid":R.value?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"flex min-w-0 flex-1 items-center","onUpdate:modelValue":A},{default:N(({segments:F})=>[(f(!0),b(me,null,Ie(F,de=>(f(),j(s(wh),{key:de.part,part:de.part,class:pe(xe(de.part))},{default:N(()=>[ye(_(de.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["id","model-value","locale","hour-cycle","name","required","aria-invalid","aria-describedby"]),q.value?(f(),b("button",{key:0,type:"button","data-action":"clear","aria-label":s(h)("backend::lang.datepicker.clear"),class:pe(qo),onClick:z},[M(s(qt),{size:16,"aria-hidden":"true"})],8,CR)):Y("",!0),g("span",SR,[M(s(Ui),{size:16})])],34)):(f(),j(s(W6),{key:2,id:e.controlId,"model-value":c.value,"default-placeholder":c.value??s(y),locale:o.value,granularity:w.value,"hour-cycle":C.value,"hide-time-zone":l.value!=="datetime"||r.value,"min-value":v.value,"max-value":m.value,"week-starts-on":x.value,name:e.field.name,required:e.field.required||void 0,"close-on-select":l.value==="date","prevent-deselect":"","onUpdate:modelValue":D},{default:N(()=>[g("div",{ref_key:"container",ref:B,"data-datepicker":"","data-mode":l.value,class:pe(_e.value),onKeyup:T,onFocusout:T},[M(s(dM),{"aria-invalid":R.value?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"flex min-w-0 flex-1 items-center overflow-hidden"},{default:N(({segments:F})=>[(f(!0),b(me,null,Ie(F,de=>(f(),j(s(CM),{key:de.part,part:de.part,class:pe(xe(de.part))},{default:N(()=>[ye(_(de.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["aria-invalid","aria-describedby"]),q.value?(f(),b("button",{key:0,type:"button","data-action":"clear","aria-label":s(h)("backend::lang.datepicker.clear"),class:pe(qo),onClick:z},[M(s(qt),{size:16,"aria-hidden":"true"})],8,AR)):Y("",!0),M(s(PM),{"data-action":"open-calendar","aria-label":s(h)("backend::lang.datepicker.open_calendar"),class:pe(qo)},{default:N(()=>[M(s(yb),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])],42,ER),M(s(iM),{"data-datepicker-calendar":"","side-offset":4,align:"end",class:"z-50 w-[284px] rounded-inner border border-border bg-surface p-4 text-text shadow-menu"},{default:N(()=>[M(s(Y6),null,{default:N(({weekDays:F,grid:de})=>[M(s(xM),{class:"flex h-9 items-center justify-between"},{default:N(()=>[M(s(TM),{"aria-label":s(h)("backend::lang.datepicker.prev_month"),class:pe(qo)},{default:N(()=>[M(s(Is),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"]),M(s(wM),{class:"font-semibold"},{default:N(({headingValue:ve})=>[ye(_(Ae(ve)),1)]),_:1}),M(s(EM),{"aria-label":s(h)("backend::lang.datepicker.next_month"),class:pe(qo)},{default:N(()=>[M(s(vr),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),_:1}),(f(!0),b(me,null,Ie(de,ve=>(f(),j(s(fM),{key:ve.value.toString(),class:"mt-2 w-full border-collapse select-none"},{default:N(()=>[M(s(hM),null,{default:N(()=>[M(s(yh),{class:"flex"},{default:N(()=>[(f(!0),b(me,null,Ie(F,Z=>(f(),j(s(bM),{key:Z,class:"flex h-9 w-9 items-center justify-center text-[13px] font-normal text-muted"},{default:N(()=>[ye(_(Z),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),M(s(mM),null,{default:N(()=>[(f(!0),b(me,null,Ie(ve.rows,(Z,he)=>(f(),j(s(yh),{key:`week-${he}`,class:"flex"},{default:N(()=>[(f(!0),b(me,null,Ie(Z,J=>(f(),j(s(Z6),{key:J.toString(),date:J,class:"p-0"},{default:N(()=>[M(s(Q6),{day:J,month:ve.value,class:"flex size-9 items-center justify-center rounded-pager tabular-nums text-text transition-colors duration-150 ease-out hover:bg-hover data-[outside-view]:text-placeholder data-[today]:font-semibold data-[today]:shadow-[inset_0_0_0_1px_var(--c-border-strong)] data-[selected]:bg-primary data-[selected]:font-semibold data-[selected]:text-on-primary data-[disabled]:cursor-not-allowed data-[disabled]:text-placeholder data-[disabled]:opacity-40 data-[disabled]:hover:bg-transparent data-[unavailable]:cursor-not-allowed data-[unavailable]:opacity-40"},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1}),l.value==="datetime"?(f(),b("div",TR,[M(s(Ui),{size:16,class:"shrink-0 text-muted","aria-hidden":"true"}),M(s(kh),{"model-value":K.value,locale:o.value,"hour-cycle":C.value,granularity:"minute","hide-time-zone":"",class:"flex min-w-0 items-center","onUpdate:modelValue":ie},{default:N(({segments:F})=>[(f(!0),b(me,null,Ie(F,de=>(f(),j(s(wh),{key:de.part,part:de.part,class:pe(xe(de.part))},{default:N(()=>[ye(_(de.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["model-value","locale","hour-cycle"])])):Y("",!0)]),_:1})]),_:1},8,["id","model-value","default-placeholder","locale","granularity","hour-cycle","hide-time-zone","min-value","max-value","week-starts-on","name","required","close-on-select"]))}}),Bs=Symbol("summer.form.values"),Rp=Symbol("summer.form.patch"),Qu=Symbol("summer.form.locale"),n_=Symbol("summer.form.partialReload"),su=Symbol("summer.form.enabledLocales"),l_=Symbol("summer.form.assets");function qp(){const e=E(0);return{activeUploads:e,beginUpload(){e.value++;let t=!1;return()=>{t||(t=!0,e.value>0&&e.value--)}}}}const _o=Symbol("summer.form.session"),r_=Symbol("summer.settings.secrets"),Lp=Symbol("summer.form.permissionLocks"),Np=Symbol("summer.form.triggerNotes"),Rh="summer-action",DR="summer-result",qh="summer-change",Lh="summer-upload",OR="summer-upload-result",Nh="summer-media-pick",Bh="summer-media-pick-result",o_=5e3,Bp=Symbol("summer.form.feedback"),Fs=Symbol("summer.form.fieldScope"),Fp=Symbol("summer.form.rememberLabel"),s_=Symbol("summer.form.dependentCache"),PR=["data-dependent"],IR={class:"relative"},RR=["id","name","value","disabled","required","aria-required","aria-invalid","aria-busy","aria-describedby"],qR={key:0,value:"state",class:"text-muted"},LR=["value"],NR=["id"],BR={key:1,class:"flex flex-wrap items-center gap-2"},FR=["id"],di="empty",ci="placeholder",VR=ae({__name:"DropdownField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=" ".repeat(4),r=ct(Fs,null),o=ct(Bp,null),i=ct(s_,null)??new Map,u=k(()=>a.field.dependsOn??""),c=k(()=>u.value!==""),d=E("waiting"),p=E([]),v=k(()=>{const K=r?.values.value[u.value];return K==null||K===""||typeof K=="object"?null:String(K)}),m=k(()=>r?.fields.value.find(K=>K.name===u.value)),y=k(()=>m.value?.label||u.value),x=k(()=>(m.value?.options??[]).find(re=>w(re.value,v.value))?.label??v.value??""),C=k(()=>c.value?p.value:a.field.options??[]);function w(K,re){return K==null||re===null||re===void 0?K===re||K==null&&re==null:String(K)===String(re)}function S(){return a.modelValue!==null&&a.modelValue!==void 0&&a.modelValue!==""}function q(){S()&&(n("update:modelValue",null),o?.announce(h("backend::lang.form.dependent_cleared",{field:a.field.label||a.field.name})))}function O(K,re){if(!K.applies){p.value=[],d.value="unused",re&&q();return}p.value=K.options.map(ie=>({value:ie.value,label:l.repeat(Math.max(0,ie.depth))+ie.label})),d.value=p.value.length>0?"ready":"empty",re&&S()&&!p.value.some(ie=>w(ie.value,a.modelValue))&&q()}let I=0,B=!1;async function L(K){const re=++I,ie=v.value;if(ie===null){p.value=[],d.value="waiting",K&&q();return}const Ae=r?.path(a.field.name)??a.field.name,_e=`${Ae}\0${ie}`,xe=i.get(_e);if(xe){O(xe,K);return}if(!a.source){B=K,d.value="failed";return}d.value="loading";try{const{data:ne}=await Le.GET("/{vendor}/{plugin}/{controller}/fields/{field}/dependent-options",{params:{path:{...a.source,field:Ae},query:{[`values[${u.value}]`]:ie}}});if(re!==I)return;if(!ne){B=K,d.value="failed";return}i.set(_e,ne.data),O(ne.data,K)}catch{re===I&&(B=K,d.value="failed")}}function W(){L(B)}ze(v,(K,re)=>{c.value&&K!==re&&L(!0)}),$t(()=>{c.value&&L(!1)}),Dt(()=>{I++});const T=k(()=>{const K=C.value.findIndex(re=>w(re.value,a.modelValue));return K>=0?String(K):a.field.emptyOption!==void 0&&!S()?di:ci}),R=k(()=>{switch(d.value){case"waiting":return h("backend::lang.form.dependent_waiting",{field:y.value});case"loading":return h("backend::lang.form.loading_options");case"unused":return h("backend::lang.form.dependent_not_used");case"empty":return h("backend::lang.form.dependent_empty",{type:x.value});case"failed":return h("backend::lang.form.dependent_failed");default:return""}}),G=k(()=>c.value&&d.value!=="ready"),A=k(()=>G.value||T.value===di||T.value===ci),D=k(()=>`${a.controlId}-dependent`),z=k(()=>[a.describedBy??"",c.value&&(d.value==="empty"||d.value==="failed")?D.value:""].filter(Boolean).join(" "));function V(K){const re=K.target.value;if(re===di){n("update:modelValue",null);return}const ie=C.value[Number(re)];ie&&n("update:modelValue",ie.value)}return(K,re)=>(f(),b("div",{class:"flex flex-col gap-1.5","data-dependent":c.value?d.value:void 0},[g("div",IR,[g("select",{id:e.controlId,name:e.field.name,value:G.value?"state":T.value,disabled:G.value||void 0,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-busy":c.value&&d.value==="loading"?"true":void 0,"aria-describedby":z.value||void 0,class:pe([[s(Lt)(e.invalid),A.value?"text-muted":""],"h-input appearance-none pr-10 disabled:cursor-not-allowed"]),onChange:V},[G.value?(f(),b("option",qR,_(R.value),1)):(f(),b(me,{key:1},[e.field.emptyOption!==void 0?(f(),b("option",{key:0,value:di,class:"text-muted"},_(e.field.emptyOption),1)):Y("",!0),T.value===ci?(f(),b("option",{key:1,value:ci,disabled:""},_(s(h)("backend::lang.form.select_placeholder")),1)):Y("",!0),(f(!0),b(me,null,Ie(C.value,(ie,Ae)=>(f(),b("option",{key:Ae,value:String(Ae),class:"text-text"},_(ie.label),9,LR))),128))],64))],42,RR),M(s(Gn),{size:16,class:"pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"})]),c.value&&d.value==="empty"?(f(),b("p",{key:0,id:D.value,"data-dependent-hint":"",class:"text-[13px] text-muted"},_(R.value),9,NR)):c.value&&d.value==="failed"?(f(),b("div",BR,[g("p",{id:D.value,role:"alert",class:"flex items-center gap-1.5 text-[13px] text-danger"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.form.dependent_failed")),1)],8,FR),M(Ke,{variant:"ghost",size:"sm",icon:s(ki),"data-action":"dependent-retry",onClick:W},{default:N(()=>[ye(_(s(h)("backend::lang.form.dependent_retry")),1)]),_:1},8,["icon"])])):Y("",!0)],8,PR))}}),zR={class:"flex items-start gap-3"},jR={class:"flex min-w-0 flex-1 flex-col gap-1"},UR={key:0,class:"flex items-center gap-4"},HR=["src"],KR={key:1,class:"flex size-16 shrink-0 items-center justify-center rounded-inner bg-subtle","aria-hidden":"true"},WR=["title"],GR={class:"flex flex-col gap-1.5"},YR=["for"],JR=["id","disabled","aria-invalid","aria-describedby"],ZR=["id"],XR={class:"flex flex-col gap-1.5"},QR=["for"],eq=["id","disabled","aria-invalid","aria-describedby"],tq=["id"],aq={class:"flex gap-2.5"},nq=["disabled"],lq=["aria-keyshortcuts","title","disabled"],rq=ae({__name:"FileCaptionModal",props:{open:{type:Boolean},file:{},routes:{},preview:{},idPrefix:{}},emits:["update:open","saved","closed"],setup(e,{emit:t}){const a=e,n=t,l=E(""),r=E(""),o=E({}),i=E(!1),u=ol();function c(C){const w={};for(const[S,q]of Object.entries(C??{})){const O=(Array.isArray(q)?q:[q]).filter(I=>typeof I=="string"&&I!=="");O.length>0&&(w[S]=O)}return w}const d=k(()=>`${a.idPrefix}-caption-title`),p=k(()=>`${a.idPrefix}-caption-description`),v=k(()=>!!a.file&&(l.value!==a.file.title||r.value!==a.file.description));ze(()=>a.open,C=>{C&&a.file&&(l.value=a.file.title??"",r.value=a.file.description??"",o.value={},i.value=!1)},{immediate:!0});async function m(C){if(C){n("update:open",!0);return}i.value||v.value&&!await u.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})||n("update:open",!1)}async function y(){if(!(i.value||!a.file||!a.routes)){i.value=!0;try{const C=await a.routes.update(a.file.id,{title:l.value,description:r.value});if(C.data){o.value={},n("saved",C.data),n("update:open",!1),Oe(h("backend::lang.fileupload.details_saved"));return}if(C.status===422){o.value=c(C.error?.details),Object.keys(o.value).length===0&&(o.value={title:[Ip(C.error)||h("backend::lang.form.error_generic")]});return}Oe(C.error?.message||h("backend::lang.form.error_generic"),"danger")}finally{i.value=!1}}}function x(C){C.preventDefault(),n("closed")}return(C,w)=>(f(),b(me,null,[M(s(al),{open:e.open,"onUpdate:open":m},{default:N(()=>[M(s(zl),null,{default:N(()=>[M(s(ll),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),M(s(nl),{"data-caption-modal":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop",onCloseAutoFocus:x},{default:N(()=>[g("div",zR,[g("div",jR,[M(s(bn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(s(h)("backend::lang.fileupload.attachment")),1)]),_:1}),M(s(hn),{class:"text-muted"},{default:N(()=>[ye(_(s(h)("backend::lang.fileupload.help")),1)]),_:1})]),M(s(Pl),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),disabled:i.value,class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:N(()=>[M(s(qt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","disabled"])]),e.file?(f(),b("div",UR,[e.preview?(f(),b("img",{key:0,src:e.preview,alt:"",class:"size-16 shrink-0 rounded-inner object-cover"},null,8,HR)):(f(),b("span",KR,[M(s(Ia),{size:16,class:"text-muted"})])),g("span",{class:"min-w-0 truncate text-[13px] text-muted",title:e.file.file_name},_(e.file.file_name),9,WR)])):Y("",!0),g("form",{class:"flex flex-col gap-4",novalidate:"",onSubmit:mt(y,["prevent"])},[g("div",GR,[g("label",{for:d.value,class:"font-semibold"},_(s(h)("backend::lang.fileupload.title_label")),9,YR),Jt(g("input",{id:d.value,"onUpdate:modelValue":w[0]||(w[0]=S=>l.value=S),type:"text","data-caption-title":"",disabled:i.value,"aria-invalid":o.value.title?"true":void 0,"aria-describedby":o.value.title?`${d.value}-error`:void 0,class:pe([s(Lt)(!!o.value.title),"h-input"])},null,10,JR),[[Ua,l.value]]),o.value.title?(f(),b("p",{key:0,id:`${d.value}-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(o.value.title.join(" ")),1)],8,ZR)):Y("",!0)]),g("div",XR,[g("label",{for:p.value,class:"font-semibold"},_(s(h)("backend::lang.fileupload.description_label")),9,QR),Jt(g("textarea",{id:p.value,"onUpdate:modelValue":w[1]||(w[1]=S=>r.value=S),rows:"3","data-caption-description":"",disabled:i.value,"aria-invalid":o.value.description?"true":void 0,"aria-describedby":o.value.description?`${p.value}-error`:void 0,class:pe([s(Lt)(!!o.value.description),"min-h-input resize-y py-2.5"])},null,10,eq),[[Ua,r.value]]),o.value.description?(f(),b("p",{key:0,id:`${p.value}-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(o.value.description.join(" ")),1)],8,tq)):Y("",!0)]),g("div",aq,[g("button",{type:"button","data-action":"cancel",disabled:i.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:w[2]||(w[2]=S=>m(!1))},_(s(h)("backend::lang.form.cancel")),9,nq),g("button",{type:"submit","data-action":"save-caption","data-hotkey":"mod+s mod+enter","aria-keyshortcuts":s(Ju)("mod+s mod+enter"),title:s(Ha)(s(h)("backend::lang.fileupload.details_submit"),"mod+s"),disabled:i.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"},_(i.value?s(h)("backend::lang.form.saving"):s(h)("backend::lang.fileupload.details_submit")),9,lq)])],32)]),_:1})]),_:1})]),_:1},8,["open"]),M(Sn,{open:s(u).request.value!==null,message:s(u).request.value?.message??"","confirm-label":s(u).request.value?.confirmLabel,danger:s(u).request.value?.danger,onConfirm:s(u).confirm,onCancel:s(u).cancel},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])],64))}}),oq=["id","data-field-name","aria-labelledby","aria-describedby","aria-busy"],sq={key:0,"data-fileupload-loading":"",class:"h-[112px] rounded-control bg-skel","aria-hidden":"true"},iq={key:1,role:"alert","data-fileupload-failed":"",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},uq={key:0,"data-fileupload-empty":"",class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 text-muted"},dq={key:1,"data-fileupload-grid":"",class:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-4"},cq=["data-file-item","data-state","onDragover","onDrop"],fq={class:"relative flex aspect-square items-center justify-center bg-subtle"},pq=["href","aria-label"],mq=["src","alt","onError"],vq=["aria-label","onClick"],hq=["src","alt"],gq={key:2,"data-preview-unavailable":"",class:"flex flex-col items-center gap-2 text-[13px] text-muted"},yq=["data-handle","aria-label","onKeydown","onDragstart"],bq={key:5,class:"absolute top-2 right-2 flex gap-1"},_q=["data-caption","aria-label","onClick"],xq=["aria-label","onClick"],kq=["aria-label","onClick"],wq={class:"flex flex-col gap-1 p-2"},$q=["title"],Cq={class:"flex items-center gap-2 text-[13px] text-muted tabular-nums"},Sq={key:0},Eq={key:1},Aq={key:2},Tq={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},Mq={key:1,"data-file-error":"",class:"text-[13px] text-danger"},Dq={class:"sr-only"},Oq={key:2,"data-fileupload-single":"",class:"flex flex-col gap-2"},Pq=["data-file-item","data-state"],Iq=["src","alt","onError"],Rq={key:3,"data-preview-unavailable":"",class:"flex flex-col items-center gap-2 text-[13px] text-muted"},qq={class:"flex min-w-0 flex-1 flex-col gap-1"},Lq=["title"],Nq={class:"flex items-center gap-2 text-[13px] text-muted tabular-nums"},Bq={key:0},Fq={key:1},Vq={key:2},zq={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},jq={key:1,"data-file-error":"",class:"text-[13px] text-danger"},Uq={class:"sr-only"},Hq={key:2,class:"mt-1 flex flex-wrap gap-2"},Kq={key:3,"data-fileupload-rows":"",class:"flex flex-col gap-2"},Wq=["data-file-item","data-state","onDragover","onDrop"],Gq={class:"flex items-center gap-3"},Yq=["data-handle","aria-label","onKeydown","onDragstart"],Jq={class:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-pager bg-subtle"},Zq=["src","onError"],Xq={class:"flex min-w-0 flex-1 flex-col leading-tight"},Qq=["title"],eL=["title"],tL=["title"],aL={class:"flex shrink-0 items-center gap-2 text-[13px] text-muted tabular-nums"},nL={key:0},lL={key:1},rL={key:2},oL={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},sL={class:"flex shrink-0 items-center gap-1"},iL=["href","aria-label"],uL=["aria-label","onClick"],dL=["data-caption","aria-label","onClick"],cL=["aria-label","onClick"],fL=["aria-label","onClick"],pL={key:1,"data-file-error":"",class:"text-[13px] text-danger"},mL={class:"sr-only"},vL=["aria-describedby"],hL={class:"flex size-10 items-center justify-center rounded-full bg-surface","aria-hidden":"true"},gL={class:"text-text"},yL={key:0,"data-fileupload-limits":"",class:"text-[13px] text-muted tabular-nums"},bL={key:5,"data-fileupload-limits":"",class:"text-[13px] text-muted tabular-nums"},_L={key:6,role:"alert","data-fileupload-too-many":"",class:"flex items-center gap-1.5 text-[13px] text-danger"},xL=["accept","multiple"],kL={class:"sr-only","aria-live":"polite","data-fileupload-live":""},wL=1<<20,$L=400,Qd="inline-flex size-8 items-center justify-center rounded-pager border border-border bg-surface text-muted hover:text-text",CL="inline-flex size-8 items-center justify-center rounded-pager border border-border bg-surface text-muted hover:bg-danger-soft hover:text-danger",Pr="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted hover:bg-hover hover:text-text",SL=ae({__name:"FileuploadField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=ct(_o,null),n=["jpg","jpeg","png","gif","webp"],l=["image/jpeg","image/png","image/gif","image/webp"];let r=1;const o=E([]),i=E("loading"),u=E(!1),c=E(0),d=E(""),p=E(null),v=E(null),m=E(null),y=E(null),x=E(null),C=E(!1),w=E({}),S=E(new Set),q=E(new Set),O=new Set,I=[],B=a?a.routes(t.field.name):null;let L=null,W=null,T=!1,R=null,G=0,A=!1;const D=k(()=>{const Q=t.field.attributes?.readonly;return!!t.field.readOnly||Q!=null&&Q!==!1}),z=k(()=>t.field.multiple===!0),V=k(()=>t.field.mode==="image"),K=k(()=>z.value?t.field.maxFiles:1),re=k(()=>(a?.recordId??0)!==0),ie=k(()=>o.value.filter(Q=>Q.state!=="failed")),Ae=k(()=>{if(z.value)return o.value;const Q=ie.value,Re=Q[Q.length-1];return o.value.filter(le=>le.state==="failed"||le===Re)}),_e=k(()=>Ae.value.filter(Q=>Q.state!=="failed").length),xe=k(()=>D.value||i.value!=="ready"?!1:z.value?K.value===void 0||K.value===null||ie.value.length<K.value:_e.value===0),ne=k(()=>z.value&&!D.value&&typeof K.value=="number"&&ie.value.length>=K.value),fe=k(()=>t.field.fileTypes?.length?t.field.fileTypes.map(Q=>Q.toLowerCase()):V.value&&!t.field.mimeTypes?.length?n:null),F=k(()=>(t.field.fileTypes?.length?t.field.fileTypes:t.field.mimeTypes??[]).join(", ")),de=k(()=>{const Q=[];for(const Re of t.field.fileTypes??[])Q.push(`.${Re.toLowerCase()}`);for(const Re of t.field.mimeTypes??[])Q.push(Re.includes("/")?Re:`.${Re.toLowerCase()}`);return Q.length===0&&V.value&&Q.push(...l),Q.length>0?Q.join(","):void 0}),ve=k(()=>t.field.prompt||h(z.value?"backend::lang.fileupload.default_prompt_many":"backend::lang.fileupload.default_prompt"));function Z(Q,Re){return new Intl.NumberFormat(Na.value,{minimumFractionDigits:Re,maximumFractionDigits:Re}).format(Q)}function he(Q){const Re=["B","kB","MB","GB"];let le=Q,Ve=0;for(;le>=1e3&&Ve<Re.length-1;)le/=1e3,Ve++;return`${Z(le,Ve===0?0:1)} ${Re[Ve]}`}const J=k(()=>{const Q=t.field.maxFilesize;return typeof Q=="number"?`${new Intl.NumberFormat(Na.value).format(Q)} MB`:""}),ee=k(()=>{const Q=[];return F.value!==""&&Q.push(h("backend::lang.fileupload.limits_types",{types:F.value})),J.value!==""&&Q.push(h("backend::lang.fileupload.limits_size",{size:J.value})),z.value&&typeof K.value=="number"&&Q.push(h("backend::lang.fileupload.limits_count",{current:ie.value.length,max:K.value})),Q.join(" · ")});function te(Q){const Re=Q.lastIndexOf(".");return Re<0?"":Q.slice(Re+1).toLowerCase()}function $(Q){const Re=t.field.mimeTypes??[];if(Re.length===0||Q.type==="")return!0;const le=Q.type.toLowerCase(),Ve=te(Q.name);return Re.some(st=>{const Nt=st.toLowerCase();return Nt.includes("/")?Nt.endsWith("/*")?le.startsWith(Nt.slice(0,-1)):le===Nt:Nt===Ve})}function P(Q){const Re=fe.value;if(Re&&!Re.includes(te(Q.name)))return h("backend::lang.fileupload.wrong_type",{name:Q.name,types:Re.join(", ")});if(!$(Q))return h("backend::lang.fileupload.wrong_type",{name:Q.name,types:F.value});const le=t.field.maxFilesize;return typeof le=="number"&&Q.size>Math.ceil(le*wL)?h("backend::lang.fileupload.too_large",{name:Q.name,size:J.value}):""}function U(Q){return Ka({uid:r++,name:Q.file_name,size:Q.file_size,state:"done",progress:100,error:"",retryable:!1,file:Q,source:null,handle:null,uploadId:""})}function ce(){return globalThis.crypto?.randomUUID?.()??`u${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}function X(Q,Re){return Ka({uid:r++,name:Q.name,size:Q.size,state:Re===""?"queued":"failed",progress:0,error:Re,retryable:!1,file:null,source:Ti(Q),handle:null,uploadId:ce()})}function oe(Q){return o.value.find(Re=>Re.uid===Q)}async function ke(Q){if(!B){i.value="failed";return}Q&&(i.value="loading");const Re=await B.list();if(A)return;if(!Re.data){Q&&(i.value="failed");return}const le=o.value.filter(Ve=>Ve.state!=="done");for(const Ve of o.value)Ve.state==="done"&&An(Ve.uid);o.value=[...Re.data.map(U),...le],i.value="ready"}function Se(){D.value||p.value?.click()}function Te(Q){if(Q.length===0||D.value)return;if(c.value=0,!z.value)for(const st of[...o.value])st.state!=="failed"&&(st.state!=="done"||st.file?.pending)&&$e(st);let Re=z.value?typeof K.value=="number"?Math.max(K.value-ie.value.length,0):Number.POSITIVE_INFINITY:1,le=0;const Ve=[];for(const st of Q.slice(0,z.value?Q.length:1)){const Nt=P(st);if(Nt===""&&Re<=0){le++;continue}Nt===""&&Re--,Ve.push(X(st,Nt))}o.value=[...o.value,...Ve],c.value=le,Ue()}function se(Q){const Re=Q.target;Te(Array.from(Re.files??[])),Re.value=""}function Me(Q){return m.value===null&&Array.from(Q.dataTransfer?.types??[]).includes("Files")}function Ce(Q){Me(Q)&&(Q.preventDefault(),u.value=!0)}function Fe(Q){Me(Q)&&(Q.preventDefault(),u.value=!1,Te(Array.from(Q.dataTransfer?.files??[])))}function Ue(){if(!B||o.value.some(Re=>Re.state==="uploading"))return;const Q=o.value.find(Re=>Re.state==="queued");Q&&Ze(Q)}async function Ze(Q){if(!B||!Q.source)return;Q.state="uploading",Q.progress=0,Q.error="",Q.retryable=!1;const Re=new Set(o.value.filter(Ve=>Ve.file).map(Ve=>Ve.file.id)),le=a?.beginUpload();try{const Ve=B.upload(Q.source,(en,dl)=>{Q.progress=dl>0?Math.min(100,Math.round(en/dl*100)):0},Q.uploadId||void 0);Q.handle=Ti(Ve);const st=await Ve.promise;Q.handle=null;const Nt=!!oe(Q.uid);if(st.ok)!Nt||A?B.remove(st.item.id):(Q.state="done",Q.progress=100,Q.file=st.item,Q.name=st.item.file_name,Q.size=st.item.file_size,a?.markDirty());else if(st.reason==="aborted"||st.reason==="network"){const en=await at(Re);if(st.reason==="aborted"){for(const dl of en)B.remove(dl.id);o.value=o.value.filter(dl=>dl.uid!==Q.uid),An(Q.uid)}else Nt&&en[0]&&en.length===1?(Q.state="done",Q.progress=100,Q.file=en[0],Q.name=en[0].file_name,Q.size=en[0].file_size,a?.markDirty()):(Q.state="failed",Q.error=h("backend::lang.fileupload.upload_failed"),Q.retryable=!0)}else if(Nt)switch(Q.state="failed",st.reason){case"too_large":Q.error=J.value?h("backend::lang.fileupload.too_large",{name:Q.name,size:J.value}):st.message||h("backend::lang.fileupload.upload_failed");break;case"invalid":Q.error=st.message||h("backend::lang.fileupload.upload_failed");break;default:Q.error=st.message||h("backend::lang.fileupload.upload_failed"),Q.retryable=st.status>=500}}finally{le?.(),A||Ue()}}async function at(Q){if(!B)return[];const Re=await B.list();return Re.data?Re.data.filter(le=>le.pending&&!Q.has(le.id)):[]}function nt(Q){Q.state!=="failed"||!Q.source||(Q.state="queued",Q.error="",Q.retryable=!1,Ue())}async function $e(Q){const Re=o.value.findIndex(Ve=>Ve.uid===Q.uid);if(Re<0)return;switch(o.value=o.value.filter(Ve=>Ve.uid!==Q.uid),An(Q.uid),Q.state){case"uploading":Q.handle?.abort(),a?.markDirty(),Ue();return;case"queued":case"failed":return}if(!B||!Q.file)return;a?.markDirty();const le=await B.remove(Q.file.id);if(!le.data&&!A){const Ve=[...o.value];Ve.splice(Math.min(Re,Ve.length),0,Q),o.value=Ve,Oe(le.error?.message||h("backend::lang.form.error_generic"),"danger")}}function ge(){return o.value.map(Q=>Q.uid)}function be(Q){const Re=new Map(o.value.map(st=>[st.uid,st])),le=Q.map(st=>Re.get(st)).filter(st=>!!st),Ve=o.value.filter(st=>!Q.includes(st.uid));o.value=[...le,...Ve]}function We(){L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,Be()},$L)}function it(){return o.value.filter(Q=>Q.state==="done"&&Q.file).map(Q=>Q.file.id)}async function Be(){if(!B)return;const Q=it();if(T){R=Q;return}const Re=W;W=null;const le=++G;T=!0;try{const Ve=await B.reorder(Q);if(R)return;!Ve.data&&!A&&le===G&&(Re&&be(Re),Oe(h("backend::lang.fileupload.reorder_failed"),"danger"))}finally{T=!1,R&&(R=null,Be())}}function He(Q,Re){const le=o.value.findIndex(Nt=>Nt.uid===Q);if(le<0||Re<0||Re>=o.value.length||Re===le)return!1;W===null&&(W=ge());const Ve=[...o.value],[st]=Ve.splice(le,1);return Ve.splice(Re,0,st),o.value=Ve,d.value=h("backend::lang.fileupload.moved",{name:st.name,position:Re+1,total:Ve.length}),We(),!0}async function Je(Q,Re){const le=o.value.findIndex(st=>st.uid===Re.uid);let Ve;switch(Q.key){case"ArrowUp":case"ArrowLeft":Ve=le-1;break;case"ArrowDown":case"ArrowRight":Ve=le+1;break;default:return}Q.preventDefault(),He(Re.uid,Ve)&&(await Ge(),v.value?.querySelector(`[data-handle="${Re.uid}"]`)?.focus())}function Ot(Q,Re){m.value=Re.uid,Q.dataTransfer&&(Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData("text/plain",Re.name))}function Gt(Q,Re){m.value!==null&&(Q.preventDefault(),y.value=Re.uid)}function sl(Q,Re){m.value!==null&&(Q.preventDefault(),He(m.value,o.value.findIndex(le=>le.uid===Re.uid)),En())}function En(){m.value=null,y.value=null}function Fa(Q){const Re=Q.file?.content_type??Q.source?.type??"";return l.includes(Re.toLowerCase())}function Yt(Q){return!Q.file||!Fa(Q)||S.value.has(Q.uid)?null:!t.field.protected&&!q.value.has(Q.uid)?Q.file.thumb_url||Q.file.url||null:w.value[Q.uid]??null}function il(){return typeof URL.revokeObjectURL=="function"}function An(Q){const Re=w.value[Q];if(Re!==void 0){il()&&URL.revokeObjectURL(Re);const le={...w.value};delete le[Q],w.value=le}if(O.delete(Q),q.value.has(Q)){const le=new Set(q.value);le.delete(Q),q.value=le}}async function ul(Q){if(!B||!Q.file||O.has(Q.uid)||typeof URL.createObjectURL!="function")return;O.add(Q.uid);const Re=await B.thumb(Q.file.id);if(!(A||!oe(Q.uid)||!O.has(Q.uid))){if(!Re){S.value=new Set([...S.value,Q.uid]);return}w.value={...w.value,[Q.uid]:URL.createObjectURL(Re)}}}ze(()=>o.value.map(Q=>`${Q.uid}:${Q.state}`).join(","),()=>{if(t.field.protected)for(const Q of o.value)Q.state==="done"&&Fa(Q)&&ul(Q)});function De(Q){if(!t.field.protected&&!q.value.has(Q.uid)&&(q.value=new Set([...q.value,Q.uid]),B&&typeof URL.createObjectURL=="function")){ul(Q);return}S.value=new Set([...S.value,Q.uid])}async function je(Q,Re){if(!B||!Q.file||typeof URL.createObjectURL!="function")return;const le=await B.download(Q.file.id);if(!le){Oe(h("backend::lang.form.error_generic"),"danger");return}const Ve=URL.createObjectURL(le);I.push(Ve);const st=document.createElement("a");st.href=Ve,st.rel="noopener",Re?st.download=Q.file.file_name:st.target="_blank",st.click()}function Qe(Q){return t.field.useCaption&&Q.file?.title?Q.file.title:Q.name}function dt(Q){return re.value&&!!Q.file?.pending}const St=k(()=>x.value===null?void 0:oe(x.value));function It(Q){x.value=Q.uid,C.value=!0}function Kl(Q){const Re=St.value;Re&&(Re.file=Q)}function $o(){const Q=x.value;x.value=null,Q!==null&&v.value?.querySelector(`[data-caption="${Q}"]`)?.focus()}const Co=k(()=>{const Q=t.field.thumbOptions?.mode;return Q==="fit"||Q==="auto"?"object-contain":"object-cover"});return $t(()=>{ke(!0)}),a&&ze(a.revision,()=>{ke(!1)}),Dt(()=>{A=!0,L!==null&&(clearTimeout(L),L=null);for(const Q of o.value)Q.handle?.abort();if(il()){for(const Q of Object.values(w.value))URL.revokeObjectURL(Q);for(const Q of I)URL.revokeObjectURL(Q)}}),(Q,Re)=>(f(),b("div",{id:e.controlId,ref_key:"root",ref:v,role:"group","data-fileupload":"","data-field-name":e.field.name,"aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":i.value==="loading"?"true":void 0,class:"flex min-w-0 flex-col gap-4"},[i.value==="loading"?(f(),b("span",sq)):i.value==="failed"?(f(),b("p",iq,_(s(h)("backend::lang.fileupload.load_failed")),1)):(f(),b(me,{key:2},[D.value&&Ae.value.length===0?(f(),b("p",uq,_(s(h)("backend::lang.fileupload.empty")),1)):V.value&&z.value&&Ae.value.length>0?(f(),b("ul",dq,[(f(!0),b(me,null,Ie(Ae.value,le=>(f(),b("li",{key:le.uid,"data-file-item":le.uid,"data-state":le.state,class:pe([[le.state==="failed"?"border-danger":"border-border",m.value===le.uid?"opacity-50":"",y.value===le.uid&&m.value!==le.uid?"border-2 border-dashed border-primary bg-sel":""],"relative overflow-hidden rounded-inner border bg-surface"]),onDragover:Ve=>Gt(Ve,le),onDrop:Ve=>sl(Ve,le)},[g("div",fq,[le.state==="uploading"?(f(),j(s(Vn),{key:0,size:20,class:"animate-spin text-muted","aria-hidden":"true"})):le.state==="failed"?(f(),j(s(bt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):le.state==="done"?(f(),b(me,{key:2},[Yt(le)&&!e.field.protected&&le.file?.url?(f(),b("a",{key:0,href:le.file.url,target:"_blank",rel:"noopener",class:"block size-full","aria-label":s(h)("backend::lang.fileupload.open_preview",{name:le.name})},[g("img",{src:Yt(le)??void 0,alt:Qe(le),class:pe([Co.value,"size-full"]),onError:Ve=>De(le)},null,42,mq)],8,pq)):Yt(le)?(f(),b("button",{key:1,type:"button",class:"block size-full","aria-label":s(h)("backend::lang.fileupload.open_preview",{name:le.name}),onClick:Ve=>je(le,!1)},[g("img",{src:Yt(le)??void 0,alt:Qe(le),class:pe([Co.value,"size-full"])},null,10,hq)],8,vq)):S.value.has(le.uid)?(f(),b("span",gq,[M(s(_v),{size:20,"aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.fileupload.preview_unavailable")),1)])):(f(),j(s(Ia),{key:3,size:20,class:"text-muted","aria-hidden":"true"}))],64)):(f(),j(s(Ia),{key:3,size:20,class:"text-muted","aria-hidden":"true"})),!D.value&&le.state==="done"?(f(),b("button",{key:4,type:"button",draggable:"true","data-handle":le.uid,"aria-label":s(h)("backend::lang.fileupload.move",{name:le.name}),class:pe([Qd,"absolute top-2 left-2 cursor-grab"]),onKeydown:Ve=>Je(Ve,le),onDragstart:Ve=>Ot(Ve,le),onDragend:En},[M(s(Hi),{size:16,"aria-hidden":"true"})],40,yq)):Y("",!0),D.value?Y("",!0):(f(),b("div",bq,[e.field.useCaption&&le.state==="done"?(f(),b("button",{key:0,type:"button","data-caption":le.uid,"aria-label":s(h)("backend::lang.fileupload.edit_details",{name:le.name}),class:pe(Qd),onClick:Ve=>It(le)},[M(s(Wr),{size:16,"aria-hidden":"true"})],8,_q)):Y("",!0),le.state==="failed"&&le.retryable?(f(),b("button",{key:1,type:"button","data-action":"retry","aria-label":s(h)("backend::lang.fileupload.retry"),class:pe(Qd),onClick:Ve=>nt(le)},[M(s(ki),{size:16,"aria-hidden":"true"})],8,xq)):Y("",!0),g("button",{type:"button","data-action":"remove-file","aria-label":le.state==="uploading"||le.state==="queued"?s(h)("backend::lang.fileupload.cancel_upload",{name:le.name}):s(h)("backend::lang.form.remove_item",{name:le.name}),class:pe(CL),onClick:Ve=>$e(le)},[M(s(qt),{size:16,"aria-hidden":"true"})],8,kq)]))]),g("div",wq,[g("span",{class:"truncate text-[13px]",title:Qe(le)},_(Qe(le)),9,$q),g("span",Cq,[le.state==="queued"?(f(),b("span",Sq,_(s(h)("backend::lang.fileupload.queued")),1)):le.state==="uploading"?(f(),b("span",Eq,_(s(h)("backend::lang.fileupload.uploading",{percent:le.progress})),1)):(f(),b("span",Aq,_(he(le.size)),1)),dt(le)?(f(),b("span",Tq,_(s(h)("backend::lang.fileupload.unsaved")),1)):Y("",!0)]),le.state==="uploading"?(f(),j(s(Ud),{key:0,"model-value":le.progress,max:100,"aria-label":s(h)("backend::lang.fileupload.uploading",{percent:le.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:N(()=>[M(s(Hd),{class:"h-full bg-primary",style:oa({width:`${le.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Y("",!0),le.state==="failed"?(f(),b("p",Mq,[g("span",Dq,_(s(h)("backend::lang.fileupload.upload_error"))+": ",1),ye(_(le.error),1)])):Y("",!0)])],42,cq))),128))])):V.value&&!z.value&&Ae.value.length>0?(f(),b("div",Oq,[(f(!0),b(me,null,Ie(Ae.value,le=>(f(),b("div",{key:le.uid,"data-file-item":le.uid,"data-state":le.state,class:"flex items-start gap-4"},[g("div",{class:pe([le.state==="failed"?"border-danger":"border-border","flex size-40 shrink-0 items-center justify-center overflow-hidden rounded-inner border bg-subtle"])},[le.state==="uploading"?(f(),j(s(Vn),{key:0,size:20,class:"animate-spin text-muted","aria-hidden":"true"})):le.state==="failed"?(f(),j(s(bt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):Yt(le)?(f(),b("img",{key:2,src:Yt(le)??void 0,alt:Qe(le),class:pe([Co.value,"size-full"]),onError:Ve=>De(le)},null,42,Iq)):S.value.has(le.uid)?(f(),b("span",Rq,[M(s(_v),{size:20,"aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.fileupload.preview_unavailable")),1)])):(f(),j(s(Ia),{key:4,size:20,class:"text-muted","aria-hidden":"true"}))],2),g("div",qq,[g("span",{class:"truncate font-semibold",title:Qe(le)},_(Qe(le)),9,Lq),g("span",Nq,[le.state==="queued"?(f(),b("span",Bq,_(s(h)("backend::lang.fileupload.queued")),1)):le.state==="uploading"?(f(),b("span",Fq,_(s(h)("backend::lang.fileupload.uploading",{percent:le.progress})),1)):(f(),b("span",Vq,_(he(le.size)),1)),dt(le)?(f(),b("span",zq,_(s(h)("backend::lang.fileupload.unsaved")),1)):Y("",!0)]),le.state==="uploading"?(f(),j(s(Ud),{key:0,"model-value":le.progress,max:100,"aria-label":s(h)("backend::lang.fileupload.uploading",{percent:le.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:N(()=>[M(s(Hd),{class:"h-full bg-primary",style:oa({width:`${le.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Y("",!0),le.state==="failed"?(f(),b("p",jq,[g("span",Uq,_(s(h)("backend::lang.fileupload.upload_error"))+": ",1),ye(_(le.error),1)])):Y("",!0),D.value?Y("",!0):(f(),b("div",Hq,[le.state!=="failed"?(f(),j(Ke,{key:0,size:"sm",variant:"outline","data-action":"replace-file",icon:s(ns),onClick:Se},{default:N(()=>[ye(_(s(h)("backend::lang.fileupload.replace_file")),1)]),_:1},8,["icon"])):Y("",!0),le.state==="failed"&&le.retryable?(f(),j(Ke,{key:1,size:"sm",variant:"outline","data-action":"retry",icon:s(ki),onClick:Ve=>nt(le)},{default:N(()=>[ye(_(s(h)("backend::lang.fileupload.retry")),1)]),_:1},8,["icon","onClick"])):Y("",!0),e.field.useCaption&&le.state==="done"?(f(),j(Ke,{key:2,size:"sm",variant:"outline","data-caption":le.uid,icon:s(Wr),onClick:Ve=>It(le)},{default:N(()=>[ye(_(s(h)("backend::lang.fileupload.details_submit")),1)]),_:1},8,["data-caption","icon","onClick"])):Y("",!0),M(Ke,{size:"sm",variant:"danger","data-action":"remove-file",icon:s(qt),onClick:Ve=>$e(le)},{default:N(()=>[ye(_(s(h)("backend::lang.fileupload.remove_file")),1)]),_:1},8,["icon","onClick"])]))])],8,Pq))),128))])):Ae.value.length>0?(f(),b("ul",Kq,[(f(!0),b(me,null,Ie(Ae.value,le=>(f(),b("li",{key:le.uid,"data-file-item":le.uid,"data-state":le.state,class:pe([[le.state==="failed"?"border-danger":"border-border",m.value===le.uid?"opacity-50":"",y.value===le.uid&&m.value!==le.uid?"border-2 border-dashed border-primary bg-sel":""],"flex min-h-14 flex-col justify-center gap-1 rounded-inner border bg-surface px-3 py-2"]),onDragover:Ve=>Gt(Ve,le),onDrop:Ve=>sl(Ve,le)},[g("div",Gq,[z.value&&!D.value&&le.state==="done"?(f(),b("button",{key:0,type:"button",draggable:"true","data-handle":le.uid,"aria-label":s(h)("backend::lang.fileupload.move",{name:le.name}),class:pe([Pr,"cursor-grab"]),onKeydown:Ve=>Je(Ve,le),onDragstart:Ve=>Ot(Ve,le),onDragend:En},[M(s(Hi),{size:16,"aria-hidden":"true"})],40,Yq)):Y("",!0),g("span",Jq,[le.state==="uploading"?(f(),j(s(Vn),{key:0,size:16,class:"animate-spin text-muted","aria-hidden":"true"})):le.state==="failed"?(f(),j(s(bt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):Yt(le)?(f(),b("img",{key:2,src:Yt(le)??void 0,alt:"",class:"size-8 object-cover",onError:Ve=>De(le)},null,40,Zq)):(f(),j(s(Ia),{key:3,size:16,class:"text-muted","aria-hidden":"true"}))]),g("span",Xq,[e.field.useCaption&&le.file?.title?(f(),b(me,{key:0},[g("span",{class:"truncate font-semibold",title:le.file.title},_(le.file.title),9,Qq),g("span",{class:"truncate text-[13px] text-muted",title:le.name},_(le.name),9,eL)],64)):(f(),b("span",{key:1,class:"truncate",title:le.name},_(le.name),9,tL))]),g("span",aL,[le.state==="queued"?(f(),b("span",nL,_(s(h)("backend::lang.fileupload.queued")),1)):le.state==="uploading"?(f(),b("span",lL,_(s(h)("backend::lang.fileupload.uploading",{percent:le.progress})),1)):(f(),b("span",rL,_(he(le.size)),1)),dt(le)?(f(),b("span",oL,_(s(h)("backend::lang.fileupload.unsaved")),1)):Y("",!0)]),!z.value&&!D.value&&le.state!=="failed"?(f(),j(Ke,{key:1,size:"sm",variant:"outline","data-action":"replace-file",icon:s(ns),onClick:Se},{default:N(()=>[ye(_(s(h)("backend::lang.fileupload.replace_file")),1)]),_:1},8,["icon"])):Y("",!0),g("span",sL,[le.state==="done"&&le.file?(f(),b(me,{key:0},[!e.field.protected&&le.file.url?(f(),b("a",{key:0,href:le.file.url,download:"",target:"_blank",rel:"noopener","aria-label":s(h)("backend::lang.fileupload.download",{name:le.name}),class:pe(Pr)},[M(s(Tc),{size:16,"aria-hidden":"true"})],8,iL)):e.field.protected?(f(),b("button",{key:1,type:"button","data-action":"download","aria-label":s(h)("backend::lang.fileupload.download",{name:le.name}),class:pe(Pr),onClick:Ve=>je(le,!0)},[M(s(Tc),{size:16,"aria-hidden":"true"})],8,uL)):Y("",!0),e.field.useCaption&&!D.value?(f(),b("button",{key:2,type:"button","data-caption":le.uid,"aria-label":s(h)("backend::lang.fileupload.edit_details",{name:le.name}),class:pe(Pr),onClick:Ve=>It(le)},[M(s(Wr),{size:16,"aria-hidden":"true"})],8,dL)):Y("",!0)],64)):Y("",!0),le.state==="failed"&&le.retryable?(f(),b("button",{key:1,type:"button","data-action":"retry","aria-label":s(h)("backend::lang.fileupload.retry"),class:pe(Pr),onClick:Ve=>nt(le)},[M(s(ki),{size:16,"aria-hidden":"true"})],8,cL)):Y("",!0),D.value?Y("",!0):(f(),b("button",{key:2,type:"button","data-action":"remove-file","aria-label":le.state==="uploading"||le.state==="queued"?s(h)("backend::lang.fileupload.cancel_upload",{name:le.name}):s(h)("backend::lang.form.remove_item",{name:le.name}),class:pe([Pr,"hover:bg-danger-soft hover:text-danger"]),onClick:Ve=>$e(le)},[M(s(qt),{size:16,"aria-hidden":"true"})],8,fL))])]),le.state==="uploading"?(f(),j(s(Ud),{key:0,"model-value":le.progress,max:100,"aria-label":s(h)("backend::lang.fileupload.uploading",{percent:le.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:N(()=>[M(s(Hd),{class:"h-full bg-primary",style:oa({width:`${le.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Y("",!0),le.state==="failed"?(f(),b("p",pL,[g("span",mL,_(s(h)("backend::lang.fileupload.upload_error"))+": ",1),ye(_(le.error),1)])):Y("",!0)],42,Wq))),128))])):Y("",!0),xe.value?(f(),b("button",{key:4,type:"button","data-fileupload-dropzone":"","aria-describedby":e.describedBy||void 0,class:pe([[u.value?"border-solid border-primary bg-sel":e.invalid?"border-dashed border-danger bg-subtle":"border-dashed border-border-strong bg-subtle"],"flex min-h-[112px] w-full flex-col items-center justify-center gap-2 rounded-control border-[1.5px] px-4 py-6 text-center transition-colors duration-150 ease-out hover:bg-hover"]),onClick:Se,onDragover:Ce,onDragleave:Re[0]||(Re[0]=le=>u.value=!1),onDrop:Fe},[g("span",hL,[M(s(ns),{size:20,class:"text-muted"})]),g("span",gL,_(ve.value),1),ee.value!==""?(f(),b("span",yL,_(ee.value),1)):Y("",!0)],42,vL)):ne.value&&ee.value!==""?(f(),b("p",bL,_(ee.value),1)):Y("",!0),c.value>0?(f(),b("p",_L,[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(wa)("backend::lang.fileupload.too_many",c.value,{max:K.value??0})),1)])):Y("",!0)],64)),g("input",{ref_key:"input",ref:p,type:"file",hidden:"",tabindex:"-1","data-fileupload-input":"",accept:de.value,multiple:z.value||void 0,onChange:se},null,40,xL),g("p",kL,_(d.value),1),e.field.useCaption?(f(),j(rq,{key:3,open:C.value,"onUpdate:open":Re[1]||(Re[1]=le=>C.value=le),file:St.value?.file??null,routes:s(B),preview:St.value?Yt(St.value):null,"id-prefix":e.controlId,onSaved:Kl,onClosed:$o},null,8,["open","file","routes","preview","id-prefix"])):Y("",!0)],8,oq))}}),EL=["id","name","value","required","aria-required","aria-invalid","aria-describedby"],AL=ae({__name:"NumberField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),r=k(()=>Hl(a.field));function o(i){const u=i.target.value.trim();if(u===""){n("update:modelValue",null);return}const c=Number(u);n("update:modelValue",Number.isFinite(c)?c:null)}return(i,u)=>(f(),b("input",Ye({id:e.controlId},r.value,{name:e.field.name,type:"number",inputmode:"decimal",value:l.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(Lt)(e.invalid),"h-input tabular-nums"],onInput:o}),null,16,EL))}}),TL=["id","aria-labelledby","aria-describedby"],ML=ae({__name:"PartialField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=ct(n_,E(0));return(n,l)=>(f(),b("div",{id:e.controlId,role:"group","data-partial-field":"","aria-labelledby":t.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0},[e.source?(f(),j(Pp,{key:0,variant:"field",source:e.source,name:t.field.path||t.field.name,"record-id":e.recordId??null,"reload-key":s(a)},null,8,["source","name","record-id","reload-key"])):(f(),j(Zu,{key:1,"data-partial-failed":"",text:s(h)("backend::lang.extension.partial_failed")},null,8,["text"]))],8,TL))}}),DL={class:"flex min-w-0 flex-col gap-1.5"},OL={class:"relative"},PL=["id","name","type","value","placeholder","disabled","required","aria-required","aria-invalid","aria-describedby"],IL=["aria-pressed","aria-label","disabled"],RL=["id","data-secret-state","role"],qL={key:3},LL=ae({__name:"PasswordField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=E(!1),r=k(()=>typeof a.modelValue=="string"?a.modelValue:""),o=k(()=>Hl(a.field)),i=ct(_o,null);i&&ze(i.revision,()=>{l.value=!1});const u=ct(r_,null),c=k(()=>u?.value[a.field.name]??""),d=k(()=>c.value!==""),p=k(()=>c.value==="stored"&&a.modelValue===null),v=k(()=>`${a.controlId}-secret`),m=k(()=>[a.describedBy??"",d.value?v.value:""].filter(Boolean).join(" ")),y=k(()=>{if(c.value==="stored"&&!p.value)return h("backend::lang.secret.placeholder_stored");const w=o.value.placeholder;return typeof w=="string"?w:void 0});function x(){l.value=!1,n("update:modelValue",null)}function C(){n("update:modelValue","")}return(w,S)=>(f(),b("div",DL,[g("div",OL,[g("input",Ye({id:e.controlId,autocomplete:"new-password",spellcheck:"false"},o.value,{name:e.field.name,type:l.value?"text":"password",value:p.value?"":r.value,placeholder:y.value,disabled:p.value||void 0,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":m.value||void 0,class:[s(Lt)(e.invalid),"h-input pr-12"],onInput:S[0]||(S[0]=q=>n("update:modelValue",q.target.value))}),null,16,PL),g("button",{type:"button","data-password-toggle":"","aria-pressed":l.value?"true":"false","aria-label":s(h)(l.value?"backend::lang.form.hide_password":"backend::lang.form.show_password"),disabled:p.value||void 0,class:"absolute top-1/2 right-1.5 flex size-8 -translate-y-1/2 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:opacity-60",onClick:S[1]||(S[1]=q=>l.value=!l.value)},[(f(),j(Wt(l.value?s(CC):s(EC)),{size:16,"aria-hidden":"true"}))],8,IL)]),d.value?(f(),b("p",{key:0,id:v.value,"data-secret-state":p.value?"clearing":c.value,role:p.value?"status":void 0,class:pe([p.value?"text-danger":"text-muted","flex flex-wrap items-center gap-2 text-[13px]"])},[p.value?(f(),b(me,{key:0},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.secret.clear_pending")),1),M(Ke,{variant:"ghost",size:"sm",icon:s(Lb),"data-action":"secret-undo",onClick:C},{default:N(()=>[ye(_(s(h)("backend::lang.secret.undo")),1)]),_:1},8,["icon"])],64)):c.value==="stored"?(f(),b(me,{key:1},[M(s(cn),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.secret.stored")),1),M(Ke,{variant:"ghost",size:"sm",icon:s(Xa),"data-action":"secret-clear",onClick:x},{default:N(()=>[ye(_(s(h)("backend::lang.secret.clear")),1)]),_:1},8,["icon"])],64)):c.value==="env"?(f(),b(me,{key:2},[M(s(Vl),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.secret.env")),1)],64)):(f(),b("span",qL,_(s(h)("backend::lang.secret.empty")),1))],10,RL)):Y("",!0)]))}}),NL=["aria-labelledby","data-ml-field"],BL={class:"flex flex-wrap items-center gap-2"},FL=["value","aria-label"],VL=["value"],ed=ae({__name:"MLField",props:{inner:{},innerType:{},mlType:{},contentLocale:{type:Boolean},field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>mn(a.modelValue)),r=ct(su,null),o=k(()=>{const w=r?.value;return w&&w.length>0?[...w]:[]}),i=E(o.value[0]??"en"),u=k(()=>`${a.controlId}-label`),c=k(()=>`${a.controlId}-editor`),d=k(()=>l.value[i.value]??""),p=k(()=>({...a.field,type:a.innerType})),v=k(()=>a.contentLocale?{contentLocale:i.value}:{});function m(w){w&&(i.value=w)}function y(w){const S=w.target.value;m(S),lR(S)}function x(w){n("update:modelValue",{...l.value,[i.value]:w})}function C(w){const S=w.detail;typeof S=="string"&&S!==""&&m(S)}return $t(()=>{window.addEventListener(Es,C)}),Qn(()=>{window.removeEventListener(Es,C)}),(w,S)=>(f(),b("div",{class:"flex flex-col gap-1.5",role:"group","aria-labelledby":u.value,"data-ml-field":e.mlType},[g("div",BL,[g("select",{"data-ml-locale":"",class:"rounded-control border border-border-strong bg-surface px-2 py-1 text-[13px]",value:i.value,"aria-label":`Locale for ${e.field.label||e.field.name}`,onChange:y},[(f(!0),b(me,null,Ie(o.value,q=>(f(),b("option",{key:q,value:q},_(q),9,VL))),128))],40,FL)]),(f(),j(Wt(e.inner),Ye({field:p.value,"model-value":d.value,"control-id":c.value,invalid:e.invalid,"described-by":e.describedBy,source:e.source,"record-id":e.recordId},v.value,{"onUpdate:modelValue":x}),null,16,["field","model-value","control-id","invalid","described-by","source","record-id"]))],8,NL))}});async function zL(){const{data:e,error:t,response:a}=await Le.GET("/media/folders");return{data:e?.data??null,error:t,status:a.status}}async function jL(e){const{data:t,error:a,response:n}=await Le.POST("/media/folders",{body:e});return{data:t?.data??null,error:a,status:n.status}}async function UL(e,t){const{data:a,error:n,response:l}=await Le.PUT("/media/folders/{id}",{params:{path:{id:e}},body:t});return{data:a?.data??null,error:n,status:l.status}}async function HL(e){const{data:t,error:a,response:n}=await Le.DELETE("/media/folders/{id}",{params:{path:{id:e}}});return{data:t?.data??null,error:a,status:n.status}}async function KL(e){const{data:t,error:a,response:n}=await Le.GET("/media/items",{params:{query:e}});return{data:t??null,error:a,status:n.status}}async function WL(e,t={}){const a=new FormData;a.append("file",e),typeof t.folderId=="number"&&t.folderId>0&&a.append("folder_id",String(t.folderId)),t.alt&&a.append("alt",t.alt),t.title&&a.append("title",t.title),t.caption&&a.append("caption",t.caption);const{data:n,error:l,response:r}=await Le.POST("/media/items",{body:a});return{data:n?.data??null,error:l,status:r.status}}async function GL(e,t){const{data:a,error:n,response:l}=await Le.PUT("/media/items/{id}",{params:{path:{id:e}},body:t});return{data:a?.data??null,error:n,status:l.status}}async function YL(e){const{data:t,error:a,response:n}=await Le.DELETE("/media/items/{id}",{params:{path:{id:e}}});return{data:t?.data??null,error:a,status:n.status}}function Mn(e,t){const a=e?.error;return a?.details?.message||a?.message||t}function af(e){return!Number.isFinite(e)||e<0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function i_(e){const t=new Map,a=new Set(e.map(o=>o.id));for(const o of e){const i=o.parent_id&&a.has(o.parent_id)?o.parent_id:0,u=t.get(i);u?u.push(o):t.set(i,[o])}for(const o of t.values())o.sort((i,u)=>i.name.localeCompare(u.name)||i.id-u.id);const n=[],l=new Set;function r(o,i){const u=t.get(o);if(u)for(const c of u)l.has(c.id)||(l.add(c.id),n.push({folder:c,depth:i}),r(c.id,i+1))}return r(0,0),n}function iu(e){const t=e.lastIndexOf(".");return t<=0||t===e.length-1?"FILE":e.slice(t+1).toUpperCase().slice(0,6)}const JL=["aria-label"],ZL={class:"mb-1 flex items-center justify-between gap-2 px-2"},XL={class:"text-[12px] font-semibold tracking-wide text-muted uppercase"},QL=["disabled","title","aria-label"],e9=["aria-current"],t9={class:"truncate"},a9=["aria-current"],n9={class:"truncate"},l9={class:"mt-1 flex flex-col gap-0.5"},r9=["data-media-folder-row"],o9=["data-media-folder","aria-current","onClick"],s9={class:"truncate"},i9={key:0,class:"flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity duration-150 group-focus-within:opacity-100 group-hover:opacity-100"},u9=["data-media-folder-add-child","disabled","title","aria-label","onClick"],d9=["data-media-folder-rename","disabled","title","aria-label","onClick"],c9=["data-media-folder-delete","disabled","title","aria-label","onClick"],f9=ae({__name:"MediaFolderTree",props:{folders:{},selected:{},canManage:{type:Boolean},busy:{type:Boolean,default:!1}},emits:["select","create","rename","delete"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>i_(a.folders));return(r,o)=>(f(),b("aside",{"data-media-folder-tree":"","aria-label":s(h)("backend::lang.media.folders"),class:"flex w-full shrink-0 flex-col gap-1 border-b border-border pb-3 md:w-[220px] md:border-r md:border-b-0 md:pr-3 md:pb-0"},[g("div",ZL,[g("span",XL,_(s(h)("backend::lang.media.folders")),1),e.canManage?(f(),b("button",{key:0,type:"button","data-media-folder-create":"",disabled:e.busy,title:s(h)("backend::lang.media.new_folder"),"aria-label":s(h)("backend::lang.media.new_folder"),class:"flex size-7 items-center justify-center rounded-tab text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:opacity-50",onClick:o[0]||(o[0]=i=>n("create",null))},[M(s(bv),{size:15,"aria-hidden":"true"})],8,QL)):Y("",!0)]),g("button",{type:"button","data-media-folder":"all","aria-current":e.selected==="all"?"true":void 0,class:pe([e.selected==="all"?"bg-sel font-semibold text-text":"text-muted hover:bg-hover hover:text-text","flex w-full items-center gap-2 rounded-inner px-2.5 py-2 text-left text-[13px] transition-colors duration-150 ease-out"]),onClick:o[1]||(o[1]=i=>n("select","all"))},[M(s($b),{size:15,class:"shrink-0","aria-hidden":"true"}),g("span",t9,_(s(h)("backend::lang.media.all_files")),1)],10,e9),g("button",{type:"button","data-media-folder":"root","aria-current":e.selected==="root"?"true":void 0,class:pe([e.selected==="root"?"bg-sel font-semibold text-text":"text-muted hover:bg-hover hover:text-text","flex w-full items-center gap-2 rounded-inner px-2.5 py-2 text-left text-[13px] transition-colors duration-150 ease-out"]),onClick:o[2]||(o[2]=i=>n("select","root"))},[M(s(Cb),{size:15,class:"shrink-0","aria-hidden":"true"}),g("span",n9,_(s(h)("backend::lang.media.root_folder")),1)],10,a9),g("div",l9,[(f(!0),b(me,null,Ie(l.value,i=>(f(),b("div",{key:i.folder.id,"data-media-folder-row":i.folder.id,class:pe(["group flex items-center gap-1 rounded-inner pr-1 transition-colors duration-150 ease-out",e.selected===i.folder.id?"bg-sel text-text":"text-muted hover:bg-hover hover:text-text"])},[g("button",{type:"button","data-media-folder":i.folder.id,"aria-current":e.selected===i.folder.id?"true":void 0,style:oa({paddingLeft:`${10+i.depth*14}px`}),class:pe(["flex min-w-0 flex-1 items-center gap-2 py-1.5 pr-1 text-left text-[13px]",e.selected===i.folder.id?"font-semibold text-text":""]),onClick:u=>n("select",i.folder.id)},[e.selected===i.folder.id?(f(),j(s(qC),{key:0,size:15,class:"shrink-0","aria-hidden":"true"})):(f(),j(s(kb),{key:1,size:15,class:"shrink-0","aria-hidden":"true"})),g("span",s9,_(i.folder.name),1)],14,o9),e.canManage?(f(),b("div",i9,[g("button",{type:"button","data-media-folder-add-child":i.folder.id,disabled:e.busy,title:s(h)("backend::lang.media.new_folder"),"aria-label":s(h)("backend::lang.media.new_folder"),class:"flex size-6 items-center justify-center rounded-tab text-muted hover:bg-surface hover:text-text disabled:opacity-50",onClick:mt(u=>n("create",i.folder.id),["stop"])},[M(s(bv),{size:13,"aria-hidden":"true"})],8,u9),g("button",{type:"button","data-media-folder-rename":i.folder.id,disabled:e.busy,title:s(h)("backend::lang.media.rename_folder"),"aria-label":s(h)("backend::lang.media.rename_folder"),class:"flex size-6 items-center justify-center rounded-tab text-muted hover:bg-surface hover:text-text disabled:opacity-50",onClick:mt(u=>n("rename",i.folder),["stop"])},[M(s(Wr),{size:13,"aria-hidden":"true"})],8,d9),g("button",{type:"button","data-media-folder-delete":i.folder.id,disabled:e.busy,title:s(h)("backend::lang.media.delete_folder"),"aria-label":s(h)("backend::lang.media.delete_folder"),class:"flex size-6 items-center justify-center rounded-tab text-muted hover:bg-danger-soft hover:text-danger disabled:opacity-50",onClick:mt(u=>n("delete",i.folder),["stop"])},[M(s(Xa),{size:13,"aria-hidden":"true"})],8,c9)])):Y("",!0)],10,r9))),128))])],8,JL))}}),p9=["aria-label"],m9={class:"flex items-center justify-between gap-2"},v9={class:"text-[15px] font-bold"},h9=["aria-label"],g9={class:"flex aspect-[16/10] w-full items-center justify-center overflow-hidden rounded-inner border border-border bg-subtle"},y9=["src","alt"],b9={key:1,class:"flex flex-col items-center gap-2 text-muted"},_9={class:"rounded-tab bg-surface px-2 py-0.5 text-[11px] font-bold tracking-wide text-text uppercase"},x9={class:"flex flex-col gap-1"},k9={class:"font-semibold [overflow-wrap:anywhere]"},w9={class:"flex items-center gap-2"},$9={class:"min-w-0 flex-1 truncate rounded-tab bg-subtle px-2 py-1 text-[12px] text-muted"},C9={class:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1.5 text-[13px]"},S9={class:"text-muted"},E9={class:"text-right font-medium"},A9={class:"text-muted"},T9={class:"text-right font-medium"},M9={class:"text-muted"},D9=["title"],O9={class:"text-muted"},P9={class:"text-right font-medium"},I9={class:"text-muted"},R9={class:"flex items-center justify-end gap-1 font-mono text-[12px]"},q9=["title"],L9=["title","aria-label"],N9={class:"flex flex-col gap-1"},B9={class:"text-[13px] font-semibold"},F9=["placeholder"],V9={class:"flex flex-col gap-1"},z9={class:"text-[13px] font-semibold"},j9={class:"flex flex-col gap-1"},U9={class:"text-[13px] font-semibold"},H9={class:"flex flex-col gap-1"},K9={class:"text-[13px] font-semibold"},W9={value:""},G9=["value"],Y9={class:"flex items-center justify-between gap-2 pt-1"},J9={key:1,class:"flex flex-col gap-2 border-t border-border pt-3 text-[13px]"},Z9={key:0},X9={class:"font-semibold"},Q9={key:1},eN={class:"font-semibold"},tN={key:2},aN={class:"font-semibold"},nN=ae({__name:"MediaInspector",props:{item:{},folders:{},canManage:{type:Boolean},saving:{type:Boolean,default:!1},deleting:{type:Boolean,default:!1}},emits:["save","delete","close"],setup(e,{emit:t}){const a=e,n=t,l=E(""),r=E(""),o=E(""),i=E(""),u=E(!1);function c(w){l.value=w.alt??"",r.value=w.title??"",o.value=w.caption??"",i.value=typeof w.folder_id=="number"&&w.folder_id>0?String(w.folder_id):""}ze(()=>a.item,w=>{c(w)},{immediate:!0});const d=k(()=>i_(a.folders)),p=k(()=>{const w=typeof a.item.folder_id=="number"&&a.item.folder_id>0?String(a.item.folder_id):"";return l.value!==(a.item.alt??"")||r.value!==(a.item.title??"")||o.value!==(a.item.caption??"")||i.value!==w}),v=k(()=>a.item.sha256?`${a.item.sha256.slice(0,12)}…`:"—"),m=k(()=>{const w=a.item.variants??[];if(w.length===0)return"0";const S=w.map(q=>`${q.width}w`).join(", ");return`${w.length} (${S})`});async function y(w){try{await navigator.clipboard.writeText(w),Oe(h("backend::lang.media.url_copied"),"success")}catch{}}function x(){if(!a.canManage||a.saving||!p.value)return;const w={alt:l.value,title:r.value,caption:o.value};if(i.value==="")w.clear_folder=!0;else{const S=Number(i.value);Number.isInteger(S)&&S>0&&(w.folder_id=S)}n("save",{id:a.item.id,body:w})}function C(){n("delete",a.item)}return(w,S)=>(f(),b("aside",{"data-media-inspector":"","aria-label":s(h)("backend::lang.media.inspector_title"),class:"flex w-full shrink-0 flex-col gap-4 border-t border-border pt-4 lg:w-[310px] lg:border-t-0 lg:border-l lg:pt-0 lg:pl-4"},[g("div",m9,[g("h2",v9,_(s(h)("backend::lang.media.inspector_title")),1),g("button",{type:"button","data-media-inspector-close":"","aria-label":s(h)("backend::lang.form.close"),class:"flex size-7 items-center justify-center rounded-tab text-muted hover:bg-hover hover:text-text",onClick:S[0]||(S[0]=q=>n("close"))},[M(s(qt),{size:15,"aria-hidden":"true"})],8,h9)]),g("div",g9,[e.item.is_image?(f(),b("img",{key:0,src:e.item.thumb_url||e.item.url,alt:e.item.alt||e.item.title||e.item.file_name,class:"size-full object-contain"},null,8,y9)):(f(),b("div",b9,[M(s(Ia),{size:36,"aria-hidden":"true"}),g("span",_9,_(s(iu)(e.item.file_name)),1)]))]),g("div",x9,[g("p",k9,_(e.item.file_name),1),g("div",w9,[g("code",$9,_(e.item.url),1),M(Ke,{variant:"outline",size:"sm","data-media-copy-url":"",icon:s(ro),onClick:S[1]||(S[1]=q=>y(e.item.url))},{default:N(()=>[ye(_(s(h)("backend::lang.media.copy_url")),1)]),_:1},8,["icon"])])]),g("dl",C9,[e.item.width&&e.item.height?(f(),b(me,{key:0},[g("dt",S9,_(s(h)("backend::lang.media.dimensions")),1),g("dd",E9,_(e.item.width)+" × "+_(e.item.height),1)],64)):Y("",!0),g("dt",A9,_(s(h)("backend::lang.media.size")),1),g("dd",T9,_(s(af)(e.item.file_size)),1),g("dt",M9,_(s(h)("backend::lang.media.content_type")),1),g("dd",{class:"truncate text-right font-medium",title:e.item.content_type},_(e.item.content_type),9,D9),e.item.is_image?(f(),b(me,{key:1},[g("dt",O9,_(s(h)("backend::lang.media.variants")),1),g("dd",P9,_(m.value),1)],64)):Y("",!0),g("dt",I9,_(s(h)("backend::lang.media.sha256")),1),g("dd",R9,[g("span",{title:e.item.sha256},_(v.value),9,q9),e.item.sha256?(f(),b("button",{key:0,type:"button",title:e.item.sha256,"aria-label":s(h)("backend::lang.media.sha256"),class:"flex size-5 items-center justify-center rounded-tab text-muted hover:bg-hover hover:text-text",onClick:S[2]||(S[2]=q=>y(e.item.sha256))},[M(s(ro),{size:12,"aria-hidden":"true"})],8,L9)):Y("",!0)])]),e.canManage?(f(),b("form",{key:0,class:"flex flex-col gap-3 border-t border-border pt-3",onSubmit:mt(x,["prevent"])},[g("label",N9,[g("span",B9,_(s(h)("backend::lang.media.alt")),1),Jt(g("input",{"onUpdate:modelValue":S[3]||(S[3]=q=>l.value=q),type:"text","data-media-inspector-alt":"",placeholder:s(h)("backend::lang.media.alt_placeholder"),class:"h-control w-full rounded-control border border-border-strong bg-surface px-3 text-[13px] text-text"},null,8,F9),[[Ua,l.value]])]),g("label",V9,[g("span",z9,_(s(h)("backend::lang.media.item_title")),1),Jt(g("input",{"onUpdate:modelValue":S[4]||(S[4]=q=>r.value=q),type:"text","data-media-inspector-title":"",class:"h-control w-full rounded-control border border-border-strong bg-surface px-3 text-[13px] text-text"},null,512),[[Ua,r.value]])]),g("label",j9,[g("span",U9,_(s(h)("backend::lang.media.caption")),1),Jt(g("textarea",{"onUpdate:modelValue":S[5]||(S[5]=q=>o.value=q),rows:"2","data-media-inspector-caption":"",class:"w-full rounded-control border border-border-strong bg-surface px-3 py-2 text-[13px] text-text"},null,512),[[Ua,o.value]])]),g("label",H9,[g("span",K9,_(s(h)("backend::lang.media.folder")),1),Jt(g("select",{"onUpdate:modelValue":S[6]||(S[6]=q=>i.value=q),"data-media-inspector-folder":"",class:"h-control w-full rounded-control border border-border-strong bg-surface px-3 text-[13px] text-text"},[g("option",W9,_(s(h)("backend::lang.media.no_folder")),1),(f(!0),b(me,null,Ie(d.value,q=>(f(),b("option",{key:q.folder.id,value:String(q.folder.id)},_(`${"— ".repeat(q.depth)}${q.folder.name}`),9,G9))),128))],512),[[Sw,i.value]])]),g("div",Y9,[M(Ke,{type:"submit",variant:"primary",size:"sm","data-media-save":"",disabled:e.saving||!p.value},{default:N(()=>[ye(_(e.saving?s(h)("backend::lang.form.saving"):s(h)("backend::lang.media.save")),1)]),_:1},8,["disabled"]),M(Ke,{variant:"danger",size:"sm","data-media-delete":"",disabled:e.deleting,icon:s(Xa),onClick:S[7]||(S[7]=q=>u.value=!0)},{default:N(()=>[ye(_(s(h)("backend::lang.media.delete")),1)]),_:1},8,["disabled","icon"])])],32)):e.item.alt||e.item.title||e.item.caption?(f(),b("div",J9,[e.item.alt?(f(),b("div",Z9,[g("span",X9,_(s(h)("backend::lang.media.alt"))+":",1),ye(" "+_(e.item.alt),1)])):Y("",!0),e.item.title?(f(),b("div",Q9,[g("span",eN,_(s(h)("backend::lang.media.item_title"))+":",1),ye(" "+_(e.item.title),1)])):Y("",!0),e.item.caption?(f(),b("div",tN,[g("span",aN,_(s(h)("backend::lang.media.caption"))+":",1),ye(" "+_(e.item.caption),1)])):Y("",!0)])):Y("",!0),M(Sn,{open:u.value,"onUpdate:open":S[8]||(S[8]=q=>u.value=q),title:s(h)("backend::lang.media.delete_confirm_title"),message:s(h)("backend::lang.media.delete_confirm_body",{name:e.item.file_name}),"confirm-label":s(h)("backend::lang.media.delete"),danger:!0,busy:e.deleting,onConfirm:C},null,8,["open","title","message","confirm-label","busy"])],8,p9))}}),lN={key:0,"data-media-drop-overlay":"",class:"pointer-events-none absolute inset-0 z-20 flex items-center justify-center rounded-inner border-2 border-dashed border-primary bg-surface/90 text-[15px] font-semibold text-primary"},rN={class:"flex min-h-0 min-w-0 flex-1 flex-col gap-3"},oN={class:"flex flex-wrap items-center gap-2"},sN={class:"relative min-w-[180px] flex-1"},iN={class:"sr-only"},uN=["data-mail-image-search","value","placeholder"],dN=["aria-label"],cN=["aria-pressed"],fN=["aria-pressed"],pN=["aria-pressed"],mN={key:1,class:"inline-flex rounded-control border border-border-strong bg-surface p-0.5"},vN=["title","aria-label","aria-pressed"],hN=["title","aria-label","aria-pressed"],gN={key:2,class:"flex items-center gap-2"},yN=["accept","multiple"],bN=["data-mail-image-upload-error"],_N=["role","aria-label","data-mail-image-grid"],xN=["data-mail-image-load-failed"],kN={key:2,class:"col-span-full flex flex-col items-center gap-1 px-2 py-8 text-center"},wN={class:"text-[14px] font-semibold"},$N={class:"text-[13px] text-muted"},CN=["data-mail-image-no-results"],SN=["role","aria-checked","aria-pressed","data-mail-image-id","data-media-item-id","onClick","onDblclick"],EN={class:"relative flex aspect-square w-full items-center justify-center overflow-hidden rounded-pager bg-subtle"},AN=["src","alt"],TN={key:1,class:"flex flex-col items-center gap-1 text-muted"},MN={class:"rounded-tab bg-surface px-1.5 py-0.5 text-[10px] font-bold text-text uppercase"},DN={key:2,class:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-primary text-on-primary","aria-hidden":"true"},ON={class:"truncate text-[13px] font-medium text-text"},PN={key:0,class:"truncate text-[11px] text-muted"},IN={key:2,"data-media-list":"",class:"min-h-0 flex-1 overflow-auto rounded-inner border border-border bg-surface"},RN={key:0,class:"px-4 py-6 text-[13px] text-muted"},qN={key:1,role:"alert","data-media-load-failed":"",class:"px-4 py-6 text-[13px] text-danger"},LN={key:2,class:"flex flex-col items-center gap-1 px-4 py-8 text-center"},NN={class:"text-[14px] font-semibold"},BN={class:"text-[13px] text-muted"},FN={key:3,"data-media-no-results":"",class:"px-4 py-8 text-center text-[13px] text-muted"},VN={key:4,class:"w-full border-collapse text-left text-[13px]"},zN={class:"border-b border-border bg-subtle text-[12px] text-muted"},jN={class:"px-3 py-2 font-semibold"},UN={class:"px-3 py-2 font-semibold"},HN={class:"px-3 py-2 font-semibold"},KN={class:"px-3 py-2 text-right font-semibold"},WN={class:"divide-y divide-border"},GN=["data-media-item-id","onClick","onDblclick"],YN={class:"px-3 py-2"},JN={class:"flex items-center gap-2.5"},ZN={class:"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-tab bg-subtle"},XN=["src","alt"],QN={class:"min-w-0"},eB={class:"truncate font-medium text-text"},tB={key:0,class:"truncate text-[12px] text-muted"},aB={class:"px-3 py-2 text-muted"},nB={class:"px-3 py-2 text-muted"},lB={class:"px-3 py-2 text-right text-muted"},rB={key:3,"data-media-pagination":"",class:"flex items-center justify-between border-t border-border pt-2.5 text-[13px] text-muted"},oB={class:"flex items-center gap-1.5"},sB=300,Fh=24,u_=ae({__name:"MediaBrowser",props:{mode:{default:"all"},selectable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},defaultFolder:{default:void 0},source:{default:"media"},searchPlaceholder:{default:void 0},uploadLabel:{default:void 0},uploadingLabel:{default:void 0},emptyTitle:{default:void 0},emptyUploadBody:{default:void 0},emptyReadOnlyBody:{default:void 0},loadFailedLabel:{default:void 0},gridAriaLabel:{default:void 0}},emits:["selection-change","activate"],setup(e,{expose:t,emit:a}){const n=e,l=a,r=E([]),o=E("all"),i=E([]),u=E(null),c=E(""),d=E(n.mode),p=E("grid"),v=E(1),m=E(!1),y=E(!1),x=E(""),C=E(!1),w=E(""),S=E(!1),q=E(!1),O=E(!1),I=E(!1),B=E(null),L=E([]),W=E(new Map),T=E(null),R=E(null),G=ol();let A=null,D=0,z=0;const V=k(()=>n.source==="mail"),K=k(()=>u.value?.can_manage===!0),re=k(()=>!V.value&&n.mode==="all"),ie=k(()=>n.mode==="image"||V.value?"image/jpeg,image/png,image/gif,image/webp":void 0),Ae=k(()=>n.selectable||B.value===null?null:i.value.find($e=>$e.id===B.value)??null),_e=k(()=>new Set(L.value)),xe=k(()=>!m.value&&!y.value&&i.value.length===0&&c.value.trim()===""),ne=k(()=>!m.value&&!y.value&&i.value.length===0&&c.value.trim()!==""),fe=k(()=>(u.value?.page??1)>1),F=k(()=>(u.value?.page??1)<(u.value?.last_page??1));function de($e){return{id:$e.id,short_id:"",slug:"",file_name:$e.fileName,content_type:"image/*",file_size:0,sha256:"",alt:$e.title||"",title:$e.title||"",caption:"",is_image:!0,url:$e.url,thumb_url:$e.thumbUrl||$e.url,variants:[],created_at:"",updated_at:""}}function ve(){const $e=[];for(const ge of L.value){const be=i.value.find(We=>We.id===ge)??W.value.get(ge);be&&$e.push(be)}l("selection-change",$e)}function Z(){L.value=[],W.value.clear(),ve()}function he($e){if(!n.selectable){B.value=B.value===$e.id?null:$e.id;return}n.multiple?_e.value.has($e.id)?(L.value=L.value.filter(ge=>ge!==$e.id),W.value.delete($e.id)):(L.value=[...L.value,$e.id],W.value.set($e.id,$e)):(L.value=[$e.id],W.value.clear(),W.value.set($e.id,$e)),ve()}function J($e){n.selectable&&!n.multiple&&(L.value=[$e.id],W.value.clear(),W.value.set($e.id,$e),ve(),l("activate",$e))}function ee($e){if(!n.selectable||n.multiple||i.value.length===0||L.value.length===0)return;const ge=L.value[0],be=i.value.findIndex(it=>it.id===ge);if(be<0)return;let We=be;if($e.key==="ArrowRight"||$e.key==="ArrowDown")We=Math.min(be+1,i.value.length-1);else if($e.key==="ArrowLeft"||$e.key==="ArrowUp")We=Math.max(be-1,0);else return;$e.preventDefault(),he(i.value[We])}async function te(){if(V.value){r.value=[];return}const $e=await zL();$e.data&&(r.value=$e.data)}async function $($e=v.value){const ge=++D;m.value=!0,y.value=!1,x.value="";try{if(V.value){const{data:Be,error:He,response:Je}=await Le.GET("/mail/images",{params:{query:{q:c.value.trim()||void 0,page:$e}}});if(ge!==D)return;if(!Be){y.value=!0;const Gt=n.loadFailedLabel??h("backend::lang.media.load_failed");x.value=Je.status===409?Mn(He,Gt):Gt,i.value=[],u.value=null;return}i.value=Be.data.map(de);const Ot=Be.meta.perPage||Fh;u.value={can_manage:Be.meta.canUpload===!0,page:Be.meta.page,per_page:Ot,total:Be.meta.total,last_page:Math.max(1,Math.ceil(Be.meta.total/Ot))},v.value=Be.meta.page;return}const be=n.mode!=="all"?n.mode:d.value,We={q:c.value.trim()||void 0,type:be==="all"?void 0:be,page:$e,per_page:Fh};o.value==="root"?We.root_only="1":typeof o.value=="number"&&(We.folder_id=String(o.value));const it=await KL(We);if(ge!==D)return;if(!it.data){y.value=!0,x.value=Mn(it.error,n.loadFailedLabel??h("backend::lang.media.load_failed")),i.value=[],u.value=null;return}i.value=it.data.data,u.value=it.data.meta,v.value=it.data.meta.page}catch{if(ge!==D)return;y.value=!0,x.value=n.loadFailedLabel??h("backend::lang.media.load_failed")}finally{ge===D&&(m.value=!1)}}async function P(){if(await te(),!V.value&&n.defaultFolder){const $e=n.defaultFolder.toLowerCase(),ge=r.value.find(be=>be.slug.toLowerCase()===$e);ge&&(o.value=ge.id)}await $(1)}function U($e){c.value=$e.target.value,A!==null&&clearTimeout(A),A=setTimeout(()=>{A=null,$(1)},sB)}function ce($e){o.value=$e,B.value=null,$(1)}function X($e){d.value=$e,$(1)}function oe($e){const ge=$e.type.trim().toLowerCase();return ge?ge.startsWith("image/")&&ge!=="image/svg+xml":/\.(jpe?g|png|gif|webp|avif)$/i.test($e.name)}async function ke($e){const ge=Array.from($e);if(!(ge.length===0||!K.value)){C.value=!0,w.value="";try{const be=typeof o.value=="number"?o.value:null;for(const We of ge){if(n.mode==="image"&&!oe(We)){w.value=n.loadFailedLabel??h("backend::lang.media.upload_failed");return}if(V.value){const it=new FormData;it.append("file",We);const{data:Be,error:He}=await Le.POST("/mail/images",{body:it});if(!Be){w.value=Mn(He,n.loadFailedLabel??h("backend::lang.media.upload_failed"));return}const Je=de(Be.data);i.value=[Je,...i.value.filter(Ot=>Ot.id!==Je.id)],u.value&&(u.value={...u.value,total:u.value.total+1}),n.selectable&&he(Je)}else{const it=await WL(We,{folderId:be});if(!it.data){w.value=Mn(it.error,h("backend::lang.media.upload_failed"));return}const Be=it.data;if(n.mode==="image"&&!Be.is_image){w.value=n.loadFailedLabel??h("backend::lang.media.upload_failed");return}(d.value==="all"||d.value==="image"&&Be.is_image||d.value==="file"&&!Be.is_image)&&(i.value=[Be,...i.value.filter(Je=>Je.id!==Be.id)],u.value&&(u.value={...u.value,total:u.value.total+1})),n.selectable?he(Be):B.value=Be.id,Oe(h("backend::lang.media.upload_done"),"success")}}}catch{w.value=n.loadFailedLabel??h("backend::lang.media.upload_failed")}finally{C.value=!1}}}function Se($e){const ge=$e.target,be=ge.files;be&&be.length>0&&ke(be),ge.value=""}function Te($e){K.value&&($e.preventDefault(),z++,S.value=!0)}function se($e){K.value&&$e.preventDefault()}function Me($e){K.value&&($e.preventDefault(),z=Math.max(0,z-1),z===0&&(S.value=!1))}function Ce($e){if(!K.value)return;$e.preventDefault(),z=0,S.value=!1;const ge=$e.dataTransfer?.files;ge&&ge.length>0&&ke(ge)}async function Fe($e){await G.ask({message:h("backend::lang.media.new_folder"),confirmLabel:h("backend::lang.form.create"),prompt:{label:h("backend::lang.media.folder_name"),placeholder:h("backend::lang.media.folder_name_placeholder"),maxLength:120}},async()=>{const ge=G.value.value.trim();if(ge){I.value=!0;try{const be=await jL({name:ge,parent_id:$e??void 0});if(!be.data){Oe(Mn(be.error,h("backend::lang.media.load_failed")),"danger");return}await te(),o.value=be.data.id,Oe(h("backend::lang.media.folder_created"),"success"),await $(1)}finally{I.value=!1}}})}async function Ue($e){const ge=G.ask({message:h("backend::lang.media.rename_folder"),confirmLabel:h("backend::lang.form.save"),prompt:{label:h("backend::lang.media.folder_name"),placeholder:h("backend::lang.media.folder_name_placeholder"),maxLength:120}},async()=>{const be=G.value.value.trim();if(be){I.value=!0;try{const We=await UL($e.id,{name:be});if(!We.data){Oe(Mn(We.error,h("backend::lang.media.load_failed")),"danger");return}await te(),Oe(h("backend::lang.media.folder_updated"),"success")}finally{I.value=!1}}});G.setValue($e.name),await ge}async function Ze($e){await G.ask({message:h("backend::lang.media.folder_delete_confirm",{name:$e.name}),confirmLabel:h("backend::lang.media.delete_folder"),danger:!0},async()=>{I.value=!0;try{const ge=await HL($e.id);if(!ge.data){const be=ge.status===409?h("backend::lang.media.folder_not_empty"):Mn(ge.error,h("backend::lang.media.load_failed"));Oe(be,"danger");return}o.value===$e.id&&(o.value="all"),await te(),Oe(h("backend::lang.media.folder_deleted"),"success"),await $(1)}finally{I.value=!1}})}async function at($e){q.value=!0;try{const ge=await GL($e.id,$e.body);if(!ge.data){Oe(Mn(ge.error,h("backend::lang.media.load_failed")),"danger");return}const be=ge.data;o.value==="all"||o.value==="root"&&!be.folder_id||typeof o.value=="number"&&be.folder_id===o.value?i.value=i.value.map(it=>it.id===be.id?be:it):(i.value=i.value.filter(it=>it.id!==be.id),B.value===be.id&&(B.value=null),u.value&&(u.value={...u.value,total:Math.max(0,u.value.total-1)})),Oe(h("backend::lang.media.saved"),"success")}finally{q.value=!1}}async function nt($e){O.value=!0;try{const ge=await YL($e.id);if(!ge.data){Oe(Mn(ge.error,h("backend::lang.media.load_failed")),"danger");return}i.value=i.value.filter(be=>be.id!==$e.id),B.value===$e.id&&(B.value=null),_e.value.has($e.id)&&(L.value=L.value.filter(be=>be!==$e.id),W.value.delete($e.id),ve()),u.value&&(u.value={...u.value,total:Math.max(0,u.value.total-1)}),Oe(h("backend::lang.media.deleted"),"success")}finally{O.value=!1}}return ze(()=>n.mode,$e=>{d.value=$e}),$t(()=>{P()}),Dt(()=>{A!==null&&clearTimeout(A),D++}),t({reload:P,clearSelection:Z,focusGrid:()=>R.value?.focus()}),($e,ge)=>(f(),b("div",{"data-media-browser":"",class:"relative flex min-h-0 flex-1 flex-col gap-4 md:flex-row",onDragenter:Te,onDragover:se,onDragleave:Me,onDrop:Ce},[S.value&&K.value?(f(),b("div",lN,_(s(h)("backend::lang.media.drop_hint")),1)):Y("",!0),V.value?Y("",!0):(f(),j(f9,{key:1,folders:r.value,selected:o.value,"can-manage":K.value,busy:I.value,onSelect:ce,onCreate:Fe,onRename:Ue,onDelete:Ze},null,8,["folders","selected","can-manage","busy"])),g("div",rN,[g("div",oN,[g("label",sN,[g("span",iN,_(e.searchPlaceholder??s(h)("backend::lang.media.search_placeholder")),1),M(s(hr),{size:17,class:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{type:"search","data-mail-image-search":V.value?"":void 0,"data-media-search":"",value:c.value,placeholder:e.searchPlaceholder??s(h)("backend::lang.media.search_placeholder"),class:"h-input w-full rounded-control border border-border-strong bg-surface pr-3.5 pl-9 text-[14px] text-text",onInput:U},null,40,uN)]),re.value?(f(),b("div",{key:0,role:"group","aria-label":s(h)("backend::lang.media.filter_all"),class:"inline-flex rounded-control border border-border-strong bg-surface p-0.5"},[g("button",{type:"button","data-media-filter":"all","aria-pressed":d.value==="all"?"true":"false",class:pe([d.value==="all"?"bg-sel font-semibold text-text":"text-muted hover:text-text","rounded-tab px-2.5 py-1.5 text-[13px] transition-colors duration-150"]),onClick:ge[0]||(ge[0]=be=>X("all"))},_(s(h)("backend::lang.media.filter_all")),11,cN),g("button",{type:"button","data-media-filter":"image","aria-pressed":d.value==="image"?"true":"false",class:pe([d.value==="image"?"bg-sel font-semibold text-text":"text-muted hover:text-text","rounded-tab px-2.5 py-1.5 text-[13px] transition-colors duration-150"]),onClick:ge[1]||(ge[1]=be=>X("image"))},_(s(h)("backend::lang.media.filter_images")),11,fN),g("button",{type:"button","data-media-filter":"file","aria-pressed":d.value==="file"?"true":"false",class:pe([d.value==="file"?"bg-sel font-semibold text-text":"text-muted hover:text-text","rounded-tab px-2.5 py-1.5 text-[13px] transition-colors duration-150"]),onClick:ge[2]||(ge[2]=be=>X("file"))},_(s(h)("backend::lang.media.filter_files")),11,pN)],8,dN)):Y("",!0),V.value?Y("",!0):(f(),b("div",mN,[g("button",{type:"button","data-media-view":"grid",title:s(h)("backend::lang.media.view_grid"),"aria-label":s(h)("backend::lang.media.view_grid"),"aria-pressed":p.value==="grid"?"true":"false",class:pe([p.value==="grid"?"bg-sel text-text":"text-muted hover:text-text","flex size-8 items-center justify-center rounded-tab transition-colors duration-150"]),onClick:ge[3]||(ge[3]=be=>p.value="grid")},[M(s(Sb),{size:15,"aria-hidden":"true"})],10,vN),g("button",{type:"button","data-media-view":"list",title:s(h)("backend::lang.media.view_list"),"aria-label":s(h)("backend::lang.media.view_list"),"aria-pressed":p.value==="list"?"true":"false",class:pe([p.value==="list"?"bg-sel text-text":"text-muted hover:text-text","flex size-8 items-center justify-center rounded-tab transition-colors duration-150"]),onClick:ge[4]||(ge[4]=be=>p.value="list")},[M(s(Rf),{size:15,"aria-hidden":"true"})],10,hN)])),K.value?(f(),b("div",gN,[g("input",{ref_key:"fileInput",ref:T,type:"file",class:"sr-only",accept:ie.value,multiple:!V.value,onChange:Se},null,40,yN),M(Ke,{variant:V.value?"outline":"primary",size:"sm","data-mail-image-upload":V.value?"":void 0,"data-media-upload":"",disabled:C.value,icon:s(ns),onClick:ge[5]||(ge[5]=be=>T.value?.click())},{default:N(()=>[ye(_(C.value?e.uploadingLabel??s(h)("backend::lang.media.uploading"):e.uploadLabel??s(h)("backend::lang.media.upload")),1)]),_:1},8,["variant","data-mail-image-upload","disabled","icon"])])):Y("",!0)]),w.value?(f(),b("p",{key:0,role:"alert","data-mail-image-upload-error":V.value?"":void 0,"data-media-upload-error":"",class:"text-[13px] text-danger"},_(w.value),9,bN)):Y("",!0),p.value==="grid"||V.value?(f(),b("div",{key:1,ref_key:"gridEl",ref:R,role:e.selectable&&!e.multiple?"radiogroup":void 0,"aria-label":e.gridAriaLabel??s(h)("backend::lang.media.title"),tabindex:"0","data-mail-image-grid":V.value?"":void 0,"data-media-grid":"",class:pe(["grid min-h-0 flex-1 content-start gap-2.5 overflow-y-auto",V.value?"grid-cols-4":"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5"]),onKeydown:ee},[m.value&&i.value.length===0?(f(),b(me,{key:0},Ie(12,be=>g("div",{key:be,class:"aspect-square rounded-inner bg-skel","aria-hidden":"true"})),64)):y.value?(f(),b("p",{key:1,role:"alert","data-mail-image-load-failed":V.value?"":void 0,"data-media-load-failed":"",class:"col-span-full py-4 text-[13px] text-danger"},_(x.value),9,xN)):xe.value?(f(),b("div",kN,[g("p",wN,_(e.emptyTitle??s(h)("backend::lang.media.empty_title")),1),g("p",$N,_(K.value?e.emptyUploadBody??s(h)("backend::lang.media.empty_body"):e.emptyReadOnlyBody??s(h)("backend::lang.media.empty_body")),1)])):ne.value?(f(),b("p",{key:3,"data-mail-image-no-results":V.value?"":void 0,"data-media-no-results":"",class:"col-span-full px-2 py-8 text-center text-[13px] text-muted"},_(V.value?s(h)("backend::lang.mail.picker.no_results",{query:c.value.trim()}):s(h)("backend::lang.media.empty_search")),9,CN)):Y("",!0),(f(!0),b(me,null,Ie(i.value,be=>(f(),b("button",{key:be.id,type:"button",role:e.selectable&&!e.multiple?"radio":void 0,"aria-checked":e.selectable&&!e.multiple?_e.value.has(be.id)?"true":"false":void 0,"aria-pressed":e.selectable&&e.multiple?_e.value.has(be.id)?"true":"false":void 0,"data-mail-image-id":V.value?be.id:void 0,"data-media-item-id":be.id,class:pe([_e.value.has(be.id)||!e.selectable&&B.value===be.id?"border-[#e0b020] bg-sel":"border-border bg-surface hover:bg-hover","relative flex flex-col gap-1.5 rounded-inner border p-1.5 text-left transition-colors duration-150 ease-out"]),onClick:We=>he(be),onDblclick:We=>J(be)},[g("span",EN,[be.is_image?(f(),b("img",{key:0,src:be.thumb_url||be.url,alt:be.alt||be.title||be.file_name,class:"size-full object-cover",loading:"lazy"},null,8,AN)):(f(),b("span",TN,[M(s(Ia),{size:28,"aria-hidden":"true"}),g("span",MN,_(s(iu)(be.file_name)),1)])),_e.value.has(be.id)?(f(),b("span",DN,[M(s(Ba),{size:14})])):Y("",!0)]),g("span",ON,_(be.file_name),1),!V.value&&be.file_size>0?(f(),b("span",PN,[ye(_(s(af)(be.file_size))+" ",1),be.width&&be.height?(f(),b(me,{key:0},[ye(" · "+_(be.width)+"×"+_(be.height),1)],64)):Y("",!0)])):Y("",!0)],42,SN))),128))],42,_N)):(f(),b("div",IN,[m.value&&i.value.length===0?(f(),b("p",RN,_(s(h)("backend::lang.list.loading")),1)):y.value?(f(),b("p",qN,_(x.value),1)):xe.value?(f(),b("div",LN,[g("p",NN,_(s(h)("backend::lang.media.empty_title")),1),g("p",BN,_(s(h)("backend::lang.media.empty_body")),1)])):ne.value?(f(),b("p",FN,_(s(h)("backend::lang.media.empty_search")),1)):(f(),b("table",VN,[g("thead",zN,[g("tr",null,[g("th",jN,_(s(h)("backend::lang.media.item_title")),1),g("th",UN,_(s(h)("backend::lang.media.content_type")),1),g("th",HN,_(s(h)("backend::lang.media.dimensions")),1),g("th",KN,_(s(h)("backend::lang.media.size")),1)])]),g("tbody",WN,[(f(!0),b(me,null,Ie(i.value,be=>(f(),b("tr",{key:be.id,"data-media-item-id":be.id,class:pe([_e.value.has(be.id)||!e.selectable&&B.value===be.id?"bg-sel":"hover:bg-hover","cursor-pointer transition-colors duration-150"]),onClick:We=>he(be),onDblclick:We=>J(be)},[g("td",YN,[g("div",JN,[g("span",ZN,[be.is_image?(f(),b("img",{key:0,src:be.thumb_url||be.url,alt:be.alt||be.file_name,class:"size-full object-cover"},null,8,XN)):(f(),j(s(Ia),{key:1,size:16,class:"text-muted","aria-hidden":"true"}))]),g("div",QN,[g("div",eB,_(be.file_name),1),be.title?(f(),b("div",tB,_(be.title),1)):Y("",!0)])])]),g("td",aB,_(be.content_type),1),g("td",nB,_(be.width&&be.height?`${be.width} × ${be.height}`:"—"),1),g("td",lB,_(s(af)(be.file_size)),1)],42,GN))),128))])]))])),u.value&&u.value.last_page>1?(f(),b("div",rB,[g("span",null,_(s(h)("backend::lang.list.pagination_range",{from:(u.value.page-1)*u.value.per_page+1,to:Math.min(u.value.page*u.value.per_page,u.value.total),total:u.value.total})),1),g("div",oB,[M(Ke,{variant:"outline",size:"sm",disabled:!fe.value||m.value,icon:s(Is),onClick:ge[6]||(ge[6]=be=>$(v.value-1))},{default:N(()=>[ye(_(s(h)("backend::lang.list.prev_page")),1)]),_:1},8,["disabled","icon"]),M(Ke,{variant:"outline",size:"sm",disabled:!F.value||m.value,icon:s(vr),onClick:ge[7]||(ge[7]=be=>$(v.value+1))},{default:N(()=>[ye(_(s(h)("backend::lang.list.next_page")),1)]),_:1},8,["disabled","icon"])])])):Y("",!0)]),Ae.value?(f(),j(nN,{key:2,item:Ae.value,folders:r.value,"can-manage":K.value,saving:q.value,deleting:O.value,onSave:at,onDelete:nt,onClose:ge[8]||(ge[8]=be=>B.value=null)},null,8,["item","folders","can-manage","saving","deleting"])):Y("",!0),M(Sn,{open:s(G).request.value!==null,message:s(G).request.value?.message??"","confirm-label":s(G).request.value?.confirmLabel,danger:s(G).request.value?.danger??!1,busy:s(G).busy.value,prompt:s(G).request.value?.prompt??null,value:s(G).value.value,"onUpdate:value":s(G).setValue,onConfirm:s(G).confirm,onCancel:s(G).cancel},null,8,["open","message","confirm-label","danger","busy","prompt","value","onUpdate:value","onConfirm","onCancel"])],32))}}),iB={class:"flex items-start justify-between gap-3"},uB={key:1,class:"flex flex-col gap-1.5 border-t border-border pt-3"},dB={class:"text-[13px] font-semibold",for:"media-picker-alt"},cB={key:0,class:"text-[13px] text-muted"},fB=["data-mail-image-alt"],pB={class:"flex justify-end gap-2.5 border-t border-border pt-3"},Vp=ae({__name:"MediaPickerModal",props:{open:{type:Boolean},mode:{default:"image"},multiple:{type:Boolean,default:!1},defaultFolder:{default:void 0},source:{default:"media"},showAlt:{type:Boolean,default:!1},title:{default:void 0},confirmLabel:{default:void 0},altLabel:{default:void 0},altComment:{default:void 0},searchPlaceholder:{default:void 0},uploadLabel:{default:void 0},uploadingLabel:{default:void 0},emptyTitle:{default:void 0},emptyUploadBody:{default:void 0},emptyReadOnlyBody:{default:void 0},loadFailedLabel:{default:void 0}},emits:["update:open","select"],setup(e,{emit:t}){const a=e,n=t,l=E(null),r=E([]),o=E(""),i=k(()=>a.source==="mail"),u=k(()=>a.title??h("backend::lang.media.picker_title")),c=k(()=>a.confirmLabel?a.confirmLabel:a.multiple&&r.value.length>0?h("backend::lang.media.picker_select_count",{count:r.value.length}):h("backend::lang.media.picker_select"));function d(y){n("update:open",y)}function p(y){if(r.value=y,a.showAlt&&y.length>0){const x=y[0];o.value=x.alt||x.title||""}}function v(){r.value.length!==0&&(n("select",{items:r.value,alt:o.value}),d(!1))}function m(y){if(r.value=[y],a.showAlt){o.value=y.alt||y.title||"";return}v()}return ze(()=>a.open,y=>{y&&(r.value=[],o.value="",Ge(()=>l.value?.focusGrid()))}),(y,x)=>(f(),j(s(al),{open:e.open,"onUpdate:open":d},{default:N(()=>[M(s(zl),null,{default:N(()=>[M(s(ll),{class:"fixed inset-0 z-40 bg-overlay"}),M(s(nl),{"data-media-picker-modal":"","data-mail-image-picker":i.value?"":void 0,class:pe([i.value?"max-w-[560px]":"max-w-[960px] h-[min(82vh,720px)]","fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-modal bg-surface p-6 text-text shadow-pop"])},{default:N(()=>[g("div",iB,[M(s(bn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(u.value),1)]),_:1}),M(s(Pl),{type:"button",class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text","aria-label":s(h)("backend::lang.form.cancel")},{default:N(()=>[M(s(qt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),e.open?(f(),j(u_,{key:0,ref_key:"browserRef",ref:l,mode:e.mode,selectable:!0,multiple:e.multiple,"default-folder":e.defaultFolder,source:e.source,"search-placeholder":e.searchPlaceholder,"upload-label":e.uploadLabel,"uploading-label":e.uploadingLabel,"empty-title":e.emptyTitle,"empty-upload-body":e.emptyUploadBody,"empty-read-only-body":e.emptyReadOnlyBody,"load-failed-label":e.loadFailedLabel,"grid-aria-label":u.value,onSelectionChange:p,onActivate:m},null,8,["mode","multiple","default-folder","source","search-placeholder","upload-label","uploading-label","empty-title","empty-upload-body","empty-read-only-body","load-failed-label","grid-aria-label"])):Y("",!0),e.showAlt&&r.value.length>0?(f(),b("div",uB,[g("label",dB,_(e.altLabel??s(h)("backend::lang.media.alt")),1),e.altComment?(f(),b("p",cB,_(e.altComment),1)):Y("",!0),Jt(g("input",{id:"media-picker-alt","onUpdate:modelValue":x[0]||(x[0]=C=>o.value=C),type:"text","data-mail-image-alt":i.value?"":void 0,"data-media-picker-alt":"",class:"h-input w-full rounded-control border border-border-strong bg-surface px-3.5 text-text"},null,8,fB),[[Ua,o.value]])])):Y("",!0),g("div",pB,[M(Ke,{variant:"ghost","data-mail-image-cancel":i.value?"":void 0,"data-media-picker-cancel":"",onClick:x[1]||(x[1]=C=>d(!1))},{default:N(()=>[ye(_(s(h)("backend::lang.form.cancel")),1)]),_:1},8,["data-mail-image-cancel"]),M(Ke,{variant:"primary","data-mail-image-confirm":i.value?"":void 0,"data-media-picker-confirm":"",disabled:r.value.length===0,onClick:v},{default:N(()=>[ye(_(c.value),1)]),_:1},8,["data-mail-image-confirm","disabled"])])]),_:1},8,["data-mail-image-picker","class"])]),_:1})]),_:1},8,["open"]))}}),mB=["id","aria-labelledby","aria-describedby","aria-busy"],vB={key:0,"data-plugin-field-skeleton":"",class:"h-[42px] w-full rounded-control bg-skel","aria-hidden":"true"},d_=ae({__name:"PluginField",props:{contentLocale:{},field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=ct(Qu,null),r=E("loading"),o=E(null);let i=null,u=!1;const c=E(!1),d=E("image"),p=E(void 0),v=E(!0);let m=null;const y=k(()=>l?.value||Na.value),x=k(()=>JSON.stringify(a.field.typeOptions??{})),C=k(()=>a.field.readOnly===!0);function w(D,z){if(Object.is(D,z))return!0;if(D===null||z===null||typeof D!="object"||typeof z!="object")return!1;try{return JSON.stringify(D)===JSON.stringify(z)}catch{return!1}}function S(D,z){w(D.value,z)||(D.value=z)}function q(D,z,V){V?D.setAttribute(z,""):D.removeAttribute(z)}function O(D){D.setAttribute("field-name",a.field.name),D.setAttribute("record-id",a.recordId==null?"":String(a.recordId)),D.setAttribute("locale",a.contentLocale??""),D.setAttribute("ui-locale",y.value),D.setAttribute("options",x.value),q(D,"disabled",C.value),q(D,"invalid",a.invalid===!0)}function I(D){let z;return{promise:new Promise((K,re)=>{z=setTimeout(()=>re(new Error("field type element was not defined in time")),D)}),cancel:()=>clearTimeout(z)}}async function B(D){const z=await LO(D);if(customElements.get(D))return;if(z.length>0)throw new Error(`plugin script failed: ${z.join(", ")}`);const V=I(o_);try{await Promise.race([customElements.whenDefined(D),V.promise])}finally{V.cancel()}}async function L(D){const z=i,V=D.detail;if(!z||V===null||typeof V!="object")return;const{id:K,file:re}=V,ie=ne=>{!u&&i===z&&z.dispatchEvent(new CustomEvent(OR,{detail:{id:K,...ne}}))},Ae=()=>h("backend::lang.fileupload.upload_failed"),_e=a.source;if(!(re instanceof Blob)||!_e){ie({error:Ae()});return}const xe=re instanceof File&&re.name!==""?re.name:"upload";try{const ne=await Le.POST("/{vendor}/{plugin}/{controller}/{id}/fields/{field}/upload",{params:{path:{..._e,id:a.recordId??0,field:a.field.name}},body:{file:""},bodySerializer:()=>{const F=new FormData;return F.append("file",re,xe),F}});if(ne.data){ie({url:ne.data.data.url});return}const fe=ne.response.status===422?Ip(ne.error?.error):"";ie({error:fe||Ae()})}catch{ie({error:Ae()})}}function W(D){L(D)}function T(D){const z=D.detail;if(!i||z===null||typeof z!="object")return;const{id:V,mode:K,defaultFolder:re,showAlt:ie}=z;typeof V!="string"||V===""||(m=V,d.value=K==="file"||K==="all"?K:"image",p.value=typeof re=="string"&&re.trim()!==""?re.trim():void 0,v.value=ie!==!1,c.value=!0)}function R(D){const z=m;m=null;const V=D.items[0];!z||!V||u||!i||i.dispatchEvent(new CustomEvent(Bh,{detail:{id:z,item:{url:V.url,alt:D.alt||V.alt||"",title:V.title||"",caption:V.caption||"",width:V.width??null,height:V.height??null}}}))}function G(D){if(c.value=D,!D&&m){const z=m;m=null,!u&&i&&i.dispatchEvent(new CustomEvent(Bh,{detail:{id:z,cancelled:!0}}))}}function A(D){const z=D.detail;z!==null&&typeof z=="object"&&Object.hasOwn(z,"value")&&n("update:modelValue",z.value)}return $t(async()=>{const D=a.field.element??"";try{if(D==="")throw new Error("plugin field without an element");if(await B(D),u||!o.value)return;const z=document.createElement(D);O(z),S(z,a.modelValue),z.addEventListener(qh,A),z.addEventListener(Lh,W),z.addEventListener(Nh,T),o.value.append(z),i=z,r.value="ready"}catch{u||(r.value="failed")}}),ze(()=>[a.recordId,a.invalid,a.contentLocale,C.value,y.value,x.value],()=>{i&&O(i)}),ze(()=>a.modelValue,D=>{i&&S(i,D)},{deep:!0}),Dt(()=>{u=!0,i?.removeEventListener(qh,A),i?.removeEventListener(Lh,W),i?.removeEventListener(Nh,T),i=null}),(D,z)=>r.value==="failed"?(f(),j(Zu,{key:0,id:e.controlId,"data-plugin-field-failed":"","aria-describedby":e.describedBy||void 0,text:s(h)("backend::lang.extension.widget_failed")},null,8,["id","aria-describedby","text"])):(f(),b("div",{key:1,id:e.controlId,role:"group","data-plugin-field":"","aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":r.value==="loading"?"true":void 0,class:"flex min-h-input min-w-0 flex-col"},[r.value==="loading"?(f(),b("span",vB)):Y("",!0),g("div",{ref_key:"mountPoint",ref:o,class:"contents"},null,512),M(Vp,{open:c.value,mode:d.value,"default-folder":p.value,"show-alt":v.value,"onUpdate:open":G,onSelect:R},null,8,["open","mode","default-folder","show-alt"])],8,mB))}}),hB=ae({__name:"MLPluginField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;return(l,r)=>(f(),j(ed,Ye(a,{inner:d_,"inner-type":e.field.type,"ml-type":e.field.type,"content-locale":"","onUpdate:modelValue":r[0]||(r[0]=o=>n("update:modelValue",o))}),null,16,["inner-type","ml-type"]))}}),gB=["id"],yB=["id","aria-labelledby","aria-label","aria-describedby","data-mode"],bB=["aria-labelledby"],_B=["id"],xB={class:"min-w-0 [overflow-wrap:anywhere]"},kB={key:0,class:"shrink-0 text-[12px] font-semibold text-muted","aria-hidden":"true"},wB=["data-permission","data-locked","data-locked-by"],$B={class:"flex min-w-0 flex-col"},CB=["id"],SB=["id"],EB=ae({__name:"PermissionEditorField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=ct(Lp,null),r=k(()=>{const O=new Map;for(const I of l?.value[a.field.name]??[])O.set(I.code,I);return O}),o=k(()=>a.field.permissionOptions??[]),i=k(()=>a.field.mode==="radio"),u=k(()=>!!a.field.readOnly||!!Hl(a.field).readonly),c=k(()=>a_(a.field,a.modelValue)),d=k(()=>{const O=[],I=[];for(const B of o.value){if(!B.tab){I.push(B);continue}let L=O.find(W=>W.label===B.tab);L||(L={key:`tab:${B.tab}`,label:B.tab,options:[]},O.push(L)),L.options.push(B)}return I.length>0&&O.push({key:"other",label:h("backend::lang.permissioneditor.other"),options:I}),O}),p=[{value:"1",label:"backend::lang.permissioneditor.allow",checked:"data-[state=checked]:bg-ok-bg data-[state=checked]:text-ok-text"},{value:"0",label:"backend::lang.permissioneditor.inherit",checked:"data-[state=checked]:bg-surface data-[state=checked]:text-text data-[state=checked]:shadow-tab"},{value:"-1",label:"backend::lang.permissioneditor.deny",checked:"data-[state=checked]:bg-danger-soft data-[state=checked]:text-danger"}],v=k(()=>`${a.controlId}-label`);function m(O,I){return`${a.controlId}-${O}-${I}`}function y(O){return r.value.get(O.code)}function x(O){return u.value||!!O.locked||y(O)!==void 0}function C(O){return(!!O.locked||y(O)!==void 0)&&!u.value}function w(O){return y(O)?.note||h("backend::lang.permissioneditor.locked")}function S(O){const I=y(O);return I?I.value===1||i.value&&I.value===-1?I.value:0:c.value[O.code]??0}function q(O,I){if(x(O))return;const B={...c.value};I===1||i.value&&I===-1?B[O.code]=I:delete B[O.code],n("update:modelValue",B)}return(O,I)=>o.value.length===0?(f(),b("div",{key:0,id:e.controlId,"data-permission-empty":"",class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 text-muted"},_(s(h)("backend::lang.permissioneditor.empty")),9,gB)):(f(),b("div",{key:1,id:e.controlId,role:"group","aria-labelledby":e.field.label?v.value:void 0,"aria-label":e.field.label?void 0:e.field.name,"aria-describedby":e.describedBy||void 0,class:pe([e.invalid?"border-danger":"border-border","overflow-hidden rounded-inner border"]),"data-permission-editor":"","data-mode":i.value?"radio":"checkbox"},[(f(!0),b(me,null,Ie(d.value,(B,L)=>(f(),b("div",{key:B.key,role:"group","aria-labelledby":`${e.controlId}-section-${L}`,"data-permission-section":""},[g("h3",{id:`${e.controlId}-section-${L}`,class:pe([L>0?"border-t border-border":"","flex h-row-head items-center justify-between gap-4 bg-subtle px-4 font-semibold"])},[g("span",xB,_(B.label),1),i.value?Y("",!0):(f(),b("span",kB,_(s(h)("backend::lang.permissioneditor.allow")),1))],10,_B),(f(!0),b(me,null,Ie(B.options,(W,T)=>(f(),b("div",{key:W.code,"data-permission":W.code,"data-locked":C(W)?"":void 0,"data-locked-by":C(W)&&y(W)?"record":void 0,class:"flex min-h-[56px] items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3 max-sm:flex-col max-sm:items-start"},[g("div",$B,[(f(),j(Wt(i.value?"span":"label"),{id:`${m(L,T)}-label`,for:i.value?void 0:m(L,T),class:"[overflow-wrap:anywhere]"},{default:N(()=>[ye(_(W.label||W.code)+" ",1),C(W)?(f(),j(s(cn),{key:0,size:14,class:"ml-1 inline-block align-[-2px] text-muted","aria-hidden":"true"})):Y("",!0)]),_:2},1032,["id","for"])),C(W)?(f(),b("p",{key:0,id:`${m(L,T)}-note`,class:"text-[13px] text-muted [overflow-wrap:anywhere]","data-permission-locked":""},_(w(W)),9,CB)):W.comment?(f(),b("p",{key:1,id:`${m(L,T)}-note`,class:"text-[13px] text-muted [overflow-wrap:anywhere]"},_(W.comment),9,SB)):Y("",!0)]),i.value?(f(),j(s($p),{key:0,orientation:"horizontal","model-value":String(S(W)),disabled:x(W),"aria-disabled":x(W)?"true":void 0,"aria-labelledby":`${m(L,T)}-label`,"aria-describedby":C(W)||W.comment?`${m(L,T)}-note`:void 0,class:"inline-flex shrink-0 gap-1 rounded-inner border border-border bg-subtle p-1","onUpdate:modelValue":R=>q(W,Number(R))},{default:N(()=>[(f(),b(me,null,Ie(p,R=>M(s(Cp),{key:R.value,value:R.value,"data-segment":R.value,class:pe([R.checked,"inline-flex h-pager items-center rounded-tab px-4 text-[13px] whitespace-nowrap text-muted transition-colors duration-150 ease-out hover:text-text disabled:cursor-not-allowed disabled:hover:text-muted data-[state=checked]:text-[14px] data-[state=checked]:font-semibold"])},{default:N(()=>[ye(_(s(h)(R.label)),1)]),_:2},1032,["value","data-segment","class"])),64))]),_:1},8,["model-value","disabled","aria-disabled","aria-labelledby","aria-describedby","onUpdate:modelValue"])):(f(),j(s(W8),{key:1,id:m(L,T),"model-value":S(W)===1,disabled:x(W),"aria-disabled":x(W)?"true":void 0,"aria-labelledby":`${m(L,T)}-label`,"aria-describedby":C(W)||W.comment?`${m(L,T)}-note`:void 0,class:"flex size-[18px] shrink-0 items-center justify-center rounded-checkbox border border-border-strong bg-surface disabled:cursor-not-allowed disabled:opacity-60 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-on-primary","onUpdate:modelValue":R=>q(W,R===!0?1:0)},{default:N(()=>[M(s(Y8),null,{default:N(()=>[M(s(Ba),{size:14,"aria-hidden":"true"})]),_:1})]),_:1},8,["id","model-value","disabled","aria-disabled","aria-labelledby","aria-describedby","onUpdate:modelValue"]))],8,wB))),128))],8,bB))),128))],10,yB))}}),AB=ae({__name:"FieldRenderer",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>A_(a.field));return(r,o)=>(f(),j(Wt(l.value),{field:e.field,"model-value":e.modelValue,"control-id":e.controlId,invalid:e.invalid,"described-by":e.describedBy,labels:e.labels,source:e.source,"record-id":e.recordId,"onUpdate:modelValue":o[0]||(o[0]=i=>n("update:modelValue",i))},null,8,["field","model-value","control-id","invalid","described-by","labels","source","record-id"]))}}),TB=["data-field"],MB=["id"],DB={key:0,class:"text-danger","aria-hidden":"true"},OB=["id","for"],PB={key:0,class:"text-danger","aria-hidden":"true"},IB=["id"],RB=["id"],qB=["id"],LB=["id"],NB=ae({__name:"FormField",props:{field:{},modelValue:{},errors:{},notices:{},labels:{},source:{},recordId:{},idPrefix:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>`${a.idPrefix??"field"}-${a.field.name}`),r=k(()=>l.value),o=k(()=>`${l.value}-comment`),i=k(()=>`${l.value}-error`),u=k(()=>`${l.value}-notice`),c=k(()=>`${l.value}-trigger`),d=ct(Fs,null),p=ct(Np,null),v=k(()=>p?.value[d?d.path(a.field.name):a.field.name]??""),m=k(()=>(a.errors?.length??0)>0),y=k(()=>(a.notices?.length??0)>0),x=k(()=>fU(a.field.type)),C=k(()=>pU(a.field.type)||ad(a.field)),w=k(()=>!x.value&&!!a.field.comment),S=k(()=>[v.value!==""?c.value:"",w.value||x.value&&a.field.comment?o.value:"",m.value?i.value:"",y.value?u.value:""].filter(Boolean).join(" "));return(q,O)=>(f(),b("div",{class:"flex min-w-0 flex-col gap-1.5","data-field":e.field.name},[C.value&&e.field.label?(f(),b("span",{key:0,id:`${r.value}-label`,class:"font-semibold"},[ye(_(e.field.label),1),e.field.required?(f(),b("span",DB," *")):Y("",!0)],8,MB)):!x.value&&!C.value?(f(),b("label",{key:1,id:`${r.value}-label`,for:r.value,class:"font-semibold"},[ye(_(e.field.label||e.field.name),1),e.field.required?(f(),b("span",PB," *")):Y("",!0)],8,OB)):Y("",!0),v.value!==""?(f(),b("p",{key:2,id:c.value,"data-trigger-note":"",class:"flex items-center gap-2 text-[13px] text-muted"},[M(s(Vl),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(v.value),1)],8,IB)):Y("",!0),M(AB,{field:e.field,"model-value":e.modelValue,"control-id":r.value,invalid:m.value,"described-by":S.value,labels:e.labels,source:e.source,"record-id":e.recordId,"onUpdate:modelValue":O[0]||(O[0]=I=>n("update:modelValue",I))},null,8,["field","model-value","control-id","invalid","described-by","labels","source","record-id"]),w.value?(f(),b("p",{key:3,id:o.value,class:"text-[13px] text-muted"},_(e.field.comment),9,RB)):Y("",!0),y.value?(f(),b("div",{key:4,id:u.value,role:"status","data-field-notice":"",class:"summer-callout summer-callout--warning text-[13px]!"},[(f(!0),b(me,null,Ie(e.notices,(I,B)=>(f(),b("p",{key:B,class:"summer-callout__text"},_(I),1))),128))],8,qB)):Y("",!0),m.value?(f(),b("div",{key:5,id:i.value,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(f(!0),b(me,null,Ie(e.errors,(I,B)=>(f(),b("p",{key:B,class:"flex items-center gap-1.5"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(I),1)]))),128))],8,LB)):Y("",!0)],8,TB))}}),BB={class:"grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},xo=ae({__name:"FormGrid",props:{fields:{},values:{},errors:{},notices:{},labels:{},source:{},recordId:{},idPrefix:{},scopePath:{}},emits:["update"],setup(e,{emit:t}){const a=e,n=t;yt(Fs,{fields:k(()=>a.fields),values:k(()=>a.values),path:r=>a.scopePath?`${a.scopePath}.${r}`:r});function l(r){if(r.type===xr)return"col-span-full";switch(r.span){case"left":return"min-[600px]:col-start-1";case"right":return"min-[600px]:col-start-2";case"auto":case"row":return"";default:return"col-span-full"}}return(r,o)=>(f(),b("div",BB,[(f(!0),b(me,null,Ie(e.fields,i=>(f(),j(NB,{key:i.name,class:pe(l(i)),field:i,"model-value":e.values[i.name],errors:e.errors[i.name],notices:e.notices?.[i.name],labels:e.labels?.[i.name],source:e.source,"record-id":e.recordId,"id-prefix":e.idPrefix,"onUpdate:modelValue":u=>n("update",i.name,u)},null,8,["class","field","model-value","errors","notices","labels","source","record-id","id-prefix","onUpdate:modelValue"]))),128))]))}}),FB=["data-preview-field"],VB=["id"],zB={class:"m-0 min-w-0"},jB={key:0,"data-switch":"true",class:"inline-flex h-6 items-center rounded-pill bg-ok-bg px-2.5 text-[12px] font-semibold text-ok-text"},UB={key:1,"data-switch":"false",class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[12px] font-semibold text-muted"},HB={class:"flex size-[22px] shrink-0 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-on-primary","aria-hidden":"true"},KB={class:"font-semibold"},WB={key:0,class:"px-2 text-muted","data-empty":""},GB={key:0},YB={key:1,class:"text-muted","data-empty":""},JB={key:0},ZB={key:1,class:"text-muted","data-empty":""},ec="flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 [overflow-wrap:anywhere]",c_=ae({__name:"PreviewField",props:{field:{},value:{},labels:{},source:{},recordId:{},idPrefix:{}},setup(e){const t=e,a=new Set(["datepicker","fileupload","partial","permissioneditor","richeditor","repeater","money","taglist"]),n=k(()=>`${t.idPrefix??"preview"}-${t.field.name}`),l=k(()=>`${n.value}-label`),r=k(()=>{const m=t.field.type;return a.has(m)||ad(t.field)?"control":m==="checkbox"||m==="switch"?"toggle":m==="relation"?t.field.multiple?"chips":"relation":m==="textarea"?"textarea":"text"}),o=k(()=>({...t.field,readOnly:!0})),i=k(()=>A_(t.field));function u(m){return m==null||m===""}const c=k(()=>{const m=t.value;if(u(m)||typeof m=="object")return"";if(t.field.type==="dropdown"){const y=(t.field.options??[]).find(x=>String(x.value)===String(m));return y?y.label:String(m)}return String(m)}),d=k(()=>t.labels?.[0]?.label??""),p=k(()=>Array.isArray(t.value)?t.labels??[]:[]);function v(m){return m.trim().split(/\s+/).filter(Boolean).slice(0,2).map(x=>x.charAt(0).toUpperCase()).join("")}return(m,y)=>(f(),b("div",{class:"flex min-w-0 flex-col gap-1.5","data-preview-field":e.field.name},[g("dt",{id:l.value,class:"font-semibold"},_(e.field.label||e.field.name),9,VB),g("dd",zB,[r.value==="control"?(f(),j(Wt(i.value),{key:0,field:o.value,"model-value":e.value,"control-id":n.value,labels:e.labels,source:e.source,"record-id":e.recordId},null,8,["field","model-value","control-id","labels","source","record-id"])):r.value==="toggle"?(f(),b(me,{key:1},[s(Xu)(e.value)?(f(),b("span",jB,_(s(h)("backend::lang.list.column_switch_true")),1)):(f(),b("span",UB,_(s(h)("backend::lang.list.column_switch_false")),1))],64)):r.value==="chips"?(f(),b("div",{key:2,"data-preview-value":"",class:pe([ec,"flex-wrap gap-1.5 p-1.5"])},[(f(!0),b(me,null,Ie(p.value,x=>(f(),b("span",{key:String(x.value),"data-chip":"",class:"inline-flex min-h-[30px] items-center gap-1.5 rounded-pill bg-surface pr-3 pl-1"},[g("span",HB,_(v(x.label)),1),g("span",KB,_(x.label),1)]))),128)),p.value.length===0?(f(),b("span",WB,_(s(h)("backend::lang.list.empty_value")),1)):Y("",!0)])):r.value==="relation"?(f(),b("div",{key:3,"data-preview-value":"",class:pe(ec)},[d.value!==""?(f(),b("span",GB,_(d.value),1)):(f(),b("span",YB,_(e.field.emptyOption||s(h)("backend::lang.list.empty_value")),1))])):(f(),b("div",{key:4,"data-preview-value":"",class:pe([ec,r.value==="textarea"?"items-start! py-3 whitespace-pre-wrap":""])},[c.value!==""?(f(),b("span",JB,_(c.value),1)):(f(),b("span",ZB,_(s(h)("backend::lang.list.empty_value")),1))],2))])],8,FB))}}),f_=new Set(["p","br","strong","b","em","i","u","s","h3","ul","ol","li","blockquote","a","div","span"]);function p_(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function XB(e){if(e==="")return[];const t=new Set;for(const a of Array.from(p_(e).querySelectorAll("*")))t.add(a.localName.toLowerCase());return[...t]}function Vh(e){return XB(e).some(t=>!f_.has(t))}const QB=["aria-labelledby","aria-describedby","data-repeater"],eF={key:0,"data-repeater-empty":"",class:"flex flex-col items-center gap-2 rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},tF={class:"font-semibold"},aF={key:0,class:"max-w-[420px] text-[13px] text-muted"},nF={key:0,"data-repeater-slot":"",class:"h-12 rounded-inner border-2 border-dashed border-primary bg-sel"},lF=["data-repeater-row","data-repeater-key","onDragover"],rF=["data-repeater-handle","aria-label","onKeydown","onDragstart"],oF={class:"text-[13px] text-muted tabular-nums"},sF=["title"],iF={key:1,"data-repeater-errors":"",class:"inline-flex h-6 items-center rounded-pill bg-danger-soft px-2.5 text-[13px] font-semibold text-danger"},uF={key:2,class:"flex gap-1"},dF=["aria-label","disabled","onClick"],cF=["aria-label","disabled","onClick"],fF=["aria-label","aria-expanded","aria-controls","onClick"],pF=["aria-label","disabled","onClick"],mF=["id"],vF={key:0,class:"m-0 grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},hF={key:2,class:"flex flex-wrap items-center gap-4"},gF={key:0,"data-repeater-count":"",class:"text-[13px] text-muted tabular-nums"},Lo="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",yF=ae({__name:"RepeaterField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=ct(Bp,null),r=k(()=>a.field.form?.fields??[]),o=k(()=>!!a.field.readOnly),i=k(()=>Array.isArray(a.modelValue)?a.modelValue.map(J=>J!==null&&typeof J=="object"&&!Array.isArray(J)?J:{}):[]),u=k(()=>typeof a.field.maxItems=="number"?a.field.maxItems:null),c=k(()=>typeof a.field.minItems=="number"?a.field.minItems:0),d=k(()=>a.field.prompt||h("backend::lang.repeater.add")),p=k(()=>`${a.controlId}-label`);let v=0;const m=E([]),y=E(new Set);let x;function C(){return v+=1,`r${v}`}ze(()=>a.modelValue,J=>{J===x&&m.value.length===i.value.length||m.value.length!==i.value.length&&(m.value=i.value.map(()=>C()),y.value=new Set)},{immediate:!0});function w(J,ee){m.value=ee,x=J,n("update:modelValue",J)}function S(J){return J==null||J===""||J===!1||Array.isArray(J)&&J.length===0}function q(){const J={};for(const ee of r.value)ee.default!==void 0?J[ee.name]=ee.default:ee.type==="checkbox"||ee.type==="switch"?J[ee.name]=!1:J[ee.name]=null;return J}function O(J){return r.value.some(ee=>{const te=J[ee.name];return S(te)?!1:ee.default===void 0||String(ee.default)!==String(te)})}function I(J){return(p_(J).textContent??"").replace(/\s+/g," ").trim()}function B(J){const ee=i.value[J]??{},te=r.value.find(U=>U.name===a.field.titleFrom),$=te?ee[te.name]:void 0;let P="";return te&&!S($)&&typeof $!="object"&&(te.type==="dropdown"?P=(te.options??[]).find(U=>String(U.value)===String($))?.label??String($):te.type==="richeditor"?P=I(String($)):P=String($).trim()),P!==""?P:h("backend::lang.repeater.untitled",{n:J+1})}function L(J,ee){const te=`${a.field.name}.${ee}.`,$={};for(const[P,U]of Object.entries(J??{}))P.startsWith(te)&&P.length>te.length&&($[P.slice(te.length)]=U);return $}const W=k(()=>i.value.map((J,ee)=>L(l?.errors.value,ee))),T=k(()=>i.value.map((J,ee)=>L(l?.notices.value,ee))),R=J=>Object.keys(W.value[J]??{}).length;ze(W,J=>{const ee=J.flatMap((te,$)=>Object.keys(te).length>0?[m.value[$]]:[]);if(ee.length>0){const te=new Set(y.value);for(const $ of ee)te.delete($);y.value=te}});function G(J){return o.value||!y.value.has(J)}function A(J,ee){const te=new Set(y.value);ee?te.delete(J):te.add(J),y.value=te}const D=k(()=>m.value.some(J=>!y.value.has(J)));function z(){y.value=D.value?new Set(m.value):new Set}const V=E(null),K=E(null);function re(J){return V.value?.querySelector(`[data-repeater-handle="${J}"]`)??null}function ie(J,ee,te){const $=i.value.map((P,U)=>U===J?{...P,[ee]:te}:P);w($,[...m.value]),l?.clearError(`${a.field.name}.${J}.${ee}`)}async function Ae(){if(o.value||u.value!==null&&i.value.length>=u.value)return;const J=C();w([...i.value,q()],[...m.value,J]),await Ge(),V.value?.querySelector(`[data-repeater-key="${J}"]`)?.querySelector('[data-repeater-body] input, [data-repeater-body] select, [data-repeater-body] textarea, [data-repeater-body] [contenteditable="true"]')?.focus()}async function _e(J){const ee=i.value[J];if(!ee||o.value||i.value.length<=c.value)return;if(O(ee)&&l){const U=B(J);if(!await l.confirm({message:h("backend::lang.repeater.remove_confirm",{title:U}),confirmLabel:h("backend::lang.repeater.remove"),danger:!0}))return}const te=m.value.filter((U,ce)=>ce!==J);w(i.value.filter((U,ce)=>ce!==J),te),await Ge();const $=te[J]??te[J-1],P=$?re($):null;P?P.focus():K.value?.$el.focus()}async function xe(J,ee){const te=i.value.length;if(o.value||J===ee||J<0||ee<0||J>=te||ee>=te)return;const $=[...i.value],P=[...m.value],[U]=$.splice(J,1),[ce]=P.splice(J,1);$.splice(ee,0,U),P.splice(ee,0,ce),w($,P),await Ge(),re(ce)?.focus(),l?.announce(h("backend::lang.repeater.moved",{title:B(ee),position:ee+1,total:te}))}function ne(J,ee){(J.key==="ArrowUp"||J.key==="ArrowDown")&&(J.preventDefault(),xe(ee,J.key==="ArrowUp"?ee-1:ee+1))}const fe=E(null),F=E(null);function de(J,ee){fe.value=ee,F.value=null,J.dataTransfer?.setData("text/plain",m.value[ee]??""),J.dataTransfer&&(J.dataTransfer.effectAllowed="move")}function ve(J,ee){if(fe.value===null)return;J.preventDefault();const $=J.currentTarget.getBoundingClientRect();F.value=J.clientY>$.top+$.height/2?ee+1:ee}function Z(J){if(fe.value===null||F.value===null)return;J.preventDefault();const ee=fe.value,te=F.value>ee?F.value-1:F.value;he(),xe(ee,te)}function he(){fe.value=null,F.value=null}return(J,ee)=>(f(),b("div",{ref_key:"root",ref:V,role:"group","aria-labelledby":p.value,"aria-describedby":e.describedBy||void 0,"data-repeater":e.field.name,class:"flex flex-col gap-4"},[i.value.length===0?(f(),b("div",eF,[g("p",tF,_(s(h)("backend::lang.repeater.empty")),1),o.value?Y("",!0):(f(),b("p",aF,_(s(h)("backend::lang.repeater.empty_hint",{prompt:d.value})),1))])):Y("",!0),(f(!0),b(me,null,Ie(i.value,(te,$)=>(f(),b(me,{key:m.value[$]},[fe.value!==null&&F.value===$&&F.value!==fe.value&&F.value!==fe.value+1?(f(),b("div",nF)):Y("",!0),g("div",{"data-repeater-row":$,"data-repeater-key":m.value[$],class:pe([[R($)>0?"border-danger":"border-border",fe.value===$?"opacity-50":""],"rounded-inner border bg-surface"]),onDragover:P=>ve(P,$),onDrop:Z},[g("div",{class:pe([G(m.value[$])?"rounded-t-inner border-b border-border":"rounded-inner","flex min-h-12 items-center gap-2 bg-subtle px-2"])},[o.value?Y("",!0):(f(),b("button",{key:0,type:"button",draggable:"true","data-repeater-handle":m.value[$],"aria-label":s(h)("backend::lang.repeater.move",{title:B($)}),class:pe([Lo,"cursor-grab"]),onKeydown:P=>ne(P,$),onDragstart:P=>de(P,$),onDragend:he},[M(s(Hi),{size:16,"aria-hidden":"true"})],40,rF)),g("span",oF,_($+1)+".",1),g("span",{"data-repeater-title":"",class:"min-w-0 flex-1 truncate font-semibold",title:B($)},_(B($)),9,sF),R($)>0?(f(),b("span",iF,_(s(wa)("backend::lang.form.tab_errors",R($))),1)):Y("",!0),o.value?Y("",!0):(f(),b("div",uF,[g("button",{type:"button","data-action":"repeater-up","aria-label":s(h)("backend::lang.repeater.move_up",{title:B($)}),disabled:$===0,class:pe(Lo),onClick:P=>xe($,$-1)},[M(s(bb),{size:16,"aria-hidden":"true"})],8,dF),g("button",{type:"button","data-action":"repeater-down","aria-label":s(h)("backend::lang.repeater.move_down",{title:B($)}),disabled:$===i.value.length-1,class:pe(Lo),onClick:P=>xe($,$+1)},[M(s(Gn),{size:16,"aria-hidden":"true"})],8,cF),g("button",{type:"button","data-action":"repeater-toggle","aria-label":s(h)(G(m.value[$])?"backend::lang.repeater.collapse":"backend::lang.repeater.expand",{title:B($)}),"aria-expanded":G(m.value[$])?"true":"false","aria-controls":`${e.controlId}-${m.value[$]}-body`,class:pe(Lo),onClick:P=>A(m.value[$],!G(m.value[$]))},[M(s(Gn),{size:16,class:pe([G(m.value[$])?"rotate-180":"","transition-transform duration-150"]),"aria-hidden":"true"},null,8,["class"])],8,fF),g("button",{type:"button","data-action":"repeater-remove","aria-label":s(h)("backend::lang.repeater.remove_named",{title:B($)}),disabled:i.value.length<=c.value,class:pe([Lo,"hover:bg-danger-soft hover:text-danger"]),onClick:P=>_e($)},[M(s(Xa),{size:16,"aria-hidden":"true"})],8,pF)]))],2),G(m.value[$])?(f(),b("div",{key:0,id:`${e.controlId}-${m.value[$]}-body`,"data-repeater-body":"",class:"p-4"},[o.value?(f(),b("dl",vF,[(f(!0),b(me,null,Ie(r.value,P=>(f(),j(c_,{key:P.name,class:pe(P.span==="left"?"min-[600px]:col-start-1":P.span==="right"?"min-[600px]:col-start-2":"col-span-full"),field:{...P,readOnly:!0},value:te[P.name],source:e.source,"record-id":e.recordId,"id-prefix":`${e.controlId}-${m.value[$]}`},null,8,["class","field","value","source","record-id","id-prefix"]))),128))])):(f(),j(xo,{key:1,fields:r.value,values:te,errors:W.value[$]??{},notices:T.value[$],source:e.source,"record-id":e.recordId,"id-prefix":`${e.controlId}-${m.value[$]}`,"scope-path":e.field.name,onUpdate:(P,U)=>ie($,P,U)},null,8,["fields","values","errors","notices","source","record-id","id-prefix","scope-path","onUpdate"]))],8,mF)):Y("",!0)],42,lF)],64))),128)),fe.value!==null&&F.value===i.value.length&&F.value!==fe.value+1?(f(),b("div",{key:1,"data-repeater-slot":"",class:"h-12 rounded-inner border-2 border-dashed border-primary bg-sel",onDragover:ee[0]||(ee[0]=mt(()=>{},["prevent"])),onDrop:Z},null,32)):Y("",!0),o.value?Y("",!0):(f(),b("div",hF,[M(Ke,{ref_key:"addButton",ref:K,variant:"outline",size:"sm",icon:s(vo),"data-action":"repeater-add",disabled:u.value!==null&&i.value.length>=u.value,onClick:Ae},{default:N(()=>[ye(_(d.value),1)]),_:1},8,["icon","disabled"]),u.value!==null?(f(),b("span",gF,_(s(h)("backend::lang.repeater.count",{current:i.value.length,max:u.value})),1)):Y("",!0),i.value.length>1?(f(),j(Ke,{key:1,variant:"ghost",size:"sm",class:"ml-auto","data-action":"repeater-toggle-all",onClick:z},{default:N(()=>[ye(_(s(h)(D.value?"backend::lang.repeater.collapse_all":"backend::lang.repeater.expand_all")),1)]),_:1})):Y("",!0)]))],8,QB))}}),bF="modulepreload",_F=function(e,t){return new URL(e,t).href},zh={},m_=function(t,a,n){let l=Promise.resolve();if(a&&a.length>0){let c=function(d){return Promise.all(d.map(p=>Promise.resolve(p).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const o=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),u=i?.nonce||i?.getAttribute("nonce");l=c(a.map(d=>{if(d=_F(d,n),d in zh)return;zh[d]=!0;const p=d.endsWith(".css"),v=p?'[rel="stylesheet"]':"";if(n)for(let y=o.length-1;y>=0;y--){const x=o[y];if(x.href===d&&(!p||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${v}`))return;const m=document.createElement("link");if(m.rel=p?"stylesheet":bF,p||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),p)return new Promise((y,x)=>{m.addEventListener("load",y),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function r(o){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o}return l.then(o=>{for(const i of o||[])i.status==="rejected"&&r(i.reason);return t().catch(r)})};function jh(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function xF(e){if(Array.isArray(e))return e}function kF(e,t){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var n,l,r,o,i=[],u=!0,c=!1;try{if(r=(a=a.call(e)).next,t!==0)for(;!(u=(n=r.call(a)).done)&&(i.push(n.value),i.length!==t);u=!0);}catch(d){c=!0,l=d}finally{try{if(!u&&a.return!=null&&(o=a.return(),Object(o)!==o))return}finally{if(c)throw l}}return i}}function wF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $F(e,t){return xF(e)||kF(e,t)||CF(e,t)||wF()}function CF(e,t){if(e){if(typeof e=="string")return jh(e,t);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?jh(e,t):void 0}}const v_=Object.entries,Uh=Object.setPrototypeOf,SF=Object.isFrozen,EF=Object.getPrototypeOf,AF=Object.getOwnPropertyDescriptor;let Ht=Object.freeze,Xt=Object.seal,Nr=Object.create,h_=typeof Reflect<"u"&&Reflect,nf=h_.apply,lf=h_.construct;Ht||(Ht=function(t){return t});Xt||(Xt=function(t){return t});nf||(nf=function(t,a){for(var n=arguments.length,l=new Array(n>2?n-2:0),r=2;r<n;r++)l[r-2]=arguments[r];return t.apply(a,l)});lf||(lf=function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return new t(...n)});const ar=jt(Array.prototype.forEach),TF=jt(Array.prototype.lastIndexOf),Hh=jt(Array.prototype.pop),No=jt(Array.prototype.push),MF=jt(Array.prototype.splice),Qr=Array.isArray,Go=jt(String.prototype.toLowerCase),tc=jt(String.prototype.toString),Kh=jt(String.prototype.match),Bo=jt(String.prototype.replace),Wh=jt(String.prototype.indexOf),DF=jt(String.prototype.trim),OF=jt(Number.prototype.toString),PF=jt(Boolean.prototype.toString),Gh=typeof BigInt>"u"?null:jt(BigInt.prototype.toString),Yh=typeof Symbol>"u"?null:jt(Symbol.prototype.toString),fa=jt(Object.prototype.hasOwnProperty),Fo=jt(Object.prototype.toString),ta=jt(RegExp.prototype.test),vl=IF(TypeError);function jt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return nf(e,t,n)}}function IF(e){return function(){for(var t=arguments.length,a=new Array(t),n=0;n<t;n++)a[n]=arguments[n];return lf(e,a)}}function ht(e,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Go;if(Uh&&Uh(e,null),!Qr(t))return e;let n=t.length;for(;n--;){let l=t[n];if(typeof l=="string"){const r=a(l);r!==l&&(SF(t)||(t[n]=r),l=r)}e[l]=!0}return e}function RF(e){for(let t=0;t<e.length;t++)fa(e,t)||(e[t]=null);return e}function xa(e){const t=Nr(null);for(const n of v_(e)){var a=$F(n,2);const l=a[0],r=a[1];fa(e,l)&&(Qr(r)?t[l]=RF(r):r&&typeof r=="object"&&r.constructor===Object?t[l]=xa(r):t[l]=r)}return t}function qF(e){switch(typeof e){case"string":return e;case"number":return OF(e);case"boolean":return PF(e);case"bigint":return Gh?Gh(e):"0";case"symbol":return Yh?Yh(e):"Symbol()";case"undefined":return Fo(e);case"function":case"object":{if(e===null)return Fo(e);const t=e,a=Da(t,"toString");if(typeof a=="function"){const n=a(t);return typeof n=="string"?n:Fo(n)}return Fo(e)}default:return Fo(e)}}function Da(e,t){for(;e!==null;){const n=AF(e,t);if(n){if(n.get)return jt(n.get);if(typeof n.value=="function")return jt(n.value)}e=EF(e)}function a(){return null}return a}function LF(e){try{return ta(e,""),!0}catch{return!1}}const Jh=Ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ac=Ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),nc=Ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),NF=Ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),lc=Ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),BF=Ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Zh=Ht(["#text"]),Xh=Ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),rc=Ht(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Qh=Ht(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fi=Ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),FF=Xt(/{{[\w\W]*|^[\w\W]*}}/g),VF=Xt(/<%[\w\W]*|^[\w\W]*%>/g),zF=Xt(/\${[\w\W]*/g),jF=Xt(/^data-[\-\w.\u00B7-\uFFFF]+$/),UF=Xt(/^aria-[\-\w]+$/),eg=Xt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),HF=Xt(/^(?:\w+script|data):/i),KF=Xt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),WF=Xt(/^html$/i),GF=Xt(/^[a-z][.\w]*(-[.\w]+)+$/i),tg=Xt(/<[/\w!]/g),ag=Xt(/<[/\w]/g),YF=Xt(/<\/no(script|embed|frames)/i),JF=Xt(/\/>/i),_a={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},g_=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],ZF=Ht(ht({},g_)),XF=(function(){const e={};return ar(g_,t=>{e[t]=Xt(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ht(e)})(),QF=function(){return typeof window>"u"?null:window},eV=function(t,a){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const l="data-tt-policy-suffix";a&&a.hasAttribute(l)&&(n=a.getAttribute(l));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},ng=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},hl=function(t,a,n,l){return fa(t,a)&&Qr(t[a])?ht(l.base?xa(l.base):{},t[a],l.transform):n},oc=function(t,a,n){const l=fa(t,a)?t[a]:void 0;return l&&typeof l=="object"?xa(l):n()};function y_(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QF();const t=qe=>y_(qe);if(t.version="3.4.16",t.removed=[],!e||!e.document||e.document.nodeType!==_a.document||!e.Element)return t.isSupported=!1,t;let a=e.document;const n=a,l=n.currentScript;e.DocumentFragment;const r=e.HTMLTemplateElement,o=e.Node,i=e.Element,u=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const c=e.DOMParser,d=e.trustedTypes,p=i.prototype,v=Da(p,"cloneNode"),m=Da(p,"remove"),y=Da(p,"removeAttributeNode"),x=Da(p,"nextSibling"),C=Da(p,"childNodes"),w=Da(p,"parentNode"),S=Da(p,"shadowRoot"),q=Da(p,"attributes"),O=o&&o.prototype?Da(o.prototype,"nodeType"):null,I=o&&o.prototype?Da(o.prototype,"nodeName"):null,B=o&&o.prototype?Da(o.prototype,"ownerDocument"):null,L=function(H){return O?O(H):H.nodeType},W=function(H){return I?I(H):H.nodeName};if(typeof r=="function"){const qe=a.createElement("template");qe.content&&qe.content.ownerDocument&&(a=qe.content.ownerDocument)}let T,R="",G,A=!1,D=0;const z=function(){if(D>0)throw vl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},V=function(H){z(),D++;try{return T.createHTML(H)}finally{D--}},K=function(H){z(),D++;try{return T.createScriptURL(H)}finally{D--}},re=function(){return A||(G=eV(d,l),A=!0),G},ie=a,Ae=ie.implementation,_e=ie.createNodeIterator,xe=ie.createDocumentFragment,ne=ie.getElementsByTagName,fe=n.importNode;let F=ng();t.isSupported=typeof v_=="function"&&typeof w=="function"&&Ae&&Ae.createHTMLDocument!==void 0;const de=FF,ve=VF,Z=zF,he=jF,J=UF,ee=HF,te=KF,$=GF;let P=eg,U=null;const ce=ht({},[...Jh,...ac,...nc,...lc,...Zh]);let X=null;const oe=ht({},[...Xh,...rc,...Qh,...fi]);let ke=Object.seal(Nr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Se=null,Te=null;const se=Object.seal(Nr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Me=!0,Ce=!0,Fe=!1,Ue=!0,Ze=!1,at=!0,nt=!1,$e=!1,ge=null,be=null,We=!1,it=!1,Be=!1,He=!1,Je=!0,Ot=!1;const Gt="user-content-";let sl=!0,En=!1,Fa={},Yt=null;const il=ht({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let An=null;const ul=ht({},["audio","video","img","source","image","track"]);let De=null;const je=ht({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Qe="http://www.w3.org/1998/Math/MathML",dt="http://www.w3.org/2000/svg",St="http://www.w3.org/1999/xhtml";let It=St,Kl=!1,$o=null;const Co=ht({},[Qe,dt,St],tc),Q=Ht(["mi","mo","mn","ms","mtext"]);let Re=ht({},Q);const le=Ht(["annotation-xml"]);let Ve=ht({},le);const st=ht({},["title","style","font","a","script"]);let Nt=null;const en=["application/xhtml+xml","text/html"],dl="text/html";let Bt=null,kr=null;const j_=a.createElement("form"),Hp=function(H){return H instanceof RegExp||H instanceof Function},nd=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kr&&kr===H)return;(!H||typeof H!="object")&&(H={}),H=xa(H),Nt=en.indexOf(H.PARSER_MEDIA_TYPE)===-1?dl:H.PARSER_MEDIA_TYPE,Bt=Nt==="application/xhtml+xml"?tc:Go,U=hl(H,"ALLOWED_TAGS",ce,{transform:Bt}),X=hl(H,"ALLOWED_ATTR",oe,{transform:Bt}),$o=hl(H,"ALLOWED_NAMESPACES",Co,{transform:tc}),De=hl(H,"ADD_URI_SAFE_ATTR",je,{transform:Bt,base:je}),An=hl(H,"ADD_DATA_URI_TAGS",ul,{transform:Bt,base:ul}),Yt=hl(H,"FORBID_CONTENTS",il,{transform:Bt}),Se=hl(H,"FORBID_TAGS",xa({}),{transform:Bt}),Te=hl(H,"FORBID_ATTR",xa({}),{transform:Bt}),Fa=fa(H,"USE_PROFILES")?H.USE_PROFILES&&typeof H.USE_PROFILES=="object"?xa(H.USE_PROFILES):H.USE_PROFILES:!1,Me=H.ALLOW_ARIA_ATTR!==!1,Ce=H.ALLOW_DATA_ATTR!==!1,Fe=H.ALLOW_UNKNOWN_PROTOCOLS||!1,Ue=H.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ze=H.SAFE_FOR_TEMPLATES||!1,at=H.SAFE_FOR_XML!==!1,nt=H.WHOLE_DOCUMENT||!1,it=H.RETURN_DOM||!1,Be=H.RETURN_DOM_FRAGMENT||!1,He=H.RETURN_TRUSTED_TYPE||!1,We=H.FORCE_BODY||!1,Je=H.SANITIZE_DOM!==!1,Ot=H.SANITIZE_NAMED_PROPS||!1,sl=H.KEEP_CONTENT!==!1,En=H.IN_PLACE||!1,P=LF(H.ALLOWED_URI_REGEXP)?H.ALLOWED_URI_REGEXP:eg,It=typeof H.NAMESPACE=="string"?H.NAMESPACE:St,Re=oc(H,"MATHML_TEXT_INTEGRATION_POINTS",()=>ht({},Q)),Ve=oc(H,"HTML_INTEGRATION_POINTS",()=>ht({},le));const ue=oc(H,"CUSTOM_ELEMENT_HANDLING",()=>Nr(null));if(ke=Nr(null),fa(ue,"tagNameCheck")&&Hp(ue.tagNameCheck)&&(ke.tagNameCheck=ue.tagNameCheck),fa(ue,"attributeNameCheck")&&Hp(ue.attributeNameCheck)&&(ke.attributeNameCheck=ue.attributeNameCheck),fa(ue,"allowCustomizedBuiltInElements")&&typeof ue.allowCustomizedBuiltInElements=="boolean"&&(ke.allowCustomizedBuiltInElements=ue.allowCustomizedBuiltInElements),Xt(ke),Ze&&(Ce=!1),Be&&(it=!0),Fa&&(U=ht({},Zh),X=Nr(null),Fa.html===!0&&(ht(U,Jh),ht(X,Xh)),Fa.svg===!0&&(ht(U,ac),ht(X,rc),ht(X,fi)),Fa.svgFilters===!0&&(ht(U,nc),ht(X,rc),ht(X,fi)),Fa.mathMl===!0&&(ht(U,lc),ht(X,Qh),ht(X,fi))),se.tagCheck=null,se.attributeCheck=null,fa(H,"ADD_TAGS")&&(typeof H.ADD_TAGS=="function"?se.tagCheck=H.ADD_TAGS:Qr(H.ADD_TAGS)&&(U===ce&&(U=xa(U)),ht(U,H.ADD_TAGS,Bt))),fa(H,"ADD_ATTR")&&(typeof H.ADD_ATTR=="function"?se.attributeCheck=H.ADD_ATTR:Qr(H.ADD_ATTR)&&(X===oe&&(X=xa(X)),ht(X,H.ADD_ATTR,Bt))),fa(H,"ADD_FORBID_CONTENTS")&&Qr(H.ADD_FORBID_CONTENTS)&&(Yt===il&&(Yt=xa(Yt)),ht(Yt,H.ADD_FORBID_CONTENTS,Bt)),sl&&(U["#text"]=!0),nt&&ht(U,["html","head","body"]),U.table&&(ht(U,["tbody"]),delete Se.tbody),H.TRUSTED_TYPES_POLICY){if(typeof H.TRUSTED_TYPES_POLICY.createHTML!="function")throw vl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof H.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw vl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Pe=T;T=H.TRUSTED_TYPES_POLICY;try{R=V("")}catch(Ne){throw T=Pe,Ne}}else H.TRUSTED_TYPES_POLICY===null?(T=void 0,R=""):(T===void 0&&(T=re()),T&&typeof R=="string"&&(R=V("")));Ht&&Ht(H),kr=H},Kp=ht({},[...ac,...nc,...NF]),Wp=ht({},[...lc,...BF]),U_=function(H,ue,Pe){return ue.namespaceURI===St?H==="svg":ue.namespaceURI===Qe?H==="svg"&&(Pe==="annotation-xml"||Re[Pe]):!!Kp[H]},H_=function(H,ue,Pe){return ue.namespaceURI===St?H==="math":ue.namespaceURI===dt?H==="math"&&Ve[Pe]:!!Wp[H]},K_=function(H,ue,Pe){return ue.namespaceURI===dt&&!Ve[Pe]||ue.namespaceURI===Qe&&!Re[Pe]?!1:!Wp[H]&&(st[H]||!Kp[H])},W_=function(H){let ue=w(H);(!ue||!ue.tagName)&&(ue={namespaceURI:It,tagName:"template"});const Pe=Go(H.tagName),Ne=Go(ue.tagName);return $o[H.namespaceURI]?H.namespaceURI===dt?U_(Pe,ue,Ne):H.namespaceURI===Qe?H_(Pe,ue,Ne):H.namespaceURI===St?K_(Pe,ue,Ne):!!(Nt==="application/xhtml+xml"&&$o[H.namespaceURI]):!1},cl=function(H){No(t.removed,{element:H});try{w(H).removeChild(H)}catch{if(m(H),!w(H))throw vl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Gp=function(H,ue,Pe){try{y(H,ue)}catch{try{H.removeAttribute(Pe)}catch{}}},zs=function(H){js(H);const ue=C(H);if(ue){const Ne=[];ar(ue,et=>{No(Ne,et)}),ar(Ne,et=>{try{m(et)}catch{}})}const Pe=q(H);if(Pe)for(let Ne=Pe.length-1;Ne>=0;--Ne){const et=Pe[Ne],pt=et&&et.name;typeof pt=="string"&&Gp(H,et,pt)}},Wl=function(H,ue,Pe){if(!Pe)try{Pe=ue.getAttributeNode(H)}catch{Pe=null}No(t.removed,{attribute:Pe||null,from:ue});try{Pe?y(ue,Pe):ue.removeAttribute(H)}catch{try{ue.removeAttribute(H)}catch{}}if(H==="is")if(it||Be)try{cl(ue)}catch{}else try{ue.setAttribute(H,"")}catch{}},G_=function(H){const ue=q(H);if(ue)for(let Pe=ue.length-1;Pe>=0;--Pe){const Ne=ue[Pe],et=Ne&&Ne.name;typeof et!="string"||X[Bt(et)]||Gp(H,Ne,et)}},js=function(H){const ue=[H];for(;ue.length>0;){const Pe=ue.pop();L(Pe)===_a.element&&G_(Pe);const Ne=C(Pe);if(Ne)for(let et=Ne.length-1;et>=0;--et)ue.push(Ne[et])}},Yp=function(H,ue){return at?H==="patchsrc"?!0:H==="for"&&ue!=="label"&&ue!=="output":!1},Y_=function(H){if(!at)return;const ue=[H];for(;ue.length>0;){const Pe=ue.pop(),Ne=L(Pe);if(Ne===_a.processingInstruction||Ne===_a.comment&&ta(ag,Pe.data)){try{m(Pe)}catch{}continue}if(Ne===_a.element){const pt=Pe,vt=Bt(W(Pe));try{pt.hasAttribute&&pt.hasAttribute("patchsrc")&&pt.removeAttribute("patchsrc"),pt.hasAttribute&&pt.hasAttribute("for")&&Yp("for",vt)&&pt.removeAttribute("for")}catch{}}const et=C(Pe);if(et)for(let pt=et.length-1;pt>=0;--pt)ue.push(et[pt])}},Jp=function(H){let ue=null,Pe=null;if(We)H="<remove></remove>"+H;else{const pt=Kh(H,/^[\r\n\t ]+/);Pe=pt&&pt[0]}Nt==="application/xhtml+xml"&&It===St&&(H='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+H+"</body></html>");const Ne=T?V(H):H;if(It===St)try{ue=new c().parseFromString(Ne,Nt)}catch{}if(!ue||!ue.documentElement){ue=Ae.createDocument(It,"template",null);try{ue.documentElement.innerHTML=Kl?R:Ne}catch{}}const et=ue.body||ue.documentElement;return H&&Pe&&et.insertBefore(a.createTextNode(Pe),et.childNodes[0]||null),It===St?ne.call(ue,nt?"html":"body")[0]:nt?ue.documentElement:et},Zp=function(H){const ue=B?B(H):H.ownerDocument;return _e.call(ue||H,H,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Us=function(H){return H=Bo(H,de," "),H=Bo(H,ve," "),H=Bo(H,Z," "),H},ld=function(H){var ue;H.normalize();const Pe=B?B(H):H.ownerDocument,Ne=_e.call(Pe||H,H,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let et=Ne.nextNode();for(;et;)et.data=Us(et.data),et=Ne.nextNode();const pt=(ue=H.querySelectorAll)===null||ue===void 0?void 0:ue.call(H,"template");pt&&ar(pt,vt=>{wr(vt.content)&&ld(vt.content)})},Hs=function(H){const ue=I?I(H):null;return typeof ue!="string"||Bt(ue)!=="form"?!1:typeof H.nodeName!="string"||typeof H.textContent!="string"||typeof H.removeChild!="function"||H.attributes!==q(H)||typeof H.removeAttribute!="function"||typeof H.removeAttributeNode!="function"||typeof H.getAttributeNode!="function"||typeof H.setAttribute!="function"||typeof H.namespaceURI!="string"||typeof H.insertBefore!="function"||typeof H.hasChildNodes!="function"||H.nodeType!==O(H)||H.childNodes!==C(H)},wr=function(H){if(!O||typeof H!="object"||H===null)return!1;try{return O(H)===_a.documentFragment}catch{return!1}},So=function(H){if(!O||typeof H!="object"||H===null)return!1;try{return typeof O(H)=="number"}catch{return!1}};function tn(qe,H,ue){qe.length!==0&&ar(qe,Pe=>{Pe.call(t,H,ue,kr)})}const J_=function(H,ue){return!!(at&&H.hasChildNodes()&&!So(H.firstElementChild)&&ta(tg,H.textContent)&&ta(tg,H.innerHTML)||at&&H.namespaceURI===St&&ZF[ue]&&(So(H.firstElementChild)||typeof H.textContent=="string"&&ta(XF[ue],H.textContent))||H.nodeType===_a.processingInstruction||at&&H.nodeType===_a.comment&&ta(ag,H.data))},Ks=function(H,ue){if(H instanceof RegExp)return ta(H,ue);if(H instanceof Function){for(var Pe=arguments.length,Ne=new Array(Pe>2?Pe-2:0),et=2;et<Pe;et++)Ne[et-2]=arguments[et];return!!H(ue,...Ne)}return!1},Z_=function(H,ue,Pe){if(!Se[ue]&&tm(ue)&&Ks(ke.tagNameCheck,ue))return!1;if(sl&&!Yt[ue]){const Ne=w(H),et=C(H);if(et&&Ne){const pt=et.length;for(let vt=pt-1;vt>=0;--vt){const Rt=H===Pe?v(et[vt],!0):et[vt];Ne.insertBefore(Rt,x(H))}}}return cl(H),!0},Xp=function(H,ue,Pe,Ne){return H.length===0?ue:ue===Pe||ue===Ne?xa(ue):ue},$r=function(H,ue){return H===ue||w(H)!==null?!1:(En&&js(H),!0)},Qp=function(H,ue){if(tn(F.beforeSanitizeElements,H,null),$r(H,ue))return!0;if(Hs(H))return cl(H),!0;const Pe=Bt(W(H));if(U=Xp(F.uponSanitizeElement,U,ce,ge),tn(F.uponSanitizeElement,H,{tagName:Pe,allowedTags:U}),$r(H,ue))return!0;if(J_(H,Pe))return cl(H),!0;if(Se[Pe]||!(se.tagCheck instanceof Function&&se.tagCheck(Pe))&&!U[Pe]){const Ne=Z_(H,Pe,ue);return Ne===!1&&(tn(F.afterSanitizeElements,H,null),$r(H,ue))?!0:Ne}if(L(H)===_a.element&&!W_(H)||(Pe==="noscript"||Pe==="noembed"||Pe==="noframes")&&ta(YF,H.innerHTML))return cl(H),!0;if(Ze&&H.nodeType===_a.text){const Ne=Us(H.textContent);H.textContent!==Ne&&(No(t.removed,{element:H.cloneNode()}),H.textContent=Ne)}return tn(F.afterSanitizeElements,H,null),$r(H,ue)},em=function(H,ue,Pe){if(Te[ue]||Yp(ue,H)||Je&&(ue==="id"||ue==="name")&&(Pe in a||Pe in j_))return!1;const Ne=X[ue]||se.attributeCheck instanceof Function&&se.attributeCheck(ue,H);return Ce&&ta(he,ue)||Me&&ta(J,ue)?!0:Ne?De[ue]||ta(P,Bo(Pe,te,""))||(ue==="src"||ue==="xlink:href"||ue==="href")&&H!=="script"&&Wh(Pe,"data:")===0&&An[H]||Fe&&!ta(ee,Bo(Pe,te,""))?!0:!Pe:tm(H)&&Ks(ke.tagNameCheck,H)&&Ks(ke.attributeNameCheck,ue,H)||ue==="is"&&ke.allowCustomizedBuiltInElements&&Ks(ke.tagNameCheck,Pe)},X_=ht({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),tm=function(H){return!X_[Go(H)]&&ta($,H)},Q_=function(H,ue,Pe,Ne){if(T&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!Pe)switch(d.getAttributeType(H,ue)){case"TrustedHTML":return V(Ne);case"TrustedScriptURL":return K(Ne)}return Ne},ex=function(H,ue,Pe,Ne){try{return Pe?H.setAttributeNS(Pe,ue,Ne):H.setAttribute(ue,Ne),Hs(H)?(cl(H),!1):!0}catch{return Wl(ue,H),!1}},am=function(H,ue){if(tn(F.beforeSanitizeAttributes,H,null),$r(H,ue))return;const Pe=H.attributes;if(!Pe||Hs(H))return;X=Xp(F.uponSanitizeAttribute,X,oe,be);const Ne={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let et=Pe.length;const pt=Bt(H.nodeName);for(;et--;){const vt=Pe[et],Rt=vt.name,Ta=vt.namespaceURI,ya=vt.value,Cr=Bt(Rt),od=ya;let sa=Rt==="value"?od:DF(od),nm=!1;if(Ne.attrName=Cr,Ne.attrValue=sa,Ne.keepAttr=!0,Ne.forceKeepAttr=void 0,tn(F.uponSanitizeAttribute,H,Ne),sa=Ne.attrValue,Ot&&(Cr==="id"||Cr==="name")&&Wh(sa,Gt)!==0&&(Wl(Rt,H,vt),sa=Gt+sa,nm=!0),at&&ta(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,sa)){Wl(Rt,H,vt);continue}if(Cr==="attributename"&&Kh(sa,"href")){Wl(Rt,H,vt);continue}if(!Ne.forceKeepAttr){if(!Ne.keepAttr){Wl(Rt,H,vt);continue}if(!Ue&&ta(JF,sa)){Wl(Rt,H,vt);continue}if(Ze&&(sa=Us(sa)),!em(pt,Cr,sa)){Wl(Rt,H,vt);continue}sa=Q_(pt,Cr,Ta,sa),sa!==od&&ex(H,Rt,Ta,sa)&&nm&&Hh(t.removed)}}tn(F.afterSanitizeAttributes,H,null),$r(H,ue)},Ws=function(H){let ue=null;const Pe=Zp(H);for(tn(F.beforeSanitizeShadowDOM,H,null);ue=Pe.nextNode();)if(tn(F.uponSanitizeShadowNode,ue,null),Qp(ue,H),am(ue,H),wr(ue.content)&&Ws(ue.content),L(ue)===_a.element){const Ne=S(ue);wr(Ne)&&(rd(Ne),Ws(Ne))}tn(F.afterSanitizeShadowDOM,H,null)},rd=function(H){const ue=[{node:H,shadow:null}];for(;ue.length>0;){const Pe=ue.pop();if(Pe.shadow){Ws(Pe.shadow);continue}const Ne=Pe.node,et=L(Ne)===_a.element,pt=C(Ne);if(pt)for(let vt=pt.length-1;vt>=0;--vt)ue.push({node:pt[vt],shadow:null});if(et){const vt=I?I(Ne):null;if(typeof vt=="string"&&Bt(vt)==="template"){const Rt=Ne.content;wr(Rt)&&ue.push({node:Rt,shadow:null})}}if(et){const vt=S(Ne);wr(vt)&&ue.push({node:null,shadow:vt},{node:vt,shadow:null})}}};return t.sanitize=function(qe){let H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue=null,Pe=null,Ne=null,et=null;if(Kl=!qe,Kl&&(qe="<!-->"),typeof qe!="string"&&!So(qe)&&(qe=qF(qe),typeof qe!="string"))throw vl("dirty is not a string, aborting");if(!t.isSupported)return qe;$e?(U=ge,X=be):nd(H),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(U=xa(U)),F.uponSanitizeAttribute.length>0&&(X=xa(X)),t.removed=[];const pt=En&&typeof qe!="string"&&So(qe);if(pt){Y_(qe);const Ta=W(qe);if(typeof Ta=="string"){const ya=Bt(Ta);if(!U[ya]||Se[ya])throw zs(qe),vl("root node is forbidden and cannot be sanitized in-place")}if(Hs(qe))throw zs(qe),vl("root node is clobbered and cannot be sanitized in-place");try{rd(qe)}catch(ya){throw zs(qe),ya}}else if(So(qe))ue=Jp("<!---->"),Pe=ue.ownerDocument.importNode(qe,!0),Pe.nodeType===_a.element&&Pe.nodeName==="BODY"||Pe.nodeName==="HTML"?ue=Pe:ue.appendChild(Pe),rd(ue);else{if(!it&&!Ze&&!nt&&qe.indexOf("<")===-1)return T&&He?V(qe):qe;if(ue=Jp(qe),!ue)return it?null:He?R:""}ue&&We&&cl(ue.firstChild);const vt=pt?qe:ue;try{const Ta=Zp(vt);for(;Ne=Ta.nextNode();)Qp(Ne,vt),am(Ne,vt),wr(Ne.content)&&Ws(Ne.content)}catch(Ta){throw pt&&(zs(qe),ar(t.removed,ya=>{ya.element&&js(ya.element)})),Ta}if(pt){let Ta=!1;if(ar(t.removed,ya=>{ya.element&&(ya.element===qe&&(Ta=!0),js(ya.element))}),Ta)throw vl("a node selected for removal could not be safely returned; refusing to sanitize in place");return Ze&&ld(qe),qe}if(it){if(Ze&&ld(ue),Be)for(et=xe.call(ue.ownerDocument);ue.firstChild;)et.appendChild(ue.firstChild);else et=ue;return(X.shadowroot||X.shadowrootmode)&&(et=fe.call(n,et,!0)),et}let Rt=nt?ue.outerHTML:ue.innerHTML;return nt&&U["!doctype"]&&ue.ownerDocument&&ue.ownerDocument.doctype&&ue.ownerDocument.doctype.name&&ta(WF,ue.ownerDocument.doctype.name)&&(Rt="<!DOCTYPE "+ue.ownerDocument.doctype.name+`>
|
||
`+Rt),Ze&&(Rt=Us(Rt)),T&&He?V(Rt):Rt},t.setConfig=function(){let qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nd(qe),$e=!0,ge=U,be=X},t.clearConfig=function(){kr=null,$e=!1,ge=null,be=null,T=G,R=""},t.isValidAttribute=function(qe,H,ue){kr||nd({});const Pe=Bt(qe),Ne=Bt(H);return em(Pe,Ne,ue)},t.addHook=function(qe,H){typeof H=="function"&&fa(F,qe)&&No(F[qe],H)},t.removeHook=function(qe,H){if(fa(F,qe)){if(H!==void 0){const ue=TF(F[qe],H);return ue===-1?void 0:MF(F[qe],ue,1)[0]}return Hh(F[qe])}},t.removeHooks=function(qe){fa(F,qe)&&(F[qe]=[])},t.removeAllHooks=function(){F=ng()},t}var tV=y_();const aV=["http","https","mailto","tel"],nV=/[\x00-\x20\x7f]+/g,lV=/^([a-z][a-z0-9+.-]*):/i;function b_(e){if(e==null)return!1;const t=e.replace(nV,"");if(t==="")return!1;const a=lV.exec(t);if(a)return aV.includes(a[1].toLowerCase());try{return new URL(t,"https://admin.invalid/"),!0}catch{return!1}}const rV=["script","style","template","noscript","iframe","frame","frameset","object","embed","applet","svg","math","title","head","meta","link","base"],__=Object.freeze({ALLOWED_TAGS:[...f_],ALLOWED_ATTR:["href"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1,ADD_FORBID_CONTENTS:[...rV],KEEP_CONTENT:!0,RETURN_TRUSTED_TYPE:!1}),oV='<p onclick="x"><b>a</b><script>b<\/script><a href="javascript:c">d</a></p>',sV="<p><b>a</b><a>d</a></p>";let pi=null,sc=null;function x_(){return pi===null&&typeof window<"u"&&(pi=tV(window),pi.addHook("uponSanitizeAttribute",(e,t)=>{t.attrName==="href"&&(e.nodeName!=="A"||!b_(t.attrValue))&&(t.keepAttr=!1)})),pi}function iV(){if(sc===null){const e=x_();sc=e!==null&&e.isSupported&&e.sanitize(oV,__)===sV}return sc}function uV(e){return e===""||!iV()?"":x_().sanitize(e,__)}const dV=["for"],cV=["id","aria-invalid","aria-describedby"],fV=["id"],pV={class:"flex justify-end gap-2"},mV=ae({__name:"LinkPopover",props:{open:{type:Boolean},href:{},inLink:{type:Boolean},idPrefix:{}},emits:["apply","remove","update:open","closed"],setup(e,{emit:t}){const a=e,n=t,l=E(""),r=E(!1),o=E(null);let i=!1;ze(()=>a.open,async m=>{m&&(l.value=a.href,r.value=!1,i=!1,await Ge(),o.value?.focus(),o.value?.select())});function u(){const m=l.value.trim();if(!b_(m)){r.value=!0,o.value?.focus();return}i=!0,n("apply",m)}function c(){i=!0,n("remove")}function d(m){m.key==="Enter"&&(m.preventDefault(),u())}function p(m){n("update:open",m)}function v(m){m.preventDefault(),n("closed",i)}return(m,y)=>(f(),j(s(i0),{open:e.open,"onUpdate:open":p},{default:N(()=>[M(s(U6),{"as-child":""},{default:N(()=>[Ee(m.$slots,"default")]),_:3}),M(s(c0),null,{default:N(()=>[M(s(d0),{"data-richeditor-link":"",align:"start","side-offset":8,class:"z-50 flex w-[320px] flex-col gap-2 rounded-inner border border-border bg-surface p-4 text-text shadow-menu",onCloseAutoFocus:v},{default:N(()=>[g("label",{for:`${e.idPrefix}-link-url`,class:"font-semibold"},_(s(h)("backend::lang.richeditor.link_url")),9,dV),Jt(g("input",{id:`${e.idPrefix}-link-url`,ref_key:"input",ref:o,"onUpdate:modelValue":y[0]||(y[0]=x=>l.value=x),type:"url",autocomplete:"off",spellcheck:"false",class:pe([s(Lt)(r.value),"h-input"]),"aria-invalid":r.value?"true":void 0,"aria-describedby":r.value?`${e.idPrefix}-link-error`:void 0,onInput:y[1]||(y[1]=x=>r.value=!1),onKeydown:d},null,42,cV),[[Ua,l.value]]),r.value?(f(),b("p",{key:0,id:`${e.idPrefix}-link-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.richeditor.link_invalid")),1)],8,fV)):Y("",!0),g("div",pV,[e.inLink?(f(),j(Ke,{key:0,variant:"ghost",size:"sm","data-action":"richeditor-unlink",onClick:c},{default:N(()=>[ye(_(s(h)("backend::lang.richeditor.unlink")),1)]),_:1})):Y("",!0),M(Ke,{variant:"primary",size:"sm","data-action":"richeditor-link-apply",onClick:u},{default:N(()=>[ye(_(s(h)("backend::lang.richeditor.link_apply")),1)]),_:1})])]),_:1})]),_:1})]),_:3},8,["open"]))}}),vV=["id"],hV=["innerHTML"],gV={key:1,class:"text-muted"},yV={key:1,"data-richeditor-loading":"","aria-busy":"true",class:"h-[200px] rounded-control bg-skel"},bV={key:2,class:"flex flex-col gap-1.5"},_V={key:0,"data-richeditor-load-failed":"",class:"text-[13px] text-muted"},xV=["data-richeditor"],kV={key:1,role:"note","data-richeditor-lossy":"",class:"flex items-start gap-2 border-b border-border bg-surface px-3.5 py-2.5 text-[13px] text-muted"},wV=["id","name","value","aria-invalid","aria-describedby"],mi="inline-flex size-8 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text aria-pressed:bg-sel aria-pressed:text-text disabled:cursor-not-allowed disabled:opacity-40",$V=ae({__name:"RichEditorField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>!!a.field.readOnly),r=k(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),o=k(()=>l.value?uV(r.value):""),i=E("loading"),u=E(!1),c=E(""),d=E(Vh(r.value)),p=E(null),v=E(null),m=pr(null),y=E(0),x=E(!1),C=E("");let w=null,S=!1,q=null,O="";const I=k(()=>`${a.controlId}-label`),B=k(()=>[Lt(a.invalid).replace(" px-3.5",""),"overflow-hidden focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]"]);function L(){const F={class:"summer-markdown min-h-[160px] max-h-[480px] overflow-y-auto px-3.5 py-2.5 outline-none",role:"textbox","aria-multiline":"true","aria-labelledby":I.value,"data-richeditor-area":""};return u.value||(F.id=a.controlId),a.describedBy&&(F["aria-describedby"]=a.describedBy),a.invalid&&(F["aria-invalid"]="true"),F}function W(F){q=F,n("update:modelValue",F)}function T(){m.value&&w&&W(w.editorValue(m.value))}$t(async()=>{if(!l.value){try{w=await m_(()=>import("./editor-BNe2uH1t.js"),__vite__mapDeps([0,1]),import.meta.url)}catch{if(S)return;i.value="failed",c.value=r.value,O=r.value,u.value=!0;return}S||(i.value="ready",await Ge(),!(S||!p.value)&&(m.value=w.createRichEditor({element:p.value,content:r.value,attributes:L(),onChange:T,onTransaction:()=>{y.value++}})))}}),Dt(()=>{S=!0,m.value?.destroy(),m.value=null}),ze(r,F=>{F!==q&&(q=null,d.value=Vh(F),u.value&&(c.value=F,O=F),m.value&&w&&w.loadContent(m.value,F))}),ze([()=>a.invalid,()=>a.describedBy,u],()=>{m.value?.setOptions({editorProps:{attributes:L()}})});const R=[[{key:"bold",icon:A$,label:"backend::lang.richeditor.bold",run:F=>F.chain().focus().toggleBold().run(),active:F=>F.isActive("bold")},{key:"italic",icon:uS,label:"backend::lang.richeditor.italic",run:F=>F.chain().focus().toggleItalic().run(),active:F=>F.isActive("italic")},{key:"underline",icon:L3,label:"backend::lang.richeditor.underline",run:F=>F.chain().focus().toggleUnderline().run(),active:F=>F.isActive("underline")}],[{key:"heading",icon:YC,label:"backend::lang.richeditor.heading",run:F=>F.chain().focus().toggleHeading({level:3}).run(),active:F=>F.isActive("heading",{level:3})},{key:"bullet_list",icon:Rf,label:"backend::lang.richeditor.bullet_list",run:F=>F.chain().focus().toggleBulletList().run(),active:F=>F.isActive("bulletList")},{key:"ordered_list",icon:Ab,label:"backend::lang.richeditor.ordered_list",run:F=>F.chain().focus().toggleOrderedList().run(),active:F=>F.isActive("orderedList")},{key:"quote",icon:i3,label:"backend::lang.richeditor.quote",run:F=>F.chain().focus().toggleBlockquote().run(),active:F=>F.isActive("blockquote")}]],G=[{key:"undo",icon:Lb,label:"backend::lang.richeditor.undo",run:F=>F.chain().focus().undo().run(),enabled:F=>F.can().undo()},{key:"redo",icon:d3,label:"backend::lang.richeditor.redo",run:F=>F.chain().focus().redo().run(),enabled:F=>F.can().redo()}],A=k(()=>{y.value;const F=m.value;return!F||u.value?null:{editor:F,inLink:F.isActive("link"),hasSelection:!F.state.selection.empty}});function D(F){if(F.active)return A.value&&F.active(A.value.editor)?"true":"false"}function z(F){const de=A.value;return!de||F.enabled!==void 0&&!F.enabled(de.editor)}function V(F){A.value&&!z(F)&&F.run(A.value.editor)}const K=k(()=>!!A.value&&(A.value.hasSelection||A.value.inLink));function re(){if(!A.value||!K.value)return;const F=A.value.editor.getAttributes("link").href;C.value=typeof F=="string"?F:"",x.value=!0}function ie(F){m.value?.chain().focus().extendMarkRange("link").setLink({href:F}).run(),x.value=!1}function Ae(){m.value?.chain().focus().extendMarkRange("link").unsetLink().run(),x.value=!1}function _e(F){if(x.value=!1,F){m.value?.commands.focus();return}v.value?.$el?.focus()}function xe(){if(!u.value){x.value=!1,c.value=r.value,O=r.value,u.value=!0;return}m.value&&w&&c.value!==O&&w.loadContent(m.value,c.value),u.value=!1}function ne(F){c.value=F.target.value,W(c.value)}function fe(F){(F.ctrlKey||F.metaKey)&&!F.altKey&&F.key.toLowerCase()==="k"&&A.value&&(F.preventDefault(),re())}return(F,de)=>l.value?(f(),b("div",{key:0,id:e.controlId,"data-richeditor-readonly":"",class:"rounded-control border border-border bg-subtle px-3.5 py-2.5"},[o.value!==""?(f(),b("div",{key:0,class:"summer-markdown",innerHTML:o.value},null,8,hV)):(f(),b("span",gV,_(s(h)("backend::lang.list.empty_value")),1))],8,vV)):i.value==="loading"?(f(),b("div",yV)):(f(),b("div",bV,[i.value==="failed"?(f(),b("p",_V,_(s(h)("backend::lang.richeditor.load_failed")),1)):Y("",!0),g("div",{"data-richeditor":e.field.name,class:pe(B.value),onKeydown:fe},[i.value==="ready"?(f(),j(s(ED),{key:0,"aria-label":s(h)("backend::lang.richeditor.toolbar"),"aria-controls":e.controlId,class:"flex flex-wrap items-center gap-1 border-b border-border bg-subtle p-1"},{default:N(()=>[(f(),b(me,null,Ie(R,(ve,Z)=>(f(),b(me,{key:Z},[Z>0?(f(),j(s(Kd),{key:0,class:"mx-1 h-5 w-px bg-border"})):Y("",!0),(f(!0),b(me,null,Ie(ve,he=>(f(),j(s(Io),{key:he.key,"data-tool":he.key,"aria-label":s(h)(he.label),title:s(h)(he.label),"aria-pressed":D(he),disabled:z(he),class:pe(mi),onMousedown:de[0]||(de[0]=mt(()=>{},["prevent"])),onClick:J=>V(he)},{default:N(()=>[(f(),j(Wt(he.icon),{size:16,"aria-hidden":"true"}))]),_:2},1032,["data-tool","aria-label","title","aria-pressed","disabled","onClick"]))),128))],64))),64)),M(s(Kd),{class:"mx-1 h-5 w-px bg-border"}),M(mV,{open:x.value,href:C.value,"in-link":!!A.value?.inLink,"id-prefix":e.controlId,"onUpdate:open":de[2]||(de[2]=ve=>{ve||(x.value=!1)}),onApply:ie,onRemove:Ae,onClosed:_e},{default:N(()=>[M(s(Io),{ref_key:"linkButton",ref:v,"data-tool":"link","aria-label":s(h)("backend::lang.richeditor.link"),title:s(h)("backend::lang.richeditor.link"),"aria-pressed":A.value?.inLink?"true":"false","aria-haspopup":"dialog","aria-expanded":x.value?"true":"false",disabled:!K.value,class:pe(mi),onMousedown:de[1]||(de[1]=mt(()=>{},["prevent"])),onClick:re},{default:N(()=>[M(s(Eb),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","title","aria-pressed","aria-expanded","disabled"])]),_:1},8,["open","href","in-link","id-prefix"]),M(s(Io),{"data-tool":"unlink","aria-label":s(h)("backend::lang.richeditor.unlink"),title:s(h)("backend::lang.richeditor.unlink"),disabled:!A.value?.inLink,class:pe(mi),onMousedown:de[3]||(de[3]=mt(()=>{},["prevent"])),onClick:Ae},{default:N(()=>[M(s(F3),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","title","disabled"]),M(s(Kd),{class:"mx-1 h-5 w-px bg-border"}),(f(),b(me,null,Ie(G,ve=>M(s(Io),{key:ve.key,"data-tool":ve.key,"aria-label":s(h)(ve.label),title:s(h)(ve.label),disabled:z(ve),class:pe(mi),onMousedown:de[4]||(de[4]=mt(()=>{},["prevent"])),onClick:Z=>V(ve)},{default:N(()=>[(f(),j(Wt(ve.icon),{size:16,"aria-hidden":"true"}))]),_:2},1032,["data-tool","aria-label","title","disabled","onClick"])),64)),M(s(Io),{"data-tool":"source","aria-pressed":u.value?"true":"false",class:"ml-auto inline-flex h-8 items-center gap-1.5 rounded-pager px-2 text-[13px] text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text aria-pressed:bg-sel aria-pressed:text-text",onMousedown:de[5]||(de[5]=mt(()=>{},["prevent"])),onClick:xe},{default:N(()=>[M(s(_b),{size:16,"aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.richeditor.source")),1)]),_:1},8,["aria-pressed"])]),_:1},8,["aria-label","aria-controls"])):Y("",!0),d.value&&i.value==="ready"?(f(),b("p",kV,[M(s(Vl),{size:14,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.richeditor.lossy_note")),1)])):Y("",!0),Jt(g("div",{ref_key:"mount",ref:p},null,512),[[vs,!u.value]]),u.value?(f(),b("textarea",{key:2,id:e.controlId,"data-richeditor-source":"",name:e.field.name,value:c.value,spellcheck:"false","aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"block min-h-[160px] w-full resize-y bg-surface px-3.5 py-2.5 font-mono text-[13px] text-text outline-none",onInput:ne},null,40,wV)):Y("",!0)],42,xV)]))}}),CV={role:"tablist",class:"inline-flex gap-1 rounded-inner border border-border bg-subtle p-1"},SV=["id","data-tab","aria-selected","aria-controls","tabindex","onClick","onKeydown"],EV=["aria-label"],td=ae({__name:"FormTabs",props:{tabs:{},modelValue:{},idPrefix:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;function l(r,o){const i=r.key==="ArrowRight"?1:r.key==="ArrowLeft"?-1:0;if(i===0)return;r.preventDefault();const u=(o+i+a.tabs.length)%a.tabs.length,c=a.tabs[u];c&&(n("update:modelValue",c.key),document.getElementById(uo(a.idPrefix,u))?.focus())}return(r,o)=>(f(),b("div",CV,[(f(!0),b(me,null,Ie(e.tabs,(i,u)=>(f(),b("button",{id:s(uo)(e.idPrefix,u),key:i.key,type:"button",role:"tab","data-tab":i.key,"aria-selected":i.key===e.modelValue?"true":"false","aria-controls":s(Vs)(e.idPrefix,u),tabindex:i.key===e.modelValue?0:-1,class:pe([i.key===e.modelValue?"bg-surface text-text shadow-tab":"text-muted hover:text-text","inline-flex h-[34px] items-center gap-2 rounded-tab px-4 font-semibold transition-colors duration-150 ease-out"]),onClick:c=>n("update:modelValue",i.key),onKeydown:c=>l(c,u)},[ye(_(i.label)+" ",1),i.errors>0?(f(),b("span",{key:0,"data-tab-errors":"","aria-label":s(wa)("backend::lang.form.tab_errors",i.errors),class:"inline-flex h-5 min-w-5 items-center justify-center rounded-pill bg-danger px-1.5 text-[11px] font-bold text-white"},_(i.errors),9,EV)):Y("",!0)],42,SV))),128))]))}}),AV={class:"flex items-start gap-3 p-6 pb-4"},TV={key:0,"data-child-loading":"","aria-hidden":"true",class:"grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},MV={key:1,role:"alert","data-child-load-failed":"",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},DV=["id","role","aria-labelledby"],OV=["disabled"],PV={class:"flex items-center gap-2.5 border-t border-border px-6 py-4"},IV={class:"ml-auto flex gap-2.5"},RV=ae({__name:"RelationChildModal",props:{open:{type:Boolean},source:{},ownerId:{},relation:{},schema:{},mode:{},childId:{},sessionKey:{},canDelete:{type:Boolean}},emits:["update:open","changed","gone","closed"],setup(e,{emit:t}){const a=e,n=t,l=E({}),r=E({}),o=E({}),i=E(!1),u=E(!1),c=E(!1),d=E(""),p=E(Vt),v=E(Ss()),m=E(0),y=E(0),{activeUploads:x,beginUpload:C}=qp(),w=E(null),S=ol();let q=0;const O=k(()=>`child-${a.relation}`),I=k(()=>a.mode==="preview"),B=k(()=>a.mode==="create"?"create":"update"),L=k(()=>{const $=((I.value?a.schema.viewForm:a.schema.manageForm)??[]).filter(P=>As(P,B.value));return I.value?$.map(P=>({...P,readOnly:!0,attributes:{...P.attributes??{},readonly:!0}})):$}),W=k(()=>L.value.map(te=>te.name)),T=k(()=>{if(!L.value.some($=>$.tab))return[];const te=[];for(const $ of L.value){const P=va($);let U=te.find(ce=>ce.key===P);U||(U={key:P,label:$.tab||h("backend::lang.form.tab_default"),errors:0},P===Vt?te.unshift(U):te.push(U)),o.value[$.name]&&(U.errors+=1)}return te}),R=k(()=>Math.max(T.value.findIndex(te=>te.key===p.value),0)),G=k(()=>{if(T.value.length===0)return L.value;const te=T.value[R.value]?.key??Vt;return L.value.filter($=>va($)===te)}),A=k(()=>{const te=a.schema.messages;return a.mode==="create"?tt(te.createTitle):tt(I.value?te.previewTitle:te.updateTitle)}),D=k(()=>tt(a.mode==="create"?a.schema.messages.createSubmit:a.schema.messages.updateSubmit)),z=k(()=>!I.value&&!i.value&&!u.value&&(m.value>0||x.value>0||El(Ra(L.value,l.value))!==d.value));function V(){return{[ql]:a.sessionKey,[Z0]:v.value}}function K(){return{...a.source,id:a.ownerId,name:a.relation}}yt(_o,{get key(){return a.sessionKey},get childKey(){return v.value},get recordId(){return a.childId??0},routes:te=>eR(a.source,a.ownerId,a.relation,a.childId??0,te,a.sessionKey,v.value),markDirty:()=>{m.value++},pendingChanges:At(m),revision:At(y),beginUpload:C,activeUploads:At(x)}),yt(Bs,k(()=>l.value)),yt(Rp,_e);const ie=ct(su,k(()=>[]));yt(su,ie),yt(Np,At(E({})));function Ae(te,$){const P=r.value[te]??[],U=P.findIndex(X=>X.value===$.value),ce=[...P];U>=0?ce[U]=$:ce.push($),r.value={...r.value,[te]:ce}}yt(Fp,Ae);function _e(te,$){if(l.value={...l.value,[te]:$},o.value[te]){const P={...o.value};delete P[te],o.value=P}}function xe(te,$){const P=ie.value,U={...te};for(const ce of L.value)ce.type==="password"?U[ce.name]="":Ll(ce)&&(U[ce.name]=D_(te[ce.name],P));l.value=U,r.value=$?.labels??{},d.value=El(Ra(L.value,l.value))}async function ne(){await Ge(),w.value?.querySelector('input:not([type="hidden"]):not([tabindex="-1"]), select, textarea, button, [contenteditable="true"], [tabindex="0"]')?.focus()}function fe(){n("update:open",!1),Oe(h("backend::lang.relation.child_gone"),"danger"),n("gone")}async function F(){const te=++q;if(o.value={},u.value=!1,c.value=!1,m.value=0,v.value=Ss(),p.value=Vt,a.mode==="create"||a.childId===null){i.value=!1,xe(jp(L.value,ie.value)),p.value=T.value[0]?.key??Vt,await ne();return}i.value=!0;try{const $=await Le.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}",{params:{path:{...K(),child:a.childId},header:V()}});if(te!==q)return;if($.data)xe($.data.data,$.data.meta),p.value=T.value[0]?.key??Vt;else if($.response.status===404){fe();return}else u.value=!0}catch{te===q&&(u.value=!0)}finally{te===q&&(i.value=!1)}te===q&&await ne()}ze(()=>a.open,te=>{te?F():q++},{immediate:!0});async function de(te){if(te){n("update:open",!0);return}c.value||z.value&&!await S.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})||n("update:open",!1)}async function ve(te){o.value=Nl(te);const $=L.value.filter(U=>o.value[U.name]),P=$.find(U=>va(U)===p.value)??$[0];P&&(T.value.length>0&&(p.value=va(P)),await Ge(),Un(O.value,P.name))}async function Z(){if(!(c.value||I.value||i.value||u.value||x.value>0)){c.value=!0;try{const te=Ra(L.value,l.value),$=a.mode==="create"||a.childId===null?await Le.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records",{params:{path:K(),header:V()},body:te}):await Le.PUT("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}",{params:{path:{...K(),child:a.childId},header:V()},body:te});if($.data){const U=a.mode==="create"?"created":"updated";o.value={},m.value=0,n("update:open",!1),Oe(tt(U==="created"?a.schema.messages.created:a.schema.messages.updated)),n("changed",U);return}const P=$.response.status;P===422?await ve($.error?.error.details):P===404?fe():Oe($.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{c.value=!1}}}async function he(){if(c.value||a.childId===null)return;const te=a.childId;if(await S.ask({message:tt(a.schema.messages.deleteOneConfirm),confirmLabel:h("backend::lang.form.delete"),danger:!0})){c.value=!0;try{const P=await Le.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/delete",{params:{path:K(),header:{[ql]:a.sessionKey}},body:{ids:[te]}});if(P.data){m.value=0,n("update:open",!1),Oe(tt(a.schema.messages.deleted,P.data.data.deleted||1)),n("changed","deleted");return}if(P.response.status===404){fe();return}Oe(P.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{c.value=!1}}}function J(te){te.preventDefault()}function ee(te){te.preventDefault(),n("closed")}return(te,$)=>(f(),b(me,null,[M(s(al),{open:e.open,"onUpdate:open":de},{default:N(()=>[M(s(zl),null,{default:N(()=>[M(s(ll),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),M(s(nl),{"data-relation-child-modal":"","data-dialog-content":"","data-mode":e.mode,"aria-modal":"true","aria-describedby":void 0,class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[720px] -translate-x-1/2 -translate-y-1/2 flex-col rounded-modal bg-surface text-text shadow-pop",onOpenAutoFocus:J,onCloseAutoFocus:ee},{default:N(()=>[g("div",AV,[M(s(bn),{class:"min-w-0 flex-1 text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(A.value),1)]),_:1}),M(s(Pl),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),disabled:c.value,class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:N(()=>[M(s(qt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","disabled"])]),g("div",{ref_key:"body",ref:w,"data-child-body":"",class:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 pb-6"},[i.value?(f(),b("div",TV,[(f(),b(me,null,Ie(6,P=>g("div",{key:P,class:"flex flex-col gap-1.5"},[...$[3]||($[3]=[g("span",{class:"block h-3 w-24 rounded-[6px] bg-skel"},null,-1),g("span",{class:"block h-input rounded-control bg-skel"},null,-1)])])),64))])):u.value?(f(),b("p",MV,_(s(h)("backend::lang.relation.child_load_failed")),1)):(f(),b(me,{key:2},[M(ko,{errors:o.value,"field-names":W.value},null,8,["errors","field-names"]),T.value.length>0?(f(),j(td,{key:0,modelValue:p.value,"onUpdate:modelValue":$[0]||($[0]=P=>p.value=P),tabs:T.value,"id-prefix":O.value,class:"self-start"},null,8,["modelValue","tabs","id-prefix"])):Y("",!0),g("form",{id:T.value.length>0?s(Vs)(O.value,R.value):void 0,role:T.value.length>0?"tabpanel":void 0,"aria-labelledby":T.value.length>0?s(uo)(O.value,R.value):void 0,novalidate:"",onSubmit:mt(Z,["prevent"])},[g("fieldset",{disabled:c.value||I.value,class:"m-0 min-w-0 border-0 p-0"},[M(xo,{fields:G.value,values:l.value,errors:o.value,labels:r.value,source:e.source,"record-id":e.childId,"id-prefix":O.value,onUpdate:_e},null,8,["fields","values","errors","labels","source","record-id","id-prefix"])],8,OV)],40,DV)],64))],512),g("div",PV,[e.mode==="update"&&e.canDelete&&!i.value&&!u.value?(f(),j(Ke,{key:0,variant:"danger","data-action":"delete-child",icon:s(Xa),disabled:c.value,onClick:he},{default:N(()=>[ye(_(s(h)("backend::lang.form.delete")),1)]),_:1},8,["icon","disabled"])):Y("",!0),g("div",IV,[I.value?(f(),j(Ke,{key:0,variant:"outline","data-action":"cancel",onClick:$[1]||($[1]=P=>de(!1))},{default:N(()=>[ye(_(s(h)("backend::lang.form.close")),1)]),_:1})):(f(),b(me,{key:1},[M(Ke,{variant:"ghost","data-action":"cancel",disabled:c.value,onClick:$[2]||($[2]=P=>de(!1))},{default:N(()=>[ye(_(s(h)("backend::lang.form.cancel")),1)]),_:1},8,["disabled"]),u.value?Y("",!0):(f(),j(Ke,{key:0,variant:"primary","data-action":"save-child",hotkey:"mod+s mod+enter",title:s(Ha)(D.value,"mod+s"),disabled:c.value||i.value||s(x)>0,onClick:Z},{default:N(()=>[ye(_(c.value?s(h)("backend::lang.form.saving"):D.value),1)]),_:1},8,["title","disabled"]))],64))])])]),_:1},8,["data-mode"])]),_:1})]),_:1},8,["open"]),M(Sn,{open:s(S).request.value!==null,message:s(S).request.value?.message??"","confirm-label":s(S).request.value?.confirmLabel,danger:s(S).request.value?.danger,onConfirm:s(S).confirm,onCancel:s(S).cancel},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])],64))}}),qV={class:"flex items-start gap-3"},LV={class:"flex min-w-0 flex-1 flex-col gap-1"},NV=["title"],BV={key:0,class:"truncate text-[13px] text-muted"},FV=["disabled"],VV={class:"relative block"},zV={class:"sr-only"},jV=["value","placeholder"],UV=["aria-multiselectable","aria-label","aria-busy"],HV=["data-candidate","aria-selected","onClick","onKeydown"],KV={class:"flex size-8 shrink-0 items-center justify-center rounded-full bg-subtle text-[12px] font-bold","aria-hidden":"true"},WV={class:"flex min-w-0 flex-1 flex-col leading-tight"},GV={class:"truncate font-semibold"},YV={key:0,class:"truncate text-[13px] text-muted"},JV={key:0,class:"block size-2.5 rounded-full bg-primary"},ZV={key:0,role:"presentation",class:"px-1 py-3 text-[13px] text-muted"},XV={key:1,role:"presentation","data-candidates-empty":"",class:"px-1 py-3 text-[13px] text-muted"},QV=["aria-label"],e7={"data-candidates-range":"",class:"flex-1"},t7=["aria-label","disabled"],a7=["aria-label","disabled"],n7={class:"flex gap-2.5"},l7=["disabled"],r7=["disabled"],o7=["aria-keyshortcuts","title","disabled","aria-busy"],s7=5,i7=300,lg="inline-flex size-[34px] items-center justify-center rounded-tab border border-border text-text hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",u7=ae({__name:"RelationPickerModal",props:{open:{type:Boolean},source:{},recordId:{},relation:{},schema:{},sessionKey:{}},emits:["update:open","linked","closed"],setup(e,{emit:t}){const a=e,n=t,l=E(""),r=E(1),o=E([]),i=E(null),u=E(!1),c=E(!1),d=E(new Set),p=E(null),v=E(1),m=E(null),y=E({}),x=E({}),C=E(null);let w=0,S=null;const q=k(()=>a.schema.manage.list.columns),O=k(()=>q.value[0]?.key??""),I=k(()=>q.value[1]?.key??""),B=k(()=>d.value.size),L=`relation-${a.relation}-candidates`,W=k(()=>a.schema.pivotForm??[]),T=k(()=>W.value.map($=>$.name)),R=k(()=>W.value.length>0),G=k(()=>`link-${a.relation}`);function A(){return a.sessionKey?{[ql]:a.sessionKey}:void 0}const D=k(()=>{const $=i.value;if(!$||$.total===0)return"";const P=($.page-1)*$.per_page+1,U=Math.min($.page*$.per_page,$.total);return h("backend::lang.relation.candidates_range",{from:P,to:U,total:$.total})}),z=k(()=>Math.max(i.value?.last_page??1,1));function V($){const P=$.id;return typeof P=="number"&&Number.isInteger(P)?P:typeof P=="string"&&/^\d+$/.test(P)?Number(P):null}function K($,P){const U=P===""?void 0:$[P];return typeof U=="string"||typeof U=="number"?String(U):""}function re($){return $.split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(P=>P.charAt(0).toUpperCase()).join("")}async function ie(){const $=++w;u.value=!0;try{const P=l.value.trim(),{data:U}=await Le.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/candidates",{params:{path:{...a.source,id:a.recordId,name:a.relation},query:{search:P===""?void 0:P,page:r.value,per_page:s7},header:A()}});if($!==w)return;o.value=U?.data??[],i.value=U?.meta??null}catch{$===w&&(o.value=[],i.value=null)}finally{$===w&&(u.value=!1)}}function Ae(){S!==null&&(clearTimeout(S),S=null),w++,l.value="",r.value=1,o.value=[],i.value=null,u.value=!1,d.value=new Set,v.value=1,m.value=null,y.value={},x.value={}}ze(()=>a.open,$=>{$?(Ae(),ie()):Ae()},{immediate:!0});function _e($){l.value=$.target.value,S!==null&&clearTimeout(S),S=setTimeout(()=>{S=null,r.value=1,ie()},i7)}function xe($){$<1||$>z.value||$===r.value||(r.value=$,ie())}function ne($){const P=V($);return P!==null&&d.value.has(P)}function fe($){const P=V($);if(P===null)return;if(R.value){d.value=new Set([P]),m.value=$;return}const U=new Set(d.value);U.has(P)?U.delete(P):U.add(P),d.value=U}async function F(){!R.value||d.value.size===0||!m.value||(v.value=2,y.value=jp(W.value,[]),x.value={},await Ge(),C.value?.querySelector('input, select, textarea, button, [contenteditable="true"]')?.focus())}async function de(){if(c.value)return;v.value=1,x.value={},await Ge(),(document.querySelector(`#${L} [aria-selected="true"]`)??p.value)?.focus()}function ve($,P){if(y.value={...y.value,[$]:P},x.value[$]){const U={...x.value};delete U[$],x.value=U}}function Z($,P,U){switch($.key){case" ":$.preventDefault(),fe(P);break;case"Enter":$.preventDefault(),fe(P),R.value&&F();break;case"ArrowDown":case"ArrowUp":{$.preventDefault();const ce=$.currentTarget.parentElement?.querySelectorAll('[role="option"]'),X=$.key==="ArrowDown"?1:-1;ce?.[Math.min(Math.max(U+X,0),ce.length-1)]?.focus();break}}}function he($){n("update:open",$)}async function J(){const $=[...d.value];if(c.value||$.length===0)return;const P=R.value;c.value=!0;try{const U=await Le.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/link",{params:{path:{...a.source,id:a.recordId,name:a.relation},header:A()},body:P?{ids:$.slice(0,1),pivot:Ra(W.value,y.value)}:{ids:$}});if(U.data){he(!1),n("linked",U.data.data.linked??$.length);return}const ce=U.response.status;if(P&&ce===422){x.value=Nl(U.error?.error.details);const X=W.value.find(oe=>x.value[oe.name]);X&&(await Ge(),Un(G.value,X.name));return}if(P&&ce===404){Oe(h("backend::lang.relation.child_gone"),"danger"),d.value=new Set,m.value=null,v.value=1,ie();return}if(P){Oe(h("backend::lang.form.error_generic"),"danger");return}Oe(U.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{c.value=!1}}function ee($){$.preventDefault(),p.value?.focus()}function te($){$.preventDefault(),n("closed")}return Dt(()=>{S!==null&&clearTimeout(S)}),($,P)=>(f(),j(s(al),{open:e.open,"onUpdate:open":he},{default:N(()=>[M(s(zl),null,{default:N(()=>[M(s(ll),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),M(s(nl),{"data-relation-picker":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-modal bg-surface p-6 text-text shadow-pop",onOpenAutoFocus:ee,onCloseAutoFocus:te},{default:N(()=>[g("div",qV,[g("div",LV,[M(s(bn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(v.value===2?s(tt)(e.schema.messages.pivotTitle):s(tt)(e.schema.messages.link)),1)]),_:1}),v.value===1?(f(),j(s(hn),{key:0,class:"text-muted"},{default:N(()=>[ye(_(s(tt)(e.schema.messages.linkHint)),1)]),_:1})):(f(),j(s(hn),{key:1,class:"flex min-w-0 flex-col","data-chosen-record":""},{default:N(()=>[g("span",{class:"truncate font-semibold text-text",title:K(m.value??{},O.value)},_(K(m.value??{},O.value)),9,NV),I.value?(f(),b("span",BV,_(K(m.value??{},I.value)),1)):Y("",!0)]),_:1}))]),M(s(Pl),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:N(()=>[M(s(qt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),v.value===2?(f(),b("div",{key:0,ref_key:"stepTwo",ref:C,"data-pivot-step":"",class:"flex min-h-0 flex-col gap-4 overflow-y-auto"},[M(ko,{errors:x.value,"field-names":T.value},null,8,["errors","field-names"]),g("form",{novalidate:"",onSubmit:mt(J,["prevent"])},[g("fieldset",{disabled:c.value,class:"m-0 min-w-0 border-0 p-0"},[M(xo,{fields:W.value,values:y.value,errors:x.value,source:e.source,"record-id":null,"id-prefix":G.value,onUpdate:ve},null,8,["fields","values","errors","source","id-prefix"])],8,FV)],32)],512)):Y("",!0),Jt(g("label",VV,[g("span",zV,_(s(h)("backend::lang.list.search")),1),M(s(hr),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{ref_key:"searchInput",ref:p,type:"search","data-candidate-search":"",value:l.value,placeholder:s(tt)(e.schema.messages.candidateSearch),"aria-controls":L,class:"h-input w-full rounded-control border border-border-strong bg-surface pr-3.5 pl-10",onInput:_e},null,40,jV)],512),[[vs,v.value===1]]),Jt(g("ul",{id:L,role:"listbox","aria-multiselectable":R.value?"false":"true","aria-label":s(tt)(e.schema.messages.link),"aria-busy":u.value?"true":void 0,class:"flex min-h-0 flex-col gap-2 overflow-y-auto"},[(f(!0),b(me,null,Ie(o.value,(U,ce)=>(f(),b("li",{key:V(U)??`row-${ce}`,role:"option",tabindex:"0","data-candidate":V(U)??void 0,"aria-selected":ne(U)?"true":"false",class:pe([ne(U)?"border-[#e0b020] bg-sel":"border-border hover:bg-hover","flex h-[54px] cursor-pointer items-center gap-3 rounded-inner border px-3 transition-colors duration-150 ease-out"]),onClick:X=>fe(U),onKeydown:X=>Z(X,U,ce)},[g("span",KV,_(re(K(U,O.value))),1),g("span",WV,[g("span",GV,_(K(U,O.value)),1),I.value?(f(),b("span",YV,_(K(U,I.value)),1)):Y("",!0)]),R.value?(f(),b("span",{key:0,"data-radio":"",class:pe([ne(U)?"border-primary":"border-border-strong bg-surface","flex size-[18px] shrink-0 items-center justify-center rounded-full border"]),"aria-hidden":"true"},[ne(U)?(f(),b("span",JV)):Y("",!0)],2)):(f(),b("span",{key:1,class:pe([ne(U)?"border-primary bg-primary text-on-primary":"border-border-strong bg-surface","flex size-[18px] shrink-0 items-center justify-center rounded-checkbox border"]),"aria-hidden":"true"},[ne(U)?(f(),j(s(Ba),{key:0,size:14})):Y("",!0)],2))],42,HV))),128)),u.value&&o.value.length===0?(f(),b("li",ZV,_(s(h)("backend::lang.list.loading")),1)):!u.value&&o.value.length===0?(f(),b("li",XV,_(s(h)("backend::lang.relation.no_candidates")),1)):Y("",!0)],8,UV),[[vs,v.value===1]]),v.value===1&&i.value&&i.value.total>0?(f(),b("nav",{key:1,"aria-label":s(h)("backend::lang.list.pagination"),class:"flex items-center gap-2 text-[13px] text-muted"},[g("span",e7,_(D.value),1),g("button",{type:"button","data-page":"prev","aria-label":s(h)("backend::lang.list.prev_page"),class:pe(lg),disabled:u.value||r.value<=1,onClick:P[0]||(P[0]=U=>xe(r.value-1))},[M(s(Is),{size:16,"aria-hidden":"true"})],8,t7),g("button",{type:"button","data-page":"next","aria-label":s(h)("backend::lang.list.next_page"),class:pe(lg),disabled:u.value||r.value>=z.value,onClick:P[1]||(P[1]=U=>xe(r.value+1))},[M(s(vr),{size:16,"aria-hidden":"true"})],8,a7)],8,QV)):Y("",!0),g("div",n7,[v.value===2?(f(),b("button",{key:0,type:"button","data-action":"back",disabled:c.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:de},_(s(h)("backend::lang.relation.back")),9,l7)):(f(),j(s(Pl),{key:1,"data-action":"cancel",class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover"},{default:N(()=>[ye(_(s(h)("backend::lang.form.cancel")),1)]),_:1})),R.value&&v.value===1?(f(),b("button",{key:2,type:"button","data-action":"next",disabled:B.value===0,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",onClick:F},_(s(h)("backend::lang.relation.next")),9,r7)):(f(),b("button",{key:3,type:"button","data-action":"confirm-link","data-hotkey":"mod+s mod+enter","aria-keyshortcuts":s(Ju)("mod+s mod+enter"),title:s(Ha)(R.value?s(tt)(e.schema.messages.linkSubmit):s(h)("backend::lang.relation.add_count",{count:B.value}),"mod+s"),disabled:c.value||B.value===0,"aria-busy":c.value?"true":void 0,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",onClick:J},[R.value?(f(),b(me,{key:0},[ye(_(c.value?s(h)("backend::lang.form.saving"):s(tt)(e.schema.messages.linkSubmit)),1)],64)):(f(),b(me,{key:1},[ye(_(s(h)("backend::lang.relation.add_count",{count:B.value})),1)],64))],8,o7))])]),_:1})]),_:1})]),_:1},8,["open"]))}}),d7={class:"flex items-start gap-3"},c7={class:"flex min-w-0 flex-1 flex-col gap-1"},f7={key:0,"data-pivot-loading":"","aria-hidden":"true",class:"flex flex-col gap-1.5"},p7={key:1,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},m7=["disabled"],v7={class:"flex gap-2.5"},h7=["disabled"],g7=["aria-keyshortcuts","title","disabled"],y7=ae({__name:"RelationPivotModal",props:{open:{type:Boolean},source:{},ownerId:{},relation:{},schema:{},childId:{},childName:{},sessionKey:{}},emits:["update:open","saved","gone","closed"],setup(e,{emit:t}){const a=e,n=t,l=E({}),r=E({}),o=E(!1),i=E(!1),u=E(!1),c=E(""),d=ol();let p=0;const v=k(()=>`pivot-${a.relation}`),m=k(()=>a.schema.pivotForm??[]),y=k(()=>m.value.map(W=>W.name)),x=k(()=>!o.value&&!i.value&&El(Ra(m.value,l.value))!==c.value);function C(){return{[ql]:a.sessionKey}}function w(W){return{...a.source,id:a.ownerId,name:a.relation,child:W}}function S(W,T){if(l.value={...l.value,[W]:T},r.value[W]){const R={...r.value};delete R[W],r.value=R}}function q(){n("update:open",!1),Oe(h("backend::lang.relation.child_gone"),"danger"),n("gone")}async function O(){const W=++p;if(r.value={},i.value=!1,u.value=!1,l.value={},c.value=El({}),a.childId!==null){o.value=!0;try{const T=await Le.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/pivot/{child}",{params:{path:w(a.childId),header:C()}});if(W!==p)return;T.data?(l.value={...T.data.data},c.value=El(Ra(m.value,l.value))):T.response.status===404?q():i.value=!0}catch{W===p&&(i.value=!0)}finally{W===p&&(o.value=!1)}}}ze(()=>a.open,W=>{W?O():p++},{immediate:!0});async function I(W){if(W){n("update:open",!0);return}u.value||x.value&&!await d.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})||n("update:open",!1)}async function B(){if(!(u.value||o.value||i.value||a.childId===null)){u.value=!0;try{const W=await Le.PUT("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/pivot/{child}",{params:{path:w(a.childId),header:C()},body:Ra(m.value,l.value)});if(W.data){r.value={},c.value=El(Ra(m.value,l.value)),n("update:open",!1),Oe(tt(a.schema.messages.pivotSaved)),n("saved");return}const T=W.response.status;if(T===422){r.value=Nl(W.error?.error.details);const R=m.value.find(G=>r.value[G.name]);R&&(await Ge(),Un(v.value,R.name))}else T===404?q():Oe(h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{u.value=!1}}}function L(W){W.preventDefault(),n("closed")}return(W,T)=>(f(),b(me,null,[M(s(al),{open:e.open,"onUpdate:open":I},{default:N(()=>[M(s(zl),null,{default:N(()=>[M(s(ll),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),M(s(nl),{"data-relation-pivot-modal":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop",onCloseAutoFocus:L},{default:N(()=>[g("div",d7,[g("div",c7,[M(s(bn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(s(tt)(e.schema.messages.pivotTitle)),1)]),_:1}),M(s(hn),{class:"truncate text-muted",title:e.childName},{default:N(()=>[ye(_(e.childName),1)]),_:1},8,["title"])]),M(s(Pl),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),disabled:u.value,class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:N(()=>[M(s(qt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","disabled"])]),o.value?(f(),b("div",f7,[...T[1]||(T[1]=[g("span",{class:"block h-3 w-24 rounded-[6px] bg-skel"},null,-1),g("span",{class:"block h-input rounded-control bg-skel"},null,-1)])])):i.value?(f(),b("p",p7,_(s(h)("backend::lang.relation.child_load_failed")),1)):(f(),b("form",{key:2,class:"flex flex-col gap-4",novalidate:"",onSubmit:mt(B,["prevent"])},[M(ko,{errors:r.value,"field-names":y.value},null,8,["errors","field-names"]),g("fieldset",{disabled:u.value,class:"m-0 min-w-0 border-0 p-0"},[M(xo,{fields:m.value,values:l.value,errors:r.value,source:e.source,"record-id":null,"id-prefix":v.value,onUpdate:S},null,8,["fields","values","errors","source","id-prefix"])],8,m7)],32)),g("div",v7,[g("button",{type:"button","data-action":"cancel",disabled:u.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:T[0]||(T[0]=R=>I(!1))},_(s(h)("backend::lang.form.cancel")),9,h7),g("button",{type:"button","data-action":"save-pivot","data-hotkey":"mod+s mod+enter","aria-keyshortcuts":s(Ju)("mod+s mod+enter"),title:s(Ha)(s(tt)(e.schema.messages.pivotSubmit),"mod+s"),disabled:u.value||o.value||i.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",onClick:B},_(u.value?s(h)("backend::lang.form.saving"):s(tt)(e.schema.messages.pivotSubmit)),9,g7)])]),_:1})]),_:1})]),_:1},8,["open"]),M(Sn,{open:s(d).request.value!==null,message:s(d).request.value?.message??"","confirm-label":s(d).request.value?.confirmLabel,danger:s(d).request.value?.danger,onConfirm:s(d).confirm,onCancel:s(d).cancel},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])],64))}}),b7=["id","data-relation-name","data-deferred","aria-labelledby","aria-describedby"],_7={class:"flex flex-col gap-2"},x7={class:"flex flex-wrap items-center gap-3"},k7={class:"flex min-w-0 flex-1 flex-col"},w7=["id"],$7=["id"],C7={key:0,class:"relative block w-[220px] max-w-full"},S7={class:"sr-only"},E7=["value","placeholder"],A7={key:0,"data-relation-pending":"",class:"flex items-center gap-2 text-[13px] text-muted"},T7={key:0,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},M7={key:1,class:"overflow-hidden rounded-inner border border-border"},D7={"data-relation-empty":"",class:"text-muted"},O7=["aria-label","onClick"],P7=300,I7=ae({__name:"RelationManager",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=ct(_o,null),n=k(()=>t.field.relation||t.field.name),l=k(()=>typeof t.recordId=="number"?t.recordId:a&&a.recordId===0&&t.field.deferrable?0:null),r=k(()=>l.value===0),o=k(()=>t.source!=null&&l.value!==null),i=a?.key??Ss(),u=E(null),c=E([]),d=E(null),p=E(!0),v=E(!1),m=E(""),y=E(1),x=E(null),C=E([]),w=E(!1),S=E(!1),q=E(!1),O=E("create"),I=E(null),B=E(!1),L=E(null),W=E("");let T=null,R=null,G=null;const A=ol();let D=0,z=null;const V=k(()=>u.value?.view.list.columns??[]),K=k(()=>u.value?.view.toolbarButtons??[]),re=k(()=>u.value?.messages),ie=k(()=>`${t.controlId}-heading`),Ae=k(()=>`${t.controlId}-comment`),_e=k(()=>K.value.includes("create")&&(u.value?.manageForm?.length??0)>0),xe=k(()=>K.value.includes("update")&&(u.value?.manageForm?.length??0)>0),ne=k(()=>u.value?.kind==="belongsToMany"&&(u.value?.pivotForm?.length??0)>0&&(K.value.includes("link")||K.value.includes("update"))),fe=k(()=>(u.value?.viewForm?.length??0)>0),F=k(()=>xe.value?"update":ne.value?"pivot":fe.value?"preview":null),de=k(()=>xe.value&&ne.value),ve=k(()=>K.value.includes("unlink")||K.value.includes("delete"));function Z(){return r.value?{[ql]:i}:void 0}function he(){return{...t.source,id:l.value,name:n.value}}function J(){r.value&&a?.markDirty()}async function ee(){const{data:Be}=await Le.GET("/{vendor}/{plugin}/{controller}/schema/relation/{name}",{params:{path:{...t.source,name:n.value}}});u.value=Be?.data??null}async function te(){const Be=++D;p.value=!0,v.value=!1;try{const He=m.value.trim(),Je={page:y.value};He!==""&&(Je.search=He),x.value&&(Je.sort=x.value.column,Je.dir=x.value.dir);const{data:Ot}=await Le.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}",{params:{path:he(),query:Je,header:Z()}});if(Be!==D)return;c.value=Ot?.data??[],d.value=Ot?.meta??null,v.value=!Ot}catch{Be===D&&(c.value=[],d.value=null,v.value=!0)}finally{Be===D&&(p.value=!1)}}async function $(){if(o.value){try{await ee()}catch{u.value=null}if(!u.value){p.value=!1,v.value=!0;return}await te()}}function P(Be){m.value=Be.target.value,z!==null&&clearTimeout(z),z=setTimeout(()=>{z=null,y.value=1,C.value=[],te()},P7)}function U(Be){y.value=Be,C.value=[],te()}function ce(Be){const He=x.value;He?.column!==Be?x.value={column:Be,dir:"asc"}:He.dir==="asc"?x.value={column:Be,dir:"desc"}:x.value=null,y.value=1,C.value=[],te()}function X(){return C.value.map(Number).filter(Be=>Number.isInteger(Be)&&Be>0)}function oe(Be){const He=Be.id;return typeof He=="number"&&Number.isInteger(He)?He:typeof He=="string"&&/^\d+$/.test(He)?Number(He):null}function ke(Be){const He=V.value[0]?.key,Je=He?Be[He]:void 0;return typeof Je=="string"||typeof Je=="number"?String(Je):""}async function Se(){const Be=X();if(!(w.value||Be.length===0||!u.value||!await A.ask({message:tt(re.value?.unlinkConfirm,Be.length),confirmLabel:tt(re.value?.unlinkSelected),danger:!0}))){w.value=!0;try{const Je=await Le.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/unlink",{params:{path:he(),header:Z()},body:{ids:Be}});if(Je.data){C.value=[],J(),Oe(tt(re.value?.unlinked,Je.data.data.removed??Be.length)),await te();return}Oe(Je.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{w.value=!1}}}async function Te(Be){w.value=!0;try{const He=await Le.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/delete",{params:{path:he(),header:Z()},body:{ids:Be}});if(He.data){C.value=[],J(),Oe(tt(re.value?.deleted,He.data.data.deleted||Be.length)),await te();return}Oe(He.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{w.value=!1}}async function se(){const Be=X();w.value||Be.length===0||!u.value||await A.ask({message:tt(re.value?.deleteConfirm,Be.length),confirmLabel:tt(re.value?.deleteSelected),danger:!0},()=>Te(Be))}async function Me(Be){J(),Oe(tt(re.value?.linked,Be)),C.value=[],await te()}function Ce(Be){T=Be.currentTarget??G,O.value="create",I.value=null,q.value=!0}function Fe(Be,He){const Je=oe(Be);Je!==null&&(T=He,L.value=Je,W.value=ke(Be),B.value=!0)}function Ue(Be,He){const Je=F.value,Ot=oe(Be);if(!(Je===null||Ot===null)){if(Je==="pivot"){Fe(Be,He);return}T=He,O.value=Je,I.value=Ot,q.value=!0}}async function Ze(){J(),C.value=[],await te()}async function at(){J(),await te()}async function nt(){C.value=[],await te()}function $e(){const Be=T&&T.isConnected?T:null;T=null,Be?.focus()}function ge(){R?.focus()}function be(Be){const He=Be?.$el;return He instanceof HTMLElement?He:null}function We(Be){R=be(Be)}function it(Be){G=be(Be)}return Dt(()=>{z!==null&&clearTimeout(z)}),$(),(Be,He)=>o.value?(f(),b("section",{key:0,id:e.controlId,"data-relation-manager":"","data-relation-name":n.value,"data-deferred":r.value?"true":void 0,"aria-labelledby":ie.value,"aria-describedby":e.field.comment?Ae.value:void 0,tabindex:"-1",class:"flex flex-col gap-4"},[g("div",_7,[g("header",x7,[g("div",k7,[g("h2",{id:ie.value,class:"text-[17px] font-bold tracking-[-0.01em]"},_(u.value?.label||e.field.label||n.value),9,w7),e.field.comment?(f(),b("p",{key:0,id:Ae.value,class:"text-[13px] text-muted"},_(e.field.comment),9,$7)):Y("",!0)]),u.value?.view.showSearch?(f(),b("label",C7,[g("span",S7,_(s(h)("backend::lang.list.search")),1),M(s(hr),{size:16,class:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{type:"search","data-relation-search":"",value:m.value,placeholder:s(h)("backend::lang.list.search_prompt"),class:"h-[38px] w-full rounded-control border border-transparent bg-subtle pr-3 pl-9",onInput:P,onKeydown:He[0]||(He[0]=gn(mt(()=>{},["prevent"]),["enter"]))},null,40,E7)])):Y("",!0),(f(!0),b(me,null,Ie(K.value,Je=>(f(),b(me,{key:Je},[Je==="create"&&_e.value?(f(),j(Ke,{key:0,ref_for:!0,ref:it,"data-action":"create",size:"sm",variant:"primary",icon:s(vo),disabled:w.value||!u.value,"aria-haspopup":"dialog",onClick:Ce},{default:N(()=>[ye(_(s(tt)(re.value?.create)),1)]),_:1},8,["icon","disabled"])):Je==="link"?(f(),j(Ke,{key:1,ref_for:!0,ref:We,"data-action":"link",size:"sm",variant:_e.value?"outline":"primary",icon:s(Bb),disabled:w.value||!u.value,"aria-haspopup":"dialog",onClick:He[1]||(He[1]=Ot=>S.value=!0)},{default:N(()=>[ye(_(s(tt)(re.value?.link)),1)]),_:1},8,["variant","icon","disabled"])):Je==="delete"?(f(),j(Ke,{key:2,"data-action":"delete",size:"sm",variant:"danger",icon:s(Xa),disabled:w.value||C.value.length===0,onClick:se},{default:N(()=>[ye(_(s(tt)(re.value?.deleteSelected)),1)]),_:1},8,["icon","disabled"])):Je==="unlink"?(f(),j(Ke,{key:3,"data-action":"unlink",size:"sm",variant:"danger",icon:s(Nb),disabled:w.value||C.value.length===0,onClick:Se},{default:N(()=>[ye(_(s(tt)(re.value?.unlinkSelected)),1)]),_:1},8,["icon","disabled"])):Y("",!0)],64))),128))]),r.value?(f(),b("p",A7,[M(s(Vl),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.relation.pending_note")),1)])):Y("",!0)]),v.value&&!p.value?(f(),b("p",T7,_(s(h)("backend::lang.relation.load_failed")),1)):(f(),b("div",M7,[M(Y0,{selected:C.value,"onUpdate:selected":He[2]||(He[2]=Je=>C.value=Je),variant:"relation",columns:V.value,rows:c.value,loading:p.value,selectable:ve.value,sortable:!0,sort:x.value,openable:F.value!==null,trailing:de.value,onSort:ce,onOpen:Ue},{empty:N(()=>[g("span",D7,_(s(tt)(re.value?.empty)),1)]),trailing:N(({row:Je})=>[g("button",{type:"button","data-action":"edit-pivot","aria-label":s(tt)(re.value?.editPivot,void 0,{name:ke(Je)}),class:"flex size-8 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:Ot=>Fe(Je,Ot.currentTarget)},[M(s(Rb),{size:16,"aria-hidden":"true"})],8,O7)]),_:1},8,["selected","columns","rows","loading","selectable","sort","openable","trailing"]),d.value&&d.value.last_page>1?(f(),j(J0,{key:0,meta:d.value,loading:p.value,"per-page-options":[],"per-page":d.value.per_page,onPage:U},null,8,["meta","loading","per-page"])):Y("",!0)])),u.value&&K.value.includes("link")?(f(),j(u7,{key:2,open:S.value,"onUpdate:open":He[3]||(He[3]=Je=>S.value=Je),source:e.source,"record-id":l.value,relation:n.value,schema:u.value,"session-key":r.value?s(i):null,onLinked:Me,onClosed:ge},null,8,["open","source","record-id","relation","schema","session-key"])):Y("",!0),u.value&&(_e.value||F.value==="update"||F.value==="preview")?(f(),j(RV,{key:3,open:q.value,"onUpdate:open":He[4]||(He[4]=Je=>q.value=Je),source:e.source,"owner-id":l.value,relation:n.value,schema:u.value,mode:O.value,"child-id":I.value,"session-key":s(i),"can-delete":K.value.includes("delete"),onChanged:Ze,onGone:nt,onClosed:$e},null,8,["open","source","owner-id","relation","schema","mode","child-id","session-key","can-delete"])):Y("",!0),u.value&&ne.value?(f(),j(y7,{key:4,open:B.value,"onUpdate:open":He[5]||(He[5]=Je=>B.value=Je),source:e.source,"owner-id":l.value,relation:n.value,schema:u.value,"child-id":L.value,"child-name":W.value,"session-key":s(i),onSaved:at,onGone:nt,onClosed:$e},null,8,["open","source","owner-id","relation","schema","child-id","child-name","session-key"])):Y("",!0),M(Sn,{open:s(A).request.value!==null,message:s(A).request.value?.message??"","confirm-label":s(A).request.value?.confirmLabel,danger:s(A).request.value?.danger,busy:s(A).busy.value,onConfirm:s(A).confirm,onCancel:s(A).cancel},null,8,["open","message","confirm-label","danger","busy","onConfirm","onCancel"])],8,b7)):Y("",!0)}}),R7=["id","aria-describedby"],q7=["id","aria-describedby"],L7={class:"min-w-0 [overflow-wrap:anywhere]"},N7=["id"],B7=["data-relation"],F7={class:"flex size-[22px] items-center justify-center rounded-full bg-primary text-[10px] font-bold text-on-primary","aria-hidden":"true"},V7={class:"font-semibold"},z7={key:0,"data-chip-locked":"",class:"flex size-6 items-center justify-center text-muted"},j7={class:"sr-only"},U7=["aria-label","onClick"],H7=["id","aria-expanded","aria-controls","aria-activedescendant","aria-required","aria-invalid","aria-describedby","value","placeholder"],K7={key:1,class:"relative"},W7=["id","aria-expanded","aria-controls","aria-activedescendant","aria-required","aria-invalid","aria-describedby","value","placeholder"],G7=["id"],Y7=["id","data-value","aria-selected","aria-disabled","onMousedown"],J7={class:"min-w-0 truncate"},Z7={key:0,role:"presentation",class:"px-3 py-2 text-[13px] text-muted"},X7={key:1,role:"presentation",class:"px-3 py-2 text-[13px] text-muted"},Q7={key:2,role:"presentation",class:"p-1"},ez=["id"],tz=20,az=300,nz=ae({__name:"RelationField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=ct(Fp,void 0),r=k(()=>a.field.readOnly?"readonly":a.field.multiple?"multiple":"single"),o=k(()=>`${a.controlId}-listbox`),i=E({}),u=E(new Set);function c(Z){const he={...i.value};let J=null;for(const ee of Z)he[ee.value]=ee.label,ee.locked&&!u.value.has(ee.value)&&(J??=new Set(u.value),J.add(ee.value));i.value=he,J&&(u.value=J)}ze(()=>a.labels,Z=>c(Z??[]),{immediate:!0});function d(Z){return Z!==null&&u.value.has(Z)}const p=k(()=>`${a.controlId}-locked-note`),v=k(()=>u.value.size>0),m=k(()=>[a.describedBy,v.value?p.value:""].filter(Boolean).join(" "));function y(Z){return typeof Z=="number"&&Number.isInteger(Z)?Z:typeof Z=="string"&&/^\d+$/.test(Z)?Number(Z):null}const x=k(()=>y(a.modelValue)),C=k(()=>Array.isArray(a.modelValue)?a.modelValue.map(y).filter(Z=>Z!==null):[]);function w(Z){return i.value[Z]??String(Z)}function S(Z){return Z.split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(he=>he.charAt(0).toUpperCase()).join("")}const q=k(()=>{const Z=a.labels?.[0]?.label;return Z||(a.field.emptyOption??"—")}),O=E(!1),I=E(""),B=E([]),L=E(0),W=E(0),T=E(!1),R=E(-1);let G=0,A=null;const D=k(()=>L.value<W.value);async function z(Z,he){const J=a.source;if(!J){B.value=[];return}const ee=++G;T.value=!0;try{const te=I.value.trim(),{data:$}=await Le.GET("/{vendor}/{plugin}/{controller}/fields/{field}/options",{params:{path:{...J,field:a.field.name},query:{search:te===""?void 0:te,page:Z,per_page:tz}}});if(ee!==G)return;const P=$?.data??[];c(P),B.value=he?[...B.value,...P]:P,L.value=$?.meta.page??Z,W.value=$?.meta.last_page??Z}catch{ee===G&&!he&&(B.value=[])}finally{ee===G&&(T.value=!1)}}const V=k(()=>{const Z=[];r.value==="single"&&a.field.emptyOption!==void 0&&Z.push({key:"empty",label:a.field.emptyOption,value:null,muted:!0,locked:!1});const he=new Set(C.value);for(const J of B.value)r.value==="multiple"&&he.has(J.value)||Z.push({key:`option-${J.value}`,label:J.label,value:J.value,muted:!1,locked:!!J.locked||d(J.value)});return Z});function K(Z){return`${o.value}-${Z}`}function re(){O.value||(O.value=!0,R.value=-1,z(1,!1))}function ie(){O.value=!1,I.value="",R.value=-1,A!==null&&(clearTimeout(A),A=null)}function Ae(Z){I.value=Z.target.value,O.value=!0,R.value=-1,A!==null&&clearTimeout(A),A=setTimeout(()=>{A=null,z(1,!1)},az)}function _e(){D.value&&!T.value&&z(L.value+1,!0)}function xe(Z){const he=Z.target;he.scrollTop+he.clientHeight>=he.scrollHeight-24&&_e()}function ne(Z){Z.locked||(Z.value!==null&&l?.(a.field.name,{value:Z.value,label:Z.label,locked:Z.locked||void 0}),r.value==="multiple"?Z.value!==null&&!C.value.includes(Z.value)&&n("update:modelValue",[...C.value,Z.value]):n("update:modelValue",Z.value),ie())}function fe(Z){d(Z)||n("update:modelValue",C.value.filter(he=>he!==Z))}function F(Z,he){for(let J=Z+he;J>=0&&J<V.value.length;J+=he)if(!V.value[J].locked)return J;return Z}function de(Z){switch(Z.key){case"ArrowDown":Z.preventDefault(),O.value?R.value=F(R.value,1):re();break;case"ArrowUp":Z.preventDefault(),R.value=F(R.value<0?V.value.length:R.value,-1);break;case"Enter":if(O.value){Z.preventDefault();const he=V.value[R.value];he&&ne(he)}break;case"Escape":O.value&&(Z.preventDefault(),ie());break;case"Backspace":if(r.value==="multiple"&&I.value===""){const he=[...C.value].reverse().find(J=>!d(J));he!==void 0&&fe(he)}break}}const ve=k(()=>x.value!==null?w(x.value):a.field.emptyOption??"");return Dt(()=>{A!==null&&clearTimeout(A)}),(Z,he)=>r.value==="readonly"?(f(),b("div",{key:0,id:e.controlId,"data-relation-readonly":"","aria-describedby":e.describedBy||void 0,class:pe([e.labels?.[0]?.label?"text-text":"text-muted","flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5"])},_(q.value),11,R7)):r.value==="single"&&d(x.value)?(f(),b(me,{key:1},[g("div",{id:e.controlId,"data-relation-locked":"","aria-describedby":m.value||void 0,class:"flex min-h-input items-center justify-between gap-2 rounded-control border border-border bg-subtle px-3.5"},[g("span",L7,_(ve.value),1),M(s(cn),{size:14,class:"shrink-0 text-muted","aria-hidden":"true"})],8,q7),g("p",{id:p.value,"data-locked-note":"",class:"mt-1.5 flex items-center gap-2 text-[13px] text-muted"},[M(s(cn),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.form.locked_note")),1)],8,N7)],64)):(f(),b("div",{key:2,class:"relative","data-relation":r.value},[r.value==="multiple"?(f(),b("div",{key:0,class:pe([e.invalid?"border-danger":"border-border-strong","flex min-h-input flex-wrap items-center gap-1.5 rounded-control border bg-surface p-1.5"])},[(f(!0),b(me,null,Ie(C.value,J=>(f(),b("span",{key:J,"data-chip":"",class:"inline-flex h-[30px] items-center gap-1.5 rounded-pill bg-subtle pr-1 pl-1"},[g("span",F7,_(S(w(J))),1),g("span",V7,_(w(J)),1),d(J)?(f(),b("span",z7,[M(s(cn),{size:14,"aria-hidden":"true"}),g("span",j7,_(s(h)("backend::lang.form.locked_item",{name:w(J)})),1)])):(f(),b("button",{key:1,type:"button","aria-label":s(h)("backend::lang.form.remove_item",{name:w(J)}),class:"flex size-6 items-center justify-center rounded-full text-muted hover:bg-hover hover:text-text",onClick:ee=>fe(J)},[M(s(qt),{size:14,"aria-hidden":"true"})],8,U7))]))),128)),g("input",{id:e.controlId,type:"text",role:"combobox",autocomplete:"off","aria-expanded":O.value?"true":"false","aria-controls":o.value,"aria-autocomplete":"list","aria-activedescendant":O.value&&R.value>=0?K(R.value):void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":m.value||void 0,value:I.value,placeholder:s(h)("backend::lang.form.add_item"),class:"h-[30px] min-w-[120px] flex-1 border-0 bg-transparent px-2 focus-visible:shadow-none",onClick:re,onInput:Ae,onKeydown:de,onBlur:ie},null,40,H7)],2)):(f(),b("div",K7,[g("input",{id:e.controlId,type:"text",role:"combobox",autocomplete:"off","aria-expanded":O.value?"true":"false","aria-controls":o.value,"aria-autocomplete":"list","aria-activedescendant":O.value&&R.value>=0?K(R.value):void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":m.value||void 0,value:O.value?I.value:ve.value,placeholder:O.value&&ve.value||s(h)("backend::lang.form.select_placeholder"),class:pe([[e.invalid?"border-danger":"border-border-strong",!O.value&&x.value===null?"text-muted":"text-text"],"h-input w-full rounded-control border bg-surface pr-10 pl-3.5"]),onClick:re,onInput:Ae,onKeydown:de,onBlur:ie},null,42,W7),M(s(Gn),{size:16,class:"pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"})])),Jt(g("ul",{id:o.value,role:"listbox",class:"absolute inset-x-0 top-full z-20 mt-1 max-h-64 overflow-y-auto rounded-inner border border-border bg-surface p-1 shadow-menu",onScroll:xe},[(f(!0),b(me,null,Ie(V.value,(J,ee)=>(f(),b("li",{id:K(ee),key:J.key,role:"option","data-value":J.value??"empty","aria-selected":r.value==="single"&&J.value===x.value?"true":"false","aria-disabled":J.locked?"true":void 0,class:pe([[J.muted||J.locked?"text-muted":"text-text",J.locked?"cursor-not-allowed":"cursor-pointer hover:bg-hover",ee===R.value&&!J.locked?"bg-hover":""],"flex h-10 items-center justify-between gap-2 rounded-control px-3"]),onMousedown:mt(te=>ne(J),["prevent"])},[g("span",J7,_(J.label),1),J.locked?(f(),j(s(cn),{key:0,size:14,class:"shrink-0","aria-hidden":"true"})):Y("",!0)],42,Y7))),128)),T.value?(f(),b("li",Z7,_(s(h)("backend::lang.form.loading_options")),1)):V.value.filter(J=>J.value!==null).length===0?(f(),b("li",X7,_(s(h)("backend::lang.form.no_options")),1)):Y("",!0),D.value&&!T.value?(f(),b("li",Q7,[g("button",{type:"button","data-action":"more-options",class:"h-8 w-full rounded-control text-[13px] font-semibold text-muted hover:bg-hover hover:text-text",onMousedown:mt(_e,["prevent"])},_(s(h)("backend::lang.form.more_options")),33)])):Y("",!0)],40,G7),[[vs,O.value]]),v.value?(f(),b("p",{key:2,id:p.value,"data-locked-note":"",class:"mt-1.5 flex items-center gap-2 text-[13px] text-muted"},[M(s(cn),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.form.locked_note")),1)],8,ez)):Y("",!0)],8,B7))}}),lz={class:"flex min-w-0 flex-col"},rz=["for"],oz={key:0,class:"text-danger","aria-hidden":"true"},sz=["id"],iz=["id","aria-checked","aria-invalid","aria-describedby"],uz=ae({__name:"SwitchField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>Xu(a.modelValue));function r(){n("update:modelValue",t_(a.modelValue,!l.value))}return(o,i)=>(f(),b("div",{class:pe([e.invalid?"border-danger":"border-border","flex items-center justify-between gap-4 rounded-inner border px-4 py-3.5"]),"data-toggle-card":""},[g("div",lz,[g("label",{for:e.controlId,class:"font-semibold"},[ye(_(e.field.label||e.field.name),1),e.field.required?(f(),b("span",oz," *")):Y("",!0)],8,rz),e.field.comment?(f(),b("p",{key:0,id:`${e.controlId}-comment`,class:"text-[13px] text-muted"},_(e.field.comment),9,sz)):Y("",!0)]),g("button",{id:e.controlId,type:"button",role:"switch","aria-checked":l.value?"true":"false","aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:pe([l.value?"bg-primary":"bg-border-strong","relative h-[26px] w-[44px] shrink-0 rounded-pill transition-colors duration-150 ease-out"]),onClick:r},[g("span",{class:pe([l.value?"translate-x-[18px] bg-on-primary":"translate-x-0 bg-white","absolute top-[3px] left-[3px] size-[20px] rounded-full shadow-tab transition-transform duration-150 ease-out"]),"aria-hidden":"true"},null,2)],10,iz)],2))}}),dz=["id","name","value","required","aria-required","aria-invalid","aria-describedby"],k_=ae({__name:"TextField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),r=k(()=>Hl(a.field));return(o,i)=>(f(),b("input",Ye({id:e.controlId},r.value,{name:e.field.name,type:"text",value:l.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(Lt)(e.invalid),"h-input"],onInput:i[0]||(i[0]=u=>n("update:modelValue",u.target.value))}),null,16,dz))}}),cz=["id","name","rows","value","required","aria-required","aria-invalid","aria-describedby"],w_=ae({__name:"TextareaField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l={tiny:2,small:4,large:8,huge:12,giant:18},r=k(()=>l[a.field.size??""]??5),o=k(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),i=k(()=>Hl(a.field));return(u,c)=>(f(),b("textarea",Ye({id:e.controlId},i.value,{name:e.field.name,rows:r.value,value:o.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(Lt)(e.invalid),"min-h-input resize-y py-2.5"],onInput:c[0]||(c[0]=d=>n("update:modelValue",d.target.value))}),null,16,cz))}}),zp=ae({__name:"MailImagePicker",props:{open:{type:Boolean},mode:{}},emits:["update:open","insert","choose"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>a.mode==="insert"?h("backend::lang.mail.picker.insert_title"):h("backend::lang.mail.picker.choose_title")),r=k(()=>a.mode==="insert"?h("backend::lang.mail.picker.insert"):h("backend::lang.mail.picker.use"));function o(i){const u=i.items[0];u&&(a.mode==="insert"?n("insert",{url:u.url,alt:i.alt}):n("choose",u.id))}return(i,u)=>(f(),j(Vp,{open:e.open,mode:"image","default-folder":"mail",source:"mail",multiple:!1,"show-alt":e.mode==="insert",title:l.value,"confirm-label":r.value,"alt-label":s(h)("backend::lang.mail.picker.alt"),"alt-comment":s(h)("backend::lang.mail.picker.alt_comment"),"search-placeholder":s(h)("backend::lang.mail.picker.search"),"upload-label":s(h)("backend::lang.mail.picker.upload"),"uploading-label":s(h)("backend::lang.mail.picker.uploading"),"empty-title":s(h)("backend::lang.mail.picker.empty_title"),"empty-upload-body":s(h)("backend::lang.mail.picker.empty_upload"),"empty-read-only-body":s(h)("backend::lang.mail.picker.empty_pick_only"),"load-failed-label":s(h)("backend::lang.mail.picker.load_failed"),"onUpdate:open":u[0]||(u[0]=c=>n("update:open",c)),onSelect:o},null,8,["open","show-alt","title","confirm-label","alt-label","alt-comment","search-placeholder","upload-label","uploading-label","empty-title","empty-upload-body","empty-read-only-body","load-failed-label"]))}});function fz(e){return e.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]")}function pz(e){return e.replace(/[ ()]/g,t=>t===" "?"%20":t==="("?"%28":"%29")}function rg(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function $_(e,t,a){switch(e){case"markdown":return`})`;case"html":return`<img src="${rg(t)}" alt="${rg(a)}">`;case"css":return`url("${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`;case"text":return t}}const mz={class:"flex flex-col gap-1.5"},vz={class:"flex items-center gap-2"},hz=["aria-pressed"],gz={key:0,class:"flex flex-col gap-1.5"},yz={key:0,"data-markdown-preview-error":"",role:"status",class:"text-[13px] text-danger"},bz=["aria-busy","innerHTML"],_z=["id","name","rows","value","required","aria-required","aria-invalid","aria-describedby"],og="Preview unavailable.",xz=300,C_=ae({__name:"MarkdownField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l={tiny:2,small:4,large:8,huge:12,giant:18},r=k(()=>l[a.field.size??""]??8),o=k(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),i=k(()=>Hl(a.field)),u=k(()=>!!a.field.mailImages),c=E(!1),d=E(""),p=E(""),v=E(!1),m=E(!1),y=E(null);let x=0,C=null;function w(){C!==null&&(clearTimeout(C),C=null)}function S(B){const W=B?.error?.details?.markdown;return Array.isArray(W)&&typeof W[0]=="string"&&W[0]!==""?W[0]:og}async function q(){const B=++x;if(o.value.trim()===""){d.value="",p.value="",v.value=!1;return}v.value=!0;try{const{data:L,error:W}=await Le.POST("/markdown/preview",{body:{markdown:o.value}});if(B!==x)return;L?(d.value=L.data.html,p.value=""):(d.value="",p.value=S(W))}catch{if(B!==x)return;d.value="",p.value=og}finally{B===x&&(v.value=!1)}}function O(){c.value=!c.value,w(),c.value?q():(x++,v.value=!1)}function I(B){const L=$_("markdown",B.url,B.alt),W=y.value,T=o.value,R=W?.selectionStart??T.length,G=W?.selectionEnd??R,A=T.slice(0,R)+L+T.slice(G);n("update:modelValue",A),Ge(()=>{if(!W)return;W.focus();const D=R+L.length;W.setSelectionRange(D,D)})}return ze(o,()=>{c.value&&(w(),C=setTimeout(()=>{C=null,q()},xz))}),Dt(()=>{w(),x++}),(B,L)=>(f(),b("div",mz,[g("div",vz,[u.value?(f(),b("button",{key:0,type:"button","data-markdown-insert-image":"",class:"inline-flex h-8 items-center gap-1.5 rounded-pager px-2 text-[13px] text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:L[0]||(L[0]=W=>m.value=!0)},[M(s(wb),{size:16,"aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.mail.picker.insert_button")),1)])):(f(),b("button",{key:1,type:"button","data-markdown-preview":"",class:"self-start rounded-pager px-2 py-1 text-[13px] text-muted hover:bg-hover hover:text-text","aria-pressed":c.value?"true":"false",onClick:O}," Preview ",8,hz))]),c.value&&!u.value?(f(),b("div",gz,[p.value?(f(),b("p",yz,_(p.value),1)):Y("",!0),g("div",{"data-markdown-preview-pane":"",class:pe([s(Lt)(e.invalid),"summer-markdown min-h-input overflow-auto px-3.5 py-2.5"]),"aria-busy":v.value?"true":"false",innerHTML:d.value},null,10,bz)])):(f(),b("textarea",Ye({key:1,id:e.controlId,ref_key:"area",ref:y},i.value,{name:e.field.name,rows:r.value,value:o.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(Lt)(e.invalid),"min-h-input resize-y py-2.5"],onInput:L[1]||(L[1]=W=>n("update:modelValue",W.target.value))}),null,16,_z)),u.value?(f(),j(zp,{key:2,open:m.value,"onUpdate:open":L[2]||(L[2]=W=>m.value=W),mode:"insert",onInsert:I},null,8,["open"])):Y("",!0)]))}}),kz={class:"overflow-hidden rounded-inner border border-border"},wz={class:"flex flex-wrap items-center gap-2 border-b border-border bg-subtle p-1"},$z={role:"tablist",class:"inline-flex gap-1 rounded-inner border border-border bg-subtle p-1"},Cz=["aria-selected"],Sz=["aria-selected"],Ez={role:"status",class:"ml-auto px-2 text-[13px] text-muted","data-mail-preview-status":""},Az={key:0,role:"alert","data-mail-preview-error":"",class:"border-b border-border px-4 py-2 text-[13px] text-danger"},Tz={key:1,class:"flex gap-2 border-b border-border px-4 py-3","data-mail-preview-subject":""},Mz={class:"font-semibold"},Dz={class:"min-w-0 break-words"},Oz={key:2,class:"px-4 py-3 text-center text-[13px] text-muted","data-mail-preview-empty":""},Pz=["srcdoc","title"],Iz={key:4,class:"m-0 max-h-[640px] overflow-auto bg-surface px-4 py-3 font-mono text-[13px] whitespace-pre-wrap","data-mail-preview-text":""},Rz={class:"text-[13px] text-muted","data-mail-preview-note":""},qz={key:0,class:"text-[13px] text-muted","data-mail-preview-comment":""},Lz={key:1,class:"flex flex-wrap items-center gap-2","data-mail-preview-test":""},Nz={class:"text-[13px] text-muted","data-mail-preview-test-hint":""},Bz={key:0,role:"alert",class:"basis-full text-[13px] text-danger","data-mail-preview-test-error":""},Fz=500,Vz=ae({__name:"MailPreviewField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,n=ct(Bs,E({})),l=k(()=>{const _e=t.field.mode;return typeof _e=="string"&&_e!==""?_e:"template"}),r=k(()=>l.value==="branding"),o=k(()=>na.value?.email??""),i=E("html"),u=E(""),c=E(""),d=E(""),p=E(!1),v=E(!1),m=E(""),y=E(""),x=E(!1),C=E(0),w=E(Date.now());let S=0,q=null,O=null,I=null;const B=k(()=>{switch(l.value){case"layout":case"partial":return"content_html";case"branding":return"";default:return"body"}}),L=k(()=>{const _e=B.value;if(_e==="")return!1;const xe=n.value[_e];return xe==null||String(xe).trim()===""}),W=k(()=>x.value||C.value>w.value),T=k(()=>l.value==="template"?h("backend::lang.mail.preview.sample_note"):h("backend::lang.mail.preview.sample_content_note"));function R(){q!==null&&(clearTimeout(q),q=null)}function G(_e){const ne=_e?.error?.details?.message;if(typeof ne=="string"&&ne!=="")return ne;const fe=_e?.error?.message;return typeof fe=="string"&&fe!==""?fe:""}const A=E(null),D=E(!0);let z=null;function V(){if(!D.value){R();return}R(),q=setTimeout(()=>{q=null,K()},Fz)}async function K(){if(!D.value)return;if(L.value){S++,v.value=!1,m.value="";return}const _e=++S;v.value=!0;try{const{data:xe,error:ne,response:fe}=await Le.POST("/mail/preview",{body:{mode:l.value,id:t.recordId??0,values:{...n.value}}});if(_e!==S)return;if(xe){u.value=xe.data.subject,c.value=xe.data.html,d.value=xe.data.text,p.value=!0,m.value="";return}if(fe.status===422){const F=G(ne);m.value=p.value?h("backend::lang.mail.preview.failed",{message:F}):h("backend::lang.mail.preview.failed_first",{message:F});return}m.value=h("backend::lang.mail.preview.unavailable")}catch{if(_e!==S)return;m.value=h("backend::lang.mail.preview.unavailable")}finally{_e===S&&(v.value=!1)}}function re(_e){const xe=_e.headers.get("Retry-After"),ne=xe?Number.parseInt(xe,10):NaN;return Number.isFinite(ne)&&ne>0?ne:60}function ie(_e){C.value=Date.now()+_e*1e3,w.value=Date.now(),O!==null&&clearTimeout(O),O=setTimeout(()=>{O=null,C.value=0,w.value=Date.now()},_e*1e3),I===null&&(I=setInterval(()=>{w.value=Date.now(),C.value<=w.value&&I!==null&&(clearInterval(I),I=null)},250))}async function Ae(){if(!(r.value||W.value||L.value)){x.value=!0,y.value="";try{const{data:_e,error:xe,response:ne}=await Le.POST("/mail/test-send",{body:{mode:l.value,id:t.recordId??0,values:{...n.value}}});if(_e){Oe(h("backend::lang.mail.preview.test_sent",{email:_e.data.email}));return}const fe=ne.status;if(fe===429){const F=re(ne);ie(F),y.value=h("backend::lang.mail.preview.test_limited",{seconds:F});return}if(fe===422){y.value=h("backend::lang.mail.preview.test_invalid",{message:G(xe)});return}if(fe===403){Oe(xe?.error.message||h("backend::lang.form.forbidden"),"danger");return}if(fe>=500){Oe(h("backend::lang.mail.preview.test_failed"),"danger");return}Oe(xe?.error.message||h("backend::lang.mail.preview.test_failed"),"danger")}catch{Oe(h("backend::lang.mail.preview.test_failed"),"danger")}finally{x.value=!1}}}return ze(()=>n.value,()=>{if(L.value){R(),S++,v.value=!1,m.value="";return}V()},{deep:!0}),$t(()=>{typeof IntersectionObserver<"u"&&A.value&&(z=new IntersectionObserver(_e=>{const xe=_e.some(ne=>ne.isIntersecting);xe!==D.value&&(D.value=xe,xe?K():(R(),S++))},{threshold:0}),z.observe(A.value)),K()}),Dt(()=>{R(),S++,z?.disconnect(),z=null,O!==null&&clearTimeout(O),I!==null&&clearInterval(I)}),(_e,xe)=>(f(),b("div",{ref_key:"rootEl",ref:A,class:"flex flex-col gap-2","data-mail-preview":""},[g("div",kz,[g("div",wz,[g("div",$z,[g("button",{type:"button",role:"tab","data-mail-preview-format":"html","aria-selected":i.value==="html"?"true":"false",class:pe([i.value==="html"?"bg-surface text-text shadow-tab":"text-muted hover:text-text","inline-flex h-[34px] items-center gap-2 rounded-tab px-4 font-semibold transition-colors duration-150 ease-out"]),onClick:xe[0]||(xe[0]=ne=>i.value="html")},_(s(h)("backend::lang.mail.preview.html")),11,Cz),g("button",{type:"button",role:"tab","data-mail-preview-format":"text","aria-selected":i.value==="text"?"true":"false",class:pe([i.value==="text"?"bg-surface text-text shadow-tab":"text-muted hover:text-text","inline-flex h-[34px] items-center gap-2 rounded-tab px-4 font-semibold transition-colors duration-150 ease-out"]),onClick:xe[1]||(xe[1]=ne=>i.value="text")},_(s(h)("backend::lang.mail.preview.text")),11,Sz)]),g("p",Ez,_(v.value?s(h)("backend::lang.mail.preview.rendering"):""),1)]),m.value?(f(),b("p",Az,_(m.value),1)):Y("",!0),!r.value&&(p.value||!L.value)?(f(),b("div",Tz,[g("span",Mz,_(s(h)("backend::lang.mail.preview.subject")),1),g("span",Dz,_(u.value),1)])):Y("",!0),L.value?(f(),b("div",Oz,_(s(h)("backend::lang.mail.preview.empty")),1)):i.value==="html"?(f(),b("iframe",{key:3,sandbox:"",referrerpolicy:"no-referrer",srcdoc:c.value,title:s(h)("backend::lang.mail.preview.frame_title"),class:"block h-[640px] w-full border-0 bg-white","data-mail-preview-frame":""},null,8,Pz)):(f(),b("pre",Iz,_(d.value),1))]),g("p",Rz,_(T.value),1),e.field.comment?(f(),b("p",qz,_(e.field.comment),1)):Y("",!0),r.value?Y("",!0):(f(),b("div",Lz,[M(Ke,{variant:"outline",size:"sm",icon:s(g3),disabled:W.value||L.value,"data-mail-preview-test-send":"",onClick:Ae},{default:N(()=>[ye(_(x.value?s(h)("backend::lang.mail.preview.test_sending"):s(h)("backend::lang.mail.preview.test_send")),1)]),_:1},8,["icon","disabled"]),g("p",Nz,_(s(h)("backend::lang.mail.preview.test_hint",{email:o.value})),1),y.value?(f(),b("p",Bz,_(y.value),1)):Y("",!0)]))],512))}}),zz=["id"],jz={key:2,class:"flex flex-col gap-1.5"},Uz={"data-codeeditor-load-failed":"",class:"flex items-center gap-2 text-[13px] text-muted"},Hz=["id","value","aria-labelledby","aria-describedby","aria-invalid"],Kz=["data-codeeditor"],Wz=["aria-label","aria-controls"],Gz=ae({__name:"CodeEditorField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){const n=e,l=a,r={tiny:128,small:192,large:320,huge:480,giant:640},o=k(()=>!!n.field.readOnly),i=k(()=>n.modelValue===null||n.modelValue===void 0?"":String(n.modelValue)),u=k(()=>{const A=n.field.language;return A==="html"||A==="css"||A==="text"?A:"html"}),c=k(()=>r[n.field.size??""]??320),d=k(()=>!!n.field.mailImages),p=k(()=>`${n.controlId}-label`),v=E("loading"),m=E(""),y=E(null),x=pr(null),C=E(!1);let w=null,S=!1,q=null,O=!1;const I=k(()=>["rounded-control border bg-surface overflow-hidden","focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]",n.invalid?"border-danger":"border-border-strong"]);function B(){const A={id:n.controlId,"aria-labelledby":p.value,"aria-multiline":"true"};return n.describedBy&&(A["aria-describedby"]=n.describedBy),n.invalid&&(A["aria-invalid"]="true"),A}function L(A){q=A,l("update:modelValue",A)}function W(A){O||L(A)}$t(async()=>{if(!o.value)try{if(w=await(await m_(async()=>{const{importCodeEditor:A}=await import("./load-CUAo41yp.js");return{importCodeEditor:A}},[],import.meta.url)).importCodeEditor(),S||(v.value="ready",await Ge(),S||!y.value||!w))return;x.value=w.createCodeEditor({parent:y.value,doc:i.value,language:u.value,height:c.value,attributes:B(),onChange:W})}catch{if(S)return;x.value?.destroy(),x.value=null,v.value="failed",m.value=i.value}}),Dt(()=>{S=!0,x.value?.destroy(),x.value=null}),ze(i,A=>{if(A!==q){if(q=null,v.value==="failed"){m.value=A;return}x.value&&(O=!0,x.value.setDoc(A),O=!1)}});function T(A){const D=A.target.value;m.value=D,L(D)}function R(A){if(x.value){x.value.insert(A);return}if(v.value==="failed"){const D=document.getElementById(n.controlId);if(!D){m.value=m.value+A,L(m.value);return}const z=D.selectionStart??m.value.length,V=D.selectionEnd??z,K=m.value.slice(0,z)+A+m.value.slice(V);m.value=K,L(K),Ge(()=>{D.focus();const re=z+A.length;D.setSelectionRange(re,re)})}}function G(A){R($_(u.value,A.url,A.alt))}return t({insert:R}),(A,D)=>o.value?(f(),b("pre",{key:0,id:e.controlId,"data-codeeditor-readonly":"",class:"max-h-[480px] overflow-auto rounded-control border border-border bg-subtle px-3.5 py-2.5 font-mono text-[13px] whitespace-pre-wrap"},_(i.value!==""?i.value:s(h)("backend::lang.list.empty_value")),9,zz)):v.value==="loading"?(f(),b("div",{key:1,"data-codeeditor-loading":"","aria-busy":"true",class:"rounded-control bg-skel",style:oa({height:`${c.value}px`})},null,4)):v.value==="failed"?(f(),b("div",jz,[g("p",Uz,[M(s(Vl),{size:14,"aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.codeeditor.load_failed")),1)]),g("textarea",{id:e.controlId,"data-codeeditor-fallback":"",value:m.value,"aria-labelledby":p.value,"aria-describedby":e.describedBy,"aria-invalid":e.invalid?"true":void 0,spellcheck:"false",class:pe([s(Lt)(e.invalid),"font-mono text-[13px] resize-y px-3.5 py-2.5"]),style:oa({height:`${c.value}px`}),onInput:T},null,46,Hz)])):(f(),b("div",{key:3,"data-codeeditor":e.field.name,class:pe(I.value)},[d.value?(f(),b("div",{key:0,role:"toolbar","aria-label":s(h)("backend::lang.codeeditor.toolbar"),"aria-controls":e.controlId,class:"flex flex-wrap items-center gap-1 border-b border-border bg-subtle p-1","data-codeeditor-toolbar":""},[g("button",{type:"button","data-codeeditor-insert-image":"",class:"inline-flex h-8 items-center gap-1.5 rounded-pager px-2 text-[13px] text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:D[0]||(D[0]=z=>C.value=!0)},[M(s(wb),{size:16,"aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.mail.picker.insert_button")),1)])],8,Wz)):Y("",!0),g("div",{ref_key:"mountEl",ref:y,"data-codeeditor-mount":""},null,512),d.value?(f(),j(zp,{key:1,open:C.value,"onUpdate:open":D[1]||(D[1]=z=>C.value=z),mode:"insert",onInsert:G},null,8,["open"])):Y("",!0)],10,Kz))}}),Yz={class:"flex items-center gap-2","data-colorpicker":""},Jz=["value","aria-label"],Zz=["id","value","placeholder","aria-describedby","aria-invalid"],Xz=ae({__name:"ColorPickerField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=/^#[0-9a-fA-F]{6}$/,r=k(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),o=E(l.test(r.value)?r.value.toLowerCase():"#ffffff");ze(r,d=>{l.test(d)&&(o.value=d.toLowerCase())});const i=k(()=>l.test(r.value)?r.value.toLowerCase():o.value);function u(d){const p=d.target.value;o.value=p.toLowerCase(),n("update:modelValue",p)}function c(d){const p=d.target.value;l.test(p)&&(o.value=p.toLowerCase()),n("update:modelValue",p)}return(d,p)=>(f(),b("div",Yz,[g("input",{type:"color","data-colorpicker-swatch":"",value:i.value,"aria-label":s(h)("backend::lang.colorpicker.pick",{field:e.field.label??e.field.name}),class:"size-input shrink-0 cursor-pointer rounded-control border border-border-strong bg-surface p-1",onInput:u},null,40,Jz),g("input",{id:e.controlId,type:"text","data-colorpicker-text":"",value:r.value,maxlength:"7",spellcheck:"false",placeholder:s(h)("backend::lang.colorpicker.not_set"),"aria-describedby":e.describedBy||void 0,"aria-invalid":e.invalid?"true":void 0,class:pe([s(Lt)(e.invalid),"h-input font-mono text-[13px]"]),onInput:c},null,42,Zz)]))}}),Qz={class:"flex items-center gap-4","data-mailimage":""},ej={class:"flex size-[96px] shrink-0 items-center justify-center overflow-hidden rounded-inner border border-border bg-subtle"},tj=["src","alt"],aj={class:"flex flex-col gap-2"},nj={key:0,class:"text-[14px]"},lj={key:1,class:"text-[13px] text-muted"},rj={class:"flex gap-2"},oj={key:2,"data-mailimage-missing":"",class:"text-[13px] text-danger"},sj=ae({__name:"MailImageField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=E(!1),r=E(null),o=E(!1),i=E(!1),u=k(()=>{const v=a.modelValue;if(v==null||v==="")return null;const m=Number(v);return Number.isInteger(m)&&m>0?m:null});async function c(){const v=u.value;if(v===null){r.value=null,o.value=!1;return}i.value=!0,o.value=!1;try{const{data:m,response:y}=await Le.GET("/mail/images/{id}",{params:{path:{id:v}}});m?(r.value=m.data,o.value=!1):(r.value=null,o.value=y.status===404)}catch{r.value=null,o.value=!0}finally{i.value=!1}}ze(u,()=>{c()},{immediate:!0});function d(v){n("update:modelValue",v)}function p(){n("update:modelValue",null)}return(v,m)=>(f(),b("div",Qz,[g("div",ej,[r.value?(f(),b("img",{key:0,src:r.value.thumbUrl||r.value.url,alt:r.value.title||r.value.fileName,class:"size-full object-contain"},null,8,tj)):(f(),j(s(If),{key:1,size:24,class:"text-muted","aria-hidden":"true"}))]),g("div",aj,[r.value?(f(),b("p",nj,_(r.value.fileName),1)):(f(),b("p",lj,_(s(h)("backend::lang.mailimage.empty")),1)),g("div",rj,[M(Ke,{variant:"outline",size:"sm","data-mailimage-choose":"",onClick:m[0]||(m[0]=y=>l.value=!0)},{default:N(()=>[ye(_(r.value?s(h)("backend::lang.mailimage.change"):s(h)("backend::lang.mailimage.choose")),1)]),_:1}),r.value||u.value!==null?(f(),j(Ke,{key:0,variant:"ghost",size:"sm","data-mailimage-remove":"",onClick:p},{default:N(()=>[ye(_(s(h)("backend::lang.mailimage.remove")),1)]),_:1})):Y("",!0)]),o.value?(f(),b("p",oj,_(s(h)("backend::lang.mailimage.missing")),1)):Y("",!0)]),M(zp,{open:l.value,"onUpdate:open":m[1]||(m[1]=y=>l.value=y),mode:"choose",onChoose:d},null,8,["open"])]))}}),ij={"data-mediafinder":"",class:"flex flex-col gap-3"},uj={key:0,class:"flex items-center gap-4"},dj={class:"flex size-[96px] shrink-0 items-center justify-center overflow-hidden rounded-inner border border-border bg-subtle"},cj=["src","alt"],fj={key:1,class:"flex flex-col items-center gap-1 text-muted"},pj={class:"rounded-tab bg-surface px-1.5 py-0.5 text-[10px] font-bold text-text uppercase"},mj={class:"flex min-w-0 flex-col gap-2"},vj=["title"],hj={key:1,class:"text-[13px] text-muted"},gj={key:2,class:"flex flex-wrap gap-2"},yj={key:0,class:"grid grid-cols-2 gap-2.5 sm:grid-cols-3 md:grid-cols-4"},bj={class:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-pager bg-subtle"},_j=["src","alt"],xj={key:1,class:"flex flex-col items-center gap-1 text-muted"},kj={class:"rounded-tab bg-surface px-1.5 py-0.5 text-[10px] font-bold text-text uppercase"},wj=["title"],$j=["aria-label","title","onClick"],Cj={key:1,class:"text-[13px] text-muted"},Sj={key:2},Ej=ae({__name:"MediaFinderField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=E(!1),r=k(()=>a.field.multiple===!0),o=k(()=>a.field.mode==="file"?"file":"image"),i=k(()=>a.field.folder||void 0),u=k(()=>a.field.readOnly===!0),c=k(()=>{const y=a.modelValue;return Array.isArray(y)?y.filter(x=>typeof x=="string"&&x.trim()!==""):typeof y=="string"&&y.trim()!==""?[y.trim()]:[]});function d(y){return o.value==="image"?!0:/\.(?:jpe?g|png|gif|webp)(?:[?#].*)?$/i.test(y)}function p(y){const x=y.split(/[?#]/)[0]??y,C=x.lastIndexOf("/");return C>=0&&x.slice(C+1)||y}function v(y){if(y.items.length!==0){if(r.value){const x=new Set(c.value),C=[...c.value];for(const w of y.items)w.url&&!x.has(w.url)&&(x.add(w.url),C.push(w.url));n("update:modelValue",C);return}n("update:modelValue",y.items[0].url)}}function m(y){if(!u.value){if(r.value){const x=c.value.filter((C,w)=>w!==y);n("update:modelValue",x);return}n("update:modelValue",null)}}return(y,x)=>(f(),b("div",ij,[r.value?(f(),b(me,{key:1},[c.value.length>0?(f(),b("div",yj,[(f(!0),b(me,null,Ie(c.value,(C,w)=>(f(),b("div",{key:`${C}-${w}`,"data-mediafinder-item":"",class:"relative flex flex-col gap-1.5 rounded-inner border border-border bg-surface p-1.5"},[g("div",bj,[d(C)?(f(),b("img",{key:0,src:C,alt:p(C),class:"size-full object-cover"},null,8,_j)):(f(),b("div",xj,[M(s(Ia),{size:24,"aria-hidden":"true"}),g("span",kj,_(s(iu)(p(C))),1)]))]),g("span",{class:"truncate text-[12px] text-muted",title:C},_(p(C)),9,wj),u.value?Y("",!0):(f(),b("button",{key:0,type:"button","data-mediafinder-remove":"","aria-label":s(h)("backend::lang.media.finder_remove"),title:s(h)("backend::lang.media.finder_remove"),class:"absolute top-2 right-2 flex size-6 items-center justify-center rounded-full bg-surface/90 text-muted shadow-sm hover:bg-danger-soft hover:text-danger",onClick:S=>m(w)},[M(s(qt),{size:13,"aria-hidden":"true"})],8,$j))]))),128))])):(f(),b("p",Cj,_(s(h)("backend::lang.media.finder_empty")),1)),u.value?Y("",!0):(f(),b("div",Sj,[M(Ke,{variant:"outline",size:"sm","data-mediafinder-choose":"",icon:s(vo),onClick:x[2]||(x[2]=C=>l.value=!0)},{default:N(()=>[ye(_(s(h)("backend::lang.media.finder_add")),1)]),_:1},8,["icon"])]))],64)):(f(),b("div",uj,[g("div",dj,[c.value[0]&&d(c.value[0])?(f(),b("img",{key:0,src:c.value[0],alt:p(c.value[0]),class:"size-full object-cover"},null,8,cj)):c.value[0]?(f(),b("div",fj,[M(s(Ia),{size:24,"aria-hidden":"true"}),g("span",pj,_(s(iu)(p(c.value[0]))),1)])):o.value==="image"?(f(),j(s(If),{key:2,size:24,class:"text-muted","aria-hidden":"true"})):(f(),j(s(Ia),{key:3,size:24,class:"text-muted","aria-hidden":"true"}))]),g("div",mj,[c.value[0]?(f(),b("p",{key:0,class:"truncate text-[14px] font-medium",title:c.value[0]},_(p(c.value[0])),9,vj)):(f(),b("p",hj,_(s(h)("backend::lang.media.finder_empty")),1)),u.value?Y("",!0):(f(),b("div",gj,[M(Ke,{variant:"outline",size:"sm","data-mediafinder-choose":"",onClick:x[0]||(x[0]=C=>l.value=!0)},{default:N(()=>[ye(_(c.value[0]?s(h)("backend::lang.media.finder_change"):s(h)("backend::lang.media.finder_choose")),1)]),_:1}),c.value[0]?(f(),j(Ke,{key:0,variant:"ghost",size:"sm","data-mediafinder-remove":"",icon:s(Xa),onClick:x[1]||(x[1]=C=>m(0))},{default:N(()=>[ye(_(s(h)("backend::lang.media.finder_remove")),1)]),_:1},8,["icon"])):Y("",!0)]))])])),M(Vp,{open:l.value,"onUpdate:open":x[3]||(x[3]=C=>l.value=C),mode:o.value,multiple:r.value,"default-folder":i.value,onSelect:v},null,8,["open","mode","multiple","default-folder"])]))}}),Aj=["id","aria-describedby"],Tj={key:0},Mj={key:1,class:"text-muted","data-empty":""},Dj={key:1,class:"flex min-w-0 flex-col gap-1.5"},Oj={class:"relative"},Pj=["id","name","value","required","aria-required","aria-invalid","aria-describedby"],Ij={key:0,"data-money-currency":"","aria-hidden":"true",class:"absolute inset-y-px right-px flex min-w-[52px] items-center justify-center rounded-r-control border-l border-border bg-subtle px-3 text-muted"},Rj=["id"],qj=["id"],Lj=ae({__name:"MoneyField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=ct(Fs,null),r=k(()=>a.field.scale??4),o=k(()=>{if(a.field.currencyFrom){const T=l?.values.value[a.field.currencyFrom];return typeof T=="string"?T.trim():""}return a.field.currency??""}),i=k(()=>{const T=a.field.attributes?.readonly;return!!a.field.readOnly||T!=null&&T!==!1}),u=k(()=>Hl(a.field)),c=k(()=>Na.value),d=k(()=>eP(c.value)),p=k(()=>`${a.controlId}-currency`),v=k(()=>`${a.controlId}-money-error`);function m(T){return typeof T!="string"||T===""?"":QO(T).replace(".",d.value)}const y=E(m(a.modelValue)),x=E(null),C=E(!1);let w;ze(()=>a.modelValue,T=>{T!==w&&(y.value=m(T),x.value=null,C.value=!1)});function S(T){const R=XO(T,r.value);return R.error===null?R:{value:T.replace(/[\s ]/g,""),error:R.error}}function q(T){y.value=T.target.value;const R=S(y.value);C.value&&(x.value=R.error),w=R.value,n("update:modelValue",R.value)}function O(){C.value=!0,x.value=S(y.value).error}const I=k(()=>!!a.invalid||x.value!==null),B=k(()=>x.value==="too_precise"?h("backend::lang.money.too_precise",{scale:r.value}):h("backend::lang.money.invalid")),L=k(()=>typeof a.modelValue=="string"&&a.modelValue!==""?G0(a.modelValue,o.value,c.value,r.value):""),W=k(()=>[a.describedBy??"",o.value!==""?p.value:"",x.value!==null?v.value:""].filter(Boolean).join(" "));return(T,R)=>i.value?(f(),b("div",{key:0,id:e.controlId,"data-money-readonly":"","aria-describedby":W.value||void 0,class:"flex h-input items-center justify-end rounded-control border border-border bg-subtle px-3.5 tabular-nums whitespace-nowrap"},[L.value!==""?(f(),b("span",Tj,_(L.value),1)):(f(),b("span",Mj,"—"))],8,Aj)):(f(),b("div",Dj,[g("div",Oj,[g("input",Ye({id:e.controlId},u.value,{name:e.field.name,type:"text",inputmode:"decimal",autocomplete:"off",spellcheck:"false",value:y.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":I.value?"true":void 0,"aria-describedby":W.value||void 0,class:[[s(Lt)(I.value),o.value!==""?"pr-16":"pr-3.5"],"h-input text-right tabular-nums"],onInput:q,onBlur:O}),null,16,Pj),o.value!==""?(f(),b("span",Ij,_(o.value),1)):Y("",!0),o.value!==""?(f(),b("span",{key:1,id:p.value,class:"sr-only"},_(s(h)("backend::lang.money.currency",{code:o.value})),9,Rj)):Y("",!0)]),x.value!==null?(f(),b("p",{key:0,id:v.value,"data-money-error":"",class:"flex items-center gap-1.5 text-[13px] text-danger"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(B.value),1)],8,qj)):Y("",!0)]))}}),Nj=["id","aria-describedby"],Bj={key:0,class:"sr-only"},Fj={"data-taglist-chip":"",class:"inline-flex items-center rounded-full bg-surface px-2.5 py-0.5 text-[13px] text-text"},Vj={key:1,class:"text-muted","data-empty":""},zj=["aria-label","onClick"],jj=["id","name","list","placeholder","value","aria-required","aria-invalid","aria-describedby"],Uj=["id"],Hj=["value"],Kj=ae({__name:"TaglistField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,l=k(()=>{const I=a.field.attributes?.readonly;return!!a.field.readOnly||I!=null&&I!==!1}),r=k(()=>Hl(a.field)),o=k(()=>`${a.controlId}-options`),i=k(()=>(a.field.options??[]).map(I=>I.label)),u=k(()=>a.field.mode==="array"),c=k(()=>!u.value&&a.field.separator==="space"),d=k(()=>c.value?" ":","),p=k(()=>a.field.customTags===!1);function v(I){let B=[];Array.isArray(I)?B=I:typeof I=="string"&&!u.value&&(B=c.value?I.split(/\s+/):I.split(","));const L=[];for(const W of B){const T=typeof W=="string"?W.trim():"";T!==""&&!L.includes(T)&&L.push(T)}return L}const m=E(v(a.modelValue)),y=E("");let x;ze(()=>a.modelValue,I=>{I!==x&&(m.value=v(I))});function C(I){m.value=I;const B=u.value?[...I]:I.join(c.value?" ":",");x=B,n("update:modelValue",B)}function w(){const I=y.value.trim();y.value="",!(I===""||m.value.includes(I)||p.value&&!i.value.includes(I))&&C([...m.value,I])}function S(I){C(m.value.filter((B,L)=>L!==I))}function q(I){const B=I.target.value;if(!B.includes(d.value)){y.value=B;return}const L=B.split(d.value),W=L.pop()??"";for(const T of L)y.value=T,w();y.value=W}function O(I){I.key==="Enter"?(I.preventDefault(),w()):I.key==="Backspace"&&y.value===""&&m.value.length>0&&S(m.value.length-1)}return(I,B)=>l.value?(f(),b("div",{key:0,id:e.controlId,"data-taglist-readonly":"","aria-describedby":e.describedBy||void 0,class:"flex min-h-input flex-wrap items-center gap-1.5 rounded-control border border-border bg-subtle px-3.5 py-2"},[m.value.length>0?(f(!0),b(me,{key:0},Ie(m.value,(L,W)=>(f(),b(me,{key:L},[W>0?(f(),b("span",Bj,", ")):Y("",!0),g("span",Fj,_(L),1)],64))),128)):(f(),b("span",Vj,"—"))],8,Nj)):(f(),b("div",{key:1,class:pe([s(Lt)(e.invalid),"flex min-h-input flex-wrap items-center gap-1.5 py-1.5 focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]"]),"data-taglist":""},[(f(!0),b(me,null,Ie(m.value,(L,W)=>(f(),b("span",{key:L,"data-taglist-chip":"",class:"inline-flex items-center gap-1 rounded-full bg-subtle py-0.5 pr-1 pl-2.5 text-[13px] text-text"},[g("span",null,_(L),1),g("button",{type:"button","data-taglist-remove":"","aria-label":s(h)("backend::lang.taglist.remove",{tag:L}),class:"inline-flex size-5 items-center justify-center rounded-full text-muted hover:bg-border hover:text-text",onClick:T=>S(W)},[M(s(qt),{size:12,"aria-hidden":"true"})],8,zj)]))),128)),g("input",Ye({id:e.controlId},r.value,{name:e.field.name,type:"text",autocomplete:"off",list:i.value.length>0?o.value:void 0,placeholder:s(h)("backend::lang.taglist.add"),value:y.value,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"min-w-[8rem] flex-1 bg-transparent py-1 outline-none focus-visible:shadow-none",onInput:q,onKeydown:O,onBlur:w}),null,16,jj),i.value.length>0?(f(),b("datalist",{key:0,id:o.value},[(f(!0),b(me,null,Ie(i.value,L=>(f(),b("option",{key:L,value:L},null,8,Hj))),128))],8,Uj)):Y("",!0)],2))}}),Wj=ae({__name:"MLTextField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;return(l,r)=>(f(),j(ed,Ye(a,{inner:k_,"inner-type":"text","ml-type":"mltext","onUpdate:modelValue":r[0]||(r[0]=o=>n("update:modelValue",o))}),null,16))}}),Gj=ae({__name:"MLTextareaField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;return(l,r)=>(f(),j(ed,Ye(a,{inner:w_,"inner-type":"textarea","ml-type":"mltextarea","onUpdate:modelValue":r[0]||(r[0]=o=>n("update:modelValue",o))}),null,16))}}),Yj=ae({__name:"MLMarkdownField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;return(l,r)=>(f(),j(ed,Ye(a,{inner:C_,"inner-type":"markdown","ml-type":"mlmarkdown","onUpdate:modelValue":r[0]||(r[0]=o=>n("update:modelValue",o))}),null,16))}}),Jj=["id","aria-describedby"],Zj={key:0},Xj={class:"font-mono text-text"},Qj={key:1},eU={class:"font-mono text-text"},vi="\0",tU=ae({__name:"UnsupportedField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=k(()=>{const[l="",r=""]=h("backend::lang.form.unsupported_field",{type:vi}).split(vi);return{before:l,after:r}}),n=k(()=>h("backend::lang.form.unsupported_field",{type:vi}).includes(vi));return(l,r)=>(f(),b("div",{id:e.controlId,"data-unsupported-field":"","aria-describedby":e.describedBy||void 0,class:"flex min-h-input items-center gap-2.5 rounded-control border-[1.5px] border-dashed border-border-strong bg-subtle px-3.5 text-[13px] text-muted"},[M(s(Ob),{size:16,"aria-hidden":"true"}),n.value?(f(),b("span",Zj,[ye(_(a.value.before),1),g("code",Xj,_(t.field.type),1),ye(_(a.value.after),1)])):(f(),b("span",Qj,[ye(_(s(h)("backend::lang.form.unsupported_field"))+" ",1),g("code",eU,_(t.field.type),1)]))],8,Jj))}}),aU=["id","aria-labelledby","aria-describedby","aria-busy"],nU={key:0,"data-widget-skeleton":"",class:"h-[42px] w-[160px] rounded-control bg-skel","aria-hidden":"true"},lU=ae({__name:"WidgetField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=ct(Bs,null),n=ct(Rp,()=>{}),l=ct(Qu,null),r=ct(l_,()=>Promise.resolve([])),o=E("loading"),i=E(null);let u=null,c=!1,d=!1;function p(){const O=a?.value??{},I={};for(const B of t.field.fill??[])O[B]!==void 0&&(I[B]=O[B]);return I}const v=k(()=>JSON.stringify(p())),m=k(()=>l?.value||Na.value);function y(O){let I;return{promise:new Promise((L,W)=>{I=setTimeout(()=>W(new Error("widget element was not defined in time")),O)}),cancel:()=>clearTimeout(I)}}async function x(O){const I=await r();if(customElements.get(O))return;if(I.length>0)throw new Error(`plugin script failed: ${I.join(", ")}`);const B=y(o_);try{await Promise.race([customElements.whenDefined(O),B.promise])}finally{B.cancel()}}function C(O){Oe(O||h("backend::lang.extension.action_failed"),"danger"),u?.setAttribute("state","error")}async function w(O){const I=t.source,B=u;if(!(!B||c||!I)){c=!0,B.setAttribute("busy",""),B.removeAttribute("state");try{const L=await Le.POST("/{vendor}/{plugin}/{controller}/widgets/{field}",{params:{path:{...I,field:t.field.name}},body:{record_id:t.recordId??void 0,values:p(),...O===void 0?{}:{payload:O}}});if(L.data){const W=L.data.data,T=W.fill??{};for(const R of t.field.fill??[])Object.hasOwn(T,R)&&n(R,T[R]);d||(Object.hasOwn(W,"data")?B.setAttribute("data",JSON.stringify(W.data)):B.removeAttribute("data"),B.dispatchEvent(new CustomEvent(DR,{detail:{data:W.data,fill:T,message:W.message}}))),W.message&&Oe(W.message)}else C(L.error?.error.message)}catch{C()}finally{c=!1,u?.removeAttribute("busy")}}}function S(O){const I=O.detail;if(I!==null&&typeof I=="object"&&Object.hasOwn(I,"payload"))return I.payload}function q(O){w(S(O))}return $t(async()=>{const O=t.field.widget??"";try{if(O===""||!t.source)throw new Error("widget field without a tag or controller");if(await x(O),d||!i.value)return;const I=document.createElement(O);I.setAttribute("record-id",t.recordId==null?"":String(t.recordId)),I.setAttribute("field-name",t.field.name),I.setAttribute("locale",m.value),I.setAttribute("fill-values",v.value),I.setAttribute("label",t.field.actionLabel||t.field.label||t.field.name),I.setAttribute("busy-label",h("backend::lang.extension.busy")),I.addEventListener(Rh,q),u=I,i.value.append(I),o.value="ready"}catch{d||(o.value="failed")}}),ze(v,O=>u?.setAttribute("fill-values",O)),ze(m,O=>u?.setAttribute("locale",O)),Dt(()=>{d=!0,u?.removeEventListener(Rh,q),u=null}),(O,I)=>o.value==="failed"?(f(),j(Zu,{key:0,id:e.controlId,"data-widget-failed":"","aria-describedby":e.describedBy||void 0,text:s(h)("backend::lang.extension.widget_failed")},null,8,["id","aria-describedby","text"])):(f(),b("div",{key:1,id:e.controlId,role:"group","data-widget-host":"","aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":o.value==="loading"?"true":void 0,class:"flex min-h-input items-center"},[o.value==="loading"?(f(),b("span",nU)):Y("",!0),g("div",{ref_key:"mountPoint",ref:i,class:"contents"},null,512)],8,aU))}}),xr="relation-manager",S_=new Map([[xr,()=>I7]]),E_=new Map([["text",k_],["textarea",w_],["number",AL],["dropdown",VR],["switch",uz],["checkbox",dR],["relation",nz],["widget",lU],["partial",ML],["fileupload",SL],["datepicker",MR],["password",LL],["permissioneditor",EB],["markdown",C_],["mltext",Wj],["mltextarea",Gj],["mlmarkdown",Yj],["richeditor",$V],["repeater",yF],["money",Lj],["taglist",Kj],["mailpreview",Vz],["codeeditor",Gz],["colorpicker",Xz],["mailimage",sj],["mediafinder",Ej]]),rU=new Set(["switch","checkbox",xr]),oU=new Set([xr]),sU=new Set([xr,"widget","partial","fileupload","mailpreview"]),iU=new Set(["widget","partial","fileupload","permissioneditor","mltext","mltextarea","mlmarkdown","repeater","mailpreview","mailimage","mediafinder"]);function uU(e){return E_.get(e)??S_.get(e)?.()??tU}function dU(e){return(E_.has(e)||S_.has(e))&&!sU.has(e)}function ad(e){return typeof e.element=="string"&&e.element!==""}function A_(e){return ad(e)?e.translatable?hB:d_:uU(e.type)}function T_(e){return ad(e)||dU(e.type)}function cU(e){return oU.has(e)}function fU(e){return rU.has(e)}function pU(e){return iU.has(e)}const Vt="default";function va(e){return e.tab?`tab:${e.tab}`:Vt}function uo(e,t){return`${e}-tab-${t}`}function Vs(e,t){return`${e}-panel-${t}`}function As(e,t){const a=e.context;if(a==null)return!0;const n=Array.isArray(a)?a:[a];return n.length===0||n.includes(t)}function Ra(e,t,a="create",n){const l={};for(const r of e){if(r.readOnly||!T_(r))continue;const o=t[r.name];if(!(r.type==="password"&&a==="update"&&(o===""||o===null))){if(r.type==="permissioneditor"){const i=n?.[r.name];l[r.name]=a_(r,o,i?new Set(i.map(u=>u.code)):void 0);continue}if(Ll(r)){l[r.name]=mn(o);continue}o!==void 0&&(l[r.name]=o)}}return l}function ic(e,t){const a=typeof t=="string"||typeof t=="number"?String(t):"";return e!=="slug"?a:a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function M_(e,t){const a=mn(e),n=mn(t),l=[];for(const r of new Set([...Object.keys(a),...Object.keys(n)]))(a[r]??"")!==(n[r]??"")&&l.push(r);return l}function mU(e,t,a,n,l,r,o){const i={},u=Ll(e.find(c=>c.name===t));for(const c of e){const d=c.preset;if(!d||d.field!==t||c.type!=="text"&&c.type!=="mltext")continue;if(c.type==="text"){if(o(c.name))continue;i[c.name]=ic(d.type,u?mn(n)[r]??"":n);continue}if(!u){if(o(c.name,r))continue;i[c.name]={...mn(l[c.name]),[r]:ic(d.type,n)};continue}const p=mn(n),v={...mn(l[c.name])};let m=!1;for(const y of M_(a,n))o(c.name,y)||(v[y]=ic(d.type,p[y]??""),m=!0);m&&(i[c.name]=v)}return i}function jp(e,t=[]){const a={};for(const n of e)if(n.default!==void 0)a[n.name]=n.default;else if(n.type==="switch"||n.type==="checkbox")a[n.name]=!1;else if(n.type==="relation"&&n.multiple)a[n.name]=[];else if(Ll(n)){const l={};for(const r of t)l[r]="";a[n.name]=l}return a}function Br(e){return e?.enabledLocales??[]}function D_(e,t){const a={};for(const n of t)a[n]="";if(typeof e=="string"){const n=t[0];return n&&(a[n]=e),a}return{...a,...mn(e)}}function O_(e,t,a){const n=e?.find(i=>i.type==="text"||Ll(i)),l=n?t[n.name]:void 0;if(typeof l=="string"||typeof l=="number")return String(l).trim();if(!n||!Ll(n))return"";const r=mn(l),o=a[0]!==void 0?(r[a[0]]??"").trim():"";if(o!=="")return o;for(const i of Object.values(r))if(i.trim()!=="")return i.trim();return""}function P_(e){const t={};for(const a of e??[]){if(!a||typeof a.message!="string"||a.message===""||typeof a.field!="string")continue;const n=a.locale?`${a.locale.toUpperCase()}: ${a.message}`:a.message;(t[a.field]??=[]).push(n)}return t}function Nl(e){const t={};for(const[a,n]of Object.entries(e??{})){const l=Array.isArray(n)?n.filter(r=>typeof r=="string"&&r!==""):typeof n=="string"&&n!==""?[n]:[];l.length>0&&(t[a]=l)}return t}function El(e){return JSON.stringify(Object.keys(e).sort().map(t=>[t,e[t]]))}function Un(e,t){const a=document.getElementById(`${e}-${t}`);return a?(a.matches("input, select, textarea, button, [tabindex]")||a.setAttribute("tabindex","-1"),a.focus(),!0):!1}function vU(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}function rf(e,t){return Object.keys(e).some(a=>a===t||a.startsWith(`${t}.`))}function hU(e,t){return e[t]?t:Object.keys(e).find(a=>a.startsWith(`${t}.`))}const sg=/^[A-Za-z0-9_-]+$/;function ig(e,t){const a=t.split(".");if(a.length<3)return Un(e,a[0]??t);const[n,l,r]=a;if(!sg.test(n)||!/^\d+$/.test(l)||!sg.test(r))return Un(e,n);const o=document.querySelector(`[data-repeater="${n}"] [data-repeater-row="${l}"] [data-field="${r}"]`),i=o?.querySelector("label[for]")?.getAttribute("for"),u=(i?document.getElementById(i):null)??o?.querySelector('input, select, textarea, [contenteditable="true"], button');return u?(u.matches('input, select, textarea, button, [tabindex], [contenteditable="true"]')||u.setAttribute("tabindex","-1"),u.focus(),!0):Un(e,n)}const gU={key:0,role:"alert","data-forbidden-banner":"",class:"flex items-start gap-3 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},yU={class:"flex min-w-0 flex-col gap-1"},bU={class:"[overflow-wrap:anywhere]"},_U={key:1,role:"alert","data-error-banner":"",class:"flex items-start gap-3 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},xU={class:"flex flex-col gap-1"},ko=ae({__name:"FormErrorBanner",props:{errors:{},fieldNames:{},forbidden:{default:null}},setup(e){const t=e,a=k(()=>Object.keys(t.errors).length),n=k(()=>Object.entries(t.errors).filter(([l])=>!t.fieldNames.includes(l)&&!t.fieldNames.includes(vU(l))).flatMap(([,l])=>l));return(l,r)=>e.forbidden?(f(),b("div",gU,[M(s(bt),{size:20,class:"mt-px shrink-0","aria-hidden":"true"}),g("div",yU,[g("p",bU,_(e.forbidden),1),(f(!0),b(me,null,Ie(n.value,(o,i)=>(f(),b("p",{key:i,class:"text-[13px] [overflow-wrap:anywhere]"},_(o),1))),128))])])):a.value>0?(f(),b("div",_U,[M(s(bt),{size:20,class:"mt-px shrink-0","aria-hidden":"true"}),g("div",xU,[g("p",null,[g("strong",null,_(s(h)("backend::lang.form.error_title")),1),ye(" "+_(s(wa)("backend::lang.form.error_fields",a.value)),1)]),(f(!0),b(me,null,Ie(n.value,(o,i)=>(f(),b("p",{key:i,class:"text-[13px]"},_(o),1))),128))])])):Y("",!0)}}),kU={class:"flex flex-wrap items-center gap-2"},wU=["for"],$U=["id","value"],CU=["value","data-locale"],SU=ae({__name:"LocaleVariantSwitcher",props:{variants:{},controlId:{}},setup(e){const t=e,a=ga(),n=wn(),l=k(()=>t.variants.find(c=>c.current)?.id??t.variants[0]?.id??0),r=E(l.value);ze(l,c=>{r.value=c});const o=k(()=>t.controlId??"locale-variant");function i(c){const d=c.states??[];return d.length>0?`${c.label} — ${d.join(", ")}`:c.label}async function u(c){const d=c.target,p=Number(d.value);if(!Number.isFinite(p)||p===l.value)return;r.value=p;let v=!1;try{const m=await n.push({name:a.name??void 0,params:{...a.params,id:String(p)},query:a.query});v=ln(m)}catch{v=!0}v&&(r.value=l.value,d.value=String(l.value))}return(c,d)=>(f(),b("div",kU,[g("label",{for:o.value,class:"text-[13px] text-muted"},_(s(h)("backend::lang.form.locale_variant")),9,wU),g("select",{id:o.value,"data-locale-variant":"",class:"rounded-control border border-border-strong bg-surface px-2 py-1 text-[13px]",value:String(r.value),onChange:u},[(f(!0),b(me,null,Ie(e.variants,p=>(f(),b("option",{key:p.id,value:String(p.id),"data-locale":p.locale},_(i(p)),9,CU))),128))],40,$U)]))}}),I_=ae({__name:"RecordActions",props:{source:{},recordId:{},actions:{},disabled:{type:Boolean,default:!1}},emits:["busy","done","stale","gone"],setup(e,{emit:t}){const a=e,n=t,l=ol(),r=E(!1);function o(u){const d=u?.error?.details?.payload;return Array.isArray(d)&&typeof d[0]=="string"?d[0]:""}async function i(u){if(r.value||a.disabled)return;let c=0,d=!1,p="",v="";if(await l.ask({message:u.confirm||h("backend::lang.form.action_confirm",{action:u.label}),confirmLabel:u.label,danger:u.danger,prompt:u.prompt?{label:u.prompt.label,placeholder:u.prompt.placeholder,comment:u.prompt.comment,maxLength:u.prompt.max_length}:void 0},async()=>{r.value=!0,n("busy",!0);try{const y={path:{...a.source,id:a.recordId,action:u.name}},x=u.prompt?await Le.POST("/{vendor}/{plugin}/{controller}/{id}/actions/{action}",{params:y,body:{payload:l.value.value.trim()}}):await Le.POST("/{vendor}/{plugin}/{controller}/{id}/actions/{action}",{params:y,body:{}});c=x.response.status,d=!!x.data,p=x.data?.data.message??x.error?.error.message??"",v=o(x.error)}catch{c=0}finally{r.value=!1,n("busy",!1)}})){if(d){n("done",p||h("backend::lang.form.action_done"));return}if(c===409){Oe(h("backend::lang.form.action_stale"),"danger"),n("stale");return}if(c===404){n("gone");return}if(c===403){Oe(p||h("backend::lang.list.action_forbidden"),"danger");return}if(c===422&&v){Oe(v,"danger");return}Oe(p||h("backend::lang.extension.action_failed"),"danger")}}return(u,c)=>e.actions.length>0?(f(),b(me,{key:0},[(f(!0),b(me,null,Ie(e.actions,d=>(f(),j(Ke,{key:d.name,variant:"outline",size:"md","data-record-action":d.name,disabled:e.disabled||r.value,onClick:p=>i(d)},{default:N(()=>[ye(_(d.label),1)]),_:2},1032,["data-record-action","disabled","onClick"]))),128)),M(Sn,{open:s(l).request.value!==null,message:s(l).request.value?.message??"","confirm-label":s(l).request.value?.confirmLabel,danger:s(l).request.value?.danger,busy:s(l).busy.value,prompt:s(l).request.value?.prompt??null,value:s(l).value.value,"onUpdate:value":s(l).setValue,onConfirm:s(l).confirm,onCancel:s(l).cancel},null,8,["open","message","confirm-label","danger","busy","prompt","value","onUpdate:value","onConfirm","onCancel"])],64)):Y("",!0)}});function EU(e,t,a){const n=e.trigger;if(!n)return"inactive";const l=a.has(n.field)&&Xu(t[n.field]);return(n.condition==="checked"?l:!l)?"active":"inactive"}function R_(e,t,a){const n=new Set(e.map(o=>o.name)),l=[],r={};for(const o of e){if(!o.trigger||EU(o,t,n)==="inactive"){l.push(o);continue}if(o.trigger.action==="hide")continue;l.push({...o,readOnly:!0});const i=o.trigger.condition==="checked"?"backend::lang.form.trigger_disabled_on":"backend::lang.form.trigger_disabled_off";r[o.name]=h(i,{field:a(o.trigger.field)})}return{fields:l,notes:r}}const AU={class:"flex w-full flex-col gap-5 pb-24"},TU={class:"flex flex-wrap items-center gap-4"},MU={class:"flex min-w-0 flex-1 flex-col"},DU={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},OU={key:0,class:"text-muted"},PU={key:0,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},IU=["id","role","aria-labelledby"],RU={class:"fixed right-0 bottom-0 left-[var(--shell-offset,0px)] z-30 flex flex-wrap items-center gap-2.5 border-t border-border bg-surface px-8 py-3.5"},qU={class:"flex flex-wrap items-center gap-2.5"},LU={class:"ml-auto flex flex-wrap items-center gap-2.5"},NU={class:"sr-only","aria-live":"polite","data-form-live":""},Ql="field",ug="/settings",dg=ae({__name:"FormView",setup(e){const t=ga(),a=wn(),n={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},l=Os(n),r=Ja(l)??"/",o=t.name==="create"?"create":"update",i=o==="update"?Number(t.params.id):null,u=E(null),c=E({}),d=E({}),p=E({}),v=E(""),m=E([]),y=E(!0),x=E([]),C=E(!1),w=E(0),S=E({}),q=E(null),O=E({}),I=E(!0),B=E(!1),L=E(!1),W=E(""),T=E(Vt),R=ol();let G=!1,A=Promise.resolve([]);const D=Ss(),z={[ql]:D},V=E(0),K=E(0),{activeUploads:re,beginUpload:ie}=qp(),Ae=k(()=>(u.value?.fields??[]).filter(De=>As(De,o)&&(o==="update"||!cU(De.type)||De.type===xr&&!!De.deferrable)));function _e(De){return u.value?.fields.find(Qe=>Qe.name===De)?.label||De}const xe=k(()=>R_(Ae.value,c.value,_e)),ne=k(()=>xe.value.fields),fe=k(()=>ne.value.map(De=>De.name)),F=k(()=>{if(!ne.value.some(je=>je.tab))return[];const De=[];for(const je of ne.value){const Qe=va(je);let dt=De.find(St=>St.key===Qe);dt||(dt={key:Qe,label:je.tab||h("backend::lang.form.tab_default"),errors:0},Qe===Vt?De.unshift(dt):De.push(dt)),rf(S.value,je.name)&&(dt.errors+=1)}return De}),de=k(()=>Math.max(F.value.findIndex(De=>De.key===T.value),0)),ve=k(()=>{if(F.value.length===0)return ne.value;const De=F.value[de.value]?.key??Vt;return ne.value.filter(je=>va(je)===De)}),Z=k(()=>v.value||O_(u.value?.fields,c.value,Br(u.value?.meta))),he=k(()=>{if(o==="update"&&Z.value!=="")return Z.value;const De=o==="create"?u.value?.messages.create:u.value?.messages.update;return tt(De,void 0,{name:Z.value})}),J=k(()=>o==="update"&&!!u.value?.singleton),ee=k(()=>o==="update"&&!J.value?tt(u.value?.messages.update,void 0,{name:Z.value}):""),te=k(()=>o==="update"&&!J.value&&!!u.value?.preview),$=k(()=>J.value?ug:te.value?`${r}/${i}/preview`:r),P=k(()=>J.value?h("backend::lang.settings.back"):h(te.value?"backend::lang.form.return_to_preview":"backend::lang.form.return_to_list")),U=k(()=>!I.value&&(V.value>0||re.value>0||El(Ra(ne.value,c.value,o,p.value))!==W.value));function ce(De){if(De){const je=Br(u.value?.meta),Qe={...De.data};for(const dt of Ae.value)dt.type==="password"?Qe[dt.name]="":Ll(dt)&&(Qe[dt.name]=D_(De.data[dt.name],je));c.value=Qe,d.value=De.meta.labels??{},p.value=De.meta.permissionLocks??{},v.value=De.meta.title??"",m.value=De.meta.actions??[],y.value=De.meta.deletable!==!1,De.meta.localeVariants&&(x.value=De.meta.localeVariants)}W.value=El(Ra(ne.value,c.value,o,p.value))}function X(De,je){const Qe=d.value[De]??[],dt=Qe.findIndex(It=>It.value===je.value),St=[...Qe];dt>=0?St[dt]=je:St.push(je),d.value={...d.value,[De]:St}}async function oe(){I.value=!0,B.value=!1;const De={path:n},[je,Qe]=await Promise.all([Le.GET("/{vendor}/{plugin}/{controller}/schema/form",{params:De}),i!==null?Le.GET("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i}}}):Promise.resolve(null)]);u.value=je.data?.data??null,B.value=!je.data||Qe!==null&&!Qe.data,u.value&&(A=Op(l,u.value.assets)),u.value&&o==="create"&&(c.value=jp(Ae.value,Br(u.value.meta))),ce(Qe?.data),Te.value=se(),T.value=F.value[0]?.key??Vt,I.value=!1}const ke=new Set,Se=new Map,Te=E("en");function se(){return Br(u.value?.meta)[0]??"en"}function Me(De){const je=De.detail;typeof je=="string"&&je!==""&&(Te.value=je)}ze(T,()=>{Te.value=se()});function Ce(De,je){return je===void 0?ke.has(De):Se.get(De)?.has(je)??!1}function Fe(De,je){const Qe=c.value[De],dt={...c.value,[De]:je};if(ke.add(De),Ll(Ae.value.find(It=>It.name===De))){let It=Se.get(De);It||(It=new Set,Se.set(De,It));for(const Kl of M_(Qe,je))It.add(Kl)}o==="create"&&Object.assign(dt,mU(Ae.value,De,Qe,je,c.value,Te.value,Ce));const St=xe.value.notes;if(c.value=dt,nt(St),S.value[De]){const It={...S.value};delete It[De],S.value=It}}yt(Bs,k(()=>c.value)),yt(Rp,Fe),yt(Fp,X),yt(Qu,k(()=>u.value?.meta.locale||Na.value)),yt(su,k(()=>Br(u.value?.meta))),yt(l_,()=>A),yt(Lp,k(()=>p.value)),yt(Np,k(()=>xe.value.notes)),yt(n_,w);const Ue=E("");let Ze=null;function at(De){Ue.value="",Ze!==null&&clearTimeout(Ze),Ze=setTimeout(()=>{Ze=null,Ue.value=De},50)}function nt(De){const je=xe.value.notes,Qe=Object.keys(je).filter(dt=>!(dt in De)).map(dt=>`${_e(dt)}: ${je[dt]}`);Qe.length>0&&at(Qe.join(" "))}ze(()=>F.value.map(De=>De.key),De=>{De.length>0&&!De.includes(T.value)&&(T.value=De[0]??Vt)}),yt(Bp,{errors:k(()=>S.value),notices:k(()=>O.value),clearError:De=>{if(S.value[De]){const je={...S.value};delete je[De],S.value=je}},announce:at,confirm:De=>R.ask(De)}),yt(s_,new Map),yt(_o,{key:D,recordId:i??0,routes:De=>e_(n,i??0,De,D),markDirty:()=>{V.value++},pendingChanges:At(V),revision:At(K),beginUpload:ie,activeUploads:At(re)});async function $e(De){S.value=Nl(De?.details);const je=ne.value.filter(St=>rf(S.value,St.name)),Qe=je.find(St=>va(St)===T.value)??je[0];if(!Qe)return;F.value.length>0&&(T.value=va(Qe)),await Ge();const dt=hU(S.value,Qe.name)??Qe.name;ig(Ql,dt)||(await Ge(),ig(Ql,dt))}function ge(De,je){const Qe=u.value?.redirects,dt=(Qe?.[o]?.[De]||Qe?.default)??"";return W0(dt,l,typeof je=="number"||typeof je=="string"?je:null)}async function be(){if(L.value||!u.value||re.value>0)return null;L.value=!0,q.value=null,O.value={};try{const De=Ra(ne.value,c.value,o,p.value),je=i===null?await Le.POST("/{vendor}/{plugin}/{controller}",{params:{path:n,header:z},body:De}):await Le.PUT("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i},header:z},body:De});if(je.data){S.value={},ce(je.data),O.value=P_(je.data.meta.notices),V.value=0,K.value++,w.value++;const Qe=tt(u.value.messages.saved,void 0,{name:Z.value}),dt=Object.values(O.value).flat().join(" ");return Oe(dt===""?Qe:`${Qe} ${dt}`),je.data}return je.response.status===422?await $e(je.error?.error):je.response.status===403?(q.value=je.error?.error.message||h("backend::lang.form.forbidden"),await $e(je.error?.error)):Oe(je.error?.error.message||h("backend::lang.form.error_generic"),"danger"),null}catch{return Oe(h("backend::lang.form.error_generic"),"danger"),null}finally{L.value=!1}}async function We(De){G=!0;try{await a.push(De)}finally{G=!1}}async function it(){const De=await be();De&&o==="create"&&await We(ge("redirect",De.data.id))}async function Be(){const De=await be();De&&await We(J.value?ug:ge("redirectClose",De.data.id))}async function He(){await be()&&OO()}const Je=k(()=>o==="update"&&!J.value&&!te.value&&m.value.length>0),Ot=k(()=>o==="update"&&!J.value&&y.value),Gt=k(()=>L.value||C.value);async function sl(De){if(Oe(De),i===null)return;const je=await Le.GET("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i}}});je.data?(ce(je.data),w.value++):je.response.status===404&&(B.value=!0)}async function En(){if(i===null)return;const De=await Le.GET("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i}}});De.data&&(ce(De.data),w.value++)}function Fa(){B.value=!0}async function Yt(){if(!(i===null||L.value||!u.value||!await R.ask({message:tt(u.value.messages.deleteConfirm,void 0,{name:Z.value}),confirmLabel:h("backend::lang.form.delete"),danger:!0}))){L.value=!0;try{const je=await Le.DELETE("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i}}});if(je.data){Oe(tt(u.value.messages.deleted,void 0,{name:Z.value})),await We(r);return}const Qe=je.response.status===403?"backend::lang.list.action_forbidden":"backend::lang.form.error_generic";Oe(je.error?.error.message||h(Qe),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{L.value=!1}}}async function il(){return G||!U.value?!0:R.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})}async function An(){U.value&&!await R.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})||await We($.value)}eb(il),c2(il);function ul(De){U.value&&(De.preventDefault(),De.returnValue="")}return $t(()=>{window.addEventListener("beforeunload",ul),window.addEventListener(Es,Me)}),Dt(()=>{window.removeEventListener("beforeunload",ul),window.removeEventListener(Es,Me),Ze!==null&&clearTimeout(Ze)}),Aa(()=>Mf(I.value?"":he.value)),Dt(Df),oe(),(De,je)=>(f(),b("section",AU,[g("header",TU,[M(Ke,{variant:"outline","data-action":"back","aria-label":P.value,class:"size-10! px-0!",onClick:An},{default:N(()=>[M(s(mo),{size:18,"aria-hidden":"true"})]),_:1},8,["aria-label"]),g("div",MU,[g("h1",DU,_(I.value?"":he.value),1),ee.value?(f(),b("p",OU,_(ee.value),1)):Y("",!0),!I.value&&x.value.length>1?(f(),j(SU,{key:1,class:"mt-1.5",variants:x.value,"control-id":`${Ql}-locale-variant`},null,8,["variants","control-id"])):Y("",!0)]),F.value.length>0?(f(),j(td,{key:0,modelValue:T.value,"onUpdate:modelValue":je[0]||(je[0]=Qe=>T.value=Qe),tabs:F.value,"id-prefix":Ql},null,8,["modelValue","tabs"])):Y("",!0)]),B.value&&!I.value?(f(),b("p",PU,_(s(h)("backend::lang.form.load_failed")),1)):u.value?(f(),b(me,{key:1},[M(ko,{errors:S.value,"field-names":fe.value,forbidden:q.value},null,8,["errors","field-names","forbidden"]),g("form",{id:F.value.length>0?s(Vs)(Ql,de.value):void 0,role:F.value.length>0?"tabpanel":void 0,"aria-labelledby":F.value.length>0?s(uo)(Ql,de.value):void 0,class:"rounded-card border border-border bg-surface p-7 shadow-card",novalidate:"",onSubmit:mt(it,["prevent"])},[M(xo,{fields:ve.value,values:c.value,errors:S.value,notices:O.value,labels:d.value,source:n,"record-id":s(i),"id-prefix":Ql,onUpdate:Fe},null,8,["fields","values","errors","notices","labels","record-id"])],40,IU)],64)):Y("",!0),g("footer",RU,[g("div",qU,[Ot.value?(f(),j(Ke,{key:0,variant:"danger","data-action":"delete",icon:s(Xa),disabled:Gt.value||I.value||!u.value,onClick:Yt},{default:N(()=>[ye(_(s(h)("backend::lang.form.delete")),1)]),_:1},8,["icon","disabled"])):Y("",!0),Je.value&&s(i)!==null?(f(),j(I_,{key:1,source:n,"record-id":s(i),actions:m.value,disabled:Gt.value||I.value||!u.value,onBusy:je[1]||(je[1]=Qe=>C.value=Qe),onDone:sl,onStale:En,onGone:Fa},null,8,["record-id","actions","disabled"])):Y("",!0)]),g("div",LU,[M(Ke,{variant:"ghost","data-action":"cancel",hotkey:"escape",disabled:Gt.value,onClick:An},{default:N(()=>[ye(_(s(h)("backend::lang.form.cancel")),1)]),_:1},8,["disabled"]),s(o)==="create"?(f(),j(Ke,{key:0,variant:"outline","data-action":"save-new",hotkey:"mod+shift+s",title:s(Ha)(s(h)("backend::lang.form.create_and_new"),"mod+shift+s"),disabled:Gt.value||I.value||!u.value||s(re)>0,onClick:He},{default:N(()=>[ye(_(s(h)("backend::lang.form.create_and_new")),1)]),_:1},8,["title","disabled"])):Y("",!0),M(Ke,{variant:"outline","data-action":"save-close",hotkey:"mod+enter",title:s(Ha)(s(h)("backend::lang.form.save_and_close"),"mod+enter"),disabled:Gt.value||I.value||!u.value||s(re)>0,onClick:Be},{default:N(()=>[ye(_(s(h)("backend::lang.form.save_and_close")),1)]),_:1},8,["title","disabled"]),M(Ke,{variant:"primary","data-action":"save",hotkey:"mod+s",title:s(Ha)(s(h)("backend::lang.form.save"),"mod+s"),disabled:Gt.value||I.value||!u.value||s(re)>0,onClick:it},{default:N(()=>[ye(_(L.value?s(h)("backend::lang.form.saving"):s(h)("backend::lang.form.save")),1)]),_:1},8,["title","disabled"])])]),g("p",NU,_(Ue.value),1),M(Sn,{open:s(R).request.value!==null,message:s(R).request.value?.message??"","confirm-label":s(R).request.value?.confirmLabel,danger:s(R).request.value?.danger,onConfirm:s(R).confirm,onCancel:s(R).cancel,"onUpdate:open":je[2]||(je[2]=Qe=>{Qe||s(R).cancel()})},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])]))}}),BU={class:"flex w-full flex-col gap-5 pb-24","data-preview":""},FU={class:"flex flex-wrap items-center gap-4"},VU={class:"flex min-w-0 flex-1 flex-col"},zU={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},jU={key:0,class:"text-muted"},UU={key:0,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},HU=["id","role","aria-labelledby"],KU={class:"m-0 grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},WU={class:"fixed right-0 bottom-0 left-[var(--shell-offset,0px)] z-30 flex flex-wrap items-center gap-2.5 border-t border-border bg-surface px-8 py-3.5"},GU={class:"ml-auto flex flex-wrap items-center gap-2.5"},hi="preview",YU=ae({__name:"PreviewView",setup(e){const t=ga(),a=wn(),n={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},l=Os(n),r=Ja(l)??"/",o=Number(t.params.id),i=`${r}/${o}`,u=E(null),c=E({}),d=E({}),p=E({}),v=E(""),m=E([]),y=E(!0),x=E(!1),C=E(!1),w=E(Vt),S=E(0),q=new Set(["password","widget",xr]),O=k(()=>R_((u.value?.fields??[]).filter(ne=>As(ne,"preview")&&!q.has(ne.type)),c.value,ne=>ne).fields),I=k(()=>(u.value?.fields??[]).some(ne=>T_(ne)&&As(ne,"update"))),B=k(()=>{if(!O.value.some(fe=>fe.tab))return[];const ne=[];for(const fe of O.value){const F=va(fe);if(ne.some(ve=>ve.key===F))continue;const de={key:F,label:fe.tab||h("backend::lang.form.tab_default"),errors:0};F===Vt?ne.unshift(de):ne.push(de)}return ne}),L=k(()=>Math.max(B.value.findIndex(ne=>ne.key===w.value),0)),W=k(()=>{if(B.value.length===0)return O.value;const ne=B.value[L.value]?.key??Vt;return O.value.filter(fe=>va(fe)===ne)}),T=k(()=>v.value||O_(u.value?.fields,c.value,Br(u.value?.meta))),R=k(()=>tt(u.value?.messages.preview,void 0,{name:T.value})),G=k(()=>u.value?.preview?.headerPartial??""),A=k(()=>!y.value&&!x.value&&u.value!==null);function D(ne){switch(ne.span){case"left":return"min-[600px]:col-start-1";case"right":return"min-[600px]:col-start-2";case"auto":case"row":return"";default:return"col-span-full"}}async function z(){try{const ne=await Le.GET("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:o}}});return ne.data?(c.value={...ne.data.data},d.value=ne.data.meta.labels??{},p.value=ne.data.meta.permissionLocks??{},v.value=ne.data.meta.title??"",m.value=ne.data.meta.actions??[],!0):!1}catch{return!1}}async function V(){y.value=!0,x.value=!1;const[ne,fe]=await Promise.all([Le.GET("/{vendor}/{plugin}/{controller}/schema/form",{params:{path:n}}).catch(()=>null),z()]),F=ne?.data?.data??null;if(F&&!F.preview){await a.replace(i);return}u.value=F,x.value=!F||!fe,F&&Op(l,F.assets),w.value=B.value[0]?.key??Vt,y.value=!1}async function K(){S.value++,await z()||(x.value=!0)}async function re(ne){Oe(ne),await K()}function ie(){x.value=!0}const{activeUploads:Ae,beginUpload:_e}=qp(),xe=Ss();return yt(Fs,{fields:k(()=>O.value),values:k(()=>c.value),path:ne=>ne}),yt(Lp,k(()=>p.value)),yt(_o,{key:xe,recordId:o,routes:ne=>e_(n,o,ne,xe),markDirty:()=>{},pendingChanges:At(E(0)),revision:At(E(0)),beginUpload:_e,activeUploads:At(Ae)}),Aa(()=>Mf(y.value?"":T.value)),Dt(Df),V(),(ne,fe)=>(f(),b("section",BU,[g("header",FU,[M(Ke,{variant:"outline","data-action":"back",to:s(r),"aria-label":s(h)("backend::lang.form.return_to_list"),class:"size-10! px-0!"},{default:N(()=>[M(s(mo),{size:18,"aria-hidden":"true"})]),_:1},8,["to","aria-label"]),g("div",VU,[g("h1",zU,_(y.value?"":T.value),1),A.value&&R.value?(f(),b("p",jU,_(R.value),1)):Y("",!0)]),A.value&&B.value.length>0?(f(),j(td,{key:0,modelValue:w.value,"onUpdate:modelValue":fe[0]||(fe[0]=F=>w.value=F),tabs:B.value,"id-prefix":hi},null,8,["modelValue","tabs"])):Y("",!0)]),x.value&&!y.value?(f(),b("p",UU,_(s(h)("backend::lang.form.load_failed")),1)):A.value?(f(),b(me,{key:1},[G.value!==""?(f(),j(Pp,{key:0,variant:"header",hint:"",source:n,name:G.value,"record-id":s(o),"reload-key":S.value},null,8,["name","record-id","reload-key"])):Y("",!0),g("div",{id:B.value.length>0?s(Vs)(hi,L.value):void 0,role:B.value.length>0?"tabpanel":void 0,"aria-labelledby":B.value.length>0?s(uo)(hi,L.value):void 0,class:"rounded-card border border-border bg-surface p-7 shadow-card"},[g("dl",KU,[(f(!0),b(me,null,Ie(W.value,F=>(f(),j(c_,{key:F.name,class:pe(D(F)),field:F,value:c.value[F.name],labels:d.value?.[F.name],source:n,"record-id":s(o),"id-prefix":hi},null,8,["class","field","value","labels","record-id"]))),128))])],8,HU)],64)):Y("",!0),g("footer",WU,[g("div",GU,[A.value?(f(),j(I_,{key:0,source:n,"record-id":s(o),actions:m.value,disabled:C.value,onBusy:fe[1]||(fe[1]=F=>C.value=F),onDone:re,onStale:K,onGone:ie},null,8,["record-id","actions","disabled"])):Y("",!0),!x.value&&I.value?(f(),j(Ke,{key:1,variant:"primary","data-action":"edit",icon:s(Wr),disabled:y.value||C.value,onClick:fe[2]||(fe[2]=F=>s(a).push(i))},{default:N(()=>[ye(_(s(tt)(u.value?.messages.edit)),1)]),_:1},8,["icon","disabled"])):Y("",!0)])])]))}}),q_=Symbol("summer.reorder.page");function JU(e){const t=new Map;for(const o of e)t.set(o.id,{id:o.id,name:o.name??"",children:[]});const a=[...e].sort((o,i)=>o.sort_order-i.sort_order||o.id-i.id),n=[];for(const o of a){const i=t.get(o.id),u=o.parent_id??null,c=u!==null?t.get(u):void 0;c&&c!==i?c.children.push(i):n.push(i)}const l=new Set,r=o=>{for(const i of o)l.add(i.id),r(i.children)};r(n);for(const o of a)if(!l.has(o.id)){const i=t.get(o.id);for(const u of t.values())u.children=u.children.filter(c=>c.id!==i.id);n.push(i),r([i])}return n}function ZU(e,t=!1){const a=[],n=(l,r)=>{for(const o of l)a.push({id:o.id,parent_id:t?null:r,sort_order:a.length+1}),n(o.children,o.id)};return n(e,null),a}function Fr(e){return e.map(t=>({id:t.id,name:t.name,children:Fr(t.children)}))}function Bl(e,t,a=null,n=0){for(let l=0;l<e.length;l++){const r=e[l];if(r.id===t)return{node:r,list:e,index:l,parent:a,depth:n};const o=Bl(r.children,t,r,n+1);if(o)return o}return null}function L_(e,t){return e.id===t||e.children.some(a=>L_(a,t))}function N_(e,t,a){const n=Bl(e,t);if(!n)return!1;switch(a){case"up":case"indent":return n.index>0;case"down":return n.index<n.list.length-1;case"outdent":return n.parent!==null}}function XU(e,t,a){if(!N_(e,t,a))return!1;const n=Bl(e,t);switch(a){case"up":return n.list.splice(n.index,1),n.list.splice(n.index-1,0,n.node),!0;case"down":return n.list.splice(n.index,1),n.list.splice(n.index+1,0,n.node),!0;case"indent":{const l=n.list[n.index-1];return n.list.splice(n.index,1),l.children.push(n.node),!0}case"outdent":{const l=Bl(e,n.parent.id);return n.list.splice(n.index,1),l.list.splice(l.index+1,0,n.node),!0}}}function QU(e,t){return t&&e==="inside"?"after":e}function Ei(e,t){return!t||e==="up"||e==="down"}function B_(e,t,a){const n=Bl(e,t);return!!n&&!L_(n.node,a)}function eH(e,t,a,n){if(!B_(e,t,a))return!1;const l=Bl(e,t);l.list.splice(l.index,1);const r=Bl(e,a);return n==="inside"?r.node.children.push(l.node):r.list.splice(n==="before"?r.index:r.index+1,0,l.node),!0}const tH={role:"list",class:"m-0 list-none p-0"},aH=["data-reorder-node","onDragover","onDragleave"],nH=["data-reorder-handle","aria-label","onKeydown","onDragstart"],lH={class:"flex gap-1"},rH=["data-action","aria-label","disabled","onClick"],cg="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",oH=ae({__name:"ReorderBranch",props:{nodes:{},depth:{},flat:{type:Boolean,default:!1}},setup(e){const t=e,a=ct(q_),n=[{move:"up",icon:bb,label:"backend::lang.reorder.move_up",action:"reorder-up"},{move:"down",icon:Gn,label:"backend::lang.reorder.move_down",action:"reorder-down"},{move:"outdent",icon:CS,label:"backend::lang.reorder.outdent",action:"reorder-outdent"},{move:"indent",icon:ES,label:"backend::lang.reorder.indent",action:"reorder-indent"}],l=k(()=>n.filter(r=>Ei(r.move,t.flat)));return(r,o)=>{const i=uk("ReorderBranch",!0);return f(),b("ul",tH,[(f(!0),b(me,null,Ie(e.nodes,(u,c)=>(f(),b("li",{key:u.id},[g("div",{"data-reorder-node":u.id,class:pe([[e.depth===0&&c===0?"":"border-t border-border",s(a).dropTarget.value?.id===u.id&&s(a).dropTarget.value.zone==="inside"?"bg-sel outline-2 -outline-offset-2 outline-primary outline-dashed":"hover:bg-hover",s(a).dragging.value===u.id?"opacity-50":"",s(a).blocked.value===u.id?"cursor-not-allowed":""],"relative flex min-h-row items-center gap-2 pr-4"]),style:oa({paddingInlineStart:`calc(16px + ${e.depth} * 24px)`}),onDragover:d=>s(a).onDragOver(d,u.id),onDragleave:d=>s(a).onDragLeave(u.id),onDrop:o[1]||(o[1]=d=>s(a).onDrop(d))},[s(a).dropTarget.value?.id===u.id&&s(a).dropTarget.value.zone!=="inside"?(f(),b("span",{key:0,"data-reorder-line":"",class:pe([s(a).dropTarget.value.zone==="before"?"top-0":"bottom-0","pointer-events-none absolute right-0 h-0.5 bg-primary"]),style:oa({left:`calc(16px + ${e.depth} * 24px)`})},null,6)):Y("",!0),g("button",{type:"button",draggable:"true","data-reorder-handle":u.id,"aria-label":s(h)("backend::lang.reorder.move",{name:s(a).nameOf(u)}),class:pe([cg,"cursor-grab"]),onKeydown:d=>s(a).onHandleKeydown(d,u.id),onDragstart:d=>s(a).onDragStart(d,u.id),onDragend:o[0]||(o[0]=(...d)=>s(a).onDragEnd&&s(a).onDragEnd(...d))},[M(s(Hi),{size:16,"aria-hidden":"true"})],40,nH),g("span",{class:pe(["min-w-0 flex-1 [overflow-wrap:anywhere]",u.name===""?"text-muted":""])},_(s(a).nameOf(u)),3),g("div",lH,[(f(!0),b(me,null,Ie(l.value,d=>(f(),b("button",{key:d.move,type:"button","data-action":d.action,"aria-label":s(h)(d.label,{name:s(a).nameOf(u)}),disabled:!s(a).canMove(u.id,d.move),class:pe(cg),onClick:p=>s(a).move(u.id,d.move)},[(f(),j(Wt(d.icon),{size:16,"aria-hidden":"true"}))],8,rH))),128))])],46,aH),u.children.length>0?(f(),j(i,{key:0,nodes:u.children,depth:e.depth+1,flat:e.flat},null,8,["nodes","depth","flat"])):Y("",!0)]))),128))])}}}),sH={class:"flex w-full flex-col gap-5"},iH={class:"flex flex-wrap items-center gap-4"},uH={class:"flex min-w-0 flex-1 flex-col"},dH={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},cH={class:"flex items-center gap-4"},fH={"data-reorder-status":"","aria-live":"polite",class:"flex items-center gap-1.5 text-[13px] text-muted"},pH={key:0,class:"flex items-center gap-2 font-semibold"},mH=["value"],vH=["value"],hH={key:0,role:"alert",class:"flex items-center gap-2 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},gH={key:1,role:"alert",class:"flex items-center gap-2 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},yH=["aria-busy"],bH={key:1,"data-reorder-empty":"",class:"flex flex-col items-center gap-2 px-6 py-8 text-center"},_H={class:"flex size-10 items-center justify-center rounded-full bg-subtle text-muted"},xH={class:"font-semibold"},kH={class:"max-w-[420px] text-[13px] text-muted"},wH={class:"sr-only","aria-live":"polite","data-reorder-live":""},$H=400,CH=2e3,SH=ae({__name:"ReorderView",setup(e){const t=ga(),a=wn(),n={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},l=Os(n),r=Ja(l)??"/",o=E("loading"),i=E(""),u=E(null),c=E(!1),d=E([]);let p=[];const v=E(0),m=E(!1),y=E("");let x=null,C=!1,w=null,S=null,q=null,O=0;const I=k(()=>{const ee=t.query.partition,te=Number(Array.isArray(ee)?ee[0]:ee);return Number.isInteger(te)&&te>0?te:void 0});async function B(){const ee=++O;o.value="loading";try{const te=I.value!==void 0?{partition:I.value}:void 0,{data:$,response:P}=await Le.GET("/{vendor}/{plugin}/{controller}/reorder",{params:{path:n,query:te}});if(ee!==O)return;if(!$){o.value=P.status===403?"forbidden":"failed";return}i.value=$.data.title,u.value=$.data.partition??null,c.value=$.data.flat===!0,d.value=JU($.data.nodes??[]),p=Fr(d.value),o.value="ready"}catch{ee===O&&(o.value="failed")}}function L(){m.value=!0,S!==null&&clearTimeout(S),S=setTimeout(()=>{S=null,m.value=!1},CH)}function W(){x=null;const ee={sent:Fr(d.value),partition:u.value?.value??null,generation:O};if(C){w=ee;return}G(ee)}function T(ee){return x!==null||w!==null&&w.generation===ee.generation}function R(ee){if(ee.generation===O){if(T(ee))return;d.value=Fr(p)}Oe(h("backend::lang.reorder.failed"),"danger")}async function G(ee){C=!0;const te={nodes:ZU(ee.sent,c.value),partition:ee.partition};m.value=!1,v.value++;try{const{data:$,response:P}=await Le.POST("/{vendor}/{plugin}/{controller}/reorder",{params:{path:n},body:te}),U=ee.generation===O;if($){U&&(p=ee.sent,T(ee)||L());return}if(P.status===409){U&&(w!==null&&w.generation===ee.generation&&(w=null),Oe(h("backend::lang.reorder.stale"),"danger"),await B());return}R(ee)}catch{R(ee)}finally{v.value--,C=!1;const $=w;w=null,$&&G($)}}function A(){x!==null&&clearTimeout(x),x=setTimeout(W,$H)}function D(){x!==null&&(clearTimeout(x),W())}function z(ee){y.value="",q!==null&&clearTimeout(q),q=setTimeout(()=>{q=null,y.value=ee},50)}function V(ee){return ee.name!==""?ee.name:h("backend::lang.reorder.untitled",{id:ee.id})}async function K(ee,te){A();const $=Bl(d.value,ee);if(!$)return;const P=V($.node);te==="nested"&&$.parent?z(h("backend::lang.reorder.nested",{name:P,parent:V($.parent)})):z(te==="unnested"?h("backend::lang.reorder.unnested",{name:P,level:$.depth+1}):h("backend::lang.reorder.moved",{name:P,position:$.index+1,total:$.list.length})),await Ge(),document.querySelector(`[data-reorder-handle="${ee}"]`)?.focus()}function re(ee,te){if(!Ei(te,c.value))return;const $=Fr(d.value);XU($,ee,te)&&(d.value=$,K(ee,te==="indent"?"nested":te==="outdent"?"unnested":"moved"))}const ie={ArrowUp:"up",ArrowDown:"down",ArrowRight:"indent",ArrowLeft:"outdent"};function Ae(ee,te){const $=ie[ee.key];$&&Ei($,c.value)&&(ee.preventDefault(),re(te,$))}const _e=E(null),xe=E(null),ne=E(null);function fe(ee,te){_e.value=te,xe.value=null,ee.dataTransfer?.setData("text/plain",String(te)),ee.dataTransfer&&(ee.dataTransfer.effectAllowed="move")}function F(ee,te){if(_e.value===null)return;if(!B_(d.value,_e.value,te)){ne.value=te,xe.value=null,ee.dataTransfer&&(ee.dataTransfer.dropEffect="none");return}ee.preventDefault(),ne.value=null;const $=ee.currentTarget.getBoundingClientRect(),P=ee.clientY-$.top,U=P<$.height/3?"before":P>$.height*2/3?"after":"inside";xe.value={id:te,zone:QU(U,c.value)}}function de(ee){ne.value===ee&&(ne.value=null)}function ve(ee){const te=_e.value,$=xe.value;if(Z(),te===null||!$)return;ee.preventDefault();const P=Fr(d.value);eH(P,te,$.id,$.zone)&&(d.value=P,K(te,$.zone==="inside"?"nested":"moved"))}function Z(){_e.value=null,xe.value=null,ne.value=null}yt(q_,{dragging:_e,dropTarget:xe,blocked:ne,nameOf:V,canMove:(ee,te)=>Ei(te,c.value)&&N_(d.value,ee,te),move:re,onHandleKeydown:Ae,onDragStart:fe,onDragOver:F,onDragLeave:de,onDrop:ve,onDragEnd:Z});function he(ee){const te=ee.target.value;D(),a.replace({path:t.path,query:{...t.query,partition:te}})}ze(I,(ee,te)=>{ee!==te&&B()});function J(){a.push(r)}return eb(()=>(D(),!0)),Dt(()=>{D();for(const ee of[S,q])ee!==null&&clearTimeout(ee);Df()}),Aa(()=>Mf(o.value==="ready"?i.value:"")),B(),(ee,te)=>(f(),b("section",sH,[g("header",iH,[M(Ke,{variant:"outline","data-action":"back","aria-label":s(h)("backend::lang.form.return_to_list"),class:"size-10! px-0!",onClick:J},{default:N(()=>[M(s(mo),{size:18,"aria-hidden":"true"})]),_:1},8,["aria-label"]),g("div",uH,[g("h1",dH,_(i.value),1)]),g("div",cH,[g("p",fH,[v.value>0?(f(),b(me,{key:0},[M(s(Vn),{size:14,class:"animate-spin","aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.form.saving")),1)],64)):m.value?(f(),b(me,{key:1},[ye(_(s(h)("backend::lang.reorder.saved")),1)],64)):Y("",!0)]),u.value?(f(),b("label",pH,[ye(_(u.value.label)+" ",1),g("select",{"data-reorder-partition":"",value:String(u.value.value),class:"h-input w-[240px] appearance-none rounded-control border border-border-strong bg-surface px-3.5 font-normal text-text",onChange:he},[(f(!0),b(me,null,Ie(u.value.options,$=>(f(),b("option",{key:$.value,value:String($.value)},_($.label),9,vH))),128))],40,mH)])):Y("",!0)])]),o.value==="failed"?(f(),b("p",hH,[M(s(bt),{size:16,class:"shrink-0","aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.reorder.load_failed")),1)])):o.value==="forbidden"?(f(),b("p",gH,[M(s(bt),{size:16,class:"shrink-0","aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.form.forbidden")),1)])):(f(),b("div",{key:2,"data-reorder-card":"",class:"overflow-hidden rounded-card border border-border bg-surface shadow-card","aria-busy":o.value==="loading"?"true":void 0},[o.value==="loading"?(f(),b(me,{key:0},Ie(5,$=>g("div",{key:$,"data-reorder-skeleton":"",class:"flex min-h-row items-center gap-3 border-t border-border px-4 first:border-t-0"},[...te[0]||(te[0]=[g("span",{class:"size-5 rounded-[6px] bg-skel"},null,-1),g("span",{class:"h-3 w-48 rounded-[6px] bg-skel"},null,-1)])])),64)):d.value.length===0?(f(),b("div",bH,[g("span",_H,[M(s(mb),{size:20,"aria-hidden":"true"})]),g("p",xH,_(s(h)("backend::lang.reorder.empty")),1),g("p",kH,_(s(h)("backend::lang.reorder.empty_hint")),1)])):(f(),j(oH,{key:2,nodes:d.value,depth:0,flat:c.value,"aria-label":s(h)("backend::lang.reorder.tree"),"data-reorder-tree":""},null,8,["nodes","flat","aria-label"]))],8,yH)),g("p",wH,_(y.value),1)]))}}),EH={class:"flex w-full flex-col gap-5 pb-24"},AH={class:"flex items-center gap-4"},TH={class:"flex min-w-0 flex-1 flex-col"},MH={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},DH={key:0,class:"text-muted"},OH={key:0,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},PH=["id","role","aria-labelledby"],IH={class:"fixed right-0 bottom-0 left-[var(--shell-offset,0px)] z-30 flex items-center justify-end gap-2.5 border-t border-border bg-surface px-8 py-3.5"},Vo="setting",RH=ae({__name:"SettingsFormView",setup(e){const t=ga(),a=wn(),n=String(t.params.code??""),l=E(null),r=E({}),o=E({}),i=E({}),u=E({}),c=E(!0),d=E(!1),p=E(!1),v=E(Vt);yt(r_,k(()=>u.value)),yt(Bs,k(()=>r.value)),yt(Qu,k(()=>l.value?.meta.locale||Na.value));const m=k(()=>(l.value?.fields??[]).filter(R=>As(R,"update"))),y=k(()=>m.value.map(R=>R.name)),x=k(()=>gs(n)?.label||l.value?.name||n),C=k(()=>gs(n)?.description??""),w=k(()=>{if(!m.value.some(G=>G.tab))return[];const R=[];for(const G of m.value){const A=va(G);let D=R.find(z=>z.key===A);D||(D={key:A,label:G.tab||h("backend::lang.form.tab_default"),errors:0},A===Vt?R.unshift(D):R.push(D)),rf(o.value,G.name)&&(D.errors+=1)}return R}),S=k(()=>Math.max(w.value.findIndex(R=>R.key===v.value),0)),q=k(()=>{if(w.value.length===0)return m.value;const R=w.value[S.value]?.key??Vt;return m.value.filter(G=>va(G)===R)});async function O(){const R={path:{code:n}},[G,A]=await Promise.all([Le.GET("/settings/{code}/schema",{params:R}),Le.GET("/settings/{code}",{params:R})]);l.value=G.data?.data??null,r.value={...A.data?.data.data??{}},u.value={...A.data?.data.meta?.secrets??{}},d.value=!G.data||!A.data,c.value=!1,v.value=w.value[0]?.key??Vt}function I(R,G){if(r.value={...r.value,[R]:G},o.value[R]){const A={...o.value};delete A[R],o.value=A}}function B(R,G){const A=Ra(R,G);for(const D of R){if(D.type!=="password")continue;const z=G[D.name];z===null?A[D.name]=null:(typeof z!="string"||z==="")&&delete A[D.name]}return A}async function L(){if(p.value||!l.value)return!1;p.value=!0;try{const R=await Le.PUT("/settings/{code}",{params:{path:{code:n}},body:B(m.value,r.value)});if(R.data)return o.value={},r.value={...R.data.data.data},u.value={...R.data.data.meta?.secrets??{}},i.value=P_(R.data.data.meta?.notices),Oe(h("backend::lang.settings.saved")),!0;if(R.response.status===422){o.value=Nl(R.error?.error.details);const G=m.value.filter(D=>o.value[D.name]),A=G.find(D=>va(D)===v.value)??G[0];return A&&w.value.length>0&&(v.value=va(A)),await Ge(),A&&Un(Vo,A.name),!1}return Oe(R.error?.error.message||h("backend::lang.form.error_generic"),"danger"),!1}catch{return Oe(h("backend::lang.form.error_generic"),"danger"),!1}finally{p.value=!1}}async function W(){await L()}async function T(){await L()&&await a.push("/settings")}return O(),(R,G)=>(f(),b("section",EH,[g("header",AH,[M(Ke,{variant:"outline","data-action":"back",to:"/settings","aria-label":s(h)("backend::lang.settings.back"),class:"size-10! px-0!"},{default:N(()=>[M(s(mo),{size:18,"aria-hidden":"true"})]),_:1},8,["aria-label"]),g("div",TH,[g("h1",MH,_(x.value),1),C.value?(f(),b("p",DH,_(C.value),1)):Y("",!0)]),w.value.length>0?(f(),j(td,{key:0,modelValue:v.value,"onUpdate:modelValue":G[0]||(G[0]=A=>v.value=A),tabs:w.value,"id-prefix":Vo},null,8,["modelValue","tabs"])):Y("",!0)]),d.value&&!c.value?(f(),b("p",OH,_(s(h)("backend::lang.form.load_failed")),1)):l.value?(f(),b(me,{key:1},[M(ko,{errors:o.value,"field-names":y.value},null,8,["errors","field-names"]),g("form",{id:w.value.length>0?s(Vs)(Vo,S.value):void 0,role:w.value.length>0?"tabpanel":void 0,"aria-labelledby":w.value.length>0?s(uo)(Vo,S.value):void 0,class:"rounded-card border border-border bg-surface p-7 shadow-card",novalidate:"",onSubmit:mt(W,["prevent"])},[M(xo,{fields:q.value,values:r.value,errors:o.value,notices:i.value,source:null,"id-prefix":Vo,onUpdate:I},null,8,["fields","values","errors","notices"])],40,PH)],64)):Y("",!0),g("footer",IH,[M(Ke,{variant:"ghost",to:"/settings"},{default:N(()=>[ye(_(s(h)("backend::lang.form.cancel")),1)]),_:1}),M(Ke,{variant:"outline","data-action":"save-close",hotkey:"mod+enter",title:s(Ha)(s(h)("backend::lang.form.save_and_close"),"mod+enter"),disabled:p.value||c.value||!l.value,onClick:T},{default:N(()=>[ye(_(s(h)("backend::lang.form.save_and_close")),1)]),_:1},8,["title","disabled"]),M(Ke,{variant:"primary","data-action":"save",hotkey:"mod+s",title:s(Ha)(s(h)("backend::lang.form.save"),"mod+s"),disabled:p.value||c.value||!l.value,onClick:W},{default:N(()=>[ye(_(p.value?s(h)("backend::lang.form.saving"):s(h)("backend::lang.form.save")),1)]),_:1},8,["title","disabled"])])]))}}),qH={class:"flex flex-col gap-5"},LH={class:"text-[26px] font-bold tracking-[-0.02em]"},NH={key:0,class:"text-muted"},BH={key:0,class:"text-[13px] font-semibold tracking-[0.02em] text-muted uppercase"},FH={class:"grid grid-cols-1 gap-3 min-[900px]:grid-cols-2"},VH=["href","data-settings","onClick"],zH={class:"flex size-10 shrink-0 items-center justify-center rounded-inner bg-subtle text-muted"},jH={class:"flex min-w-0 flex-col"},UH={class:"font-semibold"},HH={key:0,class:"text-[13px] text-muted"},KH=ae({__name:"SettingsIndexView",setup(e){return(t,a)=>(f(),b("section",qH,[g("header",null,[g("h1",LH,_(s(h)("backend::lang.settings.title")),1)]),s(Ac).length===0?(f(),b("p",NH,_(s(h)("backend::lang.settings.empty")),1)):Y("",!0),(f(!0),b(me,null,Ie(s(Ac),n=>(f(),b("section",{key:n.category,"data-settings-group":"",class:"flex flex-col gap-3"},[n.category?(f(),b("h2",BH,_(n.category),1)):Y("",!0),g("div",FH,[(f(!0),b(me,null,Ie(n.entries,l=>(f(),j(s(Sa),{key:l.code,to:s(Pf)(l),custom:""},{default:N(({href:r,navigate:o})=>[g("a",{href:r,"data-settings":l.code,class:"flex items-start gap-3.5 rounded-card border border-border bg-surface p-5 text-text no-underline shadow-card hover:bg-hover",onClick:o},[g("span",zH,[(f(),j(Wt(s(qs)(l.icon)),{size:20,"aria-hidden":"true"}))]),g("span",jH,[g("span",UH,_(l.label),1),l.description?(f(),b("span",HH,_(l.description),1)):Y("",!0)])],8,VH)]),_:2},1032,["to"]))),128))])]))),128))]))}}),WH=["data-account-contribution"],GH={class:"flex flex-col gap-1"},YH={tabindex:"-1",class:"text-[18px] font-bold"},JH={key:0,class:"max-w-[640px] text-[13px] text-muted"},ZH={key:0,"data-account-contribution-status":"",class:"font-medium"},XH={key:1,"data-account-contribution-error":"",class:"text-[13px] text-muted"},QH={key:0,role:"list","data-account-items":"",class:"flex flex-col overflow-hidden rounded-inner border border-border"},eK=["data-account-item"],tK={class:"flex min-w-0 flex-1 flex-col gap-1"},aK={class:"font-semibold [overflow-wrap:anywhere]"},nK={key:0,class:"text-[13px] text-muted [overflow-wrap:anywhere]"},lK={key:1,class:"text-[13px] text-muted tabular-nums [overflow-wrap:anywhere]"},rK={key:0,class:"flex flex-wrap gap-2 max-sm:self-start"},oK={key:1,"data-account-items-empty":"",class:"rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},sK={class:"text-[13px] text-muted"},iK=["href"],uK={key:4,class:"flex flex-wrap gap-2.5"},dK=ae({__name:"AccountContributions",props:{confirm:{}},setup(e){const t=e,a=E([]),n=E(""),l=E({});function r(m){if(/[\u0000-\u001f\u007f]/.test(m))return"";if(/^https?:\/\//i.test(m))try{return new URL(m).host!==""?m:""}catch{return""}return m.startsWith("/")&&!m.startsWith("//")&&!m.startsWith("/\\")?m:""}async function o(){try{const m=await Le.GET("/account/contributions");if(m.data){a.value=m.data.data??[];return}Oe(h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}}async function i(m,y){n.value=`${m.name}/${y.name}`;try{const x=await Le.POST("/account/contributions/{name}/actions/{action}",{params:{path:{name:m.name,action:y.name}}});if(x.data){const w=x.data.data;Oe(w.message||h("backend::lang.form.action_done"));const S=r(w.url??"");S&&(l.value={...l.value,[m.name]:S},window.open(S,"_blank","noopener")),await o();return}const C=x.response.status;if(C===409){Oe(h("backend::lang.myaccount.action_stale"),"danger"),await o();return}if(C===403){Oe(x.error?.error.message||h("backend::lang.list.action_forbidden"),"danger");return}Oe(x.error?.error.message||h("backend::lang.extension.action_failed"),"danger")}catch{Oe(h("backend::lang.extension.action_failed"),"danger")}finally{n.value=""}}function u(m){return Array.isArray(m.items)?m.items:null}async function c(m){await Ge(),document.querySelector(`[data-account-contribution="${CSS.escape(m)}"]`)?.querySelector("h2")?.focus()}async function d(m,y,x){n.value=`${m.name}/${y.id}/${x.name}`;try{const C=await Le.POST("/account/contribution-items/{name}/{item}/actions/{action}",{params:{path:{name:m.name,item:y.id,action:x.name}}});if(C.data){const S=C.data.data;Oe(S.message||h("backend::lang.form.action_done"));const q=r(S.url??"");q&&(l.value={...l.value,[m.name]:q},window.open(q,"_blank","noopener")),await o(),await c(m.name);return}const w=C.response.status;if(w===404){Oe(h("backend::lang.myaccount.item_gone"),"danger"),await o(),await c(m.name);return}if(w===409){Oe(h("backend::lang.myaccount.action_stale"),"danger"),await o(),await c(m.name);return}if(w===403){Oe(C.error?.error.message||h("backend::lang.list.action_forbidden"),"danger");return}Oe(C.error?.error.message||h("backend::lang.extension.action_failed"),"danger")}catch{Oe(h("backend::lang.extension.action_failed"),"danger")}finally{n.value=""}}async function p(m,y,x){if(!n.value){if(!x.confirm&&!x.danger){await d(m,y,x);return}await t.confirm.ask({message:x.confirm?Vi(x.confirm,{title:y.title}):h("backend::lang.myaccount.action_confirm",{action:x.label}),confirmLabel:x.label,danger:x.danger},()=>d(m,y,x))}}async function v(m,y){if(!n.value){if(!y.confirm&&!y.danger){await i(m,y);return}await t.confirm.ask({message:y.confirm||h("backend::lang.myaccount.action_confirm",{action:y.label}),confirmLabel:y.label,danger:y.danger},()=>i(m,y))}}return $t(()=>{o()}),(m,y)=>(f(!0),b(me,null,Ie(a.value,x=>(f(),b("div",{key:x.name,"data-account-contribution":x.name,class:"flex flex-col gap-4 rounded-card border border-border bg-surface p-7 shadow-card"},[g("div",GH,[g("h2",YH,_(x.label),1),x.description?(f(),b("p",JH,_(x.description),1)):Y("",!0)]),x.status?(f(),b("p",ZH,_(x.status),1)):Y("",!0),x.error?(f(),b("p",XH,_(s(h)("backend::lang.myaccount.section_error")),1)):u(x)!==null?(f(),b(me,{key:2},[u(x).length>0?(f(),b("div",QH,[(f(!0),b(me,null,Ie(u(x),C=>(f(),b("div",{key:C.id,role:"listitem","data-account-item":C.id,class:"flex items-start justify-between gap-4 border-t border-border px-4 py-3.5 first:border-t-0 max-sm:flex-col"},[g("div",tK,[g("span",aK,_(C.title),1),C.subtitle?(f(),b("span",nK,_(C.subtitle),1)):Y("",!0),(C.meta??[]).length>0?(f(),b("span",lK,_((C.meta??[]).join(" · ")),1)):Y("",!0)]),(x.item_actions??[]).length>0?(f(),b("div",rK,[(f(!0),b(me,null,Ie(x.item_actions??[],w=>(f(),j(Ke,{key:w.name,variant:w.danger?"danger":"outline",size:"sm",icon:w.danger?s(gb):void 0,"data-account-item-action":w.name,"aria-label":s(h)("backend::lang.myaccount.item_action_named",{action:w.label,title:C.title}),disabled:n.value!=="",onClick:S=>p(x,C,w)},{default:N(()=>[ye(_(w.label),1)]),_:2},1032,["variant","icon","data-account-item-action","aria-label","disabled","onClick"]))),128))])):Y("",!0)],8,eK))),128))])):(f(),b("div",oK,[g("p",sK,_(x.items_empty||s(h)("backend::lang.myaccount.items_empty")),1)]))],64)):Y("",!0),r(l.value[x.name]??"")?(f(),b("a",{key:3,"data-account-contribution-url":"",href:r(l.value[x.name]??""),target:"_blank",rel:"noopener noreferrer",class:"text-primary underline [overflow-wrap:anywhere]"},_(l.value[x.name]),9,iK)):Y("",!0),x.actions.length>0?(f(),b("div",uK,[(f(!0),b(me,null,Ie(x.actions,C=>(f(),j(Ke,{key:C.name,variant:"outline",size:"md","data-account-contribution-action":C.name,disabled:n.value!=="",onClick:w=>v(x,C)},{default:N(()=>[ye(_(C.label),1)]),_:2},1032,["data-account-contribution-action","disabled","onClick"]))),128))])):Y("",!0)],8,WH))),128))}});function wo(e){let t=null,a=null;const n=[];for(const l of e)l.name==="*"?t??=l:l.name==="admin:read"?a??=l:n.push(l);return{fullScope:t,adminReadScope:a,pluginScopes:n}}function cK(e,t,a){const n=new Map;for(const r of e){const o=`${r.plugin_id}\0${r.group}`;let i=n.get(o);if(!i){const u=r.group.trim()||r.plugin_id.trim()||a;i={key:o,pluginId:r.plugin_id,label:u,scopes:[]},n.set(o,i)}i.scopes.push(r)}let l;try{l=new Intl.Collator(t||void 0,{sensitivity:"base"})}catch{l=new Intl.Collator(void 0,{sensitivity:"base"})}return[...n.values()].sort((r,o)=>{const i=l.compare(r.label,o.label);if(i!==0)return i;const u=r.pluginId.localeCompare(o.pluginId);return u!==0?u:r.key.localeCompare(o.key)})}function fK(e,t,a){const n=a.trim().toLowerCase();return n===""?!0:e.name.toLowerCase().includes(n)||e.label.toLowerCase().includes(n)||e.description.toLowerCase().includes(n)||e.plugin_id.toLowerCase().includes(n)||t.toLowerCase().includes(n)}function of(e,t){return t.scopes.has(e.name)||t.adminRead&&e.read_only}function pK(e,t,a,n){if(e.length<=3||t<=12)return new Set(e.map(r=>r.key));const l=new Set;for(const r of e)r.scopes.some(o=>of(o,a))&&l.add(r.key);return l}function Up(e,t,a=6){const{adminReadScope:n,pluginScopes:l}=wo(e),r=t.adminRead&&n!==null,o=[];r&&o.push({key:"admin:read",name:"admin:read",label:"admin:read",kind:"admin_read"});const i=[],u=[];for(const y of l)t.scopes.has(y.name)&&(y.read_only?r||u.push(y):i.push(y));for(const y of i)o.push({key:y.name,name:y.name,label:y.label,kind:"write"});for(const y of u)o.push({key:y.name,name:y.name,label:y.label,kind:"read_only"});const c=r?i:[...i,...u],d=new Set;for(const y of c)d.add(y.plugin_id||y.group||y.name);const p=Math.max(0,a),v=o.slice(0,p),m=Math.max(0,o.length-p);return{chips:o,visible:v,overflowCount:m,selectedWriteCount:i.length,selectedPluginCount:c.length,distinctPluginCount:d.size}}function mK(e,t,a){const{fullScope:n,adminReadScope:l,pluginScopes:r}=wo(t);return e==="full"?n?["*"]:[]:e==="read_only"?l?["admin:read"]:[]:a.adminRead&&l?["admin:read",...r.filter(o=>!o.read_only&&a.scopes.has(o.name)).map(o=>o.name)]:r.filter(o=>a.scopes.has(o.name)).map(o=>o.name)}function fg(e,t){const{fullScope:a,adminReadScope:n,pluginScopes:l}=wo(e);return t==="connect"?n!==null?{tier:"read_only",custom:{adminRead:!1,scopes:new Set}}:l.length>0?{tier:"custom",custom:{adminRead:!1,scopes:new Set(l.map(r=>r.name))}}:a!==null?{tier:"full",custom:{adminRead:!1,scopes:new Set}}:{tier:"read_only",custom:{adminRead:!1,scopes:new Set}}:n!==null?{tier:"read_only",custom:{adminRead:!1,scopes:new Set}}:a!==null?{tier:"full",custom:{adminRead:!1,scopes:new Set}}:{tier:"custom",custom:{adminRead:!1,scopes:new Set}}}const vK=["id"],hK=["aria-labelledby","aria-invalid"],gK={class:"flex flex-wrap items-center gap-1"},yK={class:"font-semibold text-text"},bK={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},_K={"data-scope-all-note":"",class:"flex items-center gap-2 text-[13px] text-muted"},xK={class:"flex flex-wrap items-center gap-1"},kK={class:"font-semibold text-text"},wK={class:"inline-flex h-6 items-center rounded-pill border border-border bg-surface px-2.5 text-[13px] font-semibold whitespace-nowrap text-muted"},$K={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},CK={class:"flex flex-wrap items-center justify-between gap-2"},SK={"data-scope-summary-count":"",class:"text-[13px] text-muted tabular-nums [overflow-wrap:anywhere]"},EK=["disabled"],AK={key:0,"data-scope-summary-chips":"",class:"flex flex-wrap gap-2"},TK=["title"],MK=["data-summary-chip","title"],DK={class:"truncate"},OK=["data-summary-chip","title"],PK={class:"truncate"},IK=["disabled"],F_=ae({__name:"ScopeAccessControl",props:{catalog:{},availableTiers:{},tier:{},custom:{},disabled:{type:Boolean},invalid:{type:Boolean},idPrefix:{}},emits:["update:tier","customize"],setup(e,{expose:t,emit:a}){const n=e,l=a,r={full:"backend::lang.api_tokens.tier_full",read_only:"backend::lang.api_tokens.tier_read_only",custom:"backend::lang.api_tokens.tier_custom"},o=E(null),i=E(null),u=k(()=>wo(n.catalog)),c=k(()=>u.value.fullScope),d=k(()=>u.value.adminReadScope),p=k(()=>Up(n.catalog,n.custom)),v=k(()=>n.custom.adminRead&&d.value!==null),m=k(()=>!v.value&&p.value.selectedPluginCount===0?h("backend::lang.api_tokens.scope_summary_empty"):v.value&&p.value.selectedWriteCount===0?h("backend::lang.api_tokens.scope_summary_admin_read_only"):v.value?h("backend::lang.api_tokens.scope_summary_admin_read_plus",{scopes:wa("backend::lang.api_tokens.scope_write_count",p.value.selectedWriteCount),plugins:wa("backend::lang.api_tokens.scope_plugin_count",p.value.distinctPluginCount)}):h("backend::lang.api_tokens.scope_summary_line",{scopes:wa("backend::lang.api_tokens.scope_count",p.value.selectedPluginCount),plugins:wa("backend::lang.api_tokens.scope_plugin_count",p.value.distinctPluginCount)}));function y(C){(C==="full"||C==="read_only"||C==="custom")&&l("update:tier",C)}function x(){if(i.value){i.value.focus();return}const C=o.value?.querySelector('[data-access-tier][data-state="checked"]');if(C){C.focus();return}o.value?.querySelector("[data-access-tier]")?.focus()}return t({focusPrimaryControl:x}),(C,w)=>(f(),b("div",{ref_key:"rootEl",ref:o,class:"flex min-w-0 flex-col gap-1.5"},[g("span",{id:`${e.idPrefix}-access-label`,class:"font-semibold text-text"},_(s(h)("backend::lang.api_tokens.access_level")),9,vK),e.availableTiers.length>1?(f(),j(s($p),{key:0,"model-value":e.tier,orientation:"horizontal",disabled:e.disabled,"aria-labelledby":`${e.idPrefix}-access-label`,"data-access-tiers":"",class:pe([e.availableTiers.length===3?"grid-cols-3":"grid-cols-2","grid gap-1 rounded-inner border border-border bg-subtle p-1"]),"onUpdate:modelValue":y},{default:N(()=>[(f(!0),b(me,null,Ie(e.availableTiers,S=>(f(),j(s(Cp),{key:S,value:S,"data-access-tier":S,class:"inline-flex min-h-[38px] items-center justify-center rounded-tab px-2 py-2 text-center text-[13px] text-muted transition-colors duration-150 ease-out hover:text-text data-[state=checked]:bg-surface data-[state=checked]:text-text data-[state=checked]:shadow-tab data-[state=checked]:font-semibold disabled:cursor-not-allowed disabled:opacity-60"},{default:N(()=>[ye(_(s(h)(r[S])),1)]),_:2},1032,["value","data-access-tier"]))),128))]),_:1},8,["model-value","disabled","aria-labelledby","class"])):Y("",!0),g("div",{"data-scope-summary":"",role:"region","aria-labelledby":`${e.idPrefix}-access-label`,"aria-invalid":e.invalid?"true":void 0,class:pe([e.invalid?"border-danger":"border-border","flex flex-col gap-2 rounded-inner border bg-subtle p-4"])},[e.tier==="full"&&c.value?(f(),b(me,{key:0},[g("div",gK,[g("span",yK,_(c.value.label),1),w[2]||(w[2]=g("span",{class:"font-mono text-[13px] text-muted"},"*",-1))]),g("p",bK,_(c.value.description),1),g("p",_K,[M(s(Vl),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.scope_all_includes")),1)])],64)):e.tier==="read_only"&&d.value?(f(),b(me,{key:1},[g("div",xK,[g("span",kK,_(d.value.label),1),w[3]||(w[3]=g("span",{class:"font-mono text-[13px] text-muted"},"admin:read",-1)),g("span",wK,_(s(h)("backend::lang.api_tokens.read_only")),1)]),g("p",$K,_(d.value.description),1)],64)):e.tier==="custom"?(f(),b(me,{key:2},[g("div",CK,[g("p",SK,_(m.value),1),g("button",{ref_key:"customizeButton",ref:i,type:"button","data-action":"customize-scopes",disabled:e.disabled,class:"inline-flex h-[38px] shrink-0 items-center justify-center gap-2 rounded-control border border-border-strong bg-surface px-4 text-[14px] font-semibold whitespace-nowrap text-text transition-colors duration-150 ease-out hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:w[0]||(w[0]=S=>l("customize"))},[M(s(Rb),{size:16,"aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.scope_customize")),1)],8,EK)]),p.value.visible.length>0?(f(),b("div",AK,[(f(!0),b(me,null,Ie(p.value.visible,S=>(f(),b(me,{key:S.key},[S.kind==="admin_read"?(f(),b("span",{key:0,"data-summary-chip":"admin:read",title:d.value?.label,class:"inline-flex h-6 items-center gap-1 rounded-pill border border-border-strong bg-surface px-2 font-mono text-[13px] font-semibold whitespace-nowrap text-text"},[M(s(cn),{size:14,class:"shrink-0 text-muted","aria-hidden":"true"}),w[4]||(w[4]=g("span",null,"admin:read",-1))],8,TK)):S.kind==="write"?(f(),b("span",{key:1,"data-summary-chip":S.name,title:S.name,class:"inline-flex h-6 max-w-full items-center rounded-pill border border-border-strong bg-surface px-2 text-[13px] font-semibold text-text"},[g("span",DK,_(S.label),1)],8,MK)):(f(),b("span",{key:2,"data-summary-chip":S.name,title:S.name,class:"inline-flex h-6 max-w-full items-center rounded-pill border border-border bg-surface px-2 text-[13px] font-normal text-muted"},[g("span",PK,_(S.label),1)],8,OK))],64))),128)),p.value.overflowCount>0?(f(),b("button",{key:0,type:"button","data-action":"customize-scopes-more",disabled:e.disabled,class:"inline-flex h-6 items-center rounded-pill border border-dashed border-border-strong bg-surface px-2 text-[13px] font-semibold tabular-nums whitespace-nowrap text-text hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:w[1]||(w[1]=S=>l("customize"))},_(s(h)("backend::lang.api_tokens.scope_more",{count:p.value.overflowCount})),9,IK)):Y("",!0)])):Y("",!0)],64)):Y("",!0)],10,hK)],512))}}),RK={"data-scope-picker":"",class:"flex min-h-0 flex-1 flex-col"},qK={class:"flex shrink-0 flex-col gap-2 border-b border-border bg-surface p-4"},LK={class:"relative flex items-center"},NK=["aria-label","placeholder"],BK=["aria-label"],FK=["aria-label"],VK=["data-scope-filter","aria-pressed","onClick"],zK={key:0,"data-admin-read-toggle":"",class:"rounded-inner border border-border bg-subtle px-4 py-2"},jK={class:"flex min-h-[44px] cursor-pointer items-start gap-3 py-2"},UK=["checked","disabled"],HK={class:"flex min-w-0 flex-col"},KK={class:"flex flex-wrap items-center gap-1"},WK={class:"font-semibold text-text"},GK={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},YK={class:"min-h-0 flex-1 overflow-y-auto p-4"},JK={key:0,"data-scope-picker-empty":"",class:"flex flex-col items-center gap-2 rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},ZK={class:"font-semibold text-text"},XK={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},QK={key:1,class:"flex flex-col gap-2"},eW={class:"flex flex-wrap items-center justify-between gap-2 bg-subtle px-4 py-2"},tW=["aria-expanded","aria-controls","onClick"],aW={class:"font-semibold text-text [overflow-wrap:anywhere]"},nW={class:"flex shrink-0 items-center gap-1"},lW=["disabled","aria-label","onClick"],rW=["disabled","aria-label","onClick"],oW=["disabled","aria-label","onClick"],sW=["id","aria-label"],iW=["data-scope"],uW=["checked","disabled","onChange"],dW={class:"flex min-w-0 flex-1 flex-col"},cW={class:"flex flex-wrap items-center gap-1"},fW={class:"font-semibold text-text [overflow-wrap:anywhere]"},pW={class:"font-mono text-[13px] text-muted [overflow-wrap:anywhere]"},mW={key:0,"data-via-admin-read":"",class:"inline-flex h-6 items-center gap-1 rounded-pill border border-border-strong bg-surface px-2 text-[13px] font-semibold whitespace-nowrap text-muted"},vW={key:1,class:"inline-flex h-6 items-center rounded-pill bg-subtle px-2.5 text-[13px] font-semibold whitespace-nowrap text-muted"},hW={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},gW={class:"flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-border bg-surface p-4"},yW={"data-scope-picker-summary":"",class:"text-[13px] text-muted tabular-nums","aria-live":"polite"},bW={class:"flex items-center gap-2 max-sm:w-full"},_W=["disabled"],xW=["disabled"],V_=ae({__name:"ScopePicker",props:{catalog:{},draftAdminRead:{type:Boolean},draftScopes:{},cancelLabel:{},disabled:{type:Boolean}},emits:["update:draftAdminRead","update:draftScopes","apply","cancel"],setup(e,{expose:t,emit:a}){const n=e,l=a,r=gf(),o=E(""),i=E("all"),u=E(new Set),c=E(new Set);let d=!1;const p=E(null),v=k(()=>wo(n.catalog)),m=k(()=>v.value.adminReadScope!==null),y=k(()=>v.value.pluginScopes),x=k(()=>n.draftAdminRead&&m.value),C=k(()=>({adminRead:x.value,scopes:n.draftScopes})),w=k(()=>cK(y.value,Na.value,h("backend::lang.permissioneditor.other"))),S=k(()=>o.value.trim()!==""),q=k(()=>y.value.length),O=k(()=>y.value.filter(fe=>of(fe,C.value)).length),I=k(()=>y.value.filter(fe=>fe.read_only).length),B=k(()=>[{id:"all",label:h("backend::lang.api_tokens.scope_filter_all",{count:q.value})},{id:"selected",label:h("backend::lang.api_tokens.scope_filter_selected",{count:O.value})},{id:"read_only",label:h("backend::lang.api_tokens.scope_filter_read_only",{count:I.value})}]);function L(fe){return x.value&&fe.read_only}function W(fe){return of(fe,C.value)}const T=k(()=>{const fe=[];return w.value.forEach((F,de)=>{const ve=F.scopes.filter($=>!(i.value==="selected"&&!W($)||i.value==="read_only"&&!$.read_only||S.value&&!fK($,F.label,o.value)));if(ve.length===0)return;const Z=F.scopes.filter($=>$.read_only),he=Z.every($=>n.draftScopes.has($.name)),J=F.scopes.filter($=>!L($)),ee=J.every($=>n.draftScopes.has($.name)),te=J.filter($=>n.draftScopes.has($.name));fe.push({key:F.key,panelId:`${r}-group-${de}`,label:F.label,allScopes:F.scopes,visibleScopes:ve,selectedCount:F.scopes.filter($=>W($)).length,canRead:!n.disabled&&!x.value&&Z.length>0&&!he,canAll:!n.disabled&&J.length>0&&!ee,canClear:!n.disabled&&te.length>0})}),fe}),R=k(()=>Up(n.catalog,C.value)),G=k(()=>x.value||R.value.selectedPluginCount>0),A=k(()=>G.value?x.value&&R.value.selectedWriteCount===0?h("backend::lang.api_tokens.scope_summary_admin_read_only"):x.value?h("backend::lang.api_tokens.scope_picker_selected_admin_read",{scopes:wa("backend::lang.api_tokens.scope_write_count",R.value.selectedWriteCount)}):h("backend::lang.api_tokens.scope_picker_selected",{scopes:wa("backend::lang.api_tokens.scope_count",R.value.selectedPluginCount)}):h("backend::lang.api_tokens.scope_picker_none_selected")),D=k(()=>S.value?{kind:"search",title:h("backend::lang.api_tokens.scope_empty_search_title"),body:h("backend::lang.api_tokens.scope_empty_search_body",{query:o.value.trim()}),actionLabel:h("backend::lang.api_tokens.scope_search_clear")}:i.value==="selected"?{kind:"filter",title:h("backend::lang.api_tokens.scope_empty_selected_title"),body:h("backend::lang.api_tokens.scope_empty_selected_body"),actionLabel:h("backend::lang.api_tokens.scope_filter_reset")}:{kind:"filter",title:h("backend::lang.api_tokens.scope_empty_readonly_title"),body:h("backend::lang.api_tokens.scope_empty_readonly_body"),actionLabel:h("backend::lang.api_tokens.scope_filter_reset")});function z(fe){return S.value?!c.value.has(fe):u.value.has(fe)}function V(fe){if(S.value){const de=new Set(c.value);de.has(fe)?de.delete(fe):de.add(fe),c.value=de;return}const F=new Set(u.value);F.has(fe)?F.delete(fe):F.add(fe),u.value=F}function K(fe,F){const de=new Set(n.draftScopes);F?de.add(fe):de.delete(fe),l("update:draftScopes",de)}function re(fe){if(!fe.canRead)return;const F=new Set(n.draftScopes);for(const de of fe.allScopes)de.read_only&&F.add(de.name);l("update:draftScopes",F)}function ie(fe){if(!fe.canAll)return;const F=new Set(n.draftScopes);for(const de of fe.allScopes)L(de)||F.add(de.name);l("update:draftScopes",F)}function Ae(fe){if(!fe.canClear)return;const F=new Set(n.draftScopes);for(const de of fe.allScopes)L(de)||F.delete(de.name);l("update:draftScopes",F)}function _e(){o.value="",Ge(()=>{p.value?.focus()})}function xe(){i.value="all"}function ne(){p.value?.focus()}return ze(o,()=>{c.value.size>0&&(c.value=new Set)}),ze(()=>w.value.length,fe=>{!d&&fe>0&&(d=!0,u.value=pK(w.value,y.value.length,C.value))},{immediate:!0}),t({focusSearch:ne}),(fe,F)=>(f(),b("div",RK,[g("div",qK,[g("div",LK,[M(s(hr),{size:16,class:"pointer-events-none absolute left-3 text-muted","aria-hidden":"true"}),Jt(g("input",{ref_key:"searchInput",ref:p,"onUpdate:modelValue":F[0]||(F[0]=de=>o.value=de),type:"search","data-scope-search":"",autocomplete:"off","aria-label":s(h)("backend::lang.api_tokens.scope_search_label"),placeholder:s(h)("backend::lang.api_tokens.scope_search_placeholder"),class:pe([s(Lt)(!1),"h-input pl-10 pr-10"])},null,10,NK),[[Ua,o.value]]),o.value!==""?(f(),b("button",{key:0,type:"button","data-action":"clear-scope-search","aria-label":s(h)("backend::lang.api_tokens.scope_search_clear"),class:"absolute right-2 flex size-8 items-center justify-center rounded-tab text-muted hover:bg-hover hover:text-text",onClick:_e},[M(s(qt),{size:16,"aria-hidden":"true"})],8,BK)):Y("",!0)]),g("div",{role:"group","aria-label":s(h)("backend::lang.api_tokens.scope_filter_label"),class:"inline-flex flex-wrap gap-1 self-start rounded-inner border border-border bg-subtle p-1"},[(f(!0),b(me,null,Ie(B.value,de=>(f(),b("button",{key:de.id,type:"button","data-scope-filter":de.id,"aria-pressed":i.value===de.id,class:pe([i.value===de.id?"bg-surface font-semibold text-text shadow-tab":"text-muted hover:text-text","inline-flex h-8 items-center rounded-tab px-4 text-[13px] tabular-nums whitespace-nowrap transition-colors duration-150 ease-out"]),onClick:ve=>i.value=de.id},_(de.label),11,VK))),128))],8,FK),m.value?(f(),b("div",zK,[g("label",jK,[g("input",{type:"checkbox","data-admin-read-checkbox":"",class:"mt-0.5 size-5 shrink-0 rounded-[6px] accent-primary",checked:e.draftAdminRead,disabled:e.disabled,onChange:F[1]||(F[1]=de=>l("update:draftAdminRead",de.target.checked))},null,40,UK),g("span",HK,[g("span",KK,[g("span",WK,_(s(h)("backend::lang.api_tokens.scope_also_admin_read")),1),F[4]||(F[4]=g("span",{class:"font-mono text-[13px] text-muted"},"admin:read",-1))]),g("span",GK,_(s(h)("backend::lang.api_tokens.scope_also_admin_read_hint")),1)])])])):Y("",!0)]),g("div",YK,[T.value.length===0?(f(),b("div",JK,[g("p",ZK,_(D.value.title),1),g("p",XK,_(D.value.body),1),D.value.kind==="search"?(f(),b("button",{key:0,type:"button","data-action":"reset-scope-search",class:"mt-2 inline-flex h-[38px] items-center justify-center rounded-control border border-border-strong bg-surface px-4 font-semibold text-text transition-colors duration-150 ease-out hover:bg-hover",onClick:_e},_(D.value.actionLabel),1)):(f(),b("button",{key:1,type:"button","data-action":"reset-scope-filter",class:"mt-2 inline-flex h-[38px] items-center justify-center rounded-control border border-border-strong bg-surface px-4 font-semibold text-text transition-colors duration-150 ease-out hover:bg-hover",onClick:xe},_(D.value.actionLabel),1))])):(f(),b("div",QK,[(f(!0),b(me,null,Ie(T.value,de=>(f(),b("section",{key:de.key,"data-scope-group":"",class:"overflow-hidden rounded-inner border border-border bg-surface"},[g("div",eW,[g("button",{type:"button","data-scope-group-toggle":"","aria-expanded":z(de.key),"aria-controls":de.panelId,class:"flex min-h-[38px] min-w-0 flex-1 items-center gap-2 text-left",onClick:ve=>V(de.key)},[z(de.key)?(f(),j(s(Gn),{key:0,size:16,class:"shrink-0 text-muted","aria-hidden":"true"})):(f(),j(s(vr),{key:1,size:16,class:"shrink-0 text-muted","aria-hidden":"true"})),g("span",aW,_(de.label),1),g("span",{"data-scope-group-count":"",class:pe([de.selectedCount>0?"border-border-strong text-text":"border-border text-muted","inline-flex h-6 shrink-0 items-center rounded-pill border bg-surface px-2 text-[13px] font-semibold tabular-nums"])},_(de.selectedCount)+"/"+_(de.allScopes.length),3)],8,tW),g("div",nW,[g("button",{type:"button","data-group-action":"read",disabled:!de.canRead,"aria-label":s(h)("backend::lang.api_tokens.group_select_read_named",{group:de.label}),class:"inline-flex h-8 items-center rounded-tab px-2 text-[13px] font-semibold text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",onClick:ve=>re(de)},_(s(h)("backend::lang.api_tokens.group_select_read")),9,lW),g("button",{type:"button","data-group-action":"all",disabled:!de.canAll,"aria-label":s(h)("backend::lang.api_tokens.group_select_all_named",{group:de.label}),class:"inline-flex h-8 items-center rounded-tab px-2 text-[13px] font-semibold text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",onClick:ve=>ie(de)},_(s(h)("backend::lang.api_tokens.group_select_all")),9,rW),g("button",{type:"button","data-group-action":"clear",disabled:!de.canClear,"aria-label":s(h)("backend::lang.api_tokens.group_clear_named",{group:de.label}),class:"inline-flex h-8 items-center rounded-tab px-2 text-[13px] font-semibold text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",onClick:ve=>Ae(de)},_(s(h)("backend::lang.api_tokens.group_clear")),9,oW)])]),Jt(g("div",{id:de.panelId,role:"group","aria-label":de.label},[(f(!0),b(me,null,Ie(de.visibleScopes,ve=>(f(),b("label",{key:ve.name,"data-scope":ve.name,class:pe([L(ve)?"cursor-not-allowed bg-subtle":"cursor-pointer hover:bg-hover","flex min-h-[56px] items-start gap-3 border-t border-border px-4 py-3"])},[g("input",{type:"checkbox",class:"mt-0.5 size-5 shrink-0 rounded-[6px] accent-primary",checked:W(ve),disabled:e.disabled||L(ve),onChange:Z=>K(ve.name,Z.target.checked)},null,40,uW),g("span",dW,[g("span",cW,[g("span",fW,_(ve.label),1),g("span",pW,_(ve.name),1),ve.read_only&&x.value?(f(),b("span",mW,[M(s(cn),{size:14,"aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.via_admin_read")),1)])):ve.read_only?(f(),b("span",vW,_(s(h)("backend::lang.api_tokens.read_only")),1)):Y("",!0)]),g("span",hW,_(ve.description),1)])],10,iW))),128))],8,sW),[[vs,z(de.key)]])]))),128))]))]),g("div",gW,[g("p",yW,_(A.value),1),g("div",bW,[g("button",{type:"button","data-action":"scope-picker-discard",disabled:e.disabled,class:"inline-flex h-button items-center justify-center gap-2 rounded-control border border-border-strong bg-surface px-4 font-semibold whitespace-nowrap text-text transition-colors duration-150 ease-out hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60 max-sm:flex-1",onClick:F[2]||(F[2]=de=>l("cancel"))},_(e.cancelLabel),9,_W),g("button",{type:"button","data-action":"scope-picker-apply",disabled:e.disabled||!G.value,class:"inline-flex h-button items-center justify-center gap-2 rounded-control bg-primary px-4 font-semibold whitespace-nowrap text-on-primary transition-colors duration-150 ease-out hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60 max-sm:flex-1",onClick:F[3]||(F[3]=de=>l("apply"))},_(s(h)("backend::lang.api_tokens.scope_picker_apply")),9,xW)])])]))}});function z_(e,t){const a=fg(e.value,t),n=E(a.tier),l=E(a.custom),r=E(!1),o=E(!1),i=E(new Set);let u=null;const c=k(()=>wo(e.value)),d=k(()=>{const q=[];return c.value.fullScope!==null&&q.push("full"),c.value.adminReadScope!==null&&q.push("read_only"),c.value.pluginScopes.length>0&&q.push("custom"),q}),p=k(()=>mK(n.value,e.value,l.value)),v=k(()=>Up(e.value,l.value)),m=k(()=>p.value.length>0);function y(q){const O=fg(q??e.value,t);n.value=O.tier,l.value=O.custom,r.value=!1,o.value=!1,i.value=new Set,u=null}function x(){o.value=l.value.adminRead,i.value=new Set(l.value.scopes),r.value=!0}function C(q){if(q===n.value||!d.value.includes(q))return;const O=n.value;n.value=q,q==="custom"&&!l.value.adminRead&&l.value.scopes.size===0&&(u=O,x())}function w(){l.value={adminRead:o.value,scopes:new Set(i.value)},n.value="custom",u=null,r.value=!1}function S(){o.value=l.value.adminRead,i.value=new Set(l.value.scopes),r.value=!1,u!==null&&(n.value=u,u=null)}return{availableTiers:d,tier:n,custom:l,pickerOpen:r,draftAdminRead:o,draftScopes:i,submittedScopes:p,summary:v,canSubmitScopes:m,reset:y,selectTier:C,openPicker:x,applyPicker:w,discardPicker:S}}const kW={class:"flex shrink-0 items-start gap-4 border-b border-border bg-surface p-4"},wW={class:"flex min-w-0 flex-1 flex-col gap-1"},$W=["disabled"],CW=["disabled","aria-label"],SW={key:1,class:"flex min-h-0 flex-1 flex-col gap-4 p-6"},EW={class:"flex items-start gap-3"},AW={class:"flex min-w-0 flex-1 flex-col gap-1"},TW=["disabled","aria-label"],MW=["disabled"],DW={class:"flex min-w-0 flex-col gap-1.5","data-field":"name"},OW=["for"],PW=["id","placeholder","aria-invalid","aria-describedby"],IW=["id"],RW=["id"],qW={class:"flex min-w-0 flex-col gap-1.5","data-field":"expires"},LW={id:"api-token-expires-label",class:"font-semibold"},NW={class:"text-[13px] text-muted tabular-nums"},BW={class:"flex min-w-0 flex-col gap-1.5","data-field":"scopes"},FW={id:"api-token-scopes-label",class:"font-semibold"},VW={id:"api-token-scopes-label",class:"font-semibold"},zW={role:"alert",class:"flex items-start gap-2 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},jW=["id"],UW={class:"flex gap-2.5"},HW={key:1,class:"flex min-h-0 flex-col gap-4"},KW={class:"flex min-w-0 flex-col gap-2"},WW=["for"],GW=["id","value"],YW={class:"flex flex-wrap items-center gap-2"},JW={key:0,role:"alert",class:"flex items-center gap-1.5 text-[13px] text-danger"},ZW={class:"sr-only","aria-live":"polite"},XW={class:"flex justify-end"},Va="api-token",QW=ae({__name:"ApiTokenCreateDialog",props:{open:{type:Boolean},confirm:{}},emits:["update:open","created","closed"],setup(e,{emit:t}){const a=e,n=t,l=[{value:"30d",label:"backend::lang.api_tokens.expires_30"},{value:"90d",label:"backend::lang.api_tokens.expires_90"},{value:"365d",label:"backend::lang.api_tokens.expires_365"},{value:"never",label:"backend::lang.api_tokens.expires_never"}],r=E(1),o=E(""),i=E("90d"),u=E([]),c=E(!1),d=E(!1),p=E(!1),v=E({}),m=E(""),y=E(!1),x=E(!1),C=E(!1),w=E("");let S=null,q=0;const O=E(null),I=E(null),B=E(null),L=E(null),W=E(null),{availableTiers:T,tier:R,custom:G,pickerOpen:A,draftAdminRead:D,draftScopes:z,submittedScopes:V,canSubmitScopes:K,reset:re,selectTier:ie,openPicker:Ae,applyPicker:_e,discardPicker:xe}=z_(u,"token"),ne=k(()=>!c.value&&!d.value&&u.value.length>0&&K.value&&!p.value);function fe(ge){return String(ge).padStart(2,"0")}function F(ge){const be=new Date;return be.setDate(be.getDate()+ge),`${be.getFullYear()}-${fe(be.getMonth()+1)}-${fe(be.getDate())}`}const de=k(()=>{if(i.value==="never")return h("backend::lang.api_tokens.expires_never_note");const ge=i.value==="30d"?30:i.value==="365d"?365:90;return h("backend::lang.api_tokens.expires_on",{date:F(ge)})});function ve(){m.value="",y.value=!1,x.value=!1,C.value=!1,w.value="",S!==null&&(clearTimeout(S),S=null)}function Z(){r.value=1,o.value="",i.value="90d",re([]),v.value={},p.value=!1,d.value=!1,ve()}function he(ge){n("update:open",ge)}async function J(){const ge=++q;c.value=!0,d.value=!1,u.value=[],re([]);try{const be=await Le.GET("/account/tokens/scopes");if(ge!==q||!a.open)return;if(be.data){const We=be.data.data??[];u.value=We,re(We),d.value=We.length===0;return}d.value=!0}catch{if(ge!==q||!a.open)return;d.value=!0}finally{ge===q&&(c.value=!1)}}ze(()=>a.open,ge=>{ge?(Z(),J()):(q+=1,c.value=!1,d.value=!1,u.value=[],ve(),re([]),r.value=1)});function ee(){if(v.value.scopes){const ge={...v.value};delete ge.scopes,v.value=ge}}async function te(ge){if(p.value)return;const be=A.value;ie(ge),ee(),!be&&A.value&&(await Ge(),W.value?.focusSearch())}async function $(){p.value||(Ae(),await Ge(),W.value?.focusSearch())}async function P(){_e(),ee(),await Ge(),L.value?.focusPrimaryControl()}async function U(){xe(),await Ge(),L.value?.focusPrimaryControl()}function ce(){const ge=[`${Va}-name-comment`,v.value.name?`${Va}-name-error`:""].filter(Boolean);return ge.length?ge.join(" "):void 0}async function X(){if(await Ge(),v.value.name){Un(Va,"name");return}if(v.value.scopes){L.value?.focusPrimaryControl();return}v.value.expires&&document.querySelector("[data-expiry-segment]")?.focus()}async function oe(){if(p.value||!ne.value||r.value!==1||A.value)return;p.value=!0,v.value={};let ge=!1;try{const be=await Le.POST("/account/tokens",{body:{name:o.value,expires:i.value,scopes:V.value}});if(be.data){m.value=be.data.data.token,r.value=2,n("created"),await Ge(),B.value?.querySelector("button")?.focus()??B.value?.focus();return}be.response.status===422?(v.value=Nl(be.error?.error.details),ge=!0):Oe(h("backend::lang.api_tokens.create_failed"),"danger")}catch{Oe(h("backend::lang.api_tokens.create_failed"),"danger")}finally{p.value=!1}ge&&await X()}function ke(){y.value=!0,x.value=!1,C.value=!0,w.value=h("backend::lang.api_tokens.copied_announce"),S!==null&&clearTimeout(S),S=setTimeout(()=>{C.value=!1,S=null},2e3)}async function Se(){const ge=m.value;if(ge)try{if(!navigator.clipboard?.writeText)throw new Error("clipboard unavailable");await navigator.clipboard.writeText(ge),ke()}catch{x.value=!0,await Ge(),I.value?.focus(),I.value?.select()}}function Te(){ke()}function se(ge){ge.target.select()}async function Me(){ve(),re([]),he(!1)}async function Ce(){p.value||r.value===2&&m.value&&!y.value&&!await a.confirm.ask({message:h("backend::lang.api_tokens.close_uncopied_confirm"),confirmLabel:h("backend::lang.api_tokens.close_uncopied_submit"),danger:!0})||await Me()}function Fe(ge){if(!ge){Ce();return}he(!0)}function Ue(ge){if(ge.preventDefault(),r.value===2){B.value?.querySelector("button")?.focus()??B.value?.focus();return}if(A.value){W.value?.focusSearch();return}O.value?.focus()}function Ze(ge){ge.preventDefault(),n("closed")}function at(ge){(r.value===2||p.value)&&ge.preventDefault()}function nt(ge){if(p.value){ge.preventDefault();return}if(r.value===1&&A.value){ge.preventDefault(),U();return}r.value===2&&(ge.preventDefault(),Ce())}function $e(){Me()}return Dt(()=>{q+=1,ve()}),(ge,be)=>(f(),j(s(al),{open:e.open,"onUpdate:open":Fe},{default:N(()=>[M(s(zl),null,{default:N(()=>[M(s(ll),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),M(s(nl),{"data-token-dialog":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-modal bg-surface text-text shadow-pop",onOpenAutoFocus:Ue,onCloseAutoFocus:Ze,onPointerDownOutside:at,onInteractOutside:at,onEscapeKeyDown:nt},{default:N(()=>[r.value===1&&s(A)?(f(),b(me,{key:0},[g("div",kW,[g("div",wW,[g("button",{type:"button","data-action":"scope-picker-back",disabled:p.value,class:"inline-flex h-[34px] self-start items-center gap-1 rounded-tab px-2 text-[14px] font-semibold text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-60",onClick:U},[M(s(mo),{size:16,"aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.scope_picker_back")),1)],8,$W),M(s(bn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(s(h)("backend::lang.api_tokens.scope_picker_title")),1)]),_:1}),M(s(hn),{class:"text-[13px] text-muted"},{default:N(()=>[ye(_(s(h)("backend::lang.api_tokens.scope_picker_description")),1)]),_:1})]),g("button",{type:"button","data-action":"close",disabled:p.value,"aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-60",onClick:Ce},[M(s(qt),{size:16,"aria-hidden":"true"})],8,CW)]),M(V_,{ref_key:"scopePickerRef",ref:W,catalog:u.value,"draft-admin-read":s(D),"onUpdate:draftAdminRead":be[0]||(be[0]=We=>Ct(D)?D.value=We:null),"draft-scopes":s(z),"onUpdate:draftScopes":be[1]||(be[1]=We=>Ct(z)?z.value=We:null),"cancel-label":s(h)("backend::lang.api_tokens.scope_picker_back"),disabled:p.value,onApply:P,onCancel:U},null,8,["catalog","draft-admin-read","draft-scopes","cancel-label","disabled"])],64)):(f(),b("div",SW,[g("div",EW,[g("div",AW,[M(s(bn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:N(()=>[ye(_(r.value===1?s(h)("backend::lang.api_tokens.create_title"):s(h)("backend::lang.api_tokens.created_title")),1)]),_:1}),r.value===1?(f(),j(s(hn),{key:0,class:"text-muted"},{default:N(()=>[ye(_(s(h)("backend::lang.api_tokens.create_description")),1)]),_:1})):(f(),j(s(hn),{key:1,"data-token-notice":"",role:"note",class:"flex items-start gap-2 rounded-inner bg-sel px-4 py-3.5 text-text"},{default:N(()=>[M(s(Ki),{size:16,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.created_notice")),1)]),_:1}))]),g("button",{type:"button","data-action":"close",disabled:p.value,"aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-60",onClick:Ce},[M(s(qt),{size:16,"aria-hidden":"true"})],8,TW)]),r.value===1?(f(),b("form",{key:0,novalidate:"",class:"flex min-h-0 flex-col gap-4",onSubmit:mt(oe,["prevent"])},[g("fieldset",{disabled:p.value,class:"flex min-h-0 flex-col gap-[18px] overflow-y-auto"},[g("div",DW,[g("label",{for:`${Va}-name`,class:"font-semibold"},_(s(h)("backend::lang.api_tokens.name")),9,OW),Jt(g("input",{id:`${Va}-name`,ref_key:"nameInput",ref:O,"onUpdate:modelValue":be[2]||(be[2]=We=>o.value=We),name:"name",type:"text",maxlength:"100",autocomplete:"off",placeholder:s(h)("backend::lang.api_tokens.name_placeholder"),"aria-invalid":v.value.name?"true":void 0,"aria-describedby":ce(),class:pe([s(Lt)(!!v.value.name),"h-input"])},null,10,PW),[[Ua,o.value]]),g("p",{id:`${Va}-name-comment`,class:"text-[13px] text-muted"},_(s(h)("backend::lang.api_tokens.name_comment")),9,IW),v.value.name?(f(),b("div",{key:0,id:`${Va}-name-error`,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(f(!0),b(me,null,Ie(v.value.name,(We,it)=>(f(),b("p",{key:it,class:"flex items-center gap-1.5"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(We),1)]))),128))],8,RW)):Y("",!0)]),g("div",qW,[g("span",LW,_(s(h)("backend::lang.api_tokens.expires")),1),M(s($p),{modelValue:i.value,"onUpdate:modelValue":be[3]||(be[3]=We=>i.value=We),orientation:"horizontal","aria-labelledby":"api-token-expires-label",class:"inline-flex flex-wrap gap-1 rounded-inner border border-border bg-subtle p-1"},{default:N(()=>[(f(),b(me,null,Ie(l,We=>M(s(Cp),{key:We.value,value:We.value,"data-expiry-segment":"",class:"inline-flex h-pager items-center rounded-tab px-4 text-[13px] whitespace-nowrap text-muted transition-colors duration-150 ease-out hover:text-text data-[state=checked]:bg-surface data-[state=checked]:text-text data-[state=checked]:shadow-tab data-[state=checked]:text-[14px] data-[state=checked]:font-semibold"},{default:N(()=>[ye(_(s(h)(We.label)),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"]),g("p",NW,_(de.value),1)]),g("div",BW,[c.value?(f(),b(me,{key:0},[g("span",FW,_(s(h)("backend::lang.api_tokens.access_level")),1),be[4]||(be[4]=g("div",{role:"group","aria-labelledby":"api-token-scopes-label","data-scope-loading":"",class:"flex flex-col gap-2","aria-hidden":"true"},[g("span",{class:"h-10 rounded-inner bg-skel"}),g("div",{class:"flex flex-col gap-2 rounded-inner border border-border bg-subtle p-4"},[g("span",{class:"h-3 w-48 rounded-[6px] bg-skel"}),g("span",{class:"h-3 w-32 rounded-[6px] bg-skel"})])],-1))],64)):d.value?(f(),b(me,{key:1},[g("span",VW,_(s(h)("backend::lang.api_tokens.access_level")),1),g("div",zW,[M(s(bt),{size:16,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.scopes_failed")),1)])],64)):(f(),j(F_,{key:2,ref_key:"scopeAccessRef",ref:L,"id-prefix":Va,catalog:u.value,"available-tiers":s(T),tier:s(R),custom:s(G),disabled:p.value,invalid:!!v.value.scopes,"onUpdate:tier":te,onCustomize:$},null,8,["catalog","available-tiers","tier","custom","disabled","invalid"])),v.value.scopes?(f(),b("div",{key:3,id:`${Va}-scopes-error`,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(f(!0),b(me,null,Ie(v.value.scopes,(We,it)=>(f(),b("p",{key:it,class:"flex items-center gap-1.5"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(We),1)]))),128))],8,jW)):Y("",!0)])],8,MW),g("div",UW,[M(Ke,{variant:"outline",class:"flex-1","data-action":"create-token-cancel",disabled:p.value,onClick:Ce},{default:N(()=>[ye(_(s(h)("backend::lang.api_tokens.create_cancel")),1)]),_:1},8,["disabled"]),M(Ke,{variant:"primary",type:"submit",class:"flex-1","data-action":"create-token-submit",hotkey:"mod+s mod+enter",title:s(Ha)(s(h)("backend::lang.api_tokens.create_submit"),"mod+s"),disabled:!ne.value},{default:N(()=>[p.value?(f(),j(s(Vn),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Y("",!0),ye(" "+_(p.value?s(h)("backend::lang.api_tokens.creating"):s(h)("backend::lang.api_tokens.create_submit")),1)]),_:1},8,["title","disabled"])])],32)):(f(),b("div",HW,[g("div",KW,[g("label",{for:`${Va}-plaintext`,class:"sr-only"},_(s(h)("backend::lang.api_tokens.token_label")),9,WW),g("input",{id:`${Va}-plaintext`,ref_key:"plaintextInput",ref:I,value:m.value,type:"text",readonly:"",autocomplete:"off",spellcheck:"false","data-token-plaintext":"",class:pe([s(Lt)(!1),"h-input bg-subtle font-mono text-[14px]"]),onFocus:se,onClick:se,onCopy:Te},null,42,GW),g("div",YW,[g("span",{ref_key:"copyButton",ref:B},[M(Ke,{variant:"outline",size:"sm",icon:C.value?s(Ba):s(ro),"data-action":"copy-token",onClick:Se},{default:N(()=>[ye(_(C.value?s(h)("backend::lang.api_tokens.copied"):s(h)("backend::lang.api_tokens.copy")),1)]),_:1},8,["icon"])],512),x.value?(f(),b("p",JW,[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.copy_failed")),1)])):Y("",!0),g("span",ZW,_(w.value),1)])]),g("div",XW,[M(Ke,{variant:"primary","data-action":"hide-token",onClick:$e},{default:N(()=>[ye(_(s(h)("backend::lang.api_tokens.done")),1)]),_:1})])]))]))]),_:1})]),_:1})]),_:1},8,["open"]))}}),eG={"data-api-tokens":"",class:"flex flex-col gap-4 rounded-card border border-border bg-surface p-7 shadow-card"},tG={class:"flex flex-wrap items-start justify-between gap-4"},aG={class:"flex min-w-0 flex-col gap-1"},nG={class:"text-[18px] font-bold"},lG={class:"max-w-[640px] text-[13px] text-muted"},rG={key:0,class:"flex items-center gap-2"},oG=["checked"],sG={key:1,role:"list","data-token-list":"","aria-busy":"true",class:"flex flex-col overflow-hidden rounded-inner border border-border"},iG={key:2,role:"alert","data-tokens-error":"",class:"flex items-start gap-2 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},uG={key:3,"data-tokens-empty":"",class:"flex flex-col items-center gap-2 rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},dG={class:"flex size-10 items-center justify-center rounded-full bg-subtle text-muted"},cG={class:"font-semibold"},fG={class:"max-w-[420px] text-[13px] text-muted"},pG={key:4,role:"list","data-token-list":"",class:"flex flex-col overflow-hidden rounded-inner border border-border"},mG=["data-token-row"],vG={class:"flex min-w-0 flex-1 flex-col gap-2"},hG={class:"flex flex-wrap items-center gap-2"},gG=["aria-label"],yG={key:0,class:"inline-flex h-6 items-center rounded-pill bg-danger-soft px-2.5 text-[13px] font-semibold whitespace-nowrap text-danger"},bG={key:1,class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[13px] font-semibold whitespace-nowrap text-muted"},_G={"data-token-scopes":"",class:"flex flex-wrap gap-2"},xG=["title"],kG=ae({__name:"ApiTokensPanel",props:{confirm:{}},setup(e){const t=e,a=E([]),n=E(!0),l=E(!0),r=E(!1),o=E(!1),i=E(!1),u=E(null);function c(I){return String(I).padStart(2,"0")}function d(I){return typeof I=="string"&&I!==""}function p(I){const B=new Date(I);return Number.isNaN(B.getTime())?I:`${B.getFullYear()}-${c(B.getMonth()+1)}-${c(B.getDate())}`}function v(I){const B=new Date(I);return Number.isNaN(B.getTime())?I:`${p(I)} ${c(B.getHours())}:${c(B.getMinutes())}`}function m(I){const B=[h("backend::lang.api_tokens.created_at",{date:p(I.created_at)})];return d(I.last_used_at)?B.push(h("backend::lang.api_tokens.last_used",{date:v(I.last_used_at)})):B.push(h("backend::lang.api_tokens.never_used")),I.expired&&d(I.expires_at)?B.push(h("backend::lang.api_tokens.expired_at",{date:p(I.expires_at)})):d(I.expires_at)?B.push(h("backend::lang.api_tokens.expires_at",{date:p(I.expires_at)})):B.push(h("backend::lang.api_tokens.no_expiry")),d(I.revoked_at)&&B.push(h("backend::lang.api_tokens.revoked_at",{date:v(I.revoked_at)})),B.join(" · ")}function y(I){return d(I.revoked_at)}async function x(){n.value=!0,r.value=!1;try{const I=await Le.GET("/account/tokens",{params:{query:o.value?{revoked:"1"}:{}}});if(I.data){a.value=I.data.data??[];return}r.value=!0,a.value=[]}catch{r.value=!0,a.value=[]}finally{n.value=!1,l.value=!1}}function C(I){o.value=I.target.checked,x()}function w(){i.value=!0}async function S(){await Ge(),u.value?.querySelector("button")?.focus()??u.value?.focus()}async function q(){await x()}async function O(I){await t.confirm.ask({message:h("backend::lang.api_tokens.revoke_confirm",{name:I.name}),confirmLabel:h("backend::lang.api_tokens.revoke_submit"),danger:!0},async()=>{const B=await Le.DELETE("/account/tokens/{id}",{params:{path:{id:I.id}}});if(B.data){await x(),Oe(h("backend::lang.api_tokens.revoked")),await Ge(),u.value?.querySelector("button")?.focus()??u.value?.focus();return}if(B.response.status===404){Oe(h("backend::lang.api_tokens.gone"),"danger"),await x();return}Oe(h("backend::lang.api_tokens.revoke_failed"),"danger")})}return $t(()=>{x()}),(I,B)=>(f(),b("div",eG,[g("div",tG,[g("div",aG,[g("h2",nG,_(s(h)("backend::lang.api_tokens.section")),1),g("p",lG,_(s(h)("backend::lang.api_tokens.section_comment")),1)]),g("span",{ref_key:"createButton",ref:u},[M(Ke,{variant:"outline",size:"sm",icon:s(vo),"data-action":"create-token",disabled:l.value&&n.value,onClick:w},{default:N(()=>[ye(_(s(h)("backend::lang.api_tokens.create")),1)]),_:1},8,["icon","disabled"])],512)]),!r.value&&!l.value?(f(),b("label",rG,[g("input",{type:"checkbox","data-show-revoked":"",class:"size-5 shrink-0 rounded-[6px] accent-primary",checked:o.value,onChange:C},null,40,oG),g("span",null,_(s(h)("backend::lang.api_tokens.show_revoked")),1)])):Y("",!0),n.value?(f(),b("div",sG,[(f(),b(me,null,Ie(3,L=>g("div",{key:L,role:"listitem",class:"flex flex-col gap-2 border-t border-border px-4 py-3.5 first:border-t-0","aria-hidden":"true"},[...B[1]||(B[1]=[g("span",{class:"h-3 w-40 rounded-[6px] bg-skel"},null,-1),g("span",{class:"h-3 w-64 rounded-[6px] bg-skel"},null,-1)])])),64))])):r.value?(f(),b("div",iG,[M(s(bt),{size:16,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.load_failed")),1)])):a.value.length===0?(f(),b("div",uG,[g("span",dG,[M(s(cS),{size:20,"aria-hidden":"true"})]),g("p",cG,_(s(h)("backend::lang.api_tokens.empty_title")),1),g("p",fG,_(s(h)("backend::lang.api_tokens.empty_body")),1)])):(f(),b("div",pG,[(f(!0),b(me,null,Ie(a.value,L=>(f(),b("div",{key:L.id,role:"listitem","data-token-row":L.id,class:"flex items-start justify-between gap-4 border-t border-border px-4 py-3.5 first:border-t-0 max-sm:flex-col"},[g("div",vG,[g("div",hG,[g("span",{class:pe([y(L)?"text-muted":"text-text","font-semibold [overflow-wrap:anywhere]"])},_(L.name),3),g("span",{class:"font-mono text-[13px] text-muted","aria-label":s(h)("backend::lang.api_tokens.hint",{last4:L.hint})},"g15_…"+_(L.hint),9,gG),L.expired&&!y(L)?(f(),b("span",yG,_(s(h)("backend::lang.api_tokens.state_expired")),1)):Y("",!0),y(L)?(f(),b("span",bG,_(s(h)("backend::lang.api_tokens.state_revoked")),1)):Y("",!0)]),g("div",_G,[(f(!0),b(me,null,Ie(L.scopes,W=>(f(),b("span",{key:W.name,title:W.known?W.name:s(h)("backend::lang.api_tokens.unknown_scope_hint"),class:pe([W.known?"bg-subtle text-text":"border border-dashed border-border-strong font-mono text-muted","inline-flex h-6 items-center rounded-pill px-2.5 text-[13px] font-semibold whitespace-nowrap"])},_(W.known?W.name==="*"?s(h)("backend::lang.api_tokens.scope_all"):W.label:s(h)("backend::lang.api_tokens.unknown_scope",{name:W.name})),11,xG))),128))]),g("p",{class:pe([(y(L),"text-muted"),"text-[13px] tabular-nums"])},_(m(L)),3)]),y(L)?Y("",!0):(f(),j(Ke,{key:0,variant:"danger",size:"sm",icon:s(gb),"data-action":"revoke-token",class:"max-sm:self-start","aria-label":s(h)("backend::lang.api_tokens.revoke_named",{name:L.name}),onClick:W=>O(L)},{default:N(()=>[ye(_(s(h)("backend::lang.api_tokens.revoke")),1)]),_:1},8,["icon","aria-label","onClick"]))],8,mG))),128))])),M(QW,{open:i.value,"onUpdate:open":B[0]||(B[0]=L=>i.value=L),confirm:e.confirm,onCreated:q,onClosed:S},null,8,["open","confirm"])]))}}),wG={class:"flex w-full flex-col gap-5 pb-24","data-account":""},$G={class:"flex min-w-0 flex-col"},CG={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},SG={class:"text-muted"},EG={class:"flex flex-col gap-3 rounded-card border border-border bg-surface p-7 shadow-card","data-account-avatar":""},AG={class:"text-[18px] font-bold"},TG={class:"flex flex-wrap items-center gap-5"},MG=["src"],DG={key:1,"aria-hidden":"true","data-account-avatar-initials":"",class:"flex size-20 shrink-0 items-center justify-center rounded-full bg-accent text-[26px] font-bold text-on-accent"},OG={class:"flex flex-col gap-2"},PG={class:"flex flex-wrap gap-2.5"},IG={class:"text-[13px] text-muted"},RG={key:0,role:"alert","data-avatar-error":"",class:"flex flex-col gap-0.5 text-[13px] text-danger"},qG={class:"flex flex-col gap-[18px]"},LG={class:"mb-[18px] text-[18px] font-bold"},NG={class:"flex min-w-0 flex-col gap-1.5"},BG=["for"],FG=["id","value"],VG={class:"grid grid-cols-1 gap-[18px] md:grid-cols-2"},zG=["data-field"],jG=["for"],UG=["id","name","type","autocomplete","value","aria-invalid","aria-describedby","onInput"],HG=["id"],KG=["id"],WG={class:"flex flex-col gap-[18px]"},GG={class:"mb-1.5 text-[18px] font-bold"},YG={class:"text-[13px] text-muted"},JG={class:"grid grid-cols-1 gap-[18px] md:grid-cols-3"},ZG=["data-field"],XG=["for"],QG=["id","name","autocomplete","value","aria-invalid","aria-describedby","onInput"],eY=["id"],tY={class:"fixed right-0 bottom-0 left-[var(--shell-offset,0px)] z-30 flex items-center justify-end gap-2.5 border-t border-border bg-surface px-8 py-3.5"},pg="account",aY="image/jpeg,image/png,image/gif,image/webp",nY=ae({__name:"AccountView",setup(e){const t=[{name:"first_name",label:"backend::lang.myaccount.first_name",type:"text",autocomplete:"given-name"},{name:"last_name",label:"backend::lang.myaccount.last_name",type:"text",autocomplete:"family-name"},{name:"email",label:"backend::lang.myaccount.email",type:"email",autocomplete:"email"},{name:"subtitle",label:"backend::lang.myaccount.subtitle",type:"text",autocomplete:"organization-title",comment:"backend::lang.myaccount.subtitle_comment"}],a=[{name:"current_password",label:"backend::lang.myaccount.current_password",type:"password",autocomplete:"current-password"},{name:"password",label:"backend::lang.myaccount.password",type:"password",autocomplete:"new-password"},{name:"password_confirmation",label:"backend::lang.myaccount.password_confirmation",type:"password",autocomplete:"new-password"}],n=[...t,...a].map(R=>R.name);function l(){const R=na.value;return{first_name:R?.first_name??"",last_name:R?.last_name??"",email:R?.email??"",subtitle:R?.subtitle??""}}const r=E(l()),o=E({current_password:"",password:"",password_confirmation:""}),i=E({}),u=E(!1),c=k(()=>na.value?.login??""),d=E(null),p=E(!1),v=E([]),m=k(()=>na.value?.avatar?.thumb_url||na.value?.avatar?.url||""),y=k(()=>E0(na.value)),x=ol();function C(){d.value?.click()}async function w(R){const G=R.target,A=G.files?.[0];if(G.value="",!(!A||p.value)){p.value=!0,v.value=[];try{const D=await Le.POST("/account/avatar",{body:{file_data:""},bodySerializer:()=>{const z=new FormData;return z.append("file_data",A,A.name),z}});if(D.data){Wd(D.data.data),Oe(h("backend::lang.myaccount.avatar_saved"));return}if(D.response.status===422){const z=Nl(D.error?.error.details);v.value=z.avatar??Object.values(z).flat();return}if(D.response.status===413){v.value=[h("backend::lang.myaccount.avatar_hint")];return}Oe(h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{p.value=!1}}}async function S(){if(!(p.value||!await x.ask({message:h("backend::lang.myaccount.avatar_remove_confirm"),confirmLabel:h("backend::lang.myaccount.avatar_remove"),danger:!0}))){p.value=!0,v.value=[];try{const G=await Le.DELETE("/account/avatar");if(G.data){Wd(G.data.data),Oe(h("backend::lang.myaccount.avatar_removed"));return}Oe(h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{p.value=!1}}}function q(R){return`${pg}-${R}`}function O(R){const A=[R.comment?`${q(R.name)}-comment`:"",i.value[R.name]?`${q(R.name)}-error`:""].filter(Boolean).join(" ");return A===""?void 0:A}function I(R){if(i.value[R]){const G={...i.value};delete G[R],i.value=G}}function B(R,G){r.value={...r.value,[R]:G},I(R)}function L(R,G){o.value={...o.value,[R]:G},I(R)}function W(){const R={first_name:r.value.first_name,last_name:r.value.last_name,email:r.value.email,subtitle:r.value.subtitle};return o.value.password!==""&&(R.current_password=o.value.current_password,R.password=o.value.password,R.password_confirmation=o.value.password_confirmation),R}async function T(){if(!u.value){u.value=!0;try{const R=await Le.PUT("/account",{body:W()});if(R.data){i.value={},Wd(R.data.data),r.value=l(),o.value={current_password:"",password:"",password_confirmation:""},Oe(h("backend::lang.myaccount.saved"));return}if(R.response.status===422){i.value=Nl(R.error?.error.details);const G=n.find(A=>i.value[A]);await Ge(),G&&Un(pg,G);return}Oe(h("backend::lang.form.error_generic"),"danger")}catch{Oe(h("backend::lang.form.error_generic"),"danger")}finally{u.value=!1}}}return(R,G)=>(f(),b("section",wG,[g("header",$G,[g("h1",CG,_(s(h)("backend::lang.myaccount.menu_label")),1),g("p",SG,_(s(h)("backend::lang.myaccount.menu_description")),1)]),M(ko,{errors:i.value,"field-names":s(n)},null,8,["errors","field-names"]),g("div",EG,[g("h2",AG,_(s(h)("backend::lang.myaccount.avatar")),1),g("div",TG,[m.value?(f(),b("img",{key:0,src:m.value,alt:"","data-account-avatar-image":"",class:"size-20 shrink-0 rounded-full object-cover"},null,8,MG)):(f(),b("span",DG,_(y.value),1)),g("div",OG,[g("div",PG,[M(Ke,{variant:"outline",size:"sm",icon:s(nS),"data-action":"avatar-upload",disabled:p.value,onClick:C},{default:N(()=>[ye(_(s(h)("backend::lang.myaccount.avatar_upload")),1)]),_:1},8,["icon","disabled"]),s(na)?.avatar?(f(),j(Ke,{key:0,variant:"danger",size:"sm",icon:s(Xa),"data-action":"avatar-remove",disabled:p.value,onClick:S},{default:N(()=>[ye(_(s(h)("backend::lang.myaccount.avatar_remove")),1)]),_:1},8,["icon","disabled"])):Y("",!0)]),g("p",IG,_(s(h)("backend::lang.myaccount.avatar_hint")),1)]),g("input",{ref_key:"avatarInput",ref:d,type:"file",name:"file_data",accept:aY,class:"hidden","data-account-avatar-input":"",onChange:w},null,544)]),v.value.length>0?(f(),b("div",RG,[(f(!0),b(me,null,Ie(v.value,(A,D)=>(f(),b("p",{key:D,class:"flex items-center gap-1.5"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(A),1)]))),128))])):Y("",!0)]),g("form",{class:"flex flex-col gap-7 rounded-card border border-border bg-surface p-7 shadow-card",novalidate:"",onSubmit:mt(T,["prevent"])},[g("fieldset",qG,[g("legend",LG,_(s(h)("backend::lang.myaccount.profile")),1),g("div",NG,[g("label",{for:q("login"),class:"font-semibold"},_(s(h)("backend::lang.myaccount.login")),9,BG),g("input",{id:q("login"),name:"login",type:"text",value:c.value,readonly:"","data-account-login":"",class:pe([s(Lt)(!1),"h-input bg-hover text-muted"])},null,10,FG)]),g("div",VG,[(f(),b(me,null,Ie(t,A=>g("div",{key:A.name,class:"flex min-w-0 flex-col gap-1.5","data-field":A.name},[g("label",{for:q(A.name),class:"font-semibold"},_(s(h)(A.label)),9,jG),g("input",{id:q(A.name),name:A.name,type:A.type,autocomplete:A.autocomplete,value:r.value[A.name],"aria-invalid":i.value[A.name]?"true":void 0,"aria-describedby":O(A),class:pe([s(Lt)(!!i.value[A.name]),"h-input"]),onInput:D=>B(A.name,D.target.value)},null,42,UG),A.comment?(f(),b("p",{key:0,id:`${q(A.name)}-comment`,class:"text-[13px] text-muted"},_(s(h)(A.comment)),9,HG)):Y("",!0),i.value[A.name]?(f(),b("div",{key:1,id:`${q(A.name)}-error`,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(f(!0),b(me,null,Ie(i.value[A.name],(D,z)=>(f(),b("p",{key:z,class:"flex items-center gap-1.5"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(D),1)]))),128))],8,KG)):Y("",!0)],8,zG)),64))])]),g("fieldset",WG,[g("legend",GG,_(s(h)("backend::lang.myaccount.password_section")),1),g("p",YG,_(s(h)("backend::lang.myaccount.password_comment")),1),g("div",JG,[(f(),b(me,null,Ie(a,A=>g("div",{key:A.name,class:"flex min-w-0 flex-col gap-1.5","data-field":A.name},[g("label",{for:q(A.name),class:"font-semibold"},_(s(h)(A.label)),9,XG),g("input",{id:q(A.name),name:A.name,type:"password",autocomplete:A.autocomplete,value:o.value[A.name],"aria-invalid":i.value[A.name]?"true":void 0,"aria-describedby":O(A),class:pe([s(Lt)(!!i.value[A.name]),"h-input"]),onInput:D=>L(A.name,D.target.value)},null,42,QG),i.value[A.name]?(f(),b("div",{key:0,id:`${q(A.name)}-error`,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(f(!0),b(me,null,Ie(i.value[A.name],(D,z)=>(f(),b("p",{key:z,class:"flex items-center gap-1.5"},[M(s(bt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(D),1)]))),128))],8,eY)):Y("",!0)],8,ZG)),64))])])],32),M(kG,{confirm:s(x)},null,8,["confirm"]),M(dK,{confirm:s(x)},null,8,["confirm"]),M(Sn,{open:s(x).request.value!==null,message:s(x).request.value?.message??"","confirm-label":s(x).request.value?.confirmLabel,danger:s(x).request.value?.danger,busy:s(x).busy.value,onConfirm:s(x).confirm,onCancel:s(x).cancel},null,8,["open","message","confirm-label","danger","busy","onConfirm","onCancel"]),g("footer",tY,[M(Ke,{variant:"primary","data-action":"save",hotkey:"mod+s",title:s(Ha)(s(h)("backend::lang.form.save"),"mod+s"),disabled:u.value,onClick:T},{default:N(()=>[ye(_(u.value?s(h)("backend::lang.form.saving"):s(h)("backend::lang.form.save")),1)]),_:1},8,["title","disabled"])])]))}}),lY={class:"flex min-h-screen items-center justify-center px-4",style:{background:"radial-gradient(ellipse at 50% 35%, #2b3a5c 0%, #1d2740 60%)"}},rY={class:"flex w-full max-w-[480px] flex-col gap-6"},oY={class:"flex items-center justify-center gap-3"},sY={class:"flex size-[34px] items-center justify-center rounded-full bg-accent-soft"},iY={class:"flex size-12 items-center justify-center rounded-full bg-[#f3f5f8]"},uY={class:"flex flex-col gap-2"},dY={class:"text-[#566175]"},cY=["src"],fY={key:1,class:"flex size-12 items-center justify-center rounded-full bg-[#f3f5f8]"},pY=["href"],mY=["src"],vY={key:1,class:"flex size-12 items-center justify-center rounded-full bg-[#f3f5f8]"},hY={class:"flex flex-col gap-2"},gY={class:"text-[#566175]"},yY={key:0,"data-previously-allowed":"",class:"flex items-center gap-2 text-[13px] text-[#566175] [overflow-wrap:anywhere]"},bY={class:"flex flex-col gap-3 rounded-inner bg-[#f3f5f8] px-4 py-3"},_Y={class:"flex flex-col gap-1"},xY={class:"font-semibold"},kY={class:"flex flex-col items-start gap-1"},wY={"data-connect-admin":"",class:"[overflow-wrap:anywhere]"},$Y=["disabled"],CY={class:"flex flex-col gap-1"},SY={class:"font-semibold"},EY={"data-connect-host":"",class:"font-mono text-[13px] [overflow-wrap:anywhere]"},AY=["disabled"],TY={class:"flex min-w-0 flex-col gap-1.5"},MY={key:0,class:"overflow-hidden rounded-inner border border-[#e6e9ef]"},DY={"data-connect-offline":"",class:"flex min-h-[56px] cursor-pointer items-start gap-3 px-4 py-3"},OY={class:"flex min-w-0 flex-col"},PY={class:"font-semibold"},IY={class:"text-[13px] text-[#566175] [overflow-wrap:anywhere]"},RY={class:"flex gap-2.5"},qY=["disabled"],LY=["disabled"],NY={class:"flex shrink-0 items-start gap-4 border-b border-border bg-surface p-4"},BY={class:"flex min-w-0 flex-1 flex-col gap-1"},FY=["aria-label"],zo="connect-light-surface flex flex-col gap-[18px] rounded-card bg-white p-8 text-[#141b2d] shadow-login",gi="text-[22px] font-bold tracking-[-0.02em] [overflow-wrap:anywhere]",yi="flex items-center gap-2.5 rounded-control bg-[#fdf0f0] px-3.5 py-3 text-[#c62828]",uc="inline-flex h-input items-center justify-center gap-2 rounded-control border border-[#d2d8e2] bg-white font-semibold text-[#141b2d] hover:bg-[#f1f3f7] disabled:opacity-60",VY=ae({__name:"ConnectView",setup(e){const t=ga(),a=wn(),n=E("loading"),l=E(null),r=E(!0),o=E(null),i=E(!1),u=E(null),c=E(""),d=E(null),p=E(null),v=E(null),m=E(null);let y=0,x=!1;const C=k(()=>{const X=t.query.request;return typeof X=="string"?X.trim():""}),w=k(()=>l.value?.scopes??[]),S=k(()=>w.value.length>0),{availableTiers:q,tier:O,custom:I,pickerOpen:B,draftAdminRead:L,draftScopes:W,submittedScopes:T,canSubmitScopes:R,reset:G,selectTier:A,openPicker:D,applyPicker:z,discardPicker:V}=z_(w,"connect"),K=k(()=>o.value!==null||i.value),re=k(()=>!K.value&&S.value&&R.value),ie=k(()=>l.value?.client.name||l.value?.client.id||""),Ae=k(()=>l.value?.client.redirect_host??""),_e=k(()=>{const X=l.value?.client.logo_url?.trim()??"";if(X==="")return"";if(X.startsWith("/")&&!X.startsWith("//")&&!X.startsWith("/\\"))return X;try{return new URL(X).protocol==="https:"?X:""}catch{return""}}),xe=k(()=>{const X=l.value?.admin;let oe=X?.name?.trim()??"",ke=X?.email?.trim()??"",Se=X?.login?.trim()??"";if(!X||oe===""&&ke===""&&Se===""){const Te=na.value;oe=Te?`${Te.first_name??""} ${Te.last_name??""}`.trim():"",ke=Te?.email?.trim()??"",Se=Te?.login??""}return oe!==""&&ke!==""?h("backend::lang.mcp_connect.admin_with_email",{name:oe,email:ke}):oe!==""?oe:Se}),ne=k(()=>{try{return new URL(c.value).host||Ae.value}catch{return Ae.value}}),fe=k(()=>{try{const X=new URL(c.value).protocol;return X==="http:"||X==="https:"?c.value:""}catch{return""}});async function F(){const X=++y;n.value="loading",u.value=null,l.value=null,G([]),c.value="";const oe=C.value;if(oe===""){n.value="expired";return}let ke;try{ke=await Le.GET("/mcp/consent/{request}",{params:{path:{request:oe}}})}catch{X===y&&(n.value="load_error");return}if(X!==y)return;if(ke.data){const Te=ke.data.data;l.value=Te,G(Te.scopes),r.value=!0,n.value="ready";return}const Se=ke.response.status;if(Se===401){Xc(a);return}n.value=Se===404?"expired":"load_error"}function de(X){K.value||(A(X),u.value==="scopes_required"&&(u.value=null))}function ve(){K.value||D()}function Z(){z(),u.value==="scopes_required"&&(u.value=null)}function he(X){X||V()}function J(X){if(X.preventDefault(),m.value){m.value.focusSearch();return}Ge(()=>{m.value?.focusSearch()})}function ee(X){if(X.preventDefault(),v.value){v.value.focusPrimaryControl();return}Ge(()=>{v.value?.focusPrimaryControl()})}const te=new Set(["javascript:","data:","vbscript:","blob:","file:","about:","filesystem:"]);function $(X,oe){if(oe==="")return!1;try{if(X.host!=="")return new URL(`${X.protocol}//${oe}`).host===X.host;const ke=new URL(oe),Se=new URL(X.href);for(const Te of[ke,Se])Te.search="",Te.hash="";return ke.href===Se.href}catch{return!1}}function P(X){let oe;try{oe=new URL(X)}catch{return null}return te.has(oe.protocol)||!$(oe,Ae.value)?null:X}async function U(X){if(!(K.value||l.value===null||n.value!=="ready")&&!(X==="allow"&&!re.value)){o.value=X,u.value=null;try{let oe;try{oe=await Le.POST("/mcp/consent/{request}",{params:{path:{request:C.value}},body:X==="allow"?{decision:X,scopes:T.value,offline_access:l.value.offline_access?r.value:!1}:{decision:X,scopes:[],offline_access:!1}})}catch{u.value="decide_failed";return}if(oe.data){const Se=P(oe.data.data.redirect_uri);if(Se===null){u.value="decide_failed";return}c.value=Se,n.value="returning",window.location.assign(Se);return}const ke=oe.response.status;ke===401?Xc(a):ke===404?n.value="expired":ke===422&&X==="allow"?u.value="scopes_required":u.value="decide_failed"}finally{o.value=null}}}async function ce(){if(K.value)return;i.value=!0,u.value=null;const X=t.fullPath;try{await T0(),await a.replace({name:"login",query:{redirect:X}})}catch{u.value="decide_failed"}finally{i.value=!1}}return ze(n,async X=>{if(!x){x=X!=="loading";return}await Ge(),d.value?.focus()},{flush:"post"}),ze(u,async X=>{X!==null&&(await Ge(),p.value?.focus())},{flush:"post"}),$t(()=>{F()}),ze(C,()=>{F()}),(X,oe)=>(f(),b("main",lY,[g("div",rY,[g("div",oY,[g("span",sY,[M(s(Rs),{size:20,class:"text-accent","aria-hidden":"true"})]),oe[6]||(oe[6]=g("span",{class:"text-[18px] font-bold text-white"},[ye("Summer"),g("span",{class:"text-accent"},"CMS")],-1))]),n.value==="loading"?(f(),b("div",{key:0,"data-connect-state":"loading","aria-busy":"true",class:pe(zo)},[g("h1",{ref_key:"heading",ref:d,tabindex:"-1",class:"sr-only"},_(s(h)("backend::lang.mcp_connect.page_title")),513),oe[7]||(oe[7]=Nk('<span class="size-12 rounded-full bg-[#eceff4]" aria-hidden="true"></span><div class="flex flex-col gap-2" aria-hidden="true"><span class="h-3 w-56 rounded-[6px] bg-[#eceff4]"></span><span class="h-3 w-40 rounded-[6px] bg-[#eceff4]"></span></div><div class="flex flex-col gap-2" aria-hidden="true"><span class="h-10 rounded-inner bg-[#eceff4]"></span><div class="flex flex-col gap-2 rounded-inner border border-[#e6e9ef] bg-[#f3f5f8] p-4"><span class="h-3 w-48 rounded-[6px] bg-[#eceff4]"></span><span class="h-3 w-32 rounded-[6px] bg-[#eceff4]"></span></div></div>',3))])):n.value==="expired"?(f(),b("div",{key:1,"data-connect-state":"expired",class:pe(zo)},[g("span",iY,[M(s(Ui),{size:24,class:"text-[#566175]","aria-hidden":"true"})]),g("div",uY,[g("h1",{ref_key:"heading",ref:d,tabindex:"-1",class:pe(gi)},_(s(h)("backend::lang.mcp_connect.expired_heading")),513),g("p",dY,_(s(h)("backend::lang.mcp_connect.expired_body")),1)]),M(s(Sa),{to:"/","data-action":"open-admin",class:pe([uc,"w-full"])},{default:N(()=>[ye(_(s(h)("backend::lang.mcp_connect.open_admin")),1)]),_:1})])):n.value==="load_error"?(f(),b("div",{key:2,"data-connect-state":"load-error",class:pe(zo)},[g("h1",{ref_key:"heading",ref:d,tabindex:"-1",class:pe(gi)},_(s(h)("backend::lang.mcp_connect.page_title")),513),g("div",{role:"alert",class:pe(yi)},[M(s(bt),{size:18,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.mcp_connect.load_failed")),1)]),g("button",{type:"button","data-action":"retry",class:pe([uc,"w-full"]),onClick:F},_(s(h)("backend::lang.mcp_connect.retry")),1)])):n.value==="returning"?(f(),b("div",{key:3,"data-connect-state":"returning",class:pe(zo)},[_e.value?(f(),b("img",{key:0,src:_e.value,alt:"",class:"size-12 rounded-inner object-contain"},null,8,cY)):(f(),b("span",fY,[M(s(yv),{size:24,class:"text-[#566175]","aria-hidden":"true"})])),g("h1",{ref_key:"heading",ref:d,tabindex:"-1",class:pe([gi,"flex items-center gap-2"])},[g("span",null,_(s(h)("backend::lang.mcp_connect.returning",{host:ne.value})),1),M(s(Vn),{size:16,class:"shrink-0 animate-spin","aria-hidden":"true"})],512),fe.value?(f(),b("a",{key:2,href:fe.value,"data-connect-continue":"",class:"text-[13px] text-[#141b2d] underline [overflow-wrap:anywhere]"},_(s(h)("backend::lang.mcp_connect.continue",{host:ne.value})),9,pY)):Y("",!0)])):l.value?(f(),b("form",{key:4,"data-connect-state":"ready",class:pe(zo),novalidate:"",onSubmit:oe[2]||(oe[2]=mt(ke=>U("allow"),["prevent"]))},[_e.value?(f(),b("img",{key:0,src:_e.value,alt:"",class:"size-12 rounded-inner object-contain"},null,8,mY)):(f(),b("span",vY,[M(s(yv),{size:24,class:"text-[#566175]","aria-hidden":"true"})])),g("div",hY,[g("h1",{ref_key:"heading",ref:d,tabindex:"-1",class:pe(gi)},_(s(h)("backend::lang.mcp_connect.heading",{client:ie.value})),513),g("p",gY,_(s(h)("backend::lang.mcp_connect.subline")),1),l.value.consent_required===!1?(f(),b("p",yY,[M(s(Vl),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.mcp_connect.previously_allowed",{client:ie.value})),1)])):Y("",!0)]),g("dl",bY,[g("div",_Y,[g("dt",xY,_(s(h)("backend::lang.mcp_connect.signed_in_as")),1),g("dd",kY,[g("span",wY,_(xe.value),1),g("button",{type:"button","data-action":"switch-account",disabled:K.value,class:"font-semibold text-[#141b2d] underline-offset-2 hover:underline disabled:opacity-60",onClick:ce},_(s(h)("backend::lang.mcp_connect.switch_account")),9,$Y)])]),g("div",CY,[g("dt",SY,_(s(h)("backend::lang.mcp_connect.returns_to")),1),g("dd",EY,_(Ae.value),1)])]),S.value?(f(),b("fieldset",{key:3,disabled:K.value,class:"flex min-w-0 flex-col gap-[18px]"},[g("div",TY,[M(F_,{ref_key:"scopeAccessRef",ref:v,"id-prefix":"connect",catalog:w.value,"available-tiers":s(q),tier:s(O),custom:s(I),disabled:K.value,invalid:u.value==="scopes_required","onUpdate:tier":de,onCustomize:ve},null,8,["catalog","available-tiers","tier","custom","disabled","invalid"]),u.value==="scopes_required"?(f(),b("div",{key:0,ref_key:"alertBlock",ref:p,role:"alert",tabindex:"-1","data-connect-error":"scopes_required",class:pe(yi)},[M(s(bt),{size:18,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.api_tokens.scopes_required")),1)],512)):Y("",!0)]),l.value.offline_access?(f(),b("div",MY,[g("label",DY,[Jt(g("input",{"onUpdate:modelValue":oe[0]||(oe[0]=ke=>r.value=ke),type:"checkbox",class:"mt-0.5 size-5 shrink-0 rounded-[6px] accent-[#22304d]"},null,512),[[Cw,r.value]]),g("span",OY,[g("span",PY,_(s(h)("backend::lang.mcp_connect.offline")),1),g("span",IY,_(s(h)("backend::lang.mcp_connect.offline_description")),1)])])])):Y("",!0)],8,AY)):(f(),b("div",{key:2,role:"alert","data-connect-none-grantable":"",class:pe([yi,"items-start"])},[M(s(bt),{size:18,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.mcp_connect.none_grantable")),1)])),u.value==="decide_failed"?(f(),b("div",{key:4,ref_key:"alertBlock",ref:p,role:"alert",tabindex:"-1","data-connect-error":"decide_failed",class:pe(yi)},[M(s(bt),{size:18,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.mcp_connect.decide_failed")),1)],512)):Y("",!0),g("div",RY,[g("button",{type:"button","data-action":"deny",disabled:K.value,class:pe([uc,"flex-1"]),onClick:oe[1]||(oe[1]=ke=>U("deny"))},[o.value==="deny"?(f(),j(s(Vn),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Y("",!0),ye(" "+_(s(h)("backend::lang.mcp_connect.deny")),1)],8,qY),S.value?(f(),b("button",{key:0,type:"submit","data-action":"allow",disabled:!re.value,class:"inline-flex h-input flex-1 items-center justify-center gap-2 rounded-control bg-[#22304d] font-semibold text-white hover:opacity-90 disabled:opacity-60"},[o.value==="allow"?(f(),j(s(Vn),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Y("",!0),ye(" "+_(o.value==="allow"?s(h)("backend::lang.mcp_connect.allowing"):s(h)("backend::lang.mcp_connect.allow")),1)],8,LY)):Y("",!0)])],32)):Y("",!0)]),M(s(al),{open:s(B),"onUpdate:open":he},{default:N(()=>[M(s(zl),null,{default:N(()=>[M(s(ll),{"data-dialog-overlay":"",class:"connect-light-surface fixed inset-0 z-40 bg-overlay"}),M(s(nl),{"data-scope-picker-dialog":"","data-dialog-content":"","aria-modal":"true",class:"connect-light-surface fixed inset-0 z-50 flex h-[100dvh] w-full flex-col overflow-hidden bg-surface text-text sm:inset-auto sm:top-1/2 sm:left-1/2 sm:h-auto sm:max-h-[85dvh] sm:w-[calc(100%-32px)] sm:max-w-[640px] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-modal sm:shadow-pop",onOpenAutoFocus:J,onCloseAutoFocus:ee},{default:N(()=>[g("div",NY,[g("div",BY,[M(s(bn),{class:"text-[20px] font-bold tracking-[-0.01em] text-text"},{default:N(()=>[ye(_(s(h)("backend::lang.api_tokens.scope_picker_title")),1)]),_:1}),M(s(hn),{class:"text-[13px] text-muted [overflow-wrap:anywhere]"},{default:N(()=>[ye(_(s(h)("backend::lang.mcp_connect.scope_picker_description",{client:ie.value})),1)]),_:1})]),g("button",{type:"button","data-action":"close-scope-picker","aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text",onClick:oe[3]||(oe[3]=(...ke)=>s(V)&&s(V)(...ke))},[M(s(qt),{size:16,"aria-hidden":"true"})],8,FY)]),M(V_,{ref_key:"scopePickerRef",ref:m,catalog:w.value,"draft-admin-read":s(L),"onUpdate:draftAdminRead":oe[4]||(oe[4]=ke=>Ct(L)?L.value=ke:null),"draft-scopes":s(W),"onUpdate:draftScopes":oe[5]||(oe[5]=ke=>Ct(W)?W.value=ke:null),"cancel-label":s(h)("backend::lang.api_tokens.scope_picker_discard"),disabled:K.value,onApply:Z,onCancel:s(V)},null,8,["catalog","draft-admin-read","draft-scopes","cancel-label","disabled","onCancel"])]),_:1})]),_:1})]),_:1},8,["open"])]))}}),zY={"data-media-view":"",class:"flex h-[calc(100vh-120px)] min-h-[520px] flex-col gap-4"},jY={class:"flex items-center justify-between gap-4"},UY={class:"text-[22px] font-bold tracking-[-0.02em]"},HY={class:"flex min-h-0 flex-1 rounded-card border border-border bg-surface p-4"},KY=ae({__name:"MediaView",setup(e){return(t,a)=>(f(),b("section",zY,[g("div",jY,[g("h1",UY,_(s(h)("backend::lang.media.title")),1)]),g("div",HY,[M(u_,{mode:"all",selectable:!1})])]))}}),WY={class:"flex flex-col gap-5","data-plugins-screen":""},GY={class:"flex flex-col gap-1"},YY={class:"text-[26px] font-bold tracking-[-0.02em]"},JY={key:0,class:"text-[13px] text-muted","data-plugins-framework":""},ZY={key:0,role:"alert",class:"flex items-center gap-2 text-danger","data-plugins-failed":""},XY={key:0,role:"status",class:"flex items-center gap-2 rounded-card border border-border bg-subtle px-4 py-3 text-[13px]","data-registry-unavailable":""},QY={key:0,class:"text-muted"},eJ={key:1,class:"overflow-x-auto rounded-card border border-border bg-surface shadow-card"},tJ={class:"w-full border-collapse text-left"},aJ={class:"border-b border-border text-[13px] text-muted"},nJ={scope:"col",class:"px-5 py-3 font-semibold"},lJ={scope:"col",class:"px-5 py-3 font-semibold"},rJ={scope:"col",class:"px-5 py-3 font-semibold"},oJ=["data-plugin"],sJ={class:"px-5 py-3"},iJ={class:"flex min-w-0 flex-col gap-0.5"},uJ={class:"font-semibold","data-plugin-name":""},dJ={key:0,class:"font-mono text-[12px] text-muted"},cJ={key:1,class:"text-[13px] text-muted","data-plugin-description":""},fJ={key:2,class:"mt-2 flex max-w-[560px] flex-col gap-1.5","data-plugin-update":""},pJ={class:"inline-flex items-center gap-1.5 self-start rounded-pill bg-sel px-2.5 py-0.5 text-[12px] font-semibold","data-update-badge":""},mJ={class:"flex items-center gap-2"},vJ=["for"],hJ=["id","data-command","value"],gJ={key:0,role:"alert",class:"text-[13px] text-danger","data-copy-failed":""},yJ={key:3,class:"text-[12px] text-muted","data-plugin-needs-framework":""},bJ={class:"px-5 py-3 whitespace-nowrap"},_J={key:0,class:"font-mono text-[13px]","data-plugin-version":""},xJ={key:1,class:"text-[13px] text-muted","data-plugin-version":""},kJ={class:"px-5 py-3 text-[13px] whitespace-nowrap","data-plugin-source":""},wJ={class:"flex flex-wrap items-end gap-3"},$J={class:"relative block w-[360px] max-w-full"},CJ={class:"sr-only"},SJ=["value","placeholder"],EJ={class:"flex flex-col gap-1 text-[13px]"},AJ={class:"font-semibold text-muted"},TJ=["value"],MJ={value:""},DJ=["value"],OJ={class:"text-[13px] text-muted"},PJ={key:0,role:"status",class:"flex items-center gap-2 text-[13px]","data-market-unavailable":""},IJ={key:1,class:"text-muted","data-market-empty":""},RJ={key:2,class:"grid grid-cols-1 gap-3 min-[1100px]:grid-cols-2"},qJ=["data-market-plugin"],LJ={class:"flex items-start gap-3.5"},NJ=["src"],BJ={class:"flex min-w-0 flex-1 flex-col gap-0.5"},FJ={class:"flex flex-wrap items-center gap-2"},VJ={class:"font-semibold","data-market-name":""},zJ={key:0,class:"font-mono text-[12px] text-muted","data-market-version":""},jJ={class:"font-mono text-[12px] text-muted"},UJ={key:0,class:"text-[13px] text-muted","data-market-description":""},HJ={key:1,class:"shrink-0 rounded-pill bg-subtle px-2.5 py-0.5 text-[12px] font-semibold","data-market-marker":"installed"},KJ={key:2,class:"shrink-0 rounded-pill bg-subtle px-2.5 py-0.5 text-[12px] font-semibold text-muted","data-market-marker":"needs-framework"},WJ={class:"flex items-center gap-2"},GJ=["for"],YJ=["id","data-command","value"],JJ={key:0,role:"alert",class:"text-[13px] text-danger","data-copy-failed":""},ZJ={class:"sr-only","aria-live":"polite"},XJ={key:2,class:"text-muted","aria-busy":"true"},QJ=300,mg="inline-flex h-[34px] items-center gap-2 rounded-tab px-4 font-semibold text-muted transition-colors duration-150 ease-out hover:text-text data-[state=active]:bg-surface data-[state=active]:text-text data-[state=active]:shadow-tab",vg="h-[38px] min-w-0 flex-1 rounded-control border border-border bg-subtle px-3 font-mono text-[13px] text-text",eZ="h-button rounded-control border border-border-strong bg-surface px-3 text-text",tZ=ae({__name:"PluginsView",setup(e){const t=E(null),a=E(!1),n=E(!0),l=E("installed"),r={module:"backend::lang.plugins.source_module",submodule:"backend::lang.plugins.source_submodule",local:"backend::lang.plugins.source_local"};function o(G){const A=r[G.source];return A?h(A):G.source}async function i(){n.value=!0,a.value=!1;try{const{data:G,response:A}=await Le.GET("/plugins");A.ok&&G?t.value=G.data:a.value=!0}catch{a.value=!0}finally{n.value=!1}}const u=E(""),c=E(""),d=E(null),p=E(!1),v=E(!1),m=E([]);let y=null,x=0;async function C(){const G=++x;p.value=!0,v.value=!1;const A={};u.value.trim()!==""&&(A.q=u.value.trim()),c.value!==""&&(A.category=c.value);try{const{data:D,response:z}=await Le.GET("/plugins/marketplace",{params:{query:A}});if(G!==x)return;z.ok&&D?(d.value=D,D.meta.categories.length>0&&(m.value=[...D.meta.categories])):v.value=!0}catch{G===x&&(v.value=!0)}finally{G===x&&(p.value=!1)}}function w(){y!==null&&(clearTimeout(y),y=null)}function S(G){u.value=G,w(),y=setTimeout(()=>{y=null,C()},QJ)}function q(G){c.value=G,w(),C()}ze(l,G=>{G==="marketplace"&&d.value===null&&!p.value&&C()});const O=E(""),I=E(""),B=E("");let L=null;function W(G){const A=document.querySelector(`[data-command="${CSS.escape(G)}"]`);A?.focus(),A?.select()}async function T(G,A){try{if(!navigator.clipboard?.writeText)throw new Error("clipboard unavailable");await navigator.clipboard.writeText(A),I.value="",O.value=G,B.value=h("backend::lang.plugins.copied_announce"),L!==null&&clearTimeout(L),L=setTimeout(()=>{O.value="",L=null},2e3)}catch{O.value="",I.value=G,W(G)}}function R(G){G.target.select()}return $t(i),Dt(()=>{w(),L!==null&&clearTimeout(L)}),(G,A)=>(f(),b("section",WY,[g("header",GY,[g("h1",YY,_(s(h)("backend::lang.plugins.title")),1),t.value?.framework?(f(),b("p",JY,_(s(h)("backend::lang.plugins.framework",{version:t.value.framework})),1)):Y("",!0)]),a.value?(f(),b("p",ZY,[M(s(bt),{size:16,class:"shrink-0","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.plugins.load_failed")),1)])):t.value?(f(),b(me,{key:1},[t.value.registry.status==="unavailable"?(f(),b("p",XY,[M(s(Ki),{size:16,class:"shrink-0 text-muted","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.plugins.registry_unavailable")),1)])):Y("",!0),M(s(mD),{modelValue:l.value,"onUpdate:modelValue":A[2]||(A[2]=D=>l.value=D),class:"flex flex-col gap-4"},{default:N(()=>[M(s(gD),{"aria-label":s(h)("backend::lang.plugins.tabs_label"),class:"inline-flex gap-1 self-start rounded-inner border border-border bg-subtle p-1"},{default:N(()=>[M(s(xh),{value:"installed","data-tab":"installed",class:pe(mg)},{default:N(()=>[ye(_(s(h)("backend::lang.plugins.tab_installed")),1)]),_:1}),t.value.registry.enabled?(f(),j(s(xh),{key:0,value:"marketplace","data-tab":"marketplace",class:pe(mg)},{default:N(()=>[ye(_(s(h)("backend::lang.plugins.tab_marketplace")),1)]),_:1})):Y("",!0)]),_:1},8,["aria-label"]),M(s(_h),{value:"installed",class:"flex flex-col gap-3"},{default:N(()=>[t.value.plugins.length===0?(f(),b("p",QY,_(s(h)("backend::lang.plugins.empty")),1)):(f(),b("div",eJ,[g("table",tJ,[g("thead",null,[g("tr",aJ,[g("th",nJ,_(s(h)("backend::lang.plugins.column_plugin")),1),g("th",lJ,_(s(h)("backend::lang.plugins.column_version")),1),g("th",rJ,_(s(h)("backend::lang.plugins.column_source")),1)])]),g("tbody",null,[(f(!0),b(me,null,Ie(t.value.plugins,D=>(f(),b("tr",{key:D.id,"data-plugin":D.id,class:"border-b border-border align-top last:border-b-0"},[g("td",sJ,[g("div",iJ,[g("span",uJ,_(D.name||D.id),1),D.name?(f(),b("span",dJ,_(D.id),1)):Y("",!0),D.description?(f(),b("span",cJ,_(D.description),1)):Y("",!0),t.value.registry.enabled&&D.updateAvailable?(f(),b("div",fJ,[g("span",pJ,[M(s(eC),{size:14,"aria-hidden":"true"}),ye(" "+_(s(h)("backend::lang.plugins.update_available",{version:D.latest})),1)]),g("div",mJ,[g("label",{for:`plugin-command-update-${D.id}`,class:"sr-only"},_(s(h)("backend::lang.plugins.command_label")),9,vJ),g("input",{id:`plugin-command-update-${D.id}`,"data-command":`update:${D.id}`,value:D.updateCommand,type:"text",readonly:"",spellcheck:"false",class:pe(vg),onFocus:R},null,40,hJ),M(Ke,{variant:"outline",size:"sm",icon:O.value===`update:${D.id}`?s(Ba):s(ro),"data-action":"copy-command",onClick:z=>T(`update:${D.id}`,D.updateCommand)},{default:N(()=>[ye(_(O.value===`update:${D.id}`?s(h)("backend::lang.plugins.copied"):s(h)("backend::lang.plugins.copy")),1)]),_:2},1032,["icon","onClick"])]),I.value===`update:${D.id}`?(f(),b("p",gJ,_(s(h)("backend::lang.plugins.copy_failed")),1)):Y("",!0)])):Y("",!0),t.value.registry.enabled&&D.latestFramework?(f(),b("span",yJ,_(s(h)("backend::lang.plugins.needs_framework",{version:D.latestFramework})),1)):Y("",!0)])]),g("td",bJ,[D.version?(f(),b("span",_J,_(D.version),1)):(f(),b("span",xJ,_(s(h)("backend::lang.plugins.no_version")),1))]),g("td",kJ,_(D.source?o(D):""),1)],8,oJ))),128))])])]))]),_:1}),t.value.registry.enabled?(f(),j(s(_h),{key:0,value:"marketplace",class:"flex flex-col gap-4"},{default:N(()=>[g("div",wJ,[g("label",$J,[g("span",CJ,_(s(h)("backend::lang.plugins.search_label")),1),M(s(hr),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{type:"search",maxlength:"100","data-market-search":"",value:u.value,placeholder:s(h)("backend::lang.plugins.search_placeholder"),class:"h-button w-full rounded-control border border-transparent bg-subtle pr-3.5 pl-10",onInput:A[0]||(A[0]=D=>S(D.target.value))},null,40,SJ)]),g("label",EJ,[g("span",AJ,_(s(h)("backend::lang.plugins.category_label")),1),g("select",{"data-market-category":"",value:c.value,class:pe(eZ),onChange:A[1]||(A[1]=D=>q(D.target.value))},[g("option",MJ,_(s(h)("backend::lang.plugins.category_all")),1),(f(!0),b(me,null,Ie(m.value,D=>(f(),b("option",{key:D,value:D},_(D),9,DJ))),128))],40,TJ)])]),g("p",OJ,_(s(h)("backend::lang.plugins.install_hint")),1),v.value||d.value?.meta.registry.status==="unavailable"?(f(),b("p",PJ,[M(s(Ki),{size:16,class:"shrink-0 text-muted","aria-hidden":"true"}),g("span",null,_(s(h)("backend::lang.plugins.registry_unavailable")),1)])):d.value&&d.value.data.length===0?(f(),b("p",IJ,_(s(h)("backend::lang.plugins.marketplace_empty")),1)):Y("",!0),d.value&&d.value.data.length>0?(f(),b("div",RJ,[(f(!0),b(me,null,Ie(d.value.data,D=>(f(),b("article",{key:D.id,"data-market-plugin":D.id,class:"flex flex-col gap-3 rounded-card border border-border bg-surface p-5 shadow-card"},[g("div",LJ,[D.iconUrl?(f(),b("img",{key:0,src:D.iconUrl,alt:"",loading:"lazy",referrerpolicy:"no-referrer",class:"size-10 shrink-0 rounded-inner object-cover"},null,8,NJ)):Y("",!0),g("div",BJ,[g("div",FJ,[g("span",VJ,_(D.name||D.id),1),D.latestVersion?(f(),b("span",zJ,_(D.latestVersion),1)):Y("",!0),D.featured?(f(),j(s(qb),{key:1,size:14,class:"text-muted","aria-label":s(h)("backend::lang.plugins.featured")},null,8,["aria-label"])):Y("",!0)]),g("span",jJ,_(D.id),1),D.description?(f(),b("span",UJ,_(D.description),1)):Y("",!0)]),D.installed?(f(),b("span",HJ,_(s(h)("backend::lang.plugins.marker_installed")),1)):D.compatible?Y("",!0):(f(),b("span",KJ,_(s(h)("backend::lang.plugins.marker_needs_framework",{version:D.latestFramework})),1))]),g("div",WJ,[g("label",{for:`plugin-command-install-${D.id}`,class:"sr-only"},_(s(h)("backend::lang.plugins.command_label")),9,GJ),g("input",{id:`plugin-command-install-${D.id}`,"data-command":`install:${D.id}`,value:D.installCommand,type:"text",readonly:"",spellcheck:"false",class:pe(vg),onFocus:R},null,40,YJ),M(Ke,{variant:"outline",size:"sm",icon:O.value===`install:${D.id}`?s(Ba):s(ro),"data-action":"copy-command",onClick:z=>T(`install:${D.id}`,D.installCommand)},{default:N(()=>[ye(_(O.value===`install:${D.id}`?s(h)("backend::lang.plugins.copied"):s(h)("backend::lang.plugins.copy")),1)]),_:2},1032,["icon","onClick"])]),I.value===`install:${D.id}`?(f(),b("p",JJ,_(s(h)("backend::lang.plugins.copy_failed")),1)):Y("",!0)],8,qJ))),128))])):Y("",!0)]),_:1})):Y("",!0)]),_:1},8,["modelValue"]),g("span",ZJ,_(B.value),1)],64)):n.value?(f(),b("p",XJ,"…")):Y("",!0)]))}}),aZ={class:"flex flex-col items-center gap-2 py-20 text-center"},nZ={class:"text-[17px] font-bold"},hg=ae({__name:"NotFoundView",props:{home:{type:Boolean}},setup(e){return(t,a)=>(f(),b("section",aZ,[g("h1",nZ,_(e.home?s(h)("backend::lang.nav.empty"):s(h)("backend::lang.page.not_found")),1)]))}});function sf(e){return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\")?null:e}const lZ=new Set(["list","create","record","preview","reorder"]);function rZ(e){if(typeof e.name!="string"||!lZ.has(e.name))return"";const{vendor:t,plugin:a,controller:n}=e.params;return typeof t!="string"||typeof a!="string"||typeof n!="string"?"":Os({vendor:t,plugin:a,controller:n})}function oZ(e=h2(mr.base)){const t=R2({history:e,routes:[{path:"/login",name:"login",component:ZO,meta:{public:!0}},{path:"/",name:"home",component:hg,props:{home:!0},meta:{shell:!0},beforeEnter:()=>l$()??!0},{path:"/settings",name:"settings",component:KH,meta:{shell:!0}},{path:"/settings/:code",name:"settings-form",component:RH,meta:{shell:!0}},{path:"/media",name:"media",component:KY,meta:{shell:!0}},{path:"/account",name:"account",component:nY,meta:{shell:!0}},{path:"/system/plugins",name:"plugins",component:tZ,meta:{shell:!0}},{path:"/connect",name:"connect",component:VY},{path:"/:vendor/:plugin/:controller",name:"list",component:YI,meta:{shell:!0}},{path:"/:vendor/:plugin/:controller/create",name:"create",component:dg,meta:{shell:!0}},{path:"/:vendor/:plugin/:controller/reorder",name:"reorder",component:SH,meta:{shell:!0}},{path:"/:vendor/:plugin/:controller/:id(\\d+)",name:"record",component:dg,meta:{shell:!0}},{path:"/:vendor/:plugin/:controller/:id(\\d+)/preview",name:"preview",component:YU,meta:{shell:!0}},{path:"/:pathMatch(.*)*",name:"not-found",component:hg,meta:{shell:!0}}]});return t.beforeEach(a=>{const n=na.value!==null;return a.meta.public?n&&a.name==="login"?sf(a.query.redirect)??"/":!0:n?!0:{name:"login",query:{redirect:a.fullPath}}}),t.afterEach((a,n,l)=>{l||RO(rZ(a))}),t}const gg="summer-admin.chunk-reload",sZ=6e4;function iZ(e,t){if(e===null)return!1;try{const a=Number.parseInt(e.getItem(gg)??"",10);return Number.isFinite(a)&&t-a>=0&&t-a<sZ?!1:(e.setItem(gg,String(t)),!0)}catch{return!1}}function uZ(){try{return window.sessionStorage}catch{return null}}function dZ(e={}){const t=e.target??window,a=e.storage??uZ,n=e.reload??(()=>window.location.reload()),l=e.now??Date.now,r=()=>{iZ(a(),l())&&n()};return t.addEventListener("vite:preloadError",r),()=>t.removeEventListener("vite:preloadError",r)}async function cZ(){dZ(),Ji(pE()),await ub(mE()||void 0).catch(()=>{}),await S0().catch(()=>null)&&await Promise.all([db().catch(()=>[]),cb().catch(()=>[]),Fb().catch(()=>!1),K0()]);const t=oZ();Y2(()=>Xc(t));const a=Ow(PO);a.use(t),await t.isReady(),a.mount("#app"),SO()}cZ();export{aV as L,m_ as _,b_ as i};
|