Validate sessions against the API, honor configurable base paths, and route unknown pages to 404. Keep development ports stable so user and admin apps cannot be confused. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 line
1.4 KiB
JavaScript
1 line
1.4 KiB
JavaScript
import{$ as e,Ct as t,V as n,X as r,Z as i,et as a,it as o,lt as s,xt as c}from"./index-B2VD3zy8.js";var l=[`title`],u={key:0,class:`base-switch__label`},d={class:`base-switch__control`},f=[`id`,`checked`,`disabled`,`aria-checked`,`aria-label`],p={class:`base-switch__track`,"aria-hidden":`true`},m={class:`base-switch__thumb`},h={key:0,class:`base-switch__spinner`},g=n(o({__name:`BaseSwitch`,props:{modelValue:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},error:{type:Boolean},label:{},activeText:{default:`فعال`},inactiveText:{default:`غیرفعال`},id:{}},emits:[`update:modelValue`],setup(n,{emit:o}){let g=n,_=o,v=r(()=>g.id??`switch-${crypto.randomUUID().slice(0,8)}`),y=r(()=>g.modelValue?g.activeText:g.inactiveText);function b(e){let t=e.target,n=t.checked;t.checked=g.modelValue,!(g.disabled||g.loading)&&_(`update:modelValue`,n)}return(r,o)=>(s(),a(`label`,{class:c([`base-switch`,{"base-switch--disabled":n.disabled||n.loading,"base-switch--error":n.error}]),title:y.value},[n.label?(s(),a(`span`,u,t(n.label),1)):e(``,!0),i(`span`,d,[i(`input`,{id:v.value,class:`base-switch__input`,type:`checkbox`,role:`switch`,checked:n.modelValue,disabled:n.disabled||n.loading,"aria-checked":n.modelValue,"aria-label":n.label||y.value,onChange:b},null,40,f),i(`span`,p,[i(`span`,m,[n.loading?(s(),a(`span`,h)):e(``,!0)])])])],10,l))}}),[[`__scopeId`,`data-v-0410eed4`]]);export{g as t}; |