@bobbykim/manguito-cms-admin 0.5.1 → 0.5.3
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-D-B7xv5c.js → ChangePasswordView-v3tSL_0C.js} +1 -1
- package/dist/assets/ContentFormView-DneaTAaq.js +1 -0
- package/dist/assets/{ContentListView-BpgXHLa6.js → ContentListView-i3MwjmNq.js} +1 -1
- package/dist/assets/{ContentSettingsView-CuuxtUQh.js → ContentSettingsView-4cpotfsZ.js} +1 -1
- package/dist/assets/{LoginView-BdqDyYJ6.js → LoginView-BObIe0zr.js} +1 -1
- package/dist/assets/{MediaDetailView-DmKNv8bW.js → MediaDetailView-BKTDY6Ne.js} +1 -1
- package/dist/assets/MediaLibraryView-DojOE-wL.js +1 -0
- package/dist/assets/MediaThumbnail-Ckiw3oQ9.js +1 -0
- package/dist/assets/TaxonomyFormView-Chd_LUly.js +1 -0
- package/dist/assets/{TaxonomyListView-kaf2LX5v.js → TaxonomyListView-Cy3iI1oC.js} +1 -1
- package/dist/assets/{UserFormView-KlTIvn2s.js → UserFormView-B2m4OdJV.js} +1 -1
- package/dist/assets/{UserListView-_HSsX1vW.js → UserListView-z6weJ8UF.js} +1 -1
- package/dist/assets/field-defaults-DLoPESiE.js +97 -0
- package/dist/assets/{index-DHBhcS6-.js → index-stKCwnA4.js} +2 -2
- package/dist/assets/{useNotification-B8AtuEWL.js → useNotification-BdRk9gQY.js} +1 -1
- package/dist/assets/useTabIndicator-CvEsGBJh.js +1 -0
- package/dist/index.html +1 -1
- package/package.json +4 -3
- package/src/components/fields/MediaUpload.vue +2 -3
- package/src/utils/__tests__/taxonomy-form.test.ts +17 -18
- package/src/utils/taxonomy-form.ts +7 -15
- package/src/views/media/MediaLibraryView.vue +2 -1
- package/src/views/taxonomy/TaxonomyFormView.vue +2 -27
- package/src/views/taxonomy/__tests__/TaxonomyFormView.test.ts +71 -0
- package/dist/assets/ContentFormView-Bfee-uVL.js +0 -1
- package/dist/assets/MediaLibraryView-OGPHji7F.js +0 -1
- package/dist/assets/MediaThumbnail-q7pxungQ.js +0 -1
- package/dist/assets/TaxonomyFormView-Dzaz47pa.js +0 -1
- package/dist/assets/field-defaults-m6kJphku.js +0 -97
|
@@ -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-BdqDyYJ6.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-D-B7xv5c.js`),__vite__mapDeps([2,1]))},{path:`content/:type`,name:`content-list`,component:()=>$(()=>import(`./ContentListView-BpgXHLa6.js`),__vite__mapDeps([3,1,4,5]))},{path:`content/:type/new`,name:`content-new`,component:()=>$(()=>import(`./ContentFormView-Bfee-uVL.js`),__vite__mapDeps([6,1,7,8,4,9,10]))},{path:`content/:type/settings`,name:`content-settings`,component:()=>$(()=>import(`./ContentSettingsView-CuuxtUQh.js`),__vite__mapDeps([11,1,8])),meta:{permission:`content:edit`}},{path:`content/:type/:id`,name:`content-edit`,component:()=>$(()=>import(`./ContentFormView-Bfee-uVL.js`),__vite__mapDeps([6,1,7,8,4,9,10]))},{path:`taxonomy/:type`,name:`taxonomy-list`,component:()=>$(()=>import(`./TaxonomyListView-kaf2LX5v.js`),__vite__mapDeps([12,1,5,13]))},{path:`taxonomy/:type/new`,name:`taxonomy-new`,component:()=>$(()=>import(`./TaxonomyFormView-Dzaz47pa.js`),__vite__mapDeps([14,1,7,8,9,13]))},{path:`taxonomy/:type/:id`,name:`taxonomy-edit`,component:()=>$(()=>import(`./TaxonomyFormView-Dzaz47pa.js`),__vite__mapDeps([14,1,7,8,9,13]))},{path:`media`,name:`media-library`,component:()=>$(()=>import(`./MediaLibraryView-OGPHji7F.js`),__vite__mapDeps([15,1,8,9,10,5,16]))},{path:`media/:id`,name:`media-detail`,component:()=>$(()=>import(`./MediaDetailView-DmKNv8bW.js`),__vite__mapDeps([17,1,8,9,16]))},{path:`users`,name:`user-list`,component:()=>$(()=>import(`./UserListView-_HSsX1vW.js`),__vite__mapDeps([18,1,19])),meta:{permission:`users:read`}},{path:`users/new`,name:`user-new`,component:()=>$(()=>import(`./UserFormView-KlTIvn2s.js`),__vite__mapDeps([20,1,8,9,19])),meta:{permission:`users:read`}},{path:`users/:id`,name:`user-edit`,component:()=>$(()=>import(`./UserFormView-KlTIvn2s.js`),__vite__mapDeps([20,1,8,9,19])),meta:{permission:`users:read`}},{path:`roles`,name:`roles`,component:()=>$(()=>import(`./RolesView-DO-Tb2Yr.js`),__vite__mapDeps([21,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-BObIe0zr.js","assets/schema-B-RKX_ep.js","assets/ChangePasswordView-v3tSL_0C.js","assets/ContentListView-i3MwjmNq.js","assets/content--2XYr_UQ.js","assets/Pagination-BIf7mQy7.js","assets/ContentFormView-DneaTAaq.js","assets/field-defaults-DLoPESiE.js","assets/MediaThumbnail-Ckiw3oQ9.js","assets/useNotification-BdRk9gQY.js","assets/ConfirmDialog-B7nxdDge.js","assets/useTabIndicator-CvEsGBJh.js","assets/ContentSettingsView-4cpotfsZ.js","assets/TaxonomyListView-Cy3iI1oC.js","assets/taxonomy-DC-6wyg3.js","assets/TaxonomyFormView-Chd_LUly.js","assets/MediaLibraryView-DojOE-wL.js","assets/media-DvQfZD4o.js","assets/MediaDetailView-BKTDY6Ne.js","assets/UserListView-z6weJ8UF.js","assets/users-DVibZ_HD.js","assets/UserFormView-B2m4OdJV.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-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 +1 @@
|
|
|
1
|
-
import{r as e}from"./index-
|
|
1
|
+
import{r as e}from"./index-stKCwnA4.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e,S as t,j as n}from"./schema-B-RKX_ep.js";function r(r,i){let a=e(0),o=e(0);function s(){let e=r.value;if(!e)return;let t=e.querySelector(`[data-tab="${i.value}"]`);t&&(a.value=t.offsetLeft,o.value=t.offsetWidth)}return n([r,i],()=>{t(()=>s())},{immediate:!0}),{left:a,width:o,measure:s}}export{r 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-stKCwnA4.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.3",
|
|
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.9.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) {
|
|
@@ -39,25 +39,24 @@ const fields: ParsedField[] = [
|
|
|
39
39
|
] as unknown as ParsedField[]
|
|
40
40
|
|
|
41
41
|
describe('initialTaxonomyForm', () => {
|
|
42
|
-
it('
|
|
43
|
-
// MUTATION:
|
|
44
|
-
//
|
|
45
|
-
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
expect(form).
|
|
50
|
-
expect(form).not.toHaveProperty('related')
|
|
51
|
-
expect(form).not.toHaveProperty('computed')
|
|
52
|
-
})
|
|
42
|
+
it('includes relation fields, from the source or their empty default', () => {
|
|
43
|
+
// MUTATION: keep leaving paragraph and many-to-many fields out (before
|
|
44
|
+
// #55). The taxonomy form then cannot show or edit them, although the
|
|
45
|
+
// edit read now returns them.
|
|
46
|
+
const form = initialTaxonomyForm(fields, {
|
|
47
|
+
name: 'Tag', parent: 'p-1', blocks: [{ title: 'b' }], hero: { title: 'h' }, related: ['t-2'],
|
|
48
|
+
})
|
|
49
|
+
expect(form).toMatchObject({ blocks: [{ title: 'b' }], hero: { title: 'h' }, related: ['t-2'] })
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
expect(initialTaxonomyForm(fields, { name: 'Tag', parent: 'p-1' })).toEqual({
|
|
58
|
-
name: 'Tag',
|
|
59
|
-
parent: 'p-1',
|
|
51
|
+
// Empty defaults follow cardinality: a list for "many", null for "one".
|
|
52
|
+
expect(initialTaxonomyForm(fields)).toEqual({
|
|
53
|
+
name: '', parent: null, blocks: [], hero: null, related: [],
|
|
60
54
|
})
|
|
61
|
-
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('leaves programmatic fields out: they are computed and never saved', () => {
|
|
58
|
+
// MUTATION: put programmatic fields into the form. Save would then send a
|
|
59
|
+
// computed value back to the api.
|
|
60
|
+
expect(initialTaxonomyForm(fields, { name: 'Tag', computed: 'x' })).not.toHaveProperty('computed')
|
|
62
61
|
})
|
|
63
62
|
})
|
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
import type { ParsedField } from '@bobbykim/manguito-cms-core'
|
|
2
2
|
import { defaultForField } from './field-defaults'
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
// field
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return field.db_column !== null && !field.db_column.junction
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// The taxonomy form's starting state, which is also what Save sends. A field
|
|
14
|
-
// the read does not return stays out of it: sending it as null would fail the
|
|
15
|
-
// api's relation shape check for a "many" field and erase a one-to-one
|
|
16
|
-
// paragraph, while an absent field is left untouched by the api.
|
|
17
|
-
// Programmatic fields are computed at read time and never submitted.
|
|
4
|
+
// The taxonomy form's starting state, which is also what Save sends. Every
|
|
5
|
+
// field the taxonomy edit read returns is included, relation fields too: the
|
|
6
|
+
// read loads paragraph fields and many-to-many link ids (#55). A field with no
|
|
7
|
+
// stored value starts at its empty default (null for a 'one' relation, [] for
|
|
8
|
+
// a 'many' one). Programmatic fields are computed at read time and never
|
|
9
|
+
// submitted, so they stay out.
|
|
18
10
|
export function initialTaxonomyForm(
|
|
19
11
|
fields: ParsedField[],
|
|
20
12
|
source?: Record<string, unknown>
|
|
21
13
|
): Record<string, unknown> {
|
|
22
14
|
const form: Record<string, unknown> = {}
|
|
23
15
|
for (const field of fields) {
|
|
24
|
-
if (
|
|
16
|
+
if (field.field_type === 'programmatic') continue
|
|
25
17
|
form[field.name] = source?.[field.name] ?? defaultForField(field)
|
|
26
18
|
}
|
|
27
19
|
return form
|
|
@@ -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,8 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, computed, onMounted, watch } from 'vue'
|
|
3
|
-
import type { Component } from 'vue'
|
|
4
3
|
import { useRoute, useRouter } from 'vue-router'
|
|
5
|
-
import type { ParsedField } from '@bobbykim/manguito-cms-core'
|
|
6
4
|
import { useApiClient } from '../../composables/useApiClient'
|
|
7
5
|
import { usePermission } from '../../composables/usePermission'
|
|
8
6
|
import { useFormValidation } from '../../composables/useFormValidation'
|
|
@@ -10,13 +8,7 @@ import { useNotification } from '../../composables/useNotification'
|
|
|
10
8
|
import { useSchemaStore } from '../../stores/schema'
|
|
11
9
|
import { useTaxonomyStore } from '../../stores/taxonomy'
|
|
12
10
|
import { initialTaxonomyForm } from '../../utils/taxonomy-form'
|
|
13
|
-
import
|
|
14
|
-
import RichTextEditor from '../../components/fields/RichTextEditor.vue'
|
|
15
|
-
import NumberInput from '../../components/fields/NumberInput.vue'
|
|
16
|
-
import BooleanToggle from '../../components/fields/BooleanToggle.vue'
|
|
17
|
-
import DatePicker from '../../components/fields/DatePicker.vue'
|
|
18
|
-
import EnumSelect from '../../components/fields/EnumSelect.vue'
|
|
19
|
-
import ComputedDisplay from '../../components/fields/ComputedDisplay.vue'
|
|
11
|
+
import { componentFor, fieldExtraProps } from '../../components/fields/field-registry'
|
|
20
12
|
import ConfirmDialog from '../../components/shared/ConfirmDialog.vue'
|
|
21
13
|
|
|
22
14
|
const route = useRoute()
|
|
@@ -48,24 +40,6 @@ const saving = ref(false)
|
|
|
48
40
|
const formError = ref('')
|
|
49
41
|
const showDeleteConfirm = ref(false)
|
|
50
42
|
|
|
51
|
-
// ── Field component mapping (flat — no paragraphs, media, or references in taxonomy) ──
|
|
52
|
-
|
|
53
|
-
const FIELD_COMP = {
|
|
54
|
-
'text/plain': TextInput,
|
|
55
|
-
'text/rich': RichTextEditor,
|
|
56
|
-
integer: NumberInput,
|
|
57
|
-
float: NumberInput,
|
|
58
|
-
boolean: BooleanToggle,
|
|
59
|
-
date: DatePicker,
|
|
60
|
-
enum: EnumSelect,
|
|
61
|
-
programmatic: ComputedDisplay,
|
|
62
|
-
} as const
|
|
63
|
-
|
|
64
|
-
function componentFor(field: ParsedField): Component {
|
|
65
|
-
const key = field.field_type as keyof typeof FIELD_COMP
|
|
66
|
-
return FIELD_COMP[key] ?? TextInput
|
|
67
|
-
}
|
|
68
|
-
|
|
69
43
|
// ── Form helpers ──────────────────────────────────────────────────────────────
|
|
70
44
|
|
|
71
45
|
function initForm(source?: Record<string, unknown>) {
|
|
@@ -241,6 +215,7 @@ const pageTitle = computed(() => {
|
|
|
241
215
|
:model-value="form[field.name]"
|
|
242
216
|
:error="errors[field.name]"
|
|
243
217
|
:disabled="saving"
|
|
218
|
+
v-bind="fieldExtraProps(field)"
|
|
244
219
|
@update:model-value="updateField(field.name, $event)"
|
|
245
220
|
/>
|
|
246
221
|
</div>
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
|
2
|
+
import { mount, flushPromises } from '@vue/test-utils'
|
|
3
|
+
import { createPinia, setActivePinia } from 'pinia'
|
|
4
|
+
import type { ParsedField, ParsedTaxonomyType } from '@bobbykim/manguito-cms-core'
|
|
5
|
+
import { useSchemaStore } from '../../../stores/schema'
|
|
6
|
+
import TaxonomyFormView from '../TaxonomyFormView.vue'
|
|
7
|
+
import ParagraphEmbed from '../../../components/fields/ParagraphEmbed.vue'
|
|
8
|
+
import ReferenceSelect from '../../../components/fields/ReferenceSelect.vue'
|
|
9
|
+
import MediaUpload from '../../../components/fields/MediaUpload.vue'
|
|
10
|
+
|
|
11
|
+
// Create mode: no :id param, so the form renders from defaults with no fetch.
|
|
12
|
+
vi.mock('vue-router', () => ({
|
|
13
|
+
useRoute: () => ({ params: { type: 'taxonomy--tag' } }),
|
|
14
|
+
useRouter: () => ({ push: vi.fn() }),
|
|
15
|
+
}))
|
|
16
|
+
|
|
17
|
+
const base = { required: false, nullable: true, order: 0, validation: { required: false } }
|
|
18
|
+
|
|
19
|
+
const tagType = {
|
|
20
|
+
schema_type: 'taxonomy-type',
|
|
21
|
+
name: 'taxonomy--tag',
|
|
22
|
+
label: 'Tag',
|
|
23
|
+
source_file: '',
|
|
24
|
+
system_fields: [],
|
|
25
|
+
fields: [
|
|
26
|
+
{ ...base, name: 'name', label: 'Name', field_type: 'text/plain',
|
|
27
|
+
db_column: { column_name: 'name', column_type: 'varchar', nullable: true }, ui_component: { component: 'text-input' } },
|
|
28
|
+
{ ...base, name: 'icon', label: 'Icon', field_type: 'image',
|
|
29
|
+
validation: { required: false, allowed_mime_types: ['image/png'] },
|
|
30
|
+
db_column: { column_name: 'icon', column_type: 'uuid', nullable: true },
|
|
31
|
+
ui_component: { component: 'file-upload', accepted_mime_types: ['image/*'] } },
|
|
32
|
+
{ ...base, name: 'parent', label: 'Parent', field_type: 'reference',
|
|
33
|
+
db_column: { column_name: 'parent', column_type: 'uuid', nullable: true },
|
|
34
|
+
ui_component: { component: 'typeahead-select', ref: 'taxonomy--tag', rel: 'one-to-one' } },
|
|
35
|
+
{ ...base, name: 'related', label: 'Related', field_type: 'reference',
|
|
36
|
+
db_column: { column_name: '', column_type: 'uuid', nullable: true,
|
|
37
|
+
junction: { table_name: 'junction_taxonomy_tag_related', left_column: 'left_id', right_column: 'right_id', right_table: 'taxonomy_tag', order_column: false } },
|
|
38
|
+
ui_component: { component: 'typeahead-select', ref: 'taxonomy--tag', rel: 'many-to-many' } },
|
|
39
|
+
{ ...base, name: 'blurb', label: 'Blurb', field_type: 'paragraph', db_column: null,
|
|
40
|
+
ui_component: { component: 'paragraph-embed', ref: 'paragraph--blurb', rel: 'one-to-one' } },
|
|
41
|
+
] as unknown as ParsedField[],
|
|
42
|
+
db: { table_name: 'taxonomy_tag', junction_tables: [] },
|
|
43
|
+
} as unknown as ParsedTaxonomyType
|
|
44
|
+
|
|
45
|
+
let pinia: ReturnType<typeof createPinia>
|
|
46
|
+
|
|
47
|
+
beforeEach(() => {
|
|
48
|
+
pinia = createPinia()
|
|
49
|
+
setActivePinia(pinia)
|
|
50
|
+
useSchemaStore().setSchema(tagType)
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
describe('TaxonomyFormView', () => {
|
|
54
|
+
it('renders relation and media fields with their real editors, not a text box', async () => {
|
|
55
|
+
// MUTATION: keep the view's own flat component map (before #55). Every
|
|
56
|
+
// paragraph, reference and media field then falls back to TextInput.
|
|
57
|
+
const w = mount(TaxonomyFormView, { global: { plugins: [pinia] } })
|
|
58
|
+
await flushPromises()
|
|
59
|
+
expect(w.findComponent(MediaUpload).exists()).toBe(true)
|
|
60
|
+
expect(w.findAllComponents(ReferenceSelect)).toHaveLength(2)
|
|
61
|
+
expect(w.findComponent(ParagraphEmbed).exists()).toBe(true)
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('gives the paragraph editor its paragraph form', async () => {
|
|
65
|
+
// MUTATION: render with componentFor but drop `v-bind="fieldExtraProps(field)"`.
|
|
66
|
+
// ParagraphEmbed then has no formComponent and cannot render its item.
|
|
67
|
+
const w = mount(TaxonomyFormView, { global: { plugins: [pinia] } })
|
|
68
|
+
await flushPromises()
|
|
69
|
+
expect(w.findComponent(ParagraphEmbed).props('formComponent')).toBeTruthy()
|
|
70
|
+
})
|
|
71
|
+
})
|