@bobbykim/manguito-cms-admin 0.5.2 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ChangePasswordView-v3tSL_0C.js → ChangePasswordView-C9NzzFbG.js} +1 -1
- package/dist/assets/ContentFormView-B3P9YP72.js +1 -0
- package/dist/assets/{ContentListView-i3MwjmNq.js → ContentListView-BGIym0gL.js} +1 -1
- package/dist/assets/{ContentSettingsView-4cpotfsZ.js → ContentSettingsView-Cy4_2nQO.js} +1 -1
- package/dist/assets/{LoginView-BObIe0zr.js → LoginView-D0fvOnS1.js} +1 -1
- package/dist/assets/{MediaDetailView-BKTDY6Ne.js → MediaDetailView-DdB2PX-3.js} +1 -1
- package/dist/assets/{MediaLibraryView-DojOE-wL.js → MediaLibraryView-CkHbclTm.js} +1 -1
- package/dist/assets/TaxonomyFormView-DxubNh6h.js +1 -0
- package/dist/assets/{TaxonomyListView-Cy3iI1oC.js → TaxonomyListView-fH2lIkhZ.js} +1 -1
- package/dist/assets/{UserFormView-B2m4OdJV.js → UserFormView-DIAspRUO.js} +1 -1
- package/dist/assets/{UserListView-z6weJ8UF.js → UserListView-B-umho5v.js} +1 -1
- package/dist/assets/{field-defaults-DLoPESiE.js → field-defaults-B5VUJSnc.js} +20 -20
- package/dist/assets/{index-stKCwnA4.js → index-CBeqUIPW.js} +2 -2
- package/dist/assets/{useNotification-BdRk9gQY.js → useNotification-DT7B0CXj.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +4 -3
- package/src/components/fields/MediaUpload.vue +2 -3
- package/src/utils/__tests__/server-errors.test.ts +19 -0
- package/src/utils/server-errors.ts +19 -0
- package/src/views/content/ContentFormView.vue +5 -2
- package/src/views/media/MediaLibraryView.vue +2 -1
- package/src/views/taxonomy/TaxonomyFormView.vue +5 -2
- package/src/views/taxonomy/__tests__/TaxonomyFormView.test.ts +37 -1
- package/dist/assets/ContentFormView-DneaTAaq.js +0 -1
- package/dist/assets/TaxonomyFormView-Chd_LUly.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-
|
|
2
|
-
import{$ as e,B as t,D as n,E as r,G as i,H as a,I as o,J as s,K as c,M as l,N as u,O as d,Q as f,R as p,S as m,U as h,V as g,W as _,X as v,Y as ee,Z as y,_ as te,at as b,b as x,c as S,ct as C,d as w,et as T,f as ne,g as E,h as D,i as re,it as ie,j as O,k as ae,l as k,lt as oe,n as se,nt as ce,o as le,ot as ue,p as de,q as fe,r as pe,rt as A,s as j,st as M,t as me,tt as he,u as N,ut as P,v as ge,w as _e,y as ve,z as ye}from"./schema-B-RKX_ep.js";var be=void 0,xe=typeof window<`u`&&window.trustedTypes;if(xe)try{be=xe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Se=be?e=>be.createHTML(e):e=>e,Ce=`http://www.w3.org/2000/svg`,we=`http://www.w3.org/1998/Math/MathML`,F=typeof document<`u`?document:null,Te=F&&F.createElement(`template`),Ee={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?F.createElementNS(Ce,e):t===`mathml`?F.createElementNS(we,e):n?F.createElement(e,{is:n}):F.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>F.createTextNode(e),createComment:e=>F.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>F.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{Te.innerHTML=Se(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Te.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},De=Symbol(`_vtc`);function Oe(e,t,n){let r=e[De];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var ke=Symbol(`_vod`),Ae=Symbol(`_vsh`),je=Symbol(``),Me=/(?:^|;)\s*display\s*:/;function Ne(e,t,n){let r=e.style,i=A(n),a=!1;if(n&&!i){if(t)if(A(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Fe(r,t,``)}else for(let e in t)n[e]??Fe(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Fe(r,i,``):ze(e,i,!A(t)&&t?t[i]:void 0,o)||Fe(r,i,o)}}else if(i){if(t!==n){let e=r[je];e&&(n+=`;`+e),r.cssText=n,a=Me.test(n)}}else t&&e.removeAttribute(`style`);ke in e&&(e[ke]=a?r.display:``,e[Ae]&&(r.display=`none`))}var Pe=/\s*!important$/;function Fe(e,t,n){if(y(n))n.forEach(n=>Fe(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Re(e,t);Pe.test(n)?e.setProperty(s(r),n.replace(Pe,``),`important`):e[r]=n}}var Ie=[`Webkit`,`Moz`,`ms`],Le={};function Re(e,t){let n=Le[t];if(n)return n;let r=i(t);if(r!==`filter`&&r in e)return Le[t]=r;r=c(r);for(let n=0;n<Ie.length;n++){let i=Ie[n]+r;if(i in e)return Le[t]=i}return t}function ze(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&A(r)&&n===r}var Be=`http://www.w3.org/1999/xlink`;function Ve(e,t,n,r,i,a=ce(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Be,t.slice(6,t.length)):e.setAttributeNS(Be,t,n):n==null||a&&!ee(n)?e.removeAttribute(t):e.setAttribute(t,a?``:ie(n)?String(n):n)}function He(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?Se(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=ee(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function I(e,t,n,r){e.addEventListener(t,n,r)}function Ue(e,t,n,r){e.removeEventListener(t,n,r)}var We=Symbol(`_vei`);function Ge(e,t,n,r,i=null){let a=e[We]||(e[We]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Je(t);r?I(e,n,a[t]=Qe(r,i),s):o&&(Ue(e,n,o,s),a[t]=void 0)}}var Ke=/(Once|Passive|Capture)$/,qe=/^on:?(?:Once|Passive|Capture)$/;function Je(e){let t,n;for(;(n=e.match(Ke))&&!qe.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):s(e.slice(2)),t]}var Ye=0,Xe=Promise.resolve(),Ze=()=>Ye||=(Xe.then(()=>Ye=0),Date.now());function Qe(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(y(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&le(e,t,5,a)}}else le(r,t,5,[e])};return n.value=e,n.attached=Ze(),n}var $e=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,et=(t,n,r,a,o,s)=>{let c=o===`svg`;n===`class`?Oe(t,a,c):n===`style`?Ne(t,r,a):T(n)?e(n)||Ge(t,n,r,a,s):(n[0]===`.`?(n=n.slice(1),!0):n[0]===`^`?(n=n.slice(1),!1):tt(t,n,a,c))?(He(t,n,a),!t.tagName.includes(`-`)&&(n===`value`||n===`checked`||n===`selected`)&&Ve(t,n,a,c,s,n!==`value`)):t._isVueCE&&(nt(t,n)||t._def.__asyncLoader&&(/[A-Z]/.test(n)||!A(a)))?He(t,i(n),a,s,n):(n===`true-value`?t._trueValue=a:n===`false-value`&&(t._falseValue=a),Ve(t,n,a,c))};function tt(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&$e(t)&&f(n));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`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return $e(t)&&A(n)?!1:t in e}function nt(e,t){let n=e._def.props;if(!n)return!1;let r=i(t);return Array.isArray(n)?n.some(e=>i(e)===r):Object.keys(n).some(e=>i(e)===r)}var rt=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return y(t)?e=>v(t,e):t};function it(e){e.target.composing=!0}function at(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var L=Symbol(`_assign`);function ot(e,t,n){return t&&(e=e.trim()),n&&(e=M(e)),e}var st={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[L]=rt(i);let a=r||i.props&&i.props.type===`number`;I(e,t?`change`:`input`,t=>{t.target.composing||e[L](ot(e.value,n,a))}),(n||a)&&I(e,`change`,()=>{e.value=ot(e.value,n,a)}),t||(I(e,`compositionstart`,it),I(e,`compositionend`,at),I(e,`change`,at))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[L]=rt(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?M(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ct={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=he(t);I(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?M(ut(e)):ut(e));e[L](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,m(()=>{e._assigning=!1})}),e[L]=rt(r)},mounted(e,{value:t}){lt(e,t)},beforeUpdate(e,t,n){e[L]=rt(n)},updated(e,{value:t}){e._assigning||lt(e,t)}};function lt(e,t){let n=e.multiple,r=y(t);if(!(n&&!r&&!he(t))){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=ut(a);if(n)if(r){let e=typeof o;e===`string`||e===`number`?a.selected=t.some(e=>String(e)===String(o)):a.selected=ue(t,o)>-1}else a.selected=t.has(o);else if(b(ut(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ut(e){return`_value`in e?e._value:e.value}var dt=[`ctrl`,`shift`,`alt`,`meta`],ft={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)=>dt.some(n=>e[`${n}Key`]&&!t.includes(n))},pt=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=ft[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},mt=fe({patchProp:et},Ee),ht;function gt(){return ht||=ne(mt)}var _t=((...e)=>{let t=gt().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=yt(e);if(!r)return;let i=t._component;!f(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,vt(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function vt(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function yt(e){return A(e)?document.querySelector(e):e}var R=typeof document<`u`;function bt(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function xt(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&bt(e.default)}var z=Object.assign;function St(e,t){let n={};for(let r in t){let i=t[r];n[r]=B(i)?i.map(e):e(i)}return n}var Ct=()=>{},B=Array.isArray;function wt(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var Tt=/#/g,Et=/&/g,Dt=/\//g,Ot=/=/g,kt=/\?/g,At=/\+/g,jt=/%5B/g,Mt=/%5D/g,Nt=/%5E/g,Pt=/%60/g,Ft=/%7B/g,It=/%7C/g,Lt=/%7D/g,Rt=/%20/g;function zt(e){return e==null?``:encodeURI(``+e).replace(It,`|`).replace(jt,`[`).replace(Mt,`]`)}function Bt(e){return zt(e).replace(Ft,`{`).replace(Lt,`}`).replace(Nt,`^`)}function Vt(e){return zt(e).replace(At,`%2B`).replace(Rt,`+`).replace(Tt,`%23`).replace(Et,`%26`).replace(Pt,"`").replace(Ft,`{`).replace(Lt,`}`).replace(Nt,`^`)}function Ht(e){return Vt(e).replace(Ot,`%3D`)}function Ut(e){return zt(e).replace(Tt,`%23`).replace(kt,`%3F`)}function Wt(e){return Ut(e).replace(Dt,`%2F`)}function Gt(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var Kt=/\/$/,qt=e=>e.replace(Kt,``);function Jt(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=tn(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:Gt(o)}}function Yt(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function Xt(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function Zt(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&V(t.matched[r],n.matched[i])&&Qt(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function V(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Qt(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!$t(e[n],t[n]))return!1;return!0}function $t(e,t){return B(e)?en(e,t):B(t)?en(t,e):e?.valueOf()===t?.valueOf()}function en(e,t){return B(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function tn(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`)if(s===`..`)a>1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var H={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},nn=function(e){return e.pop=`pop`,e.push=`push`,e}({}),rn=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function an(e){if(!e)if(R){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),qt(e)}var on=/^[^#]+#/;function sn(e,t){return e.replace(on,`#`)+t}function cn(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var ln=()=>({left:window.scrollX,top:window.scrollY});function un(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=cn(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function dn(e,t){return(history.state?history.state.position-t:-1)+e}var fn=new Map;function pn(e,t){fn.set(e,t)}function mn(e){let t=fn.get(e);return fn.delete(e),t}function hn(e){return typeof e==`string`||e&&typeof e==`object`}function gn(e){return typeof e==`string`||typeof e==`symbol`}var U=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),_n=Symbol(``);U.MATCHER_NOT_FOUND,U.NAVIGATION_GUARD_REDIRECT,U.NAVIGATION_ABORTED,U.NAVIGATION_CANCELLED,U.NAVIGATION_DUPLICATED;function W(e,t){return z(Error(),{type:e,[_n]:!0},t)}function G(e,t){return e instanceof Error&&_n in e&&(t==null||!!(e.type&t))}function vn(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(At,` `),i=r.indexOf(`=`),a=Gt(i<0?r:r.slice(0,i)),o=i<0?null:Gt(r.slice(i+1));if(a in t){let e=t[a];B(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function yn(e){let t=``;for(let n in e){let r=e[n];if(n=Ht(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(B(r)?r.map(e=>e&&Vt(e)):[r&&Vt(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function bn(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=B(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}var xn=Symbol(``),Sn=Symbol(``),Cn=Symbol(``),wn=Symbol(``),Tn=Symbol(``);function En(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function K(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(W(U.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):hn(e)?c(W(U.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Dn(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(bt(s)){let c=(s.__vccOpts||s)[t];c&&a.push(K(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=xt(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&K(c,n,r,o,e,i)()}))}}return a}function On(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>V(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>V(e,s))||i.push(s))}return[n,r,i]}var kn=()=>location.protocol+`//`+location.host;function An(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Xt(n,``)}return Xt(n,e)+r+i}function jn(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=An(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:nn.pop,direction:u?u>0?rn.forward:rn.back:rn.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(z({},e.state,{scroll:ln()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function Mn(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?ln():null}}function Nn(e){let{history:t,location:n}=window,r={value:An(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:kn()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,z({},t.state,Mn(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=z({},i.value,t.state,{forward:e,scroll:ln()});a(o.current,o,!0),a(e,z({},Mn(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function Pn(e){e=an(e);let t=Nn(e),n=jn(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=z({location:``,base:e,go:r,createHref:sn.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var q=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),J=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(J||{}),Fn={type:q.Static,value:``},In=/[a-zA-Z0-9_]/;function Ln(e){if(!e)return[[]];if(e===`/`)return[[Fn]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=J.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===J.Static?a.push({type:q.Static,value:l}):n===J.Param||n===J.ParamRegExp||n===J.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:q.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;){if(c=e[s++],c===`\\`&&n!==J.ParamRegExp){r=n,n=J.EscapeNext;continue}switch(n){case J.Static:c===`/`?(l&&d(),o()):c===`:`?(d(),n=J.Param):f();break;case J.EscapeNext:f(),n=r;break;case J.Param:c===`(`?n=J.ParamRegExp:In.test(c)?f():(d(),n=J.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case J.ParamRegExp:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=J.ParamRegExpEnd:u+=c;break;case J.ParamRegExpEnd:d(),n=J.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`);break}}return n===J.ParamRegExp&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var Rn=`[^/]+?`,zn={sensitive:!1,strict:!1,start:!0,end:!0},Y=function(e){return e[e._multiplier=10]=`_multiplier`,e[e.Root=90]=`Root`,e[e.Segment=40]=`Segment`,e[e.SubSegment=30]=`SubSegment`,e[e.Static=40]=`Static`,e[e.Dynamic=20]=`Dynamic`,e[e.BonusCustomRegExp=10]=`BonusCustomRegExp`,e[e.BonusWildcard=-50]=`BonusWildcard`,e[e.BonusRepeatable=-20]=`BonusRepeatable`,e[e.BonusOptional=-8]=`BonusOptional`,e[e.BonusStrict=.7000000000000001]=`BonusStrict`,e[e.BonusCaseSensitive=.25]=`BonusCaseSensitive`,e}(Y||{}),Bn=/[.+*?^${}()[\]/\\]/g;function Vn(e,t){let n=z({},zn,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[Y.Root];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=Y.Segment+(n.sensitive?Y.BonusCaseSensitive:0);if(o.type===q.Static)r||(i+=`/`),i+=o.value.replace(Bn,`\\$&`),s+=Y.Static;else if(o.type===q.Param){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||Rn;if(u!==Rn){s+=Y.BonusCustomRegExp;try{`${u}`}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=Y.Dynamic,c&&(s+=Y.BonusOptional),n&&(s+=Y.BonusRepeatable),u===`.*`&&(s+=Y.BonusWildcard)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=Y.BonusStrict}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===q.Static)n+=e.value;else if(e.type===q.Param){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(B(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=B(c)?c.join(`/`):c;if(!l)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function Hn(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Y.Static+Y.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Y.Static+Y.Segment?1:-1:0}function Un(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Hn(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(Wn(r))return 1;if(Wn(i))return-1}return i.length-r.length}function Wn(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var Gn={strict:!1,end:!0,sensitive:!1};function Kn(e,t,n){let r=z(Vn(Ln(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function qn(e,t){let n=[],r=new Map;t=wt(Gn,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Yn(e);s.aliasOf=r&&r.record;let l=wt(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Yn(z({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=Kn(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!Zn(d)&&o(e.name)),tr(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:Ct}function o(e){if(gn(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=$n(e,n);n.splice(t,0,e),e.record.name&&!Zn(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw W(U.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=z(Jn(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&Jn(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw W(U.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=z({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:Qn(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function Jn(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Yn(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Xn(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 Xn(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function Zn(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Qn(e){return e.reduce((e,t)=>z(e,t.meta),{})}function $n(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;Un(e,t[i])<0?r=i:n=i+1}let i=er(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function er(e){let t=e;for(;t=t.parent;)if(tr(t)&&Un(e,t)===0)return t}function tr({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function nr(e){let t=x(Cn),n=x(wn),r=j(()=>{let n=_(e.to);return t.resolve(n)}),i=j(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(V.bind(null,i));if(o>-1)return o;let s=sr(e[t-2]);return t>1&&sr(i)===s&&a[a.length-1].path!==s?a.findIndex(V.bind(null,e[t-2])):o}),a=j(()=>i.value>-1&&or(n.params,r.value.params)),o=j(()=>i.value>-1&&i.value===n.matched.length-1&&Qt(n.params,r.value.params));function s(n={}){if(ar(n)){let n=t[_(e.replace)?`replace`:`push`](_(e.to)).catch(Ct);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:j(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function rr(e){return e.length===1?e[0]:e}var ir=E({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:nr,setup(e,{slots:t}){let n=ye(nr(e)),{options:r}=x(Cn),i=j(()=>({[cr(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[cr(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&rr(t.default(n));return e.custom?r:ge(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function ar(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){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function or(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!B(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function sr(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var cr=(e,t,n)=>e??t??n,lr=E({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:r,slots:i}){let a=x(Tn),o=j(()=>e.route||a.value),s=x(Sn,0),c=j(()=>{let e=_(s),{matched:t}=o.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),l=j(()=>o.value.matched[c.value]);n(Sn,j(()=>c.value+1)),n(xn,l),n(Tn,o);let u=t();return O(()=>[u.value,l.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!V(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let t=o.value,n=e.name,a=l.value,s=a&&a.components[n];if(!s)return ur(i.default,{Component:s,route:t});let c=a.props[n],d=ge(s,z({},c?c===!0?t.params:typeof c==`function`?c(t):c:null,r,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[n]=null)},ref:u}));return ur(i.default,{Component:d,route:t})||d}}});function ur(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var dr=lr;function fr(e){let t=qn(e.routes,e),n=e.parseQuery||vn,r=e.stringifyQuery||yn,i=e.history,o=En(),s=En(),c=En(),l=a(H),u=H;R&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let d=St.bind(null,e=>``+e),f=St.bind(null,Wt),p=St.bind(null,Gt);function h(e,n){let r,i;return gn(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function v(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function ee(){return t.getRoutes().map(e=>e.record)}function y(e){return!!t.getRecordMatcher(e)}function te(e,a){if(a=z({},a||l.value),typeof e==`string`){let r=Jt(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return z(r,o,{params:p(o.params),hash:Gt(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=z({},e,{path:Jt(n,e.path,a.path).path});else{let t=z({},e.params);for(let e in t)t[e]??delete t[e];o=z({},e,{params:f(t)}),a.params=f(a.params)}let s=t.resolve(o,a),c=e.hash||``;s.params=d(p(s.params));let u=Yt(r,z({},e,{hash:Bt(c),path:s.path})),m=i.createHref(u);return z({fullPath:u,hash:c,query:r===yn?bn(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function b(e){return typeof e==`string`?Jt(n,e,l.value.path):z({},e)}function x(e,t){if(u!==e)return W(U.NAVIGATION_CANCELLED,{from:t,to:e})}function S(e){return T(e)}function C(e){return S(z(b(e),{replace:!0}))}function w(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=b(i):{path:i},i.params={}),z({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function T(e,t){let n=u=te(e),i=l.value,a=e.state,o=e.force,s=e.replace===!0,c=w(n,i);if(c)return T(z(b(c),{state:typeof c==`object`?z({},a,c.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&Zt(r,i,n)&&(f=W(U.NAVIGATION_DUPLICATED,{to:d,from:i}),de(i,i,!0,!1)),(f?Promise.resolve(f):D(d,i)).catch(e=>G(e)?G(e,U.NAVIGATION_GUARD_REDIRECT)?e:ue(e):ce(e,d,i)).then(e=>{if(e){if(G(e,U.NAVIGATION_GUARD_REDIRECT))return T(z({replace:s},b(e.to),{state:typeof e.to==`object`?z({},a,e.to.state):a,force:o}),t||d)}else e=ie(d,i,!0,s,a);return re(d,i,e),e})}function ne(e,t){let n=x(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=A.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function D(e,t){let n,[r,i,a]=On(e,t);n=Dn(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(K(r,e,t))});let c=ne.bind(null,e,t);return n.push(c),M(n).then(()=>{n=[];for(let r of o.list())n.push(K(r,e,t));return n.push(c),M(n)}).then(()=>{n=Dn(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(K(r,e,t))});return n.push(c),M(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(B(r.beforeEnter))for(let i of r.beforeEnter)n.push(K(i,e,t));else n.push(K(r.beforeEnter,e,t));return n.push(c),M(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Dn(a,`beforeRouteEnter`,e,t,E),n.push(c),M(n))).then(()=>{n=[];for(let r of s.list())n.push(K(r,e,t));return n.push(c),M(n)}).catch(e=>G(e,U.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function re(e,t,n){c.list().forEach(r=>E(()=>r(e,t,n)))}function ie(e,t,n,r,a){let o=x(e,t);if(o)return o;let s=t===H,c=R?history.state:{};n&&(r||s?i.replace(e.fullPath,z({scroll:s&&c&&c.scroll},a)):i.push(e.fullPath,a)),l.value=e,de(e,t,n,s),ue()}let O;function ae(){O||=i.listen((e,t,n)=>{if(!j.listening)return;let r=te(e),a=w(r,j.currentRoute.value);if(a){T(z(a,{replace:!0,force:!0}),r).catch(Ct);return}u=r;let o=l.value;R&&pn(dn(o.fullPath,n.delta),ln()),D(r,o).catch(e=>G(e,U.NAVIGATION_ABORTED|U.NAVIGATION_CANCELLED)?e:G(e,U.NAVIGATION_GUARD_REDIRECT)?(T(z(b(e.to),{force:!0}),r).then(e=>{G(e,U.NAVIGATION_ABORTED|U.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===nn.pop&&i.go(-1,!1)}).catch(Ct),Promise.reject()):(n.delta&&i.go(-n.delta,!1),ce(e,r,o))).then(e=>{e||=ie(r,o,!1),e&&(n.delta&&!G(e,U.NAVIGATION_CANCELLED)?i.go(-n.delta,!1):n.type===nn.pop&&G(e,U.NAVIGATION_ABORTED|U.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),re(r,o,e)}).catch(Ct)})}let k=En(),oe=En(),se;function ce(e,t,n){ue(e);let r=oe.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function le(){return se&&l.value!==H?Promise.resolve():new Promise((e,t)=>{k.add([e,t])})}function ue(e){return se||(se=!e,ae(),k.list().forEach(([t,n])=>e?n(e):t()),k.reset()),e}function de(t,n,r,i){let{scrollBehavior:a}=e;if(!R||!a)return Promise.resolve();let o=!r&&mn(dn(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return m().then(()=>a(t,n,o)).then(e=>e&&un(e)).catch(e=>ce(e,t,n))}let fe=e=>i.go(e),pe,A=new Set,j={currentRoute:l,listening:!0,addRoute:h,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:y,getRoutes:ee,resolve:te,options:e,push:S,replace:C,go:fe,back:()=>fe(-1),forward:()=>fe(1),beforeEach:o.add,beforeResolve:s.add,afterEach:c.add,onError:oe.add,isReady:le,install(e){e.component(`RouterLink`,ir),e.component(`RouterView`,dr),e.config.globalProperties.$router=j,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>_(l)}),R&&!pe&&l.value===H&&(pe=!0,S(i.location).catch(e=>{}));let t={};for(let e in H)Object.defineProperty(t,e,{get:()=>l.value[e],enumerable:!0});e.provide(Cn,j),e.provide(wn,g(t)),e.provide(Tn,l);let n=e.unmount;A.add(e),e.unmount=function(){A.delete(e),A.size<1&&(u=H,O&&O(),O=null,l.value=H,pe=!1,se=!1),n()}}};function M(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return j}function pr(){return x(Cn)}function mr(e){return x(wn)}var hr=`manguito_auth`;function gr(){try{let e=localStorage.getItem(hr);return e?JSON.parse(e):null}catch{return null}}var X=pe(`auth`,()=>{let e=me(),n=gr(),r=t(n?.id??null),i=t(n?.email??null),a=t(n?.role??null),o=t(n?.mustChangePassword??!1),s=j(()=>r.value!==null),c=j(()=>a.value?e.getRoleByName(a.value)?.permissions??[]:[]),l=j(()=>a.value?e.getRoleByName(a.value)?.hierarchy_level??1/0:1/0);function u(e){r.value=e.id,i.value=e.email,a.value=e.role,o.value=e.mustChangePassword??!1;try{localStorage.setItem(hr,JSON.stringify({id:e.id,email:e.email,role:e.role,mustChangePassword:e.mustChangePassword??!1}))}catch{}}function d(){r.value=null,i.value=null,a.value=null,o.value=!1;try{localStorage.removeItem(hr)}catch{}}function f(e){return c.value.includes(e)}return{id:r,email:i,role:a,mustChangePassword:o,isAuthenticated:s,permissions:c,hierarchyLevel:l,setUser:u,clear:d,hasPermission:f}});function _r(e){return o()?(p(e),!0):!1}var vr=new WeakMap,yr=(...e)=>{let t=e[0],n=te()?.proxy;if(n==null&&!ve())throw Error(`injectLocal must be called in setup`);return n&&vr.has(n)&&t in vr.get(n)?vr.get(n)[t]:x(...e)},br=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var xr=Object.prototype.toString,Sr=e=>xr.call(e)===`[object Object]`,Z=()=>{},Cr=wr();function wr(){return br&&(window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Tr(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function Er(e,t={}){let n,r,i=Z,a=e=>{clearTimeout(e),i(),i=Z},o;return s=>{let c=h(e),l=h(t.maxWait);return n&&a(n),c<=0||l!==void 0&&l<=0?(r&&=(a(r),null),Promise.resolve(s())):new Promise((e,u)=>{i=t.rejectOnCancel?u:e,o=s,l&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},l)),n=setTimeout(()=>{r&&a(r),r=null,e(s())},c)})}}function Dr(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function Or(e){return Array.isArray(e)?e:[e]}function kr(e,t=200,n={}){return Tr(Er(t,n),e)}function Ar(e,t,n){return O(e,t,{...n,immediate:!0})}var jr=br?window:void 0;br&&window.document,br&&window.navigator,br&&window.location;function Mr(e){let t=h(e);return t?.$el??t}function Nr(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),i=j(()=>{let t=Or(h(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=Ar(()=>[i.value?.map(e=>Mr(e))??[jr].filter(e=>e!=null),Or(h(i.value?e[1]:e[0])),Or(_(i.value?e[2]:e[1])),h(i.value?e[3]:e[2])],([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=Sr(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`});return _r(n),()=>{a(),n()}}var Pr=!1;function Fr(e,t,n={}){let{window:r=jr,ignore:i=[],capture:a=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:Z,cancel:Z,trigger:Z}:Z;if(Cr&&!Pr){Pr=!0;let e={passive:!0};Array.from(r.document.body.children).forEach(t=>Nr(t,`click`,Z,e)),Nr(r.document.documentElement,`click`,Z,e)}let c=!0,l=e=>h(i).some(t=>{if(typeof t==`string`)return Array.from(r.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{let n=Mr(t);return n&&(e.target===n||e.composedPath().includes(n))}});function u(e){let t=h(e);return t&&t.$.subTree.shapeFlag===16}function d(e,t){let n=h(e),r=n.$.subTree&&n.$.subTree.children;return r==null||!Array.isArray(r)?!1:r.some(e=>e.el===t.target||t.composedPath().includes(e.el))}let f=n=>{let r=Mr(e);if(n.target!=null&&!(!(r instanceof Element)&&u(e)&&d(e,n))&&!(!r||r===n.target||n.composedPath().includes(r))){if(`detail`in n&&n.detail===0&&(c=!l(n)),!c){c=!0;return}t(n)}},p=!1,m=[Nr(r,`click`,e=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(e))},{passive:!0,capture:a}),Nr(r,`pointerdown`,t=>{let n=Mr(e);c=!l(t)&&!!(n&&!t.composedPath().includes(n))},{passive:!0}),o&&Nr(r,`blur`,n=>{setTimeout(()=>{let i=Mr(e);r.document.activeElement?.tagName===`IFRAME`&&!i?.contains(r.document.activeElement)&&t(n)},0)},{passive:!0})].filter(Boolean),g=()=>m.forEach(e=>e());return s?{stop:g,cancel:()=>{c=!1},trigger:e=>{c=!0,f(e),c=!1}}:g}function Ir(){let e=a(!1),t=te();return t&&_e(()=>{e.value=!0},t),e}function Lr(e){let t=Ir();return j(()=>(t.value,!!e()))}var Rr=Symbol(`vueuse-ssr-width`);function zr(){let e=ve()?yr(Rr,null):null;return typeof e==`number`?e:void 0}function Br(e,t={}){let{window:n=jr,ssrWidth:r=zr()}=t,i=Lr(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),o=a(typeof r==`number`),s=a(),c=a(!1);return l(()=>{if(o.value){o.value=!i.value;let t=h(e).split(`,`);c.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=Dr(n[1])),i&&a&&(a=r<=Dr(i[1])),t?!a:a});return}i.value&&(s.value=n.matchMedia(h(e)),c.value=s.value.matches)}),Nr(s,`change`,e=>{c.value=e.matches},{passive:!0}),j(()=>c.value)}var Vr=3,Hr=4e3,Q=pe(`ui`,()=>{let e=t([]),n=t(!1),r=Br(`(max-width: 820px)`),i=t(!1),a=t(null),o=t(0),s=t(!1),c=t(`Manguito CMS`);function l(t,n,r=Hr){e.value.length>=Vr&&e.value.shift();let i=crypto.randomUUID();e.value.push({id:i,variant:t,message:n,duration:r}),r!==null&&setTimeout(()=>u(i),r)}function u(t){let n=e.value.findIndex(e=>e.id===t);n!==-1&&e.value.splice(n,1)}function d(e){o.value=e}function f(e){s.value=e}function p(e){c.value=e}function m(){r.value?i.value=!i.value:n.value=!n.value}function h(){i.value=!1}return{toasts:e,sidebarCollapsed:n,isMobile:r,mobileNavOpen:i,activeModal:a,maxFileSize:o,presignedUploads:s,cmsName:c,addToast:l,removeToast:u,setMaxFileSize:d,setPresignedUploads:f,setCmsName:p,toggleSidebar:m,closeMobileNav:h}}),Ur={key:0,class:`fixed inset-0 flex items-center justify-center bg-white`,"aria-label":`Loading`},Wr=E({__name:`App`,setup(e){let n=t(!0),i=pr(),a=X(),o=me(),s=Q();async function c(e=!0){let t=await fetch(`/admin/api/config`,{credentials:`include`});if(t.status===401){e&&(a.clear(),i.push(`/admin/login`));return}if(t.ok){let e=(await t.json()).data,n=e.all_roles??[];o.setRoles(n.map(e=>({name:e.name,label:e.label,hierarchy_level:e.hierarchy_level,is_system:e.is_system,permissions:e.permissions}))),e.user&&a.setUser({id:e.user.id,email:e.user.email,role:e.user.role,mustChangePassword:e.user.must_change_password}),s.setCmsName(e.cms_name),e.media?.max_file_size&&s.setMaxFileSize(e.media.max_file_size),s.setPresignedUploads(e.media?.presigned_uploads??!1);let r=await fetch(`/admin/api/schema`,{credentials:`include`});if(r.ok){let e=await r.json();o.setFromApiSchema(e.data)}a.mustChangePassword&&i.push(`/admin/change-password`)}}return _e(async()=>{if(!a.isAuthenticated){n.value=!1;return}try{await c()}finally{n.value=!1}}),O(()=>s.cmsName,e=>{document.title=e},{immediate:!0}),O(()=>a.isAuthenticated,async(e,t)=>{if(e&&!t){n.value=!0;try{await c(!1)}catch{}finally{n.value=!1}}}),(e,t)=>{let i=ae(`router-view`);return n.value?(r(),w(`div`,Ur,[...t[0]||=[S(`div`,{class:`h-10 w-10 animate-spin rounded-full border-4 border-gray-200 border-t-gray-600`,role:`status`},null,-1)]])):(r(),k(i,{key:1}))}}});function Gr(){let e=X(),t=me();function n(t){return e.permissions.includes(t)}function r(){return t.roles.filter(t=>t.hierarchy_level>e.hierarchyLevel&&t.name!==`admin`)}return{can:n,rolesBelow:r}}function Kr(){let e=pr(),t=X();async function n(i,a,o=!1){let s=await fetch(`/admin/api${i}`,{...a,credentials:`include`,headers:{"Content-Type":`application/json`,...a?.headers}});return s.status===401&&!o?await r()?n(i,a,!0):(t.clear(),e.push(`/admin/login`),{ok:!1,error:{code:`UNAUTHORIZED`,message:`Session expired.`}}):s.json()}async function r(){return(await fetch(`/admin/api/auth/refresh`,{method:`POST`,credentials:`include`})).ok}function i(e){return n(e,{method:`GET`})}function a(e,t){return n(e,{method:`POST`,body:JSON.stringify(t)})}function o(e,t){return n(e,{method:`PATCH`,body:JSON.stringify(t)})}function s(e,t){return n(e,{method:`PUT`,body:JSON.stringify(t)})}function c(e){return n(e,{method:`DELETE`})}return{get:i,post:a,patch:o,put:s,del:c}}var qr={class:`flex items-center gap-[11px] px-[17px] pb-[14px] pt-[18px]`},Jr={key:0,class:`overflow-hidden`},Yr={class:`whitespace-nowrap text-[15px] font-bold tracking-tight text-ink`},Xr={class:`flex flex-1 flex-col overflow-y-auto overflow-x-hidden px-3 pb-2.5 pt-1`},Zr=[`aria-expanded`],Qr={class:`min-h-0 overflow-hidden`},$r={key:0,class:`overflow-hidden whitespace-nowrap`},ei={key:0},ti=[`aria-expanded`],ni={class:`min-h-0 overflow-hidden`},ri={key:0,class:`overflow-hidden whitespace-nowrap`},ii={key:0,class:`overflow-hidden whitespace-nowrap`},ai={key:0,class:`overflow-hidden whitespace-nowrap`},oi={key:0,class:`overflow-hidden whitespace-nowrap`},si={class:`border-t border-divider p-3`},ci={class:`flex items-center gap-2.5 p-1.5`},li={class:`flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-[10px] bg-gradient-to-br from-[#6D5EF0] to-[#A06BF0] text-[14px] font-bold text-white`},ui={key:0,class:`overflow-hidden`},di={class:`whitespace-nowrap text-[13px] font-semibold text-[#2C2C44]`},fi={key:0,class:`whitespace-nowrap text-[11.5px] text-[#9A9AB0]`},pi={key:0,class:`whitespace-nowrap`},mi=E({__name:`Sidebar`,setup(e){let n=me(),i=X(),a=Q(),{can:o}=Gr(),s=pr(),c=Kr(),l=j(()=>Object.values(n.contentTypes)),f=j(()=>Object.values(n.taxonomyTypes)),p=j(()=>i.role?n.getRoleByName(i.role)?.label??i.role:null),m=t(!0),h=t(!0),g=j(()=>!a.isMobile&&a.sidebarCollapsed),v=`/admin`;async function ee(){await c.post(`/auth/logout`,{}),i.clear(),s.push(`${v}/login`)}function y(){return i.email?i.email.charAt(0).toUpperCase():`?`}return(e,t)=>{let n=ae(`RouterLink`);return r(),w(`aside`,{class:C([`flex h-full flex-col border-r border-card-border bg-white transition-[width] duration-300`,_(a).isMobile?`fixed inset-y-0 left-0 z-50 w-[258px] shadow-2xl transition-transform duration-300`:`relative shrink-0 overflow-hidden`,_(a).isMobile&&!_(a).mobileNavOpen?`-translate-x-full`:`translate-x-0`,!_(a).isMobile&&(g.value?`w-[74px]`:`w-[258px]`)]),"aria-label":`Main navigation`},[S(`div`,qr,[t[3]||=de(`<div class="flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-[11px] bg-gradient-to-br from-[#6D5EF0] to-[#5B57E8] shadow-[0_4px_12px_rgba(91,87,232,0.36)]"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.1" stroke-linecap="round"><path d="M4 7h16"></path><path d="M4 12h10"></path><path d="M4 17h13"></path></svg></div>`,1),g.value?N(``,!0):(r(),w(`div`,Jr,[S(`div`,Yr,P(_(a).cmsName),1),t[2]||=S(`div`,{class:`whitespace-nowrap text-[11px] font-medium text-faint`},`Admin panel`,-1)]))]),S(`div`,Xr,[S(`div`,null,[g.value?N(``,!0):(r(),w(`button`,{key:0,type:`button`,class:`mb-1 mt-4 flex w-full items-center justify-between px-2 text-[11px] font-bold uppercase tracking-[.09em] text-faint hover:text-muted`,"aria-expanded":m.value,onClick:t[0]||=e=>m.value=!m.value},[t[5]||=S(`span`,null,`Content`,-1),(r(),w(`svg`,{class:C([`h-3 w-3 text-[#C2C2D0] transition-transform`,m.value?``:`-rotate-90`]),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2.5`},[...t[4]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M19 9l-7 7-7-7`},null,-1)]],2))],8,Zr)),S(`div`,{class:`grid transition-[grid-template-rows] duration-300 ease-in-out`,style:oe({gridTemplateRows:g.value||m.value?`1fr`:`0fr`})},[S(`div`,Qr,[(r(!0),w(re,null,d(l.value,e=>(r(),k(n,{key:e.name,to:`${_(v)}/content/${e.name}`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[6]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M14 3v4a2 2 0 0 0 2 2h4`}),S(`path`,{d:`M5 3h9l5 5v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`}),S(`path`,{d:`M9 13h6`}),S(`path`,{d:`M9 17h5`})])],-1),g.value?N(``,!0):(r(),w(`span`,$r,P(e.label),1))]),_:2},1032,[`to`,`class`]))),128))])],4)]),f.value.length>0?(r(),w(`div`,ei,[g.value?N(``,!0):(r(),w(`button`,{key:0,type:`button`,class:`mb-1 mt-4 flex w-full items-center justify-between px-2 text-[11px] font-bold uppercase tracking-[.09em] text-faint hover:text-muted`,"aria-expanded":h.value,onClick:t[1]||=e=>h.value=!h.value},[t[8]||=S(`span`,null,`Taxonomy`,-1),(r(),w(`svg`,{class:C([`h-3 w-3 text-[#C2C2D0] transition-transform`,h.value?``:`-rotate-90`]),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2.5`},[...t[7]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M19 9l-7 7-7-7`},null,-1)]],2))],8,ti)),S(`div`,{class:`grid transition-[grid-template-rows] duration-300 ease-in-out`,style:oe({gridTemplateRows:g.value||h.value?`1fr`:`0fr`})},[S(`div`,ni,[(r(!0),w(re,null,d(f.value,e=>(r(),k(n,{key:e.name,to:`${_(v)}/taxonomy/${e.name}`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[9]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M20.6 13.4l-7.2 7.2a2 2 0 0 1-2.8 0L2 12V2h10l8.6 8.6a2 2 0 0 1 0 2.8z`}),S(`path`,{d:`M7 7h.01`})])],-1),g.value?N(``,!0):(r(),w(`span`,ri,P(e.label),1))]),_:2},1032,[`to`,`class`]))),128))])],4)])):N(``,!0),t[13]||=S(`div`,{class:`my-3.5 mx-2.5 h-px bg-divider`},null,-1),_(o)(`media:read`)?(r(),k(n,{key:1,to:`${_(v)}/media`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[10]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`}),S(`path`,{d:`M8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z`}),S(`path`,{d:`M21 15l-5-5L5 21`})])],-1),g.value?N(``,!0):(r(),w(`span`,ii,`Media`))]),_:1},8,[`to`,`class`])):N(``,!0),_(o)(`users:read`)?(r(),k(n,{key:2,to:`${_(v)}/users`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[11]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`}),S(`path`,{d:`M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z`}),S(`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.9`}),S(`path`,{d:`M16 3.1a4 4 0 0 1 0 7.8`})])],-1),g.value?N(``,!0):(r(),w(`span`,ai,`Users`))]),_:1},8,[`to`,`class`])):N(``,!0),_(o)(`roles:read`)?(r(),k(n,{key:3,to:`${_(v)}/roles`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[12]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z`})])],-1),g.value?N(``,!0):(r(),w(`span`,oi,`Roles`))]),_:1},8,[`to`,`class`])):N(``,!0)]),S(`div`,si,[S(`div`,ci,[S(`div`,li,P(y()),1),g.value?N(``,!0):(r(),w(`div`,ui,[S(`div`,di,P(_(i).email),1),p.value?(r(),w(`div`,fi,P(p.value),1)):N(``,!0)]))]),S(`button`,{type:`button`,class:C([`mt-1 flex w-full items-center rounded-[10px] py-[9px] text-left text-[13.5px] font-medium text-[#74748C] transition-colors hover:bg-[#FDF2F4] hover:text-[#E1495B]`,g.value?`justify-center px-0`:`gap-[11px] px-2`]),onClick:ee},[t[14]||=de(`<span class="flex shrink-0"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><path d="M16 17l5-5-5-5"></path><path d="M21 12H9"></path></svg></span>`,1),g.value?N(``,!0):(r(),w(`span`,pi,`Log out`))],2)])],2)}}}),hi={class:`flex h-[60px] shrink-0 items-center gap-[13px] border-b border-card-border bg-white/85 px-4 backdrop-blur-md`},gi={key:0,width:`21`,height:`21`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.9`,"stroke-linecap":`round`},_i={key:1,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},vi={class:`flex min-w-0 items-center gap-[9px]`},yi={class:`overflow-hidden truncate whitespace-nowrap text-[14.5px] font-semibold text-[#2C2C44]`},bi=E({__name:`Topbar`,setup(e){let t=Q();return(e,n)=>(r(),w(`header`,hi,[S(`button`,{type:`button`,class:`flex h-[38px] w-[38px] items-center justify-center rounded-[10px] text-[#4A4A60] transition-colors hover:bg-[#F1F0F7]`,"aria-label":`Toggle sidebar`,onClick:n[0]||=e=>_(t).toggleSidebar()},[_(t).isMobile?(r(),w(`svg`,gi,[...n[1]||=[S(`path`,{d:`M3 6h18`},null,-1),S(`path`,{d:`M3 12h18`},null,-1),S(`path`,{d:`M3 18h18`},null,-1)]])):(r(),w(`svg`,_i,[...n[2]||=[S(`path`,{d:`M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`},null,-1),S(`path`,{d:`M9 3v18`},null,-1)]]))]),S(`div`,vi,[n[3]||=S(`span`,{class:`shrink-0 rounded-[7px] bg-indigo-50 px-[9px] py-[3px] text-[10.5px] font-bold tracking-[.05em] text-indigo-600`},` ADMIN `,-1),S(`span`,yi,P(_(t).cmsName),1)]),n[4]||=S(`div`,{class:`flex-1`},null,-1)]))}}),xi={class:`mt-10 border-t border-gray-200 px-1 py-5`},Si={class:`text-xs text-gray-400`},Ci=E({__name:`Footer`,setup(e){let t=Q();return(e,n)=>(r(),w(`footer`,xi,[S(`p`,Si,P(_(t).cmsName),1)]))}}),wi={"aria-live":`polite`,"aria-atomic":`false`,class:`pointer-events-none fixed bottom-4 right-4 z-50 flex flex-col gap-2`},Ti={class:`flex-1 text-sm`},Ei=[`aria-label`,`onClick`],Di=E({__name:`ToastContainer`,setup(e){let t=Q(),n=j(()=>[...t.toasts].reverse()),i={success:`bg-green-600 text-white`,error:`bg-red-600 text-white`,warning:`bg-amber-500 text-white`,info:`bg-blue-600 text-white`};return(e,a)=>(r(),w(`div`,wi,[(r(!0),w(re,null,d(n.value,e=>(r(),w(`div`,{key:e.id,class:C([`pointer-events-auto flex w-80 items-start gap-3 rounded-lg px-4 py-3 shadow-lg`,i[e.variant]??`bg-blue-600 text-white`]),role:`status`},[S(`span`,Ti,P(e.message),1),S(`button`,{type:`button`,class:`shrink-0 opacity-80 hover:opacity-100`,"aria-label":`Dismiss: ${e.message}`,onClick:n=>_(t).removeToast(e.id)},` × `,8,Ei)],2))),128))]))}}),Oi={class:`flex h-screen overflow-hidden bg-surface`},ki={class:`flex min-w-0 flex-1 flex-col`},Ai={class:`flex-1 overflow-y-auto p-6`},ji=E({__name:`AppShell`,setup(e){let t=Q();return(e,n)=>{let i=ae(`router-view`);return r(),w(`div`,Oi,[D(mi),_(t).isMobile&&_(t).mobileNavOpen?(r(),w(`div`,{key:0,class:`fixed inset-0 z-40 bg-[rgba(20,20,40,0.4)] backdrop-blur-[2px]`,onClick:n[0]||=e=>_(t).closeMobileNav()})):N(``,!0),S(`div`,ki,[D(bi),S(`main`,Ai,[D(i),D(Ci)])]),D(Di)])}}}),Mi=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Ni=function(e){return`/`+e},Pi={},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=Ni(t,n),t=s(t),t in Pi)return;Pi[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Mi,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Fi=[{path:`/admin/login`,name:`login`,component:()=>$(()=>import(`./LoginView-BObIe0zr.js`),__vite__mapDeps([0,1]))},{path:`/admin`,component:ji,meta:{requiresAuth:!0},children:[{path:``,redirect:`/admin/media`},{path:`change-password`,name:`change-password`,component:()=>$(()=>import(`./ChangePasswordView-v3tSL_0C.js`),__vite__mapDeps([2,1]))},{path:`content/:type`,name:`content-list`,component:()=>$(()=>import(`./ContentListView-i3MwjmNq.js`),__vite__mapDeps([3,1,4,5]))},{path:`content/:type/new`,name:`content-new`,component:()=>$(()=>import(`./ContentFormView-DneaTAaq.js`),__vite__mapDeps([6,1,7,8,9,4,10,11]))},{path:`content/:type/settings`,name:`content-settings`,component:()=>$(()=>import(`./ContentSettingsView-4cpotfsZ.js`),__vite__mapDeps([12,1,9])),meta:{permission:`content:edit`}},{path:`content/:type/:id`,name:`content-edit`,component:()=>$(()=>import(`./ContentFormView-DneaTAaq.js`),__vite__mapDeps([6,1,7,8,9,4,10,11]))},{path:`taxonomy/:type`,name:`taxonomy-list`,component:()=>$(()=>import(`./TaxonomyListView-Cy3iI1oC.js`),__vite__mapDeps([13,1,5,14]))},{path:`taxonomy/:type/new`,name:`taxonomy-new`,component:()=>$(()=>import(`./TaxonomyFormView-Chd_LUly.js`),__vite__mapDeps([15,1,7,8,9,10,14]))},{path:`taxonomy/:type/:id`,name:`taxonomy-edit`,component:()=>$(()=>import(`./TaxonomyFormView-Chd_LUly.js`),__vite__mapDeps([15,1,7,8,9,10,14]))},{path:`media`,name:`media-library`,component:()=>$(()=>import(`./MediaLibraryView-DojOE-wL.js`),__vite__mapDeps([16,1,9,10,11,8,5,17]))},{path:`media/:id`,name:`media-detail`,component:()=>$(()=>import(`./MediaDetailView-BKTDY6Ne.js`),__vite__mapDeps([18,1,9,10,17]))},{path:`users`,name:`user-list`,component:()=>$(()=>import(`./UserListView-z6weJ8UF.js`),__vite__mapDeps([19,1,20])),meta:{permission:`users:read`}},{path:`users/new`,name:`user-new`,component:()=>$(()=>import(`./UserFormView-B2m4OdJV.js`),__vite__mapDeps([21,1,9,10,20])),meta:{permission:`users:read`}},{path:`users/:id`,name:`user-edit`,component:()=>$(()=>import(`./UserFormView-B2m4OdJV.js`),__vite__mapDeps([21,1,9,10,20])),meta:{permission:`users:read`}},{path:`roles`,name:`roles`,component:()=>$(()=>import(`./RolesView-DO-Tb2Yr.js`),__vite__mapDeps([22,1]))}]}],Ii=fr({history:Pn(),routes:Fi});Ii.beforeEach(e=>{let t=X();return e.path===`/admin/login`?t.isAuthenticated?{path:`/admin/media`}:!0:t.isAuthenticated?t.mustChangePassword&&e.path!==`/admin/change-password`?{path:`/admin/change-password`}:!t.mustChangePassword&&e.path===`/admin/change-password`?{path:`/admin/media`}:!0:{path:`/admin/login`,query:{redirect:e.fullPath}}}),Ii.beforeEach(e=>{let t=X();if(e.meta.permission&&!t.hasPermission(e.meta.permission))return{path:`/admin/media`}});var Li=_t(Wr);Li.use(se()),Li.use(Ii),Li.mount(`#app`);export{kr as a,pr as c,pt as d,Fr as i,ct as l,Gr as n,X as o,Q as r,mr as s,Kr as t,st as u};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-D0fvOnS1.js","assets/schema-B-RKX_ep.js","assets/ChangePasswordView-C9NzzFbG.js","assets/ContentListView-BGIym0gL.js","assets/content--2XYr_UQ.js","assets/Pagination-BIf7mQy7.js","assets/ContentFormView-B3P9YP72.js","assets/field-defaults-B5VUJSnc.js","assets/MediaThumbnail-Ckiw3oQ9.js","assets/useNotification-DT7B0CXj.js","assets/ConfirmDialog-B7nxdDge.js","assets/useTabIndicator-CvEsGBJh.js","assets/ContentSettingsView-Cy4_2nQO.js","assets/TaxonomyListView-fH2lIkhZ.js","assets/taxonomy-DC-6wyg3.js","assets/TaxonomyFormView-DxubNh6h.js","assets/MediaLibraryView-CkHbclTm.js","assets/media-DvQfZD4o.js","assets/MediaDetailView-DdB2PX-3.js","assets/UserListView-B-umho5v.js","assets/users-DVibZ_HD.js","assets/UserFormView-DIAspRUO.js","assets/RolesView-DO-Tb2Yr.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,B as t,D as n,E as r,G as i,H as a,I as o,J as s,K as c,M as l,N as u,O as d,Q as f,R as p,S as m,U as h,V as g,W as _,X as v,Y as ee,Z as y,_ as te,at as b,b as x,c as S,ct as C,d as w,et as T,f as ne,g as E,h as D,i as re,it as ie,j as O,k as ae,l as k,lt as oe,n as se,nt as ce,o as le,ot as ue,p as de,q as fe,r as pe,rt as A,s as j,st as M,t as me,tt as he,u as N,ut as P,v as ge,w as _e,y as ve,z as ye}from"./schema-B-RKX_ep.js";var be=void 0,xe=typeof window<`u`&&window.trustedTypes;if(xe)try{be=xe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Se=be?e=>be.createHTML(e):e=>e,Ce=`http://www.w3.org/2000/svg`,we=`http://www.w3.org/1998/Math/MathML`,F=typeof document<`u`?document:null,Te=F&&F.createElement(`template`),Ee={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?F.createElementNS(Ce,e):t===`mathml`?F.createElementNS(we,e):n?F.createElement(e,{is:n}):F.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>F.createTextNode(e),createComment:e=>F.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>F.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{Te.innerHTML=Se(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Te.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},De=Symbol(`_vtc`);function Oe(e,t,n){let r=e[De];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var ke=Symbol(`_vod`),Ae=Symbol(`_vsh`),je=Symbol(``),Me=/(?:^|;)\s*display\s*:/;function Ne(e,t,n){let r=e.style,i=A(n),a=!1;if(n&&!i){if(t)if(A(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Fe(r,t,``)}else for(let e in t)n[e]??Fe(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Fe(r,i,``):ze(e,i,!A(t)&&t?t[i]:void 0,o)||Fe(r,i,o)}}else if(i){if(t!==n){let e=r[je];e&&(n+=`;`+e),r.cssText=n,a=Me.test(n)}}else t&&e.removeAttribute(`style`);ke in e&&(e[ke]=a?r.display:``,e[Ae]&&(r.display=`none`))}var Pe=/\s*!important$/;function Fe(e,t,n){if(y(n))n.forEach(n=>Fe(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Re(e,t);Pe.test(n)?e.setProperty(s(r),n.replace(Pe,``),`important`):e[r]=n}}var Ie=[`Webkit`,`Moz`,`ms`],Le={};function Re(e,t){let n=Le[t];if(n)return n;let r=i(t);if(r!==`filter`&&r in e)return Le[t]=r;r=c(r);for(let n=0;n<Ie.length;n++){let i=Ie[n]+r;if(i in e)return Le[t]=i}return t}function ze(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&A(r)&&n===r}var Be=`http://www.w3.org/1999/xlink`;function Ve(e,t,n,r,i,a=ce(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Be,t.slice(6,t.length)):e.setAttributeNS(Be,t,n):n==null||a&&!ee(n)?e.removeAttribute(t):e.setAttribute(t,a?``:ie(n)?String(n):n)}function He(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?Se(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=ee(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function I(e,t,n,r){e.addEventListener(t,n,r)}function Ue(e,t,n,r){e.removeEventListener(t,n,r)}var We=Symbol(`_vei`);function Ge(e,t,n,r,i=null){let a=e[We]||(e[We]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Je(t);r?I(e,n,a[t]=Qe(r,i),s):o&&(Ue(e,n,o,s),a[t]=void 0)}}var Ke=/(Once|Passive|Capture)$/,qe=/^on:?(?:Once|Passive|Capture)$/;function Je(e){let t,n;for(;(n=e.match(Ke))&&!qe.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):s(e.slice(2)),t]}var Ye=0,Xe=Promise.resolve(),Ze=()=>Ye||=(Xe.then(()=>Ye=0),Date.now());function Qe(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(y(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&le(e,t,5,a)}}else le(r,t,5,[e])};return n.value=e,n.attached=Ze(),n}var $e=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,et=(t,n,r,a,o,s)=>{let c=o===`svg`;n===`class`?Oe(t,a,c):n===`style`?Ne(t,r,a):T(n)?e(n)||Ge(t,n,r,a,s):(n[0]===`.`?(n=n.slice(1),!0):n[0]===`^`?(n=n.slice(1),!1):tt(t,n,a,c))?(He(t,n,a),!t.tagName.includes(`-`)&&(n===`value`||n===`checked`||n===`selected`)&&Ve(t,n,a,c,s,n!==`value`)):t._isVueCE&&(nt(t,n)||t._def.__asyncLoader&&(/[A-Z]/.test(n)||!A(a)))?He(t,i(n),a,s,n):(n===`true-value`?t._trueValue=a:n===`false-value`&&(t._falseValue=a),Ve(t,n,a,c))};function tt(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&$e(t)&&f(n));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`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return $e(t)&&A(n)?!1:t in e}function nt(e,t){let n=e._def.props;if(!n)return!1;let r=i(t);return Array.isArray(n)?n.some(e=>i(e)===r):Object.keys(n).some(e=>i(e)===r)}var rt=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return y(t)?e=>v(t,e):t};function it(e){e.target.composing=!0}function at(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var L=Symbol(`_assign`);function ot(e,t,n){return t&&(e=e.trim()),n&&(e=M(e)),e}var st={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[L]=rt(i);let a=r||i.props&&i.props.type===`number`;I(e,t?`change`:`input`,t=>{t.target.composing||e[L](ot(e.value,n,a))}),(n||a)&&I(e,`change`,()=>{e.value=ot(e.value,n,a)}),t||(I(e,`compositionstart`,it),I(e,`compositionend`,at),I(e,`change`,at))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[L]=rt(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?M(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ct={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=he(t);I(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?M(ut(e)):ut(e));e[L](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,m(()=>{e._assigning=!1})}),e[L]=rt(r)},mounted(e,{value:t}){lt(e,t)},beforeUpdate(e,t,n){e[L]=rt(n)},updated(e,{value:t}){e._assigning||lt(e,t)}};function lt(e,t){let n=e.multiple,r=y(t);if(!(n&&!r&&!he(t))){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=ut(a);if(n)if(r){let e=typeof o;e===`string`||e===`number`?a.selected=t.some(e=>String(e)===String(o)):a.selected=ue(t,o)>-1}else a.selected=t.has(o);else if(b(ut(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ut(e){return`_value`in e?e._value:e.value}var dt=[`ctrl`,`shift`,`alt`,`meta`],ft={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)=>dt.some(n=>e[`${n}Key`]&&!t.includes(n))},pt=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=ft[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},mt=fe({patchProp:et},Ee),ht;function gt(){return ht||=ne(mt)}var _t=((...e)=>{let t=gt().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=yt(e);if(!r)return;let i=t._component;!f(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,vt(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function vt(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function yt(e){return A(e)?document.querySelector(e):e}var R=typeof document<`u`;function bt(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function xt(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&bt(e.default)}var z=Object.assign;function St(e,t){let n={};for(let r in t){let i=t[r];n[r]=B(i)?i.map(e):e(i)}return n}var Ct=()=>{},B=Array.isArray;function wt(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var Tt=/#/g,Et=/&/g,Dt=/\//g,Ot=/=/g,kt=/\?/g,At=/\+/g,jt=/%5B/g,Mt=/%5D/g,Nt=/%5E/g,Pt=/%60/g,Ft=/%7B/g,It=/%7C/g,Lt=/%7D/g,Rt=/%20/g;function zt(e){return e==null?``:encodeURI(``+e).replace(It,`|`).replace(jt,`[`).replace(Mt,`]`)}function Bt(e){return zt(e).replace(Ft,`{`).replace(Lt,`}`).replace(Nt,`^`)}function Vt(e){return zt(e).replace(At,`%2B`).replace(Rt,`+`).replace(Tt,`%23`).replace(Et,`%26`).replace(Pt,"`").replace(Ft,`{`).replace(Lt,`}`).replace(Nt,`^`)}function Ht(e){return Vt(e).replace(Ot,`%3D`)}function Ut(e){return zt(e).replace(Tt,`%23`).replace(kt,`%3F`)}function Wt(e){return Ut(e).replace(Dt,`%2F`)}function Gt(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var Kt=/\/$/,qt=e=>e.replace(Kt,``);function Jt(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=tn(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:Gt(o)}}function Yt(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function Xt(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function Zt(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&V(t.matched[r],n.matched[i])&&Qt(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function V(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Qt(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!$t(e[n],t[n]))return!1;return!0}function $t(e,t){return B(e)?en(e,t):B(t)?en(t,e):e?.valueOf()===t?.valueOf()}function en(e,t){return B(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function tn(e,t){if(e.startsWith(`/`))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`)if(s===`..`)a>1&&a--;else break;return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var H={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0},nn=function(e){return e.pop=`pop`,e.push=`push`,e}({}),rn=function(e){return e.back=`back`,e.forward=`forward`,e.unknown=``,e}({});function an(e){if(!e)if(R){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^\/]+/,``)}else e=`/`;return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),qt(e)}var on=/^[^#]+#/;function sn(e,t){return e.replace(on,`#`)+t}function cn(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var ln=()=>({left:window.scrollX,top:window.scrollY});function un(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=cn(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function dn(e,t){return(history.state?history.state.position-t:-1)+e}var fn=new Map;function pn(e,t){fn.set(e,t)}function mn(e){let t=fn.get(e);return fn.delete(e),t}function hn(e){return typeof e==`string`||e&&typeof e==`object`}function gn(e){return typeof e==`string`||typeof e==`symbol`}var U=function(e){return e[e.MATCHER_NOT_FOUND=1]=`MATCHER_NOT_FOUND`,e[e.NAVIGATION_GUARD_REDIRECT=2]=`NAVIGATION_GUARD_REDIRECT`,e[e.NAVIGATION_ABORTED=4]=`NAVIGATION_ABORTED`,e[e.NAVIGATION_CANCELLED=8]=`NAVIGATION_CANCELLED`,e[e.NAVIGATION_DUPLICATED=16]=`NAVIGATION_DUPLICATED`,e}({}),_n=Symbol(``);U.MATCHER_NOT_FOUND,U.NAVIGATION_GUARD_REDIRECT,U.NAVIGATION_ABORTED,U.NAVIGATION_CANCELLED,U.NAVIGATION_DUPLICATED;function W(e,t){return z(Error(),{type:e,[_n]:!0},t)}function G(e,t){return e instanceof Error&&_n in e&&(t==null||!!(e.type&t))}function vn(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(At,` `),i=r.indexOf(`=`),a=Gt(i<0?r:r.slice(0,i)),o=i<0?null:Gt(r.slice(i+1));if(a in t){let e=t[a];B(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function yn(e){let t=``;for(let n in e){let r=e[n];if(n=Ht(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}(B(r)?r.map(e=>e&&Vt(e)):[r&&Vt(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function bn(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=B(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}var xn=Symbol(``),Sn=Symbol(``),Cn=Symbol(``),wn=Symbol(``),Tn=Symbol(``);function En(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function K(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(W(U.NAVIGATION_ABORTED,{from:n,to:t})):e instanceof Error?c(e):hn(e)?c(W(U.NAVIGATION_GUARD_REDIRECT,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Dn(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(!(t!==`beforeRouteEnter`&&!o.instances[e]))if(bt(s)){let c=(s.__vccOpts||s)[t];c&&a.push(K(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=xt(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&K(c,n,r,o,e,i)()}))}}return a}function On(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>V(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>V(e,s))||i.push(s))}return[n,r,i]}var kn=()=>location.protocol+`//`+location.host;function An(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),Xt(n,``)}return Xt(n,e)+r+i}function jn(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=An(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:nn.pop,direction:u?u>0?rn.forward:rn.back:rn.unknown})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){if(document.visibilityState===`hidden`){let{history:e}=window;if(!e.state)return;e.replaceState(z({},e.state,{scroll:ln()}),``)}}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u),document.removeEventListener(`visibilitychange`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),document.addEventListener(`visibilitychange`,u),{pauseListeners:c,listen:l,destroy:d}}function Mn(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?ln():null}}function Nn(e){let{history:t,location:n}=window,r={value:An(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:kn()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,z({},t.state,Mn(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=z({},i.value,t.state,{forward:e,scroll:ln()});a(o.current,o,!0),a(e,z({},Mn(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function Pn(e){e=an(e);let t=Nn(e),n=jn(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=z({location:``,base:e,go:r,createHref:sn.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}var q=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.Group=2]=`Group`,e}({}),J=function(e){return e[e.Static=0]=`Static`,e[e.Param=1]=`Param`,e[e.ParamRegExp=2]=`ParamRegExp`,e[e.ParamRegExpEnd=3]=`ParamRegExpEnd`,e[e.EscapeNext=4]=`EscapeNext`,e}(J||{}),Fn={type:q.Static,value:``},In=/[a-zA-Z0-9_]/;function Ln(e){if(!e)return[[]];if(e===`/`)return[[Fn]];if(!e.startsWith(`/`))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=J.Static,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===J.Static?a.push({type:q.Static,value:l}):n===J.Param||n===J.ParamRegExp||n===J.ParamRegExpEnd?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:q.Param,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;){if(c=e[s++],c===`\\`&&n!==J.ParamRegExp){r=n,n=J.EscapeNext;continue}switch(n){case J.Static:c===`/`?(l&&d(),o()):c===`:`?(d(),n=J.Param):f();break;case J.EscapeNext:f(),n=r;break;case J.Param:c===`(`?n=J.ParamRegExp:In.test(c)?f():(d(),n=J.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case J.ParamRegExp:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=J.ParamRegExpEnd:u+=c;break;case J.ParamRegExpEnd:d(),n=J.Static,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`);break}}return n===J.ParamRegExp&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var Rn=`[^/]+?`,zn={sensitive:!1,strict:!1,start:!0,end:!0},Y=function(e){return e[e._multiplier=10]=`_multiplier`,e[e.Root=90]=`Root`,e[e.Segment=40]=`Segment`,e[e.SubSegment=30]=`SubSegment`,e[e.Static=40]=`Static`,e[e.Dynamic=20]=`Dynamic`,e[e.BonusCustomRegExp=10]=`BonusCustomRegExp`,e[e.BonusWildcard=-50]=`BonusWildcard`,e[e.BonusRepeatable=-20]=`BonusRepeatable`,e[e.BonusOptional=-8]=`BonusOptional`,e[e.BonusStrict=.7000000000000001]=`BonusStrict`,e[e.BonusCaseSensitive=.25]=`BonusCaseSensitive`,e}(Y||{}),Bn=/[.+*?^${}()[\]/\\]/g;function Vn(e,t){let n=z({},zn,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[Y.Root];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=Y.Segment+(n.sensitive?Y.BonusCaseSensitive:0);if(o.type===q.Static)r||(i+=`/`),i+=o.value.replace(Bn,`\\$&`),s+=Y.Static;else if(o.type===q.Param){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||Rn;if(u!==Rn){s+=Y.BonusCustomRegExp;try{`${u}`}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=Y.Dynamic,c&&(s+=Y.BonusOptional),n&&(s+=Y.BonusRepeatable),u===`.*`&&(s+=Y.BonusWildcard)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=Y.BonusStrict}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===q.Static)n+=e.value;else if(e.type===q.Param){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if(B(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=B(c)?c.join(`/`):c;if(!l)if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`);n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function Hn(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===Y.Static+Y.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Y.Static+Y.Segment?1:-1:0}function Un(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=Hn(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(Wn(r))return 1;if(Wn(i))return-1}return i.length-r.length}function Wn(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var Gn={strict:!1,end:!0,sensitive:!1};function Kn(e,t,n){let r=z(Vn(Ln(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function qn(e,t){let n=[],r=new Map;t=wt(Gn,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=Yn(e);s.aliasOf=r&&r.record;let l=wt(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(Yn(z({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&u[0]!==`/`){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=Kn(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!Zn(d)&&o(e.name)),tr(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:Ct}function o(e){if(gn(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=$n(e,n);n.splice(t,0,e),e.record.name&&!Zn(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw W(U.MATCHER_NOT_FOUND,{location:e});s=i.record.name,a=z(Jn(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&Jn(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name);else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw W(U.MATCHER_NOT_FOUND,{location:e,currentLocation:t});s=i.record.name,a=z({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:Qn(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function Jn(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function Yn(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Xn(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 Xn(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function Zn(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Qn(e){return e.reduce((e,t)=>z(e,t.meta),{})}function $n(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;Un(e,t[i])<0?r=i:n=i+1}let i=er(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function er(e){let t=e;for(;t=t.parent;)if(tr(t)&&Un(e,t)===0)return t}function tr({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function nr(e){let t=x(Cn),n=x(wn),r=j(()=>{let n=_(e.to);return t.resolve(n)}),i=j(()=>{let{matched:e}=r.value,{length:t}=e,i=e[t-1],a=n.matched;if(!i||!a.length)return-1;let o=a.findIndex(V.bind(null,i));if(o>-1)return o;let s=sr(e[t-2]);return t>1&&sr(i)===s&&a[a.length-1].path!==s?a.findIndex(V.bind(null,e[t-2])):o}),a=j(()=>i.value>-1&&or(n.params,r.value.params)),o=j(()=>i.value>-1&&i.value===n.matched.length-1&&Qt(n.params,r.value.params));function s(n={}){if(ar(n)){let n=t[_(e.replace)?`replace`:`push`](_(e.to)).catch(Ct);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>n),n}return Promise.resolve()}return{route:r,href:j(()=>r.value.href),isActive:a,isExactActive:o,navigate:s}}function rr(e){return e.length===1?e[0]:e}var ir=E({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:nr,setup(e,{slots:t}){let n=ye(nr(e)),{options:r}=x(Cn),i=j(()=>({[cr(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[cr(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&rr(t.default(n));return e.custom?r:ge(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function ar(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){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function or(e,t){for(let n in t){let r=t[n],i=e[n];if(typeof r==`string`){if(r!==i)return!1}else if(!B(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}return!0}function sr(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var cr=(e,t,n)=>e??t??n,lr=E({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:r,slots:i}){let a=x(Tn),o=j(()=>e.route||a.value),s=x(Sn,0),c=j(()=>{let e=_(s),{matched:t}=o.value,n;for(;(n=t[e])&&!n.components;)e++;return e}),l=j(()=>o.value.matched[c.value]);n(Sn,j(()=>c.value+1)),n(xn,l),n(Tn,o);let u=t();return O(()=>[u.value,l.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!V(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let t=o.value,n=e.name,a=l.value,s=a&&a.components[n];if(!s)return ur(i.default,{Component:s,route:t});let c=a.props[n],d=ge(s,z({},c?c===!0?t.params:typeof c==`function`?c(t):c:null,r,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(a.instances[n]=null)},ref:u}));return ur(i.default,{Component:d,route:t})||d}}});function ur(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var dr=lr;function fr(e){let t=qn(e.routes,e),n=e.parseQuery||vn,r=e.stringifyQuery||yn,i=e.history,o=En(),s=En(),c=En(),l=a(H),u=H;R&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let d=St.bind(null,e=>``+e),f=St.bind(null,Wt),p=St.bind(null,Gt);function h(e,n){let r,i;return gn(e)?(r=t.getRecordMatcher(e),i=n):i=e,t.addRoute(i,r)}function v(e){let n=t.getRecordMatcher(e);n&&t.removeRoute(n)}function ee(){return t.getRoutes().map(e=>e.record)}function y(e){return!!t.getRecordMatcher(e)}function te(e,a){if(a=z({},a||l.value),typeof e==`string`){let r=Jt(n,e,a.path),o=t.resolve({path:r.path},a),s=i.createHref(r.fullPath);return z(r,o,{params:p(o.params),hash:Gt(r.hash),redirectedFrom:void 0,href:s})}let o;if(e.path!=null)o=z({},e,{path:Jt(n,e.path,a.path).path});else{let t=z({},e.params);for(let e in t)t[e]??delete t[e];o=z({},e,{params:f(t)}),a.params=f(a.params)}let s=t.resolve(o,a),c=e.hash||``;s.params=d(p(s.params));let u=Yt(r,z({},e,{hash:Bt(c),path:s.path})),m=i.createHref(u);return z({fullPath:u,hash:c,query:r===yn?bn(e.query):e.query||{}},s,{redirectedFrom:void 0,href:m})}function b(e){return typeof e==`string`?Jt(n,e,l.value.path):z({},e)}function x(e,t){if(u!==e)return W(U.NAVIGATION_CANCELLED,{from:t,to:e})}function S(e){return T(e)}function C(e){return S(z(b(e),{replace:!0}))}function w(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=b(i):{path:i},i.params={}),z({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function T(e,t){let n=u=te(e),i=l.value,a=e.state,o=e.force,s=e.replace===!0,c=w(n,i);if(c)return T(z(b(c),{state:typeof c==`object`?z({},a,c.state):a,force:o,replace:s}),t||n);let d=n;d.redirectedFrom=t;let f;return!o&&Zt(r,i,n)&&(f=W(U.NAVIGATION_DUPLICATED,{to:d,from:i}),de(i,i,!0,!1)),(f?Promise.resolve(f):D(d,i)).catch(e=>G(e)?G(e,U.NAVIGATION_GUARD_REDIRECT)?e:ue(e):ce(e,d,i)).then(e=>{if(e){if(G(e,U.NAVIGATION_GUARD_REDIRECT))return T(z({replace:s},b(e.to),{state:typeof e.to==`object`?z({},a,e.to.state):a,force:o}),t||d)}else e=ie(d,i,!0,s,a);return re(d,i,e),e})}function ne(e,t){let n=x(e,t);return n?Promise.reject(n):Promise.resolve()}function E(e){let t=A.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function D(e,t){let n,[r,i,a]=On(e,t);n=Dn(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(K(r,e,t))});let c=ne.bind(null,e,t);return n.push(c),M(n).then(()=>{n=[];for(let r of o.list())n.push(K(r,e,t));return n.push(c),M(n)}).then(()=>{n=Dn(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(K(r,e,t))});return n.push(c),M(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter)if(B(r.beforeEnter))for(let i of r.beforeEnter)n.push(K(i,e,t));else n.push(K(r.beforeEnter,e,t));return n.push(c),M(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Dn(a,`beforeRouteEnter`,e,t,E),n.push(c),M(n))).then(()=>{n=[];for(let r of s.list())n.push(K(r,e,t));return n.push(c),M(n)}).catch(e=>G(e,U.NAVIGATION_CANCELLED)?e:Promise.reject(e))}function re(e,t,n){c.list().forEach(r=>E(()=>r(e,t,n)))}function ie(e,t,n,r,a){let o=x(e,t);if(o)return o;let s=t===H,c=R?history.state:{};n&&(r||s?i.replace(e.fullPath,z({scroll:s&&c&&c.scroll},a)):i.push(e.fullPath,a)),l.value=e,de(e,t,n,s),ue()}let O;function ae(){O||=i.listen((e,t,n)=>{if(!j.listening)return;let r=te(e),a=w(r,j.currentRoute.value);if(a){T(z(a,{replace:!0,force:!0}),r).catch(Ct);return}u=r;let o=l.value;R&&pn(dn(o.fullPath,n.delta),ln()),D(r,o).catch(e=>G(e,U.NAVIGATION_ABORTED|U.NAVIGATION_CANCELLED)?e:G(e,U.NAVIGATION_GUARD_REDIRECT)?(T(z(b(e.to),{force:!0}),r).then(e=>{G(e,U.NAVIGATION_ABORTED|U.NAVIGATION_DUPLICATED)&&!n.delta&&n.type===nn.pop&&i.go(-1,!1)}).catch(Ct),Promise.reject()):(n.delta&&i.go(-n.delta,!1),ce(e,r,o))).then(e=>{e||=ie(r,o,!1),e&&(n.delta&&!G(e,U.NAVIGATION_CANCELLED)?i.go(-n.delta,!1):n.type===nn.pop&&G(e,U.NAVIGATION_ABORTED|U.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),re(r,o,e)}).catch(Ct)})}let k=En(),oe=En(),se;function ce(e,t,n){ue(e);let r=oe.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function le(){return se&&l.value!==H?Promise.resolve():new Promise((e,t)=>{k.add([e,t])})}function ue(e){return se||(se=!e,ae(),k.list().forEach(([t,n])=>e?n(e):t()),k.reset()),e}function de(t,n,r,i){let{scrollBehavior:a}=e;if(!R||!a)return Promise.resolve();let o=!r&&mn(dn(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return m().then(()=>a(t,n,o)).then(e=>e&&un(e)).catch(e=>ce(e,t,n))}let fe=e=>i.go(e),pe,A=new Set,j={currentRoute:l,listening:!0,addRoute:h,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:y,getRoutes:ee,resolve:te,options:e,push:S,replace:C,go:fe,back:()=>fe(-1),forward:()=>fe(1),beforeEach:o.add,beforeResolve:s.add,afterEach:c.add,onError:oe.add,isReady:le,install(e){e.component(`RouterLink`,ir),e.component(`RouterView`,dr),e.config.globalProperties.$router=j,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>_(l)}),R&&!pe&&l.value===H&&(pe=!0,S(i.location).catch(e=>{}));let t={};for(let e in H)Object.defineProperty(t,e,{get:()=>l.value[e],enumerable:!0});e.provide(Cn,j),e.provide(wn,g(t)),e.provide(Tn,l);let n=e.unmount;A.add(e),e.unmount=function(){A.delete(e),A.size<1&&(u=H,O&&O(),O=null,l.value=H,pe=!1,se=!1),n()}}};function M(e){return e.reduce((e,t)=>e.then(()=>E(t)),Promise.resolve())}return j}function pr(){return x(Cn)}function mr(e){return x(wn)}var hr=`manguito_auth`;function gr(){try{let e=localStorage.getItem(hr);return e?JSON.parse(e):null}catch{return null}}var X=pe(`auth`,()=>{let e=me(),n=gr(),r=t(n?.id??null),i=t(n?.email??null),a=t(n?.role??null),o=t(n?.mustChangePassword??!1),s=j(()=>r.value!==null),c=j(()=>a.value?e.getRoleByName(a.value)?.permissions??[]:[]),l=j(()=>a.value?e.getRoleByName(a.value)?.hierarchy_level??1/0:1/0);function u(e){r.value=e.id,i.value=e.email,a.value=e.role,o.value=e.mustChangePassword??!1;try{localStorage.setItem(hr,JSON.stringify({id:e.id,email:e.email,role:e.role,mustChangePassword:e.mustChangePassword??!1}))}catch{}}function d(){r.value=null,i.value=null,a.value=null,o.value=!1;try{localStorage.removeItem(hr)}catch{}}function f(e){return c.value.includes(e)}return{id:r,email:i,role:a,mustChangePassword:o,isAuthenticated:s,permissions:c,hierarchyLevel:l,setUser:u,clear:d,hasPermission:f}});function _r(e){return o()?(p(e),!0):!1}var vr=new WeakMap,yr=(...e)=>{let t=e[0],n=te()?.proxy;if(n==null&&!ve())throw Error(`injectLocal must be called in setup`);return n&&vr.has(n)&&t in vr.get(n)?vr.get(n)[t]:x(...e)},br=typeof window<`u`&&typeof document<`u`;typeof WorkerGlobalScope<`u`&&globalThis instanceof WorkerGlobalScope;var xr=Object.prototype.toString,Sr=e=>xr.call(e)===`[object Object]`,Z=()=>{},Cr=wr();function wr(){return br&&(window==null?void 0:window.navigator)?.userAgent&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||(window==null?void 0:window.navigator)?.maxTouchPoints>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function Tr(e,t){function n(...n){return new Promise((r,i)=>{Promise.resolve(e(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(r).catch(i)})}return n}function Er(e,t={}){let n,r,i=Z,a=e=>{clearTimeout(e),i(),i=Z},o;return s=>{let c=h(e),l=h(t.maxWait);return n&&a(n),c<=0||l!==void 0&&l<=0?(r&&=(a(r),null),Promise.resolve(s())):new Promise((e,u)=>{i=t.rejectOnCancel?u:e,o=s,l&&!r&&(r=setTimeout(()=>{n&&a(n),r=null,e(o())},l)),n=setTimeout(()=>{r&&a(r),r=null,e(s())},c)})}}function Dr(e){return e.endsWith(`rem`)?Number.parseFloat(e)*16:Number.parseFloat(e)}function Or(e){return Array.isArray(e)?e:[e]}function kr(e,t=200,n={}){return Tr(Er(t,n),e)}function Ar(e,t,n){return O(e,t,{...n,immediate:!0})}var jr=br?window:void 0;br&&window.document,br&&window.navigator,br&&window.location;function Mr(e){let t=h(e);return t?.$el??t}function Nr(...e){let t=[],n=()=>{t.forEach(e=>e()),t.length=0},r=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),i=j(()=>{let t=Or(h(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0}),a=Ar(()=>[i.value?.map(e=>Mr(e))??[jr].filter(e=>e!=null),Or(h(i.value?e[1]:e[0])),Or(_(i.value?e[2]:e[1])),h(i.value?e[3]:e[2])],([e,i,a,o])=>{if(n(),!e?.length||!i?.length||!a?.length)return;let s=Sr(o)?{...o}:o;t.push(...e.flatMap(e=>i.flatMap(t=>a.map(n=>r(e,t,n,s)))))},{flush:`post`});return _r(n),()=>{a(),n()}}var Pr=!1;function Fr(e,t,n={}){let{window:r=jr,ignore:i=[],capture:a=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:Z,cancel:Z,trigger:Z}:Z;if(Cr&&!Pr){Pr=!0;let e={passive:!0};Array.from(r.document.body.children).forEach(t=>Nr(t,`click`,Z,e)),Nr(r.document.documentElement,`click`,Z,e)}let c=!0,l=e=>h(i).some(t=>{if(typeof t==`string`)return Array.from(r.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{let n=Mr(t);return n&&(e.target===n||e.composedPath().includes(n))}});function u(e){let t=h(e);return t&&t.$.subTree.shapeFlag===16}function d(e,t){let n=h(e),r=n.$.subTree&&n.$.subTree.children;return r==null||!Array.isArray(r)?!1:r.some(e=>e.el===t.target||t.composedPath().includes(e.el))}let f=n=>{let r=Mr(e);if(n.target!=null&&!(!(r instanceof Element)&&u(e)&&d(e,n))&&!(!r||r===n.target||n.composedPath().includes(r))){if(`detail`in n&&n.detail===0&&(c=!l(n)),!c){c=!0;return}t(n)}},p=!1,m=[Nr(r,`click`,e=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(e))},{passive:!0,capture:a}),Nr(r,`pointerdown`,t=>{let n=Mr(e);c=!l(t)&&!!(n&&!t.composedPath().includes(n))},{passive:!0}),o&&Nr(r,`blur`,n=>{setTimeout(()=>{let i=Mr(e);r.document.activeElement?.tagName===`IFRAME`&&!i?.contains(r.document.activeElement)&&t(n)},0)},{passive:!0})].filter(Boolean),g=()=>m.forEach(e=>e());return s?{stop:g,cancel:()=>{c=!1},trigger:e=>{c=!0,f(e),c=!1}}:g}function Ir(){let e=a(!1),t=te();return t&&_e(()=>{e.value=!0},t),e}function Lr(e){let t=Ir();return j(()=>(t.value,!!e()))}var Rr=Symbol(`vueuse-ssr-width`);function zr(){let e=ve()?yr(Rr,null):null;return typeof e==`number`?e:void 0}function Br(e,t={}){let{window:n=jr,ssrWidth:r=zr()}=t,i=Lr(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),o=a(typeof r==`number`),s=a(),c=a(!1);return l(()=>{if(o.value){o.value=!i.value;let t=h(e).split(`,`);c.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=Dr(n[1])),i&&a&&(a=r<=Dr(i[1])),t?!a:a});return}i.value&&(s.value=n.matchMedia(h(e)),c.value=s.value.matches)}),Nr(s,`change`,e=>{c.value=e.matches},{passive:!0}),j(()=>c.value)}var Vr=3,Hr=4e3,Q=pe(`ui`,()=>{let e=t([]),n=t(!1),r=Br(`(max-width: 820px)`),i=t(!1),a=t(null),o=t(0),s=t(!1),c=t(`Manguito CMS`);function l(t,n,r=Hr){e.value.length>=Vr&&e.value.shift();let i=crypto.randomUUID();e.value.push({id:i,variant:t,message:n,duration:r}),r!==null&&setTimeout(()=>u(i),r)}function u(t){let n=e.value.findIndex(e=>e.id===t);n!==-1&&e.value.splice(n,1)}function d(e){o.value=e}function f(e){s.value=e}function p(e){c.value=e}function m(){r.value?i.value=!i.value:n.value=!n.value}function h(){i.value=!1}return{toasts:e,sidebarCollapsed:n,isMobile:r,mobileNavOpen:i,activeModal:a,maxFileSize:o,presignedUploads:s,cmsName:c,addToast:l,removeToast:u,setMaxFileSize:d,setPresignedUploads:f,setCmsName:p,toggleSidebar:m,closeMobileNav:h}}),Ur={key:0,class:`fixed inset-0 flex items-center justify-center bg-white`,"aria-label":`Loading`},Wr=E({__name:`App`,setup(e){let n=t(!0),i=pr(),a=X(),o=me(),s=Q();async function c(e=!0){let t=await fetch(`/admin/api/config`,{credentials:`include`});if(t.status===401){e&&(a.clear(),i.push(`/admin/login`));return}if(t.ok){let e=(await t.json()).data,n=e.all_roles??[];o.setRoles(n.map(e=>({name:e.name,label:e.label,hierarchy_level:e.hierarchy_level,is_system:e.is_system,permissions:e.permissions}))),e.user&&a.setUser({id:e.user.id,email:e.user.email,role:e.user.role,mustChangePassword:e.user.must_change_password}),s.setCmsName(e.cms_name),e.media?.max_file_size&&s.setMaxFileSize(e.media.max_file_size),s.setPresignedUploads(e.media?.presigned_uploads??!1);let r=await fetch(`/admin/api/schema`,{credentials:`include`});if(r.ok){let e=await r.json();o.setFromApiSchema(e.data)}a.mustChangePassword&&i.push(`/admin/change-password`)}}return _e(async()=>{if(!a.isAuthenticated){n.value=!1;return}try{await c()}finally{n.value=!1}}),O(()=>s.cmsName,e=>{document.title=e},{immediate:!0}),O(()=>a.isAuthenticated,async(e,t)=>{if(e&&!t){n.value=!0;try{await c(!1)}catch{}finally{n.value=!1}}}),(e,t)=>{let i=ae(`router-view`);return n.value?(r(),w(`div`,Ur,[...t[0]||=[S(`div`,{class:`h-10 w-10 animate-spin rounded-full border-4 border-gray-200 border-t-gray-600`,role:`status`},null,-1)]])):(r(),k(i,{key:1}))}}});function Gr(){let e=X(),t=me();function n(t){return e.permissions.includes(t)}function r(){return t.roles.filter(t=>t.hierarchy_level>e.hierarchyLevel&&t.name!==`admin`)}return{can:n,rolesBelow:r}}function Kr(){let e=pr(),t=X();async function n(i,a,o=!1){let s=await fetch(`/admin/api${i}`,{...a,credentials:`include`,headers:{"Content-Type":`application/json`,...a?.headers}});return s.status===401&&!o?await r()?n(i,a,!0):(t.clear(),e.push(`/admin/login`),{ok:!1,error:{code:`UNAUTHORIZED`,message:`Session expired.`}}):s.json()}async function r(){return(await fetch(`/admin/api/auth/refresh`,{method:`POST`,credentials:`include`})).ok}function i(e){return n(e,{method:`GET`})}function a(e,t){return n(e,{method:`POST`,body:JSON.stringify(t)})}function o(e,t){return n(e,{method:`PATCH`,body:JSON.stringify(t)})}function s(e,t){return n(e,{method:`PUT`,body:JSON.stringify(t)})}function c(e){return n(e,{method:`DELETE`})}return{get:i,post:a,patch:o,put:s,del:c}}var qr={class:`flex items-center gap-[11px] px-[17px] pb-[14px] pt-[18px]`},Jr={key:0,class:`overflow-hidden`},Yr={class:`whitespace-nowrap text-[15px] font-bold tracking-tight text-ink`},Xr={class:`flex flex-1 flex-col overflow-y-auto overflow-x-hidden px-3 pb-2.5 pt-1`},Zr=[`aria-expanded`],Qr={class:`min-h-0 overflow-hidden`},$r={key:0,class:`overflow-hidden whitespace-nowrap`},ei={key:0},ti=[`aria-expanded`],ni={class:`min-h-0 overflow-hidden`},ri={key:0,class:`overflow-hidden whitespace-nowrap`},ii={key:0,class:`overflow-hidden whitespace-nowrap`},ai={key:0,class:`overflow-hidden whitespace-nowrap`},oi={key:0,class:`overflow-hidden whitespace-nowrap`},si={class:`border-t border-divider p-3`},ci={class:`flex items-center gap-2.5 p-1.5`},li={class:`flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-[10px] bg-gradient-to-br from-[#6D5EF0] to-[#A06BF0] text-[14px] font-bold text-white`},ui={key:0,class:`overflow-hidden`},di={class:`whitespace-nowrap text-[13px] font-semibold text-[#2C2C44]`},fi={key:0,class:`whitespace-nowrap text-[11.5px] text-[#9A9AB0]`},pi={key:0,class:`whitespace-nowrap`},mi=E({__name:`Sidebar`,setup(e){let n=me(),i=X(),a=Q(),{can:o}=Gr(),s=pr(),c=Kr(),l=j(()=>Object.values(n.contentTypes)),f=j(()=>Object.values(n.taxonomyTypes)),p=j(()=>i.role?n.getRoleByName(i.role)?.label??i.role:null),m=t(!0),h=t(!0),g=j(()=>!a.isMobile&&a.sidebarCollapsed),v=`/admin`;async function ee(){await c.post(`/auth/logout`,{}),i.clear(),s.push(`${v}/login`)}function y(){return i.email?i.email.charAt(0).toUpperCase():`?`}return(e,t)=>{let n=ae(`RouterLink`);return r(),w(`aside`,{class:C([`flex h-full flex-col border-r border-card-border bg-white transition-[width] duration-300`,_(a).isMobile?`fixed inset-y-0 left-0 z-50 w-[258px] shadow-2xl transition-transform duration-300`:`relative shrink-0 overflow-hidden`,_(a).isMobile&&!_(a).mobileNavOpen?`-translate-x-full`:`translate-x-0`,!_(a).isMobile&&(g.value?`w-[74px]`:`w-[258px]`)]),"aria-label":`Main navigation`},[S(`div`,qr,[t[3]||=de(`<div class="flex h-[34px] w-[34px] shrink-0 items-center justify-center rounded-[11px] bg-gradient-to-br from-[#6D5EF0] to-[#5B57E8] shadow-[0_4px_12px_rgba(91,87,232,0.36)]"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.1" stroke-linecap="round"><path d="M4 7h16"></path><path d="M4 12h10"></path><path d="M4 17h13"></path></svg></div>`,1),g.value?N(``,!0):(r(),w(`div`,Jr,[S(`div`,Yr,P(_(a).cmsName),1),t[2]||=S(`div`,{class:`whitespace-nowrap text-[11px] font-medium text-faint`},`Admin panel`,-1)]))]),S(`div`,Xr,[S(`div`,null,[g.value?N(``,!0):(r(),w(`button`,{key:0,type:`button`,class:`mb-1 mt-4 flex w-full items-center justify-between px-2 text-[11px] font-bold uppercase tracking-[.09em] text-faint hover:text-muted`,"aria-expanded":m.value,onClick:t[0]||=e=>m.value=!m.value},[t[5]||=S(`span`,null,`Content`,-1),(r(),w(`svg`,{class:C([`h-3 w-3 text-[#C2C2D0] transition-transform`,m.value?``:`-rotate-90`]),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2.5`},[...t[4]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M19 9l-7 7-7-7`},null,-1)]],2))],8,Zr)),S(`div`,{class:`grid transition-[grid-template-rows] duration-300 ease-in-out`,style:oe({gridTemplateRows:g.value||m.value?`1fr`:`0fr`})},[S(`div`,Qr,[(r(!0),w(re,null,d(l.value,e=>(r(),k(n,{key:e.name,to:`${_(v)}/content/${e.name}`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[6]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M14 3v4a2 2 0 0 0 2 2h4`}),S(`path`,{d:`M5 3h9l5 5v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`}),S(`path`,{d:`M9 13h6`}),S(`path`,{d:`M9 17h5`})])],-1),g.value?N(``,!0):(r(),w(`span`,$r,P(e.label),1))]),_:2},1032,[`to`,`class`]))),128))])],4)]),f.value.length>0?(r(),w(`div`,ei,[g.value?N(``,!0):(r(),w(`button`,{key:0,type:`button`,class:`mb-1 mt-4 flex w-full items-center justify-between px-2 text-[11px] font-bold uppercase tracking-[.09em] text-faint hover:text-muted`,"aria-expanded":h.value,onClick:t[1]||=e=>h.value=!h.value},[t[8]||=S(`span`,null,`Taxonomy`,-1),(r(),w(`svg`,{class:C([`h-3 w-3 text-[#C2C2D0] transition-transform`,h.value?``:`-rotate-90`]),fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2.5`},[...t[7]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M19 9l-7 7-7-7`},null,-1)]],2))],8,ti)),S(`div`,{class:`grid transition-[grid-template-rows] duration-300 ease-in-out`,style:oe({gridTemplateRows:g.value||h.value?`1fr`:`0fr`})},[S(`div`,ni,[(r(!0),w(re,null,d(f.value,e=>(r(),k(n,{key:e.name,to:`${_(v)}/taxonomy/${e.name}`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[9]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M20.6 13.4l-7.2 7.2a2 2 0 0 1-2.8 0L2 12V2h10l8.6 8.6a2 2 0 0 1 0 2.8z`}),S(`path`,{d:`M7 7h.01`})])],-1),g.value?N(``,!0):(r(),w(`span`,ri,P(e.label),1))]),_:2},1032,[`to`,`class`]))),128))])],4)])):N(``,!0),t[13]||=S(`div`,{class:`my-3.5 mx-2.5 h-px bg-divider`},null,-1),_(o)(`media:read`)?(r(),k(n,{key:1,to:`${_(v)}/media`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[10]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`}),S(`path`,{d:`M8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z`}),S(`path`,{d:`M21 15l-5-5L5 21`})])],-1),g.value?N(``,!0):(r(),w(`span`,ii,`Media`))]),_:1},8,[`to`,`class`])):N(``,!0),_(o)(`users:read`)?(r(),k(n,{key:2,to:`${_(v)}/users`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[11]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`}),S(`path`,{d:`M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z`}),S(`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.9`}),S(`path`,{d:`M16 3.1a4 4 0 0 1 0 7.8`})])],-1),g.value?N(``,!0):(r(),w(`span`,ai,`Users`))]),_:1},8,[`to`,`class`])):N(``,!0),_(o)(`roles:read`)?(r(),k(n,{key:3,to:`${_(v)}/roles`,class:C([`my-0.5 flex items-center rounded-[10px] text-sm font-medium text-[#4A4A60] transition-colors hover:bg-[#F3F2F8]`,g.value?`justify-center px-0 py-[11px]`:`gap-3 px-3 py-2.5`]),"active-class":`!bg-indigo-50 !text-indigo-600 !font-semibold`},{default:u(()=>[t[12]||=S(`span`,{class:`flex shrink-0`},[S(`svg`,{width:`19`,height:`19`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.7`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[S(`path`,{d:`M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z`})])],-1),g.value?N(``,!0):(r(),w(`span`,oi,`Roles`))]),_:1},8,[`to`,`class`])):N(``,!0)]),S(`div`,si,[S(`div`,ci,[S(`div`,li,P(y()),1),g.value?N(``,!0):(r(),w(`div`,ui,[S(`div`,di,P(_(i).email),1),p.value?(r(),w(`div`,fi,P(p.value),1)):N(``,!0)]))]),S(`button`,{type:`button`,class:C([`mt-1 flex w-full items-center rounded-[10px] py-[9px] text-left text-[13.5px] font-medium text-[#74748C] transition-colors hover:bg-[#FDF2F4] hover:text-[#E1495B]`,g.value?`justify-center px-0`:`gap-[11px] px-2`]),onClick:ee},[t[14]||=de(`<span class="flex shrink-0"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><path d="M16 17l5-5-5-5"></path><path d="M21 12H9"></path></svg></span>`,1),g.value?N(``,!0):(r(),w(`span`,pi,`Log out`))],2)])],2)}}}),hi={class:`flex h-[60px] shrink-0 items-center gap-[13px] border-b border-card-border bg-white/85 px-4 backdrop-blur-md`},gi={key:0,width:`21`,height:`21`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.9`,"stroke-linecap":`round`},_i={key:1,width:`20`,height:`20`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,"stroke-linecap":`round`,"stroke-linejoin":`round`},vi={class:`flex min-w-0 items-center gap-[9px]`},yi={class:`overflow-hidden truncate whitespace-nowrap text-[14.5px] font-semibold text-[#2C2C44]`},bi=E({__name:`Topbar`,setup(e){let t=Q();return(e,n)=>(r(),w(`header`,hi,[S(`button`,{type:`button`,class:`flex h-[38px] w-[38px] items-center justify-center rounded-[10px] text-[#4A4A60] transition-colors hover:bg-[#F1F0F7]`,"aria-label":`Toggle sidebar`,onClick:n[0]||=e=>_(t).toggleSidebar()},[_(t).isMobile?(r(),w(`svg`,gi,[...n[1]||=[S(`path`,{d:`M3 6h18`},null,-1),S(`path`,{d:`M3 12h18`},null,-1),S(`path`,{d:`M3 18h18`},null,-1)]])):(r(),w(`svg`,_i,[...n[2]||=[S(`path`,{d:`M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`},null,-1),S(`path`,{d:`M9 3v18`},null,-1)]]))]),S(`div`,vi,[n[3]||=S(`span`,{class:`shrink-0 rounded-[7px] bg-indigo-50 px-[9px] py-[3px] text-[10.5px] font-bold tracking-[.05em] text-indigo-600`},` ADMIN `,-1),S(`span`,yi,P(_(t).cmsName),1)]),n[4]||=S(`div`,{class:`flex-1`},null,-1)]))}}),xi={class:`mt-10 border-t border-gray-200 px-1 py-5`},Si={class:`text-xs text-gray-400`},Ci=E({__name:`Footer`,setup(e){let t=Q();return(e,n)=>(r(),w(`footer`,xi,[S(`p`,Si,P(_(t).cmsName),1)]))}}),wi={"aria-live":`polite`,"aria-atomic":`false`,class:`pointer-events-none fixed bottom-4 right-4 z-50 flex flex-col gap-2`},Ti={class:`flex-1 text-sm`},Ei=[`aria-label`,`onClick`],Di=E({__name:`ToastContainer`,setup(e){let t=Q(),n=j(()=>[...t.toasts].reverse()),i={success:`bg-green-600 text-white`,error:`bg-red-600 text-white`,warning:`bg-amber-500 text-white`,info:`bg-blue-600 text-white`};return(e,a)=>(r(),w(`div`,wi,[(r(!0),w(re,null,d(n.value,e=>(r(),w(`div`,{key:e.id,class:C([`pointer-events-auto flex w-80 items-start gap-3 rounded-lg px-4 py-3 shadow-lg`,i[e.variant]??`bg-blue-600 text-white`]),role:`status`},[S(`span`,Ti,P(e.message),1),S(`button`,{type:`button`,class:`shrink-0 opacity-80 hover:opacity-100`,"aria-label":`Dismiss: ${e.message}`,onClick:n=>_(t).removeToast(e.id)},` × `,8,Ei)],2))),128))]))}}),Oi={class:`flex h-screen overflow-hidden bg-surface`},ki={class:`flex min-w-0 flex-1 flex-col`},Ai={class:`flex-1 overflow-y-auto p-6`},ji=E({__name:`AppShell`,setup(e){let t=Q();return(e,n)=>{let i=ae(`router-view`);return r(),w(`div`,Oi,[D(mi),_(t).isMobile&&_(t).mobileNavOpen?(r(),w(`div`,{key:0,class:`fixed inset-0 z-40 bg-[rgba(20,20,40,0.4)] backdrop-blur-[2px]`,onClick:n[0]||=e=>_(t).closeMobileNav()})):N(``,!0),S(`div`,ki,[D(bi),S(`main`,Ai,[D(i),D(Ci)])]),D(Di)])}}}),Mi=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Ni=function(e){return`/`+e},Pi={},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL(`../../../src/node/plugins/importAnalysisBuild.ts`,import.meta.url)).href}r=o(t.map(t=>{if(t=Ni(t,n),t=s(t),t in Pi)return;Pi[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Mi,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Fi=[{path:`/admin/login`,name:`login`,component:()=>$(()=>import(`./LoginView-D0fvOnS1.js`),__vite__mapDeps([0,1]))},{path:`/admin`,component:ji,meta:{requiresAuth:!0},children:[{path:``,redirect:`/admin/media`},{path:`change-password`,name:`change-password`,component:()=>$(()=>import(`./ChangePasswordView-C9NzzFbG.js`),__vite__mapDeps([2,1]))},{path:`content/:type`,name:`content-list`,component:()=>$(()=>import(`./ContentListView-BGIym0gL.js`),__vite__mapDeps([3,1,4,5]))},{path:`content/:type/new`,name:`content-new`,component:()=>$(()=>import(`./ContentFormView-B3P9YP72.js`),__vite__mapDeps([6,1,7,8,9,4,10,11]))},{path:`content/:type/settings`,name:`content-settings`,component:()=>$(()=>import(`./ContentSettingsView-Cy4_2nQO.js`),__vite__mapDeps([12,1,9])),meta:{permission:`content:edit`}},{path:`content/:type/:id`,name:`content-edit`,component:()=>$(()=>import(`./ContentFormView-B3P9YP72.js`),__vite__mapDeps([6,1,7,8,9,4,10,11]))},{path:`taxonomy/:type`,name:`taxonomy-list`,component:()=>$(()=>import(`./TaxonomyListView-fH2lIkhZ.js`),__vite__mapDeps([13,1,5,14]))},{path:`taxonomy/:type/new`,name:`taxonomy-new`,component:()=>$(()=>import(`./TaxonomyFormView-DxubNh6h.js`),__vite__mapDeps([15,1,7,8,9,10,14]))},{path:`taxonomy/:type/:id`,name:`taxonomy-edit`,component:()=>$(()=>import(`./TaxonomyFormView-DxubNh6h.js`),__vite__mapDeps([15,1,7,8,9,10,14]))},{path:`media`,name:`media-library`,component:()=>$(()=>import(`./MediaLibraryView-CkHbclTm.js`),__vite__mapDeps([16,1,9,10,11,8,5,17]))},{path:`media/:id`,name:`media-detail`,component:()=>$(()=>import(`./MediaDetailView-DdB2PX-3.js`),__vite__mapDeps([18,1,9,10,17]))},{path:`users`,name:`user-list`,component:()=>$(()=>import(`./UserListView-B-umho5v.js`),__vite__mapDeps([19,1,20])),meta:{permission:`users:read`}},{path:`users/new`,name:`user-new`,component:()=>$(()=>import(`./UserFormView-DIAspRUO.js`),__vite__mapDeps([21,1,9,10,20])),meta:{permission:`users:read`}},{path:`users/:id`,name:`user-edit`,component:()=>$(()=>import(`./UserFormView-DIAspRUO.js`),__vite__mapDeps([21,1,9,10,20])),meta:{permission:`users:read`}},{path:`roles`,name:`roles`,component:()=>$(()=>import(`./RolesView-DO-Tb2Yr.js`),__vite__mapDeps([22,1]))}]}],Ii=fr({history:Pn(),routes:Fi});Ii.beforeEach(e=>{let t=X();return e.path===`/admin/login`?t.isAuthenticated?{path:`/admin/media`}:!0:t.isAuthenticated?t.mustChangePassword&&e.path!==`/admin/change-password`?{path:`/admin/change-password`}:!t.mustChangePassword&&e.path===`/admin/change-password`?{path:`/admin/media`}:!0:{path:`/admin/login`,query:{redirect:e.fullPath}}}),Ii.beforeEach(e=>{let t=X();if(e.meta.permission&&!t.hasPermission(e.meta.permission))return{path:`/admin/media`}});var Li=_t(Wr);Li.use(se()),Li.use(Ii),Li.mount(`#app`);export{kr as a,pr as c,pt as d,Fr as i,ct as l,Gr as n,X as o,Q as r,mr as s,Kr as t,st as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-CBeqUIPW.js";var t={INTERNAL_ERROR:`Something went wrong. Please try again.`,NOT_FOUND:`The requested item could not be found.`,STORAGE_ERROR:`File storage is unavailable. Please try again later.`,MEDIA_IN_USE:`This file is still in use and cannot be deleted.`,INSUFFICIENT_PERMISSION:`You do not have permission to do that.`,RATE_LIMITED:`Too many requests. Please wait before trying again.`,UNAUTHORIZED:`Your session has expired. Please log in again.`,TOKEN_EXPIRED:`Your session has expired. Please log in again.`};function n(){let n=e();return{success:e=>n.addToast(`success`,e),error:e=>n.addToast(`error`,e),warning:e=>n.addToast(`warning`,e),apiError:(e,r)=>n.addToast(`error`,t[e]??r)}}export{n as t};
|
package/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
|
|
7
7
|
<title>Manguito CMS</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CBeqUIPW.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/schema-B-RKX_ep.js">
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-C4qBpxpk.css">
|
|
11
11
|
</head>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobbykim/manguito-cms-admin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Bobby Kim <bobby.sihun.kim@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/bobbykim89/manguito-cms",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"vite": "^8.1.3",
|
|
42
42
|
"vue": "^3.5.39",
|
|
43
43
|
"vue-router": "^4.6.4",
|
|
44
|
-
"@bobbykim/manguito-cms-core": "0.
|
|
44
|
+
"@bobbykim/manguito-cms-core": "0.10.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@testing-library/vue": "^8.1.0",
|
|
@@ -57,8 +57,9 @@
|
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"build": "vue-tsc && vite build && tsup",
|
|
60
|
+
"typecheck": "vue-tsc --noEmit && vue-tsc --noEmit -p tsconfig.tests.json && tsc --noEmit -p tsconfig.codegen.json && tsc --noEmit -p tsconfig.adapter.json",
|
|
60
61
|
"dev": "vite",
|
|
61
62
|
"test": "dotenv -e ../../.env.test -- vitest run",
|
|
62
|
-
"lint": "eslint src"
|
|
63
|
+
"lint": "eslint src codegen index.ts tests __tests__"
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -135,9 +135,8 @@ async function uploadPresigned(file: File, alt: string): Promise<MediaItem> {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
xhr.onload = () => {
|
|
138
|
-
xhr.status >= 200 && xhr.status < 300
|
|
139
|
-
|
|
140
|
-
: reject(new Error(`Storage upload failed (${xhr.status})`))
|
|
138
|
+
if (xhr.status >= 200 && xhr.status < 300) resolve()
|
|
139
|
+
else reject(new Error(`Storage upload failed (${xhr.status})`))
|
|
141
140
|
}
|
|
142
141
|
xhr.onerror = () => reject(new Error('Network error during upload'))
|
|
143
142
|
if (method === 'POST' && fields) {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { splitServerDetails } from '../server-errors'
|
|
3
|
+
|
|
4
|
+
describe('splitServerDetails', () => {
|
|
5
|
+
it('puts a detail on its field when the form has one, and lists the rest', () => {
|
|
6
|
+
// MUTATION: send every detail to mergeServerErrors. A path inside a
|
|
7
|
+
// paragraph item ("cards[0].heading") then matches no field, and its
|
|
8
|
+
// message is never shown: the editor sees only "Some values are not valid".
|
|
9
|
+
const result = splitServerDetails(
|
|
10
|
+
[
|
|
11
|
+
{ field: 'title', message: 'title can be at most 255 characters.' },
|
|
12
|
+
{ field: 'cards[0].heading', message: 'cards[0].heading can be at most 255 characters.' },
|
|
13
|
+
],
|
|
14
|
+
['title', 'cards']
|
|
15
|
+
)
|
|
16
|
+
expect(result.fieldErrors).toEqual([{ field: 'title', message: 'title can be at most 255 characters.' }])
|
|
17
|
+
expect(result.other).toEqual(['cards[0].heading can be at most 255 characters.'])
|
|
18
|
+
})
|
|
19
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ServerDetail = { field: string; message: string }
|
|
2
|
+
|
|
3
|
+
// A 422's details, split into those a form shows next to one of its fields and
|
|
4
|
+
// the rest: paths inside paragraph items, such as "cards[0].heading", which
|
|
5
|
+
// have no field of their own in the form state, so the form lists them with
|
|
6
|
+
// its error message instead.
|
|
7
|
+
export function splitServerDetails(
|
|
8
|
+
details: ServerDetail[],
|
|
9
|
+
fieldNames: string[],
|
|
10
|
+
): { fieldErrors: ServerDetail[]; other: string[] } {
|
|
11
|
+
const known = new Set(fieldNames)
|
|
12
|
+
const fieldErrors: ServerDetail[] = []
|
|
13
|
+
const other: string[] = []
|
|
14
|
+
for (const d of details) {
|
|
15
|
+
if (known.has(d.field)) fieldErrors.push(d)
|
|
16
|
+
else other.push(d.message)
|
|
17
|
+
}
|
|
18
|
+
return { fieldErrors, other }
|
|
19
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { splitServerDetails } from '../../utils/server-errors'
|
|
2
3
|
import { ref, computed, onMounted, watch } from 'vue'
|
|
3
4
|
import { useRoute, useRouter } from 'vue-router'
|
|
4
5
|
import type { ParsedField } from '@bobbykim/manguito-cms-core'
|
|
@@ -173,8 +174,10 @@ async function doSave(publishedOverride?: boolean) {
|
|
|
173
174
|
|
|
174
175
|
if (!res.ok) {
|
|
175
176
|
const raw = res.error as { code: string; message: string; details?: Array<{ field: string; message: string }> }
|
|
176
|
-
if (raw.code === 'PUBLISH_VALIDATION_ERROR' && raw.details) {
|
|
177
|
-
|
|
177
|
+
if ((raw.code === 'PUBLISH_VALIDATION_ERROR' || raw.code === 'VALIDATION_ERROR') && raw.details) {
|
|
178
|
+
const { fieldErrors, other } = splitServerDetails(raw.details, allFields.value.map((f) => f.name))
|
|
179
|
+
mergeServerErrors(fieldErrors)
|
|
180
|
+
if (other.length > 0) formError.value = [raw.message, ...other].join(' ')
|
|
178
181
|
} else if (raw.code === 'SLUG_CONFLICT') {
|
|
179
182
|
setError('slug', 'This slug is already taken.')
|
|
180
183
|
} else {
|
|
@@ -182,7 +182,8 @@ function uploadDirect(file: File, alt: string): Promise<MediaItem> {
|
|
|
182
182
|
xhr.onload = () => {
|
|
183
183
|
try {
|
|
184
184
|
const json = JSON.parse(xhr.responseText) as { ok: boolean; data?: MediaItem; error?: { message: string } }
|
|
185
|
-
json.ok && json.data
|
|
185
|
+
if (json.ok && json.data) resolve(json.data)
|
|
186
|
+
else reject(new Error(json.error?.message ?? 'Upload failed'))
|
|
186
187
|
} catch {
|
|
187
188
|
reject(new Error('Invalid server response'))
|
|
188
189
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { splitServerDetails } from '../../utils/server-errors'
|
|
2
3
|
import { ref, computed, onMounted, watch } from 'vue'
|
|
3
4
|
import { useRoute, useRouter } from 'vue-router'
|
|
4
5
|
import { useApiClient } from '../../composables/useApiClient'
|
|
@@ -112,8 +113,10 @@ async function onSave() {
|
|
|
112
113
|
message: string
|
|
113
114
|
details?: Array<{ field: string; message: string }>
|
|
114
115
|
}
|
|
115
|
-
if (raw.code === 'PUBLISH_VALIDATION_ERROR' && raw.details) {
|
|
116
|
-
|
|
116
|
+
if ((raw.code === 'PUBLISH_VALIDATION_ERROR' || raw.code === 'VALIDATION_ERROR') && raw.details) {
|
|
117
|
+
const { fieldErrors, other } = splitServerDetails(raw.details, allFields.value.map((f) => f.name))
|
|
118
|
+
mergeServerErrors(fieldErrors)
|
|
119
|
+
if (other.length > 0) formError.value = [raw.message, ...other].join(' ')
|
|
117
120
|
} else if (raw.code === 'SLUG_CONFLICT') {
|
|
118
121
|
setError('slug', 'This slug is already taken.')
|
|
119
122
|
} else {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
|
|
2
2
|
import { mount, flushPromises } from '@vue/test-utils'
|
|
3
3
|
import { createPinia, setActivePinia } from 'pinia'
|
|
4
4
|
import type { ParsedField, ParsedTaxonomyType } from '@bobbykim/manguito-cms-core'
|
|
5
5
|
import { useSchemaStore } from '../../../stores/schema'
|
|
6
|
+
import { useAuthStore } from '../../../stores/auth'
|
|
6
7
|
import TaxonomyFormView from '../TaxonomyFormView.vue'
|
|
7
8
|
import ParagraphEmbed from '../../../components/fields/ParagraphEmbed.vue'
|
|
8
9
|
import ReferenceSelect from '../../../components/fields/ReferenceSelect.vue'
|
|
@@ -44,6 +45,10 @@ const tagType = {
|
|
|
44
45
|
|
|
45
46
|
let pinia: ReturnType<typeof createPinia>
|
|
46
47
|
|
|
48
|
+
afterEach(() => {
|
|
49
|
+
vi.unstubAllGlobals()
|
|
50
|
+
})
|
|
51
|
+
|
|
47
52
|
beforeEach(() => {
|
|
48
53
|
pinia = createPinia()
|
|
49
54
|
setActivePinia(pinia)
|
|
@@ -61,6 +66,37 @@ describe('TaxonomyFormView', () => {
|
|
|
61
66
|
expect(w.findComponent(ParagraphEmbed).exists()).toBe(true)
|
|
62
67
|
})
|
|
63
68
|
|
|
69
|
+
it('shows VALIDATION_ERROR details from a save: on the field, or in the banner for a paragraph path', async () => {
|
|
70
|
+
// MUTATION: merge details only for PUBLISH_VALIDATION_ERROR (before #57).
|
|
71
|
+
// The editor then sees only "Some values are not valid", with no field.
|
|
72
|
+
vi.stubGlobal('fetch', vi.fn().mockResolvedValue(
|
|
73
|
+
new Response(JSON.stringify({
|
|
74
|
+
ok: false,
|
|
75
|
+
error: {
|
|
76
|
+
code: 'VALIDATION_ERROR',
|
|
77
|
+
message: 'Some values are not valid',
|
|
78
|
+
details: [
|
|
79
|
+
{ field: 'name', message: 'name can be at most 255 characters.' },
|
|
80
|
+
{ field: 'blurb.text', message: 'blurb.text is required.' },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
}), { status: 422, headers: { 'Content-Type': 'application/json' } })
|
|
84
|
+
))
|
|
85
|
+
// An editor allowed to create terms, so the Save button renders.
|
|
86
|
+
useSchemaStore().setRoles([{ name: 'editor', label: 'Editor', hierarchy_level: 1, permissions: ['taxonomy:create'] }] as never)
|
|
87
|
+
useAuthStore().setUser({ id: 'u1', email: 'e@example.com', role: 'editor' })
|
|
88
|
+
const w = mount(TaxonomyFormView, { global: { plugins: [pinia] } })
|
|
89
|
+
await flushPromises()
|
|
90
|
+
const save = w.findAll('button').find((b) => b.text() === 'Save')!
|
|
91
|
+
await save.trigger('click')
|
|
92
|
+
await flushPromises()
|
|
93
|
+
|
|
94
|
+
// The field's own error, and the form's banner, are both alerts.
|
|
95
|
+
const alerts = w.findAll('[role="alert"]').map((a) => a.text())
|
|
96
|
+
expect(alerts).toContain('name can be at most 255 characters.')
|
|
97
|
+
expect(alerts).toContain('Some values are not valid blurb.text is required.')
|
|
98
|
+
})
|
|
99
|
+
|
|
64
100
|
it('gives the paragraph editor its paragraph form', async () => {
|
|
65
101
|
// MUTATION: render with componentFor but drop `v-bind="fieldExtraProps(field)"`.
|
|
66
102
|
// ParagraphEmbed then has no formComponent and cannot render its item.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,B as t,E as n,O as r,P as ee,W as i,c as a,ct as o,d as s,g as c,i as l,j as u,l as d,lt as te,m as ne,s as f,t as p,u as m,ut as h,w as re,x as ie}from"./schema-B-RKX_ep.js";import{c as ae,n as oe,s as se,t as ce,u as le}from"./index-stKCwnA4.js";import{i as ue,n as de,r as fe,t as pe}from"./field-defaults-DLoPESiE.js";import{t as me}from"./useNotification-BdRk9gQY.js";import{t as he}from"./content--2XYr_UQ.js";import{t as g}from"./ConfirmDialog-B7nxdDge.js";import{t as ge}from"./useTabIndicator-CvEsGBJh.js";var _e={key:0,class:`flex items-center justify-center py-20`},ve={key:1,class:`py-12 text-center text-sm text-gray-500`},ye={key:2},be={class:`mb-[22px] flex flex-wrap items-start justify-between gap-4`},xe={class:`mb-1.5 text-[11px] font-bold uppercase tracking-[.06em] text-faint`},Se={class:`text-[25px] font-bold tracking-tight text-ink`},Ce={class:`flex shrink-0 flex-wrap items-center gap-[9px]`},we=[`disabled`],Te=[`disabled`],Ee=[`disabled`],De=[`disabled`],Oe={key:0,class:`mb-[18px] rounded-2xl border border-card-border bg-white p-5 shadow-[0_1px_2px_rgba(24,24,48,0.04),0_8px_22px_rgba(24,24,48,0.04)]`},ke={class:`mt-2 flex flex-wrap items-center gap-[10px]`},Ae=[`disabled`],_={key:0,class:`mt-[9px] text-[12.5px] text-[#D9913C]`},v={key:1,class:`mt-1 text-sm text-red-600`,role:`alert`},y=[`data-tab`,`onClick`],b={class:`space-y-5`},x={key:2,class:`mt-4 text-sm text-red-600`,role:`alert`},S=c({__name:`ContentFormView`,setup(c){let S=se(),C=ae(),w=ce(),{can:T}=oe(),{errors:E,validate:D,mergeServerErrors:je,clearErrors:Me,setError:Ne}=ue(),Pe=me(),Fe=p(),O=he(),k=f(()=>S.params.type),A=f(()=>S.params.id),j=f(()=>Fe.contentTypes[k.value]),M=f(()=>j.value?.fields??[]),N=f(()=>j.value?.ui.tabs??[]),P=f(()=>j.value?.only_one===!0),F=f(()=>P.value?`singleton`:A.value?`edit`:`create`),I=t(null),L=t({}),R=t(!1),z=t(``),B=t(!1),V=t(!0),H=t(!1),U=t(``),W=t(!1),G=t(!1),K=t(null),q=t(0),Ie=f(()=>N.value[q.value]?.name??``),J=t(null),{left:Le,width:Re}=ge(J,Ie),Y=f(()=>{if(N.value.length===0)return M.value;let e=N.value[q.value];return e?e.fields.map(e=>M.value.find(t=>t.name===e)).filter(e=>e!==void 0):M.value}),X=f(()=>F.value===`edit`&&R.value&&L.value.slug!==z.value);function Z(e){let t={};P.value||(t.slug=e?.slug??``);for(let n of M.value)n.field_type!==`programmatic`&&(t[n.name]=e?.[n.name]??pe(n));L.value=t,R.value=e?.published===!0,e?.slug&&(z.value=String(e.slug))}function ze(e,t){L.value[e]=t}async function Q(e){let t=await w.get(`/content/${k.value}/${e}`);t.ok?(I.value=t.data,Z(t.data)):U.value=t.error.message}re(async()=>{if(!j.value){V.value=!1;return}F.value===`edit`&&A.value||F.value===`singleton`&&A.value?await Q(A.value):Z(),V.value=!1}),u(A,async(e,t)=>{e!==t&&(V.value=!0,B.value=!1,Me(),e?await Q(e):(I.value=null,Z()),V.value=!1)});async function $(e){H.value=!0,U.value=``;let t={...L.value};e!==void 0&&(t.published=e);let n;if(n=F.value===`create`?await w.post(`/content/${k.value}`,t):F.value===`singleton`?await w.put(`/content/${k.value}`,t):await w.patch(`/content/${k.value}/${A.value}`,t),H.value=!1,!n.ok){let e=n.error;e.code===`PUBLISH_VALIDATION_ERROR`&&e.details?je(e.details):e.code===`SLUG_CONFLICT`?Ne(`slug`,`This slug is already taken.`):U.value=e.message;return}I.value=n.data,R.value=n.data.published===!0,z.value=String(n.data.slug??``),B.value=!1,O.invalidate(k.value),Pe.success(`Saved.`),F.value===`create`&&C.replace({name:`content-edit`,params:{type:k.value,id:String(n.data.id)}})}function Be(){if(D(M.value,L.value)){if(X.value){K.value=()=>$(),W.value=!0;return}$()}}function Ve(){if(D(M.value,L.value,!0)){if(X.value){K.value=()=>$(!0),W.value=!0;return}$(!0)}}function He(){$(!1)}function Ue(){W.value=!1,K.value&&=(K.value(),null)}function We(){W.value=!1,K.value=null}async function Ge(){G.value=!1,H.value=!0;let e=await w.del(`/content/${k.value}/${A.value}`);if(H.value=!1,!e.ok){U.value=e.error.message;return}O.invalidate(k.value),C.push({name:`content-list`,params:{type:k.value}})}let Ke=f(()=>{if(F.value===`create`)return`New ${j.value?.label??``}`;if(F.value===`singleton`)return j.value?.label??``;let e=M.value.find(e=>e.field_type===`text/plain`);return(e?String(I.value?.[e.name]??``):``)||(j.value?.label??``)});return(t,c)=>V.value?(n(),s(`div`,_e,[...c[3]||=[a(`span`,{class:`inline-block h-6 w-6 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent`,"aria-hidden":`true`},null,-1)]])):j.value?(n(),s(`div`,ye,[a(`div`,be,[a(`div`,null,[a(`p`,xe,h(j.value.label),1),a(`h1`,Se,h(Ke.value),1)]),a(`div`,Ce,[i(T)(`content:delete`)&&F.value===`edit`?(n(),s(`button`,{key:0,type:`button`,disabled:H.value,class:`inline-flex items-center gap-1.5 rounded-[10px] border border-[#F3D2D7] bg-white px-[15px] py-2.5 text-[13px] font-semibold text-[#E1495B] transition-colors hover:bg-[#FDF2F4] disabled:cursor-not-allowed disabled:opacity-50`,onClick:c[0]||=e=>G.value=!0},` Delete `,8,we)):m(``,!0),i(T)(`content:edit`)?(n(),s(l,{key:1},[R.value?(n(),s(`button`,{key:0,type:`button`,disabled:H.value,class:`rounded-[10px] border border-[#E4E3EE] bg-white px-4 py-2.5 text-[13px] font-semibold text-[#3D3D52] transition-colors hover:bg-surface disabled:cursor-not-allowed disabled:opacity-50`,onClick:He},` Unpublish `,8,Te)):(n(),s(`button`,{key:1,type:`button`,disabled:H.value,class:`rounded-[10px] border border-[#E4E3EE] bg-white px-4 py-2.5 text-[13px] font-semibold text-[#3D3D52] transition-colors hover:bg-surface disabled:cursor-not-allowed disabled:opacity-50`,onClick:Ve},` Publish `,8,Ee)),a(`button`,{type:`button`,disabled:H.value,class:`inline-flex items-center gap-1.5 rounded-[10px] bg-indigo-600 px-4 py-2.5 text-[13px] font-semibold text-white shadow-[0_3px_10px_rgba(91,87,232,0.3)] transition-all hover:bg-indigo-700 hover:shadow-[0_6px_18px_rgba(91,87,232,0.4)] disabled:cursor-not-allowed disabled:opacity-50`,onClick:Be},h(H.value?`Saving…`:`Save draft`),9,De)],64)):m(``,!0)])]),P.value?m(``,!0):(n(),s(`div`,Oe,[c[4]||=a(`label`,{for:`slug-field`,class:`block text-[13px] font-semibold text-[#3D3D52]`},[ne(` Slug `),a(`span`,{class:`ml-0.5 text-red-500`,"aria-hidden":`true`},`*`)],-1),a(`div`,ke,[ee(a(`input`,{id:`slug-field`,"onUpdate:modelValue":c[1]||=e=>L.value.slug=e,type:`text`,disabled:H.value||R.value&&!B.value,class:o([`block min-w-[180px] flex-1 rounded-[10px] border px-[13px] py-[11px] font-mono text-sm focus:outline-none focus:ring-2`,i(E).slug?`border-red-300 focus:border-red-400 focus:ring-red-200`:`border-[#E4E3EE] bg-surface focus:border-indigo-400 focus:ring-indigo-200`,(H.value||R.value&&!B.value)&&`cursor-not-allowed bg-gray-100 opacity-70`]),placeholder:`url-slug`},null,10,Ae),[[le,L.value.slug]]),R.value&&!B.value?(n(),s(`button`,{key:0,type:`button`,class:`shrink-0 rounded-[10px] border border-[#E4E3EE] bg-white px-4 py-2.5 text-sm font-semibold text-[#3D3D52] transition-colors hover:bg-surface`,onClick:c[2]||=e=>B.value=!0},` Edit slug `)):m(``,!0)]),R.value?(n(),s(`p`,_,` Changing this slug will break existing links. `)):m(``,!0),i(E).slug?(n(),s(`p`,v,h(i(E).slug),1)):m(``,!0)])),N.value.length>1?(n(),s(`div`,{key:1,ref_key:`tabBarRef`,ref:J,class:`relative mb-[22px] flex gap-0 overflow-x-auto border-b border-card-border`},[(n(!0),s(l,null,r(N.value,(e,t)=>(n(),s(`button`,{key:e.name,"data-tab":e.name,type:`button`,class:o([`mr-6 whitespace-nowrap bg-none px-0.5 py-[11px] text-sm transition-colors`,q.value===t?`font-semibold text-indigo-600`:`font-medium text-faint hover:text-[#8A8A9E]`]),onClick:e=>q.value=t},h(e.label),11,y))),128)),a(`div`,{class:`absolute -bottom-px h-0.5 rounded-full bg-indigo-600 transition-[left,width] duration-300`,style:te({left:`${i(Le)}px`,width:`${i(Re)}px`})},null,4)],512)):m(``,!0),a(`div`,b,[(n(!0),s(l,null,r(Y.value,t=>(n(),d(e(i(de)(t)),ie({key:t.name,field:t,"model-value":L.value[t.name],error:i(E)[t.name],disabled:H.value},{ref_for:!0},i(fe)(t),{"onUpdate:modelValue":e=>ze(t.name,e)}),null,16,[`field`,`model-value`,`error`,`disabled`,`onUpdate:modelValue`]))),128))]),U.value?(n(),s(`p`,x,h(U.value),1)):m(``,!0),W.value?(n(),d(g,{key:3,message:`This item is published. Changing its slug will break existing links. Continue?`,"on-confirm":Ue,"on-cancel":We})):m(``,!0),G.value?(n(),d(g,{key:4,message:`Are you sure you want to delete this item? This action cannot be undone.`,"on-confirm":Ge,"on-cancel":()=>G.value=!1},null,8,[`on-cancel`])):m(``,!0)])):(n(),s(`div`,ve,` Content type not found. `))}});export{S as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{A as e,B as t,E as n,O as r,W as i,c as a,d as o,g as s,i as c,j as l,l as u,s as d,t as ee,u as f,ut as p,w as m,x as te}from"./schema-B-RKX_ep.js";import{c as ne,n as h,s as g,t as _}from"./index-stKCwnA4.js";import{i as v,n as y,r as b,t as x}from"./field-defaults-DLoPESiE.js";import{t as S}from"./useNotification-BdRk9gQY.js";import{t as re}from"./ConfirmDialog-B7nxdDge.js";import{t as ie}from"./taxonomy-DC-6wyg3.js";function ae(e,t){let n={};for(let r of e)r.field_type!==`programmatic`&&(n[r.name]=t?.[r.name]??x(r));return n}var oe={key:0,class:`flex items-center justify-center py-20`},se={key:1,class:`py-12 text-center text-sm text-gray-500`},ce={key:2},C={class:`mb-6 flex items-start justify-between gap-4`},w={class:`text-xs font-medium uppercase tracking-wide text-gray-400`},T={class:`text-[26px] font-bold tracking-tight text-ink`},E={class:`flex shrink-0 items-center gap-2`},D=[`disabled`],O=[`disabled`],k={class:`space-y-5`},A={key:0,class:`mt-4 text-sm text-red-600`,role:`alert`},j=s({__name:`TaxonomyFormView`,setup(s){let x=g(),j=ne(),M=_(),{can:N}=h(),{errors:P,validate:F,mergeServerErrors:I,clearErrors:L,setError:le}=v(),R=S(),z=ee(),B=ie(),V=d(()=>x.params.type),H=d(()=>x.params.id),U=d(()=>!!H.value),W=d(()=>z.taxonomyTypes[V.value]),G=d(()=>W.value?.fields??[]),K=t(null),q=t({}),J=t(!0),Y=t(!1),X=t(``),Z=t(!1);function Q(e){q.value=ae(G.value,e)}function ue(e,t){q.value[e]=t}async function $(e){let t=await M.get(`/taxonomy/${V.value}/${e}`);t.ok?(K.value=t.data,Q(t.data)):X.value=t.error.message}m(async()=>{if(!W.value){J.value=!1;return}U.value&&H.value?await $(H.value):Q(),J.value=!1}),l(H,async(e,t)=>{e!==t&&(J.value=!0,L(),e?await $(e):(K.value=null,Q()),J.value=!1)});async function de(){if(!F(G.value,q.value))return;Y.value=!0,X.value=``;let e=U.value?await M.patch(`/taxonomy/${V.value}/${H.value}`,q.value):await M.post(`/taxonomy/${V.value}`,q.value);if(Y.value=!1,!e.ok){let t=e.error;t.code===`PUBLISH_VALIDATION_ERROR`&&t.details?I(t.details):t.code===`SLUG_CONFLICT`?le(`slug`,`This slug is already taken.`):X.value=t.message;return}K.value=e.data,B.invalidate(V.value),R.success(`Saved.`),U.value||j.replace({name:`taxonomy-edit`,params:{type:V.value,id:String(e.data.id)}})}async function fe(){Z.value=!1,Y.value=!0;let e=await M.del(`/taxonomy/${V.value}/${H.value}`);if(Y.value=!1,!e.ok){X.value=e.error.message;return}B.invalidate(V.value),j.push({name:`taxonomy-list`,params:{type:V.value}})}let pe=d(()=>{if(!U.value)return`New ${W.value?.label??``}`;let e=G.value.find(e=>e.field_type===`text/plain`);return e?String(K.value?.[e.name]??``):W.value?.label??``});return(t,s)=>J.value?(n(),o(`div`,oe,[...s[1]||=[a(`span`,{class:`inline-block h-6 w-6 animate-spin rounded-full border-2 border-indigo-600 border-t-transparent`,"aria-hidden":`true`},null,-1)]])):W.value?(n(),o(`div`,ce,[a(`div`,C,[a(`div`,null,[a(`p`,w,p(W.value.label),1),a(`h1`,T,p(pe.value),1)]),a(`div`,E,[i(N)(`taxonomy:delete`)&&U.value?(n(),o(`button`,{key:0,type:`button`,disabled:Y.value,class:`rounded-md px-3 py-2 text-sm font-medium text-red-600 ring-1 ring-inset ring-red-300 hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-50`,onClick:s[0]||=e=>Z.value=!0},` Delete `,8,D)):f(``,!0),(U.value?i(N)(`taxonomy:edit`):i(N)(`taxonomy:create`))?(n(),o(`button`,{key:1,type:`button`,disabled:Y.value,class:`rounded-[11px] bg-indigo-600 px-4 py-2.5 text-[13.5px] font-semibold text-white shadow-[0_3px_10px_rgba(91,87,232,0.3)] transition-all hover:bg-indigo-700 hover:shadow-[0_6px_18px_rgba(91,87,232,0.4)] disabled:cursor-not-allowed disabled:opacity-50`,onClick:de},p(Y.value?`Saving…`:`Save`),9,O)):f(``,!0)])]),a(`div`,k,[(n(!0),o(c,null,r(G.value,t=>(n(),u(e(i(y)(t)),te({key:t.name,field:t,"model-value":q.value[t.name],error:i(P)[t.name],disabled:Y.value},{ref_for:!0},i(b)(t),{"onUpdate:modelValue":e=>ue(t.name,e)}),null,16,[`field`,`model-value`,`error`,`disabled`,`onUpdate:modelValue`]))),128))]),X.value?(n(),o(`p`,A,p(X.value),1)):f(``,!0),Z.value?(n(),u(re,{key:1,message:`Are you sure you want to delete this term? This action cannot be undone.`,"on-confirm":fe,"on-cancel":()=>Z.value=!1},null,8,[`on-cancel`])):f(``,!0)])):(n(),o(`div`,se,` Taxonomy type not found. `))}});export{j as default};
|