@bagelink/vue 1.4.118 → 1.4.122
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/components/form/inputs/DatePicker.vue.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/style.css +1 -1
- package/dist/types/BagelForm.d.ts +2 -2
- package/dist/types/BagelForm.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/inputs/DatePicker.vue +3 -2
- package/src/types/BagelForm.ts +2 -2
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var e=function(exports){function t(e){"@babel/helpers - typeof";return t=typeof
|
|
|
6
6
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
7
7
|
transition: transform 0.1s;
|
|
8
8
|
}
|
|
9
|
-
`,document.head.appendChild(e)}}let s={animation:150,mode:`line`,ghostClass:`draggable-ghost`,dragClass:`draggable-dragging`,dropIndicatorClass:`draggable-drop-indicator`,...e},c=0,l=0,u=0,d=0,f=0,p,m=null,h=-1,g=0,_=150,v=new Map;function y(e){if(!o)return null;let t=e.cloneNode(!0),n=e.getBoundingClientRect();return t.style.position=`fixed`,t.style.margin=`0`,t.style.top=`${n.top}px`,t.style.left=`${n.left}px`,t.style.width=`${n.width}px`,t.style.height=`${n.height}px`,t.style.transform=`translate3d(0, 0, 0)`,t.style.pointerEvents=`none`,t.style.zIndex=`9999`,t.style.cursor=`grabbing`,t.style.willChange=`transform`,t.classList.add(s.ghostClass),document.body.appendChild(t),t}function b(e){if(!o)return null;let t=document.createElement(`div`);t.classList.add(s.dropIndicatorClass),t.style.position=`fixed`,t.style.pointerEvents=`none`,t.style.zIndex=`9999`,t.style.height=`2px`,t.style.background=`var(--primary-color, #0066ff)`,t.style.boxShadow=`0 0 4px rgba(0, 102, 255, 0.5)`,t.style.transition=`all 0.15s ease`,t.style.display=`none`;let n=document.createElement(`div`);return n.style.position=`absolute`,n.style.left=`-4px`,n.style.top=`-3px`,n.style.width=`8px`,n.style.height=`8px`,n.style.borderRadius=`50%`,n.style.background=`var(--primary-color, #0066ff)`,t.appendChild(n),document.body.appendChild(t),t}function x(e,t){if(!i.value)return;let n=e.getBoundingClientRect();i.value.style.display=`block`,i.value.style.width=`${n.width}px`,i.value.style.left=`${n.left}px`,t?i.value.style.top=`${n.bottom}px`:i.value.style.top=`${n.top}px`}function S(e){let t=e;for(;t&&(!(`__drag_group`in t)||t.dataset.draggable===`false`);)t=t.parentElement;return t}function C(e){return e.style.opacity=`0.4`,e.style.transform=`scale(0.95)`,e.offsetHeight}function w(e){return e.style.opacity=`0.5`,2}function T(e){v.clear(),e.forEach((e,t)=>{let n=e.getBoundingClientRect();v.set(t,{top:n.top,bottom:n.bottom})})}function E(e,t,n,r){let i=Date.now();if(i-g<_)return h===-1?n:h;v.size===0&&T(t);let a=e.clientY,o=t.indexOf(r),s=v.get(o);if(!s)return n;let c=s.bottom-s.top,l=a-s.top,u=c*.3,d=c*.7,f=o;return o===n?l>d&&(f+=1):o===h?f=o>n?l<u?o:o+1:l>d?o+1:o:l>c*.6&&(f+=1),h=f,g=i,f}function D(){if(o){if(document.removeEventListener(`mousemove`,M),document.removeEventListener(`mouseup`,ee),document.removeEventListener(`keydown`,O),document.removeEventListener(`touchmove`,F),document.removeEventListener(`touchend`,I),document.removeEventListener(`touchcancel`,I),window.removeEventListener(`blur`,D),r.value&&(r.value.style.opacity=`0`,r.value.style.transform+=` scale(0.8)`,setTimeout(()=>{var e;(e=r.value)==null||(e=e.parentNode)==null||e.removeChild(r.value),r.value=null},150)),i.value&&(i.value.style.opacity=`0`,setTimeout(()=>{var e;(e=i.value)==null||(e=e.parentNode)==null||e.removeChild(i.value),i.value=null},150)),n.value){let e=n.value.__drag_list;e?.forEach(e=>{e.style.transition=``,e.style.transform=``,e.style.opacity=``}),n.value.classList.remove(s.dragClass),n.value=null}t.value=!1,a.value=null,o&&(document.body.style.userSelect=``,document.body.style.webkitUserSelect=``,document.body.style.cursor=``),m&&(cancelAnimationFrame(m),m=null),h=-1,g=0,v.clear()}}function O(e){e.key===`Escape`&&t.value&&D()}function k(e){var a;if(!o||s.disabled||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let p=S(e.target);if(!p||p.dataset.draggable===`false`)return;if(s.handle){let t=e.target.closest(s.handle);if(!t||!p.contains(t))return}e.preventDefault(),t.value=!0,n.value=p,c=e.clientX,l=e.clientY;let m=p.getBoundingClientRect();u=m.left,d=m.top,r.value=y(p),r.value&&(r.value.style.left=`${u}px`,r.value.style.top=`${d}px`),s.mode===`line`&&(i.value=b(p)),p.classList.add(s.dragClass),f=s.mode===`ghost`?C(p):w(p),(a=s.onStart)?.call(s,e),o&&(document.body.style.userSelect=`none`,document.body.style.webkitUserSelect=`none`,document.body.style.cursor=`grabbing`,window.addEventListener(`blur`,D),document.addEventListener(`mousemove`,M),document.addEventListener(`mouseup`,ee),document.addEventListener(`keydown`,O))}function A(e){let t=e.parentElement;for(;t;){let{overflow:e,overflowY:n}=window.getComputedStyle(t);if(/auto|scroll/.test(e+n))return t;t=t.parentElement}return document.scrollingElement||document.documentElement||document.body}function j(e){n.value&&(m&&cancelAnimationFrame(m),m=requestAnimationFrame(()=>{let t=A(n.value),r=t.getBoundingClientRect(),i=50,a=Math.min(20,r.height*.1),{scrollTop:o}=t,s=t.scrollHeight-t.clientHeight;if(e.clientY-r.top<i){let e=Math.max(0,o-a);t.scrollTop=e}else if(r.bottom-e.clientY<i){let e=Math.min(s,o+a);t.scrollTop=e}}))}function M(e){if(!t.value||!n.value)return;if(r.value){let t=e.clientX-c,n=e.clientY-l;r.value.style.transform=`translate3d(${t}px, ${n}px, 0)`}let o=n.value.__drag_list,u=o.filter(e=>e.dataset.draggable!==`false`),d=u.indexOf(n.value),p=document.elementFromPoint(e.clientX,e.clientY),m=S(p);if(!m||m.__drag_group!==n.value.__drag_group){i.value&&(i.value.style.display=`none`);return}let h=E(e,u,d,m);if(a.value!==m||a.value.__intended_index!==h){if(a.value=m,a.value.__intended_index=h,i.value&&s.mode===`line`){let e=h>d;x(m,e)}let e=f;u.forEach(t=>{if(t.style.transition=`transform ${s.animation}ms cubic-bezier(0.2, 0, 0, 1)`,t.style.transform=`translate3d(0, 0, 0)`,t===n.value){if(s.mode===`ghost`){let n=(h-d)*e;t.style.transform=`translate3d(0, ${n}px, 0)`}}else{let n=u.indexOf(t);d<h?n>d&&n<=h&&(t.style.transform=`translate3d(0, -${e}px, 0)`):d>h&&n>=h&&n<d&&(t.style.transform=`translate3d(0, ${e}px, 0)`)}})}j(e)}function ee(e){if(!t.value||!n.value||!a.value){D();return}let r=n.value.__drag_list;if(!r||!r.length){D();return}let i=r.filter(e=>e.dataset.draggable!==`false`),o=i.indexOf(n.value),c=a.value.__intended_index;if(o!==-1&&c!==-1){var l;r.forEach(e=>{e.style.transition=`none`,e.style.transform=``}),document.body.offsetHeight;let t=new MouseEvent(`mouseup`,e);t.oldIndex=o,t.newIndex=c,t.item=n.value.__drag_data,(l=s.onEnd)?.call(s,t)}D()}function P(e){var a;if(!o||s.disabled||!e.target)return;let p=e.touches[0];if(!p)return;let m=e.target,h=S(m);if(!h)return;let{handle:g}=s;if(g&&!m.closest(g))return;e.preventDefault(),t.value=!0,n.value=h,c=p.clientX,l=p.clientY;let _=h.getBoundingClientRect();u=_.left,d=_.top,r.value=y(h),r.value&&(r.value.style.left=`${u}px`,r.value.style.top=`${d}px`),s.mode===`line`&&(i.value=b(h)),n.value.classList.add(s.dragClass),f=s.mode===`ghost`?C(n.value):w(n.value),(a=s.onStart)?.call(s,e),o&&(document.body.style.userSelect=`none`,document.body.style.webkitUserSelect=`none`,document.body.style.cursor=`grabbing`,window.addEventListener(`blur`,D),document.addEventListener(`touchmove`,F,{passive:!1}),document.addEventListener(`touchend`,I),document.addEventListener(`touchcancel`,I))}function F(e){e.preventDefault();let t=e.touches[0];if(!t)return;let n={clientX:t.clientX,clientY:t.clientY,target:document.elementFromPoint(t.clientX,t.clientY)};M(n),j(n)}function I(e){let t=e.changedTouches[0];if(!t)return;let n={clientX:t.clientX,clientY:t.clientY,target:document.elementFromPoint(t.clientX,t.clientY)};ee(n),document.removeEventListener(`touchmove`,F),document.removeEventListener(`touchend`,I),document.removeEventListener(`touchcancel`,I)}function te(s){if(!o)return;p?.(),t.value=!1,n.value=null,r.value=null,i.value=null,a.value=null;let c=Array.from(s.children);c.forEach(e=>{delete e.__drag_group,delete e.__drag_index,delete e.__drag_list});let l=0;c.forEach((t,n)=>{t.dataset.draggable!==`false`&&(t.style.userSelect=`none`,t.style.webkitUserSelect=`none`,t.__drag_group=e.group,t.__drag_index=l++,t.__drag_list=c.filter(e=>e.dataset.draggable!==`false`),e.items&&(t.__drag_data=e.items[n]),t.addEventListener(`mousedown`,k),t.addEventListener(`touchstart`,P))}),p=()=>{c.forEach(e=>{e.removeEventListener(`mousedown`,k),e.removeEventListener(`touchstart`,P),delete e.__drag_group,delete e.__drag_index,delete e.__drag_list}),D()}}return N(()=>{p?.()}),{isDragging:t,dragElement:n,initDraggableContainer:te}}var Pr=h({__name:`Draggable`,props:{modelValue:{},group:{},handle:{},mode:{default:`line`},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`start`,`end`],setup(e,{emit:t}){let r=e,i=t,a=L(),{initDraggableContainer:o}=Nr({group:r.group,handle:r.handle,mode:r.mode,disabled:r.disabled,items:r.modelValue,onStart:e=>{i(`start`,e)},onEnd:e=>{let t=[...r.modelValue],[n]=t.splice(e.oldIndex,1);t.splice(e.newIndex,0,n),i(`update:modelValue`,t),i(`end`,e),E(()=>{a.value&&o(a.value)})}});return W(()=>r.modelValue,()=>{a.value&&o(a.value)},{deep:!0}),j(()=>{a.value&&o(a.value)}),(e,t)=>(P(),u(`div`,{ref_key:`dragContainer`,ref:a},[(P(!0),u(n,null,R(e.modelValue,(t,n)=>z(e.$slots,`default`,{key:n,item:t,index:n})),128))],512))}}),Fr=Pr;const Ir={mounted(e,t){let{initDraggableContainer:n}=Nr(t.value||{});n(e)},updated(e,t){if(t.value!==t.oldValue){let{initDraggableContainer:n}=Nr(t.value||{});n(e)}}},Lr={key:0,class:`drag-overlay`};var Rr=h({__name:`DragOver`,props:{multiple:{type:Boolean},accept:{},disabled:{type:Boolean},browse:{type:Boolean}},emits:[`addFiles`],setup(e,{emit:t}){let n=e,r=t,i=L(!1),a=L(0);function o(e){n.disabled||(e.preventDefault(),e.stopPropagation(),a.value++,i.value=!0)}function s(e){n.disabled||(e.preventDefault(),e.stopPropagation())}function c(e){n.disabled||(e.preventDefault(),e.stopPropagation(),a.value--,a.value===0&&(i.value=!1))}function d(e){if(!n.browse||n.disabled)return;e.preventDefault(),e.stopPropagation();let t=document.createElement(`input`);t.type=`file`,t.multiple=!!n.multiple,t.accept=n.accept||`*`,t.onchange=e=>{let{files:t}=e.target;t&&r(`addFiles`,t)},t.click()}function f(e){n.disabled||(e.preventDefault(),e.stopPropagation(),a.value=0,i.value=!1,e.dataTransfer&&r(`addFiles`,e.dataTransfer.files))}return(e,t)=>(P(),u(`div`,{class:D([`drag-over-container`,{"is-dragging":i.value,"is-disabled":e.disabled}]),onDragenter:o,onDragover:s,onDragleave:c,onDrop:f,onClick:d},[z(e.$slots,`default`,{},void 0,!0),i.value&&!e.disabled?(P(),u(`div`,Lr,[m(U($),{name:`download`,color:`white`,size:`2`})])):l(``,!0)],34))}}),zr=q(Rr,[[`__scopeId`,`data-v-2d9b6701`]]);const Br=[`top`,`right`,`bottom`,`left`],Vr=[`start`,`end`],Hr=Br.reduce((e,t)=>e.concat(t,t+`-`+Vr[0],t+`-`+Vr[1]),[]),Ur=Math.min,Wr=Math.max,Gr={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Kr={start:`end`,end:`start`};function qr(e,t,n){return Wr(e,Ur(t,n))}function Jr(e,t){return typeof e==`function`?e(t):e}function Yr(e){return e.split(`-`)[0]}function Xr(e){return e.split(`-`)[1]}function Zr(e){return e===`x`?`y`:`x`}function Qr(e){return e===`y`?`height`:`width`}function $r(e){return[`top`,`bottom`].includes(Yr(e))?`y`:`x`}function ei(e){return Zr($r(e))}function ti(e,t,n){n===void 0&&(n=!1);let r=Xr(e),i=ei(e),a=Qr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=oi(o)),[o,oi(o)]}function ni(e){let t=oi(e);return[ri(e),t,ri(t)]}function ri(e){return e.replace(/start|end/g,e=>Kr[e])}function ii(e,t,n){let r=[`left`,`right`],i=[`right`,`left`],a=[`top`,`bottom`],o=[`bottom`,`top`];switch(e){case`top`:case`bottom`:return n?t?i:r:t?r:i;case`left`:case`right`:return t?a:o;default:return[]}}function ai(e,t,n,r){let i=Xr(e),a=ii(Yr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ri)))),a}function oi(e){return e.replace(/left|right|bottom|top/g,e=>Gr[e])}function si(e){return{top:0,right:0,bottom:0,left:0,...e}}function ci(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:si(e)}function li(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ui(e,t,n){let{reference:r,floating:i}=e,a=$r(t),o=ei(t),s=Qr(o),c=Yr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Xr(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}const di=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ui(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=ui(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function fi(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=Jr(t,e),m=ci(p),h=d===`floating`?`reference`:`floating`,g=s[f?h:d],_=li(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))??!0?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),b=await(a.isElement==null?void 0:a.isElement(y))&&await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1},x=li(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(_.top-x.top+m.top)/b.y,bottom:(x.bottom-_.bottom+m.bottom)/b.y,left:(_.left-x.left+m.left)/b.x,right:(x.right-_.right+m.right)/b.x}}const pi=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Jr(e,t)||{};if(l==null)return{};let d=ci(u),f={x:n,y:r},p=ei(i),m=Qr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ur(d[_],T),D=Ur(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=qr(O,A,k),M=!c.arrow&&Xr(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}});function mi(e,t,n){let r=e?[...n.filter(t=>Xr(t)===e),...n.filter(t=>Xr(t)!==e)]:n.filter(e=>Yr(e)===e);return r.filter(n=>e?Xr(n)===e||(t?ri(n)!==n:!1):!0)}const hi=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){var n,r,i;let{rects:a,middlewareData:o,placement:s,platform:c,elements:l}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:f=Hr,autoAlignment:p=!0,...m}=Jr(e,t),h=d!==void 0||f===Hr?mi(d||null,p,f):f,g=await fi(t,m),_=(n=o.autoPlacement)?.index||0,v=h[_];if(v==null)return{};let y=ti(v,a,await(c.isRTL==null?void 0:c.isRTL(l.floating)));if(s!==v)return{reset:{placement:h[0]}};let b=[g[Yr(v)],g[y[0]],g[y[1]]],x=[...(r=o.autoPlacement)?.overflows||[],{placement:v,overflows:b}],S=h[_+1];if(S)return{data:{index:_+1,overflows:x},reset:{placement:S}};let C=x.map(e=>{let t=Xr(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),w=C.filter(e=>e[2].slice(0,Xr(e[0])?2:3).every(e=>e<=0)),T=(i=w[0])?.[0]||C[0][0];return T===s?{}:{data:{index:_+1,overflows:x},reset:{placement:T}}}}},gi=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n,r;let{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0,...g}=Jr(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let _=Yr(i),v=$r(s),y=Yr(s)===s,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),x=f||(y||!h?[oi(s)]:ni(s)),S=m!==`none`;!f&&S&&x.push(...ai(s,h,m,b));let C=[s,...x],w=await fi(t,g),T=[],E=(r=a.flip)?.overflows||[];if(u&&T.push(w[_]),d){let e=ti(i,o,b);T.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:i,overflows:T}],!T.every(e=>e<=0)){var D,O;let e=((D=a.flip)?.index||0)+1,t=C[e];if(t){var k;let n=d===`alignment`?v!==$r(t):!1,r=(k=E[0])?.overflows[0]>0;if(!n||r)return{data:{index:e,overflows:E},reset:{placement:t}}}let n=(O=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?.placement;if(!n)switch(p){case`bestFit`:{var A;let e=(A=E.filter(e=>{if(S){let t=$r(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?.[0];e&&(n=e);break}case`initialPlacement`:n=s;break}if(i!==n)return{reset:{placement:n}}}return{}}}};async function _i(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Yr(n),s=Xr(n),c=$r(n)===`y`,l=[`left`,`top`].includes(o)?-1:1,u=a&&c?-1:1,d=Jr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}const vi=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n,r;let{x:i,y:a,placement:o,middlewareData:s}=t,c=await _i(t,e);return o===(n=s.offset)?.placement&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},yi=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Jr(e,t),l={x:n,y:r},u=await fi(t,c),d=$r(Yr(i)),f=Zr(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=qr(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=qr(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},bi=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Jr(e,t),u=await fi(t,l),d=Yr(i),f=Xr(i),p=$r(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ur(h-u[g],v),x=Ur(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Wr(u.left,0),t=Wr(u.right,0),n=Wr(u.top,0),r=Wr(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Wr(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Wr(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function xi(e){var t;return(t=e.ownerDocument)?.defaultView||window}function Si(e){return xi(e).getComputedStyle(e)}const Ci=Math.min,wi=Math.max,Ti=Math.round;function Ei(e){let t=Si(e),n=parseFloat(t.width),r=parseFloat(t.height),i=e.offsetWidth,a=e.offsetHeight,o=Ti(n)!==i||Ti(r)!==a;return o&&(n=i,r=a),{width:n,height:r,fallback:o}}function Di(e){return Mi(e)?(e.nodeName||``).toLowerCase():``}let Oi;function ki(){if(Oi)return Oi;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Oi=e.brands.map(e=>e.brand+`/`+e.version).join(` `),Oi):navigator.userAgent}function Ai(e){return e instanceof xi(e).HTMLElement}function ji(e){return e instanceof xi(e).Element}function Mi(e){return e instanceof xi(e).Node}function Ni(e){return typeof ShadowRoot>`u`?!1:e instanceof xi(e).ShadowRoot||e instanceof ShadowRoot}function Pi(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Si(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function Fi(e){return[`table`,`td`,`th`].includes(Di(e))}function Ii(e){let t=/firefox/i.test(ki()),n=Si(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!==`none`||n.perspective!==`none`||!!r&&r!==`none`||t&&n.willChange===`filter`||t&&!!n.filter&&n.filter!==`none`||[`transform`,`perspective`].some(e=>n.willChange.includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>{let t=n.contain;return t!=null&&t.includes(e)})}function Li(){return!/^((?!chrome|android).)*safari/i.test(ki())}function Ri(e){return[`html`,`body`,`#document`].includes(Di(e))}function zi(e){return ji(e)?e:e.contextElement}const Bi={x:1,y:1};function Vi(e){let t=zi(e);if(!Ai(t))return Bi;let n=t.getBoundingClientRect(),{width:r,height:i,fallback:a}=Ei(t),o=(a?Ti(n.width):n.width)/r,s=(a?Ti(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}function Hi(e,t,n,r){var i,a;t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),s=zi(e),c=Bi;t&&(r?ji(r)&&(c=Vi(r)):c=Vi(e));let l=s?xi(s):window,u=!Li()&&n,d=(o.left+(u&&(i=l.visualViewport)?.offsetLeft||0))/c.x,f=(o.top+(u&&(a=l.visualViewport)?.offsetTop||0))/c.y,p=o.width/c.x,m=o.height/c.y;if(s){let e=xi(s),t=r&&ji(r)?xi(r):r,n=e.frameElement;for(;n&&r&&t!==e;){let e=Vi(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,p*=e.x,m*=e.y,d+=t.x,f+=t.y,n=xi(n).frameElement}}return{width:p,height:m,top:f,right:d+p,bottom:f+m,left:d,x:d,y:f}}function Ui(e){return((Mi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wi(e){return ji(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Gi(e){return Hi(Ui(e)).left+Wi(e).scrollLeft}function Ki(e){if(Di(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ni(e)&&e.host||Ui(e);return Ni(t)?t.host:t}function qi(e){let t=Ki(e);return Ri(t)?t.ownerDocument.body:Ai(t)&&Pi(t)?t:qi(t)}function Ji(e,t){var n;t===void 0&&(t=[]);let r=qi(e),i=r===(n=e.ownerDocument)?.body,a=xi(r);return i?t.concat(a,a.visualViewport||[],Pi(r)?r:[]):t.concat(r,Ji(r))}function Yi(e,t,n){return t===`viewport`?li(function(e,t){let n=xi(e),r=Ui(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Li();(e||!e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}(e,n)):ji(t)?li(function(e,t){let n=Hi(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ai(e)?Vi(e):{x:1,y:1};return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n)):li(function(e){let t=Ui(e),n=Wi(e),r=e.ownerDocument.body,i=wi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=wi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Gi(e),s=-n.scrollTop;return Si(r).direction===`rtl`&&(o+=wi(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(Ui(e)))}function Xi(e){return Ai(e)&&Si(e).position!==`fixed`?e.offsetParent:null}function Zi(e){let t=xi(e),n=Xi(e);for(;n&&Fi(n)&&Si(n).position===`static`;)n=Xi(n);return n&&(Di(n)===`html`||Di(n)===`body`&&Si(n).position===`static`&&!Ii(n))?t:n||function(e){let t=Ki(e);for(;Ai(t)&&!Ri(t);){if(Ii(t))return t;t=Ki(t)}return null}(e)||t}function Qi(e,t,n){let r=Ai(t),i=Ui(t),a=Hi(e,!0,n===`fixed`,t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&n!==`fixed`)if((Di(t)!==`body`||Pi(i))&&(o=Wi(t)),Ai(t)){let e=Hi(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=Gi(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}const $i={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=n===`clippingAncestors`?function(e,t){let n=t.get(e);if(n)return n;let r=Ji(e).filter(e=>ji(e)&&Di(e)!==`body`),i=null,a=Si(e).position===`fixed`,o=a?Ki(e):e;for(;ji(o)&&!Ri(o);){let e=Si(o),t=Ii(o);(a?t||i:t||e.position!==`static`||!i||![`absolute`,`fixed`].includes(i.position))?i=e:r=r.filter(e=>e!==o),o=Ki(o)}return t.set(e,r),r}(t,this._c):[].concat(n),o=[...a,r],s=o[0],c=o.reduce((e,n)=>{let r=Yi(t,n,i);return e.top=wi(r.top,e.top),e.right=Ci(r.right,e.right),e.bottom=Ci(r.bottom,e.bottom),e.left=wi(r.left,e.left),e},Yi(t,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=Ai(n),a=Ui(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((i||!i&&r!==`fixed`)&&((Di(n)!==`body`||Pi(a))&&(o=Wi(n)),Ai(n))){let e=Hi(n);s=Vi(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-o.scrollLeft*s.x+c.x,y:t.y*s.y-o.scrollTop*s.y+c.y}},isElement:ji,getDimensions:function(e){return Ai(e)?Ei(e):e.getBoundingClientRect()},getOffsetParent:Zi,getDocumentElement:Ui,getScale:Vi,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e,i=this.getOffsetParent||Zi,a=this.getDimensions;return{reference:Qi(t,await i(n),r),floating:{x:0,y:0,...await a(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Si(e).direction===`rtl`},ea=(e,t,n)=>{let r=new Map,i={platform:$i,...n},a={...i.platform,_c:r};return di(e,t,{...i,platform:a})};function ta(e,t){for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(typeof t[n]==`object`&&e[n]?ta(e[n],t[n]):e[n]=t[n])}const na={disabled:!1,distance:5,skidding:0,container:`body`,boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:`absolute`,preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:`top`,triggers:[`hover`,`focus`,`touch`],hideTriggers:e=>[...e,`click`],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:`...`},dropdown:{placement:`bottom`,triggers:[`click`],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:`dropdown`,triggers:[`hover`,`focus`],popperTriggers:[`hover`],delay:{show:0,hide:400}}}};function ra(e,t){let n=na.themes[e]||{},r;do r=n[t],typeof r>`u`?n.$extend?n=na.themes[n.$extend]||{}:(n=null,r=na[t]):n=null;while(n);return r}function ia(e){let t=[e],n=na.themes[e]||{};do n.$extend&&!n.$resetCss?(t.push(n.$extend),n=na.themes[n.$extend]||{}):n=null;while(n);return t.map(e=>`v-popper--theme-${e}`)}function aa(e){let t=[e],n=na.themes[e]||{};do n.$extend?(t.push(n.$extend),n=na.themes[n.$extend]||{}):n=null;while(n);return t}let oa=!1;if(typeof window<`u`){oa=!1;try{let e=Object.defineProperty({},`passive`,{get(){oa=!0}});window.addEventListener(`test`,null,e)}catch{}}let sa=!1;typeof window<`u`&&typeof navigator<`u`&&(sa=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const ca=[`auto`,`top`,`bottom`,`left`,`right`].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),la={hover:`mouseenter`,focus:`focus`,click:`click`,touch:`touchstart`,pointer:`pointerdown`},ua={hover:`mouseleave`,focus:`blur`,click:`click`,touch:`touchend`,pointer:`pointerup`};function da(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}function fa(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const pa=[];let ma=null;const ha={};function ga(e){let t=ha[e];return t||=ha[e]=[],t}let _a=function(){};typeof window<`u`&&(_a=window.Element);function va(e){return function(t){return ra(t.theme,e)}}const ya=`__floating-vue__popper`,ba=()=>h({name:`VPopper`,provide(){return{[ya]:{parentPopper:this}}},inject:{[ya]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:va(`disabled`)},positioningDisabled:{type:Boolean,default:va(`positioningDisabled`)},placement:{type:String,default:va(`placement`),validator:e=>ca.includes(e)},delay:{type:[String,Number,Object],default:va(`delay`)},distance:{type:[Number,String],default:va(`distance`)},skidding:{type:[Number,String],default:va(`skidding`)},triggers:{type:Array,default:va(`triggers`)},showTriggers:{type:[Array,Function],default:va(`showTriggers`)},hideTriggers:{type:[Array,Function],default:va(`hideTriggers`)},popperTriggers:{type:Array,default:va(`popperTriggers`)},popperShowTriggers:{type:[Array,Function],default:va(`popperShowTriggers`)},popperHideTriggers:{type:[Array,Function],default:va(`popperHideTriggers`)},container:{type:[String,Object,_a,Boolean],default:va(`container`)},boundary:{type:[String,_a],default:va(`boundary`)},strategy:{type:String,validator:e=>[`absolute`,`fixed`].includes(e),default:va(`strategy`)},autoHide:{type:[Boolean,Function],default:va(`autoHide`)},handleResize:{type:Boolean,default:va(`handleResize`)},instantMove:{type:Boolean,default:va(`instantMove`)},eagerMount:{type:Boolean,default:va(`eagerMount`)},popperClass:{type:[String,Array,Object],default:va(`popperClass`)},computeTransformOrigin:{type:Boolean,default:va(`computeTransformOrigin`)},autoMinSize:{type:Boolean,default:va(`autoMinSize`)},autoSize:{type:[Boolean,String],default:va(`autoSize`)},autoMaxSize:{type:Boolean,default:va(`autoMaxSize`)},autoBoundaryMaxSize:{type:Boolean,default:va(`autoBoundaryMaxSize`)},preventOverflow:{type:Boolean,default:va(`preventOverflow`)},overflowPadding:{type:[Number,String],default:va(`overflowPadding`)},arrowPadding:{type:[Number,String],default:va(`arrowPadding`)},arrowOverflow:{type:Boolean,default:va(`arrowOverflow`)},flip:{type:Boolean,default:va(`flip`)},shift:{type:Boolean,default:va(`shift`)},shiftCrossAxis:{type:Boolean,default:va(`shiftCrossAxis`)},noAutoFocus:{type:Boolean,default:va(`noAutoFocus`)},disposeTimeout:{type:Number,default:va(`disposeTimeout`)}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:``,strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join(`_`)}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId==null?this.randomId:this.ariaId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide==`function`?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[ya])?.parentPopper},hasPopperShowTriggerHover(){var e,t;return(e=this.popperTriggers)?.includes(`hover`)||(t=this.popperShowTriggers)?.includes(`hover`)}},watch:{shown:`$_autoShowHide`,disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:`$_refreshListeners`,deep:!0},positioningDisabled:`$_refreshListeners`,...[`placement`,`distance`,`skidding`,`boundary`,`strategy`,`overflowPadding`,`arrowPadding`,`preventOverflow`,`shift`,`shiftCrossAxis`,`flip`].reduce((e,t)=>(e[t]=`$_computePosition`,e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:n=!1}={}){var r,i;(r=this.parentPopper)!=null&&r.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(n||!this.disabled)&&((i=this.parentPopper)?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit(`show`),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit(`update:shown`,!0))},hide({event:e=null,skipDelay:t=!1}={}){var n;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}(n=this.parentPopper)?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit(`hide`),this.$emit(`update:shown`,!1)}},init(){var e;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=(e=this.referenceNode)?.call(this)??this.$el,this.$_targetNodes=this.targetNodes().filter(e=>e.nodeType===e.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(`.v-popper__inner`),this.$_arrowNode=this.$_popperNode.querySelector(`.v-popper__arrow-container`),this.$_swapTargetAttrs(`title`,`data-original-title`),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs(`data-original-title`,`title`))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit(`resize`))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;let e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(vi({mainAxis:this.distance,crossAxis:this.skidding}));let t=this.placement.startsWith(`auto`);if(t?e.middleware.push(hi({alignment:this.placement.split(`-`)[1]??``})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(yi({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(gi({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(pi({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:`arrowOverflow`,fn:({placement:e,rects:t,middlewareData:n})=>{let r,{centerOffset:i}=n.arrow;return r=e.startsWith(`top`)||e.startsWith(`bottom`)?Math.abs(i)>t.reference.width/2:Math.abs(i)>t.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){let t=this.autoSize?this.autoSize:this.autoMinSize?`min`:null;e.middleware.push({name:`autoSize`,fn:({rects:e,placement:n,middlewareData:r})=>{var i;if((i=r.autoSize)!=null&&i.skip)return{};let a,o;return n.startsWith(`top`)||n.startsWith(`bottom`)?a=e.reference.width:o=e.reference.height,this.$_innerNode.style[t===`min`?`minWidth`:t===`max`?`maxWidth`:`width`]=a==null?null:`${a}px`,this.$_innerNode.style[t===`min`?`minHeight`:t===`max`?`maxHeight`:`height`]=o==null?null:`${o}px`,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(bi({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:e,availableHeight:t})=>{this.$_innerNode.style.maxWidth=e==null?null:`${e}px`,this.$_innerNode.style.maxHeight=t==null?null:`${t}px`}})));let n=await ea(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:n.x,y:n.y,placement:n.placement,strategy:n.strategy,arrow:{...n.middlewareData.arrow,...n.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),ma&&this.instantMove&&ma.instantMove&&ma!==this.parentPopper){ma.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay(`show`))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(ma=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay(`hide`))},$_computeDelay(e){let t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await fa(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...Ji(this.$_referenceNode),...Ji(this.$_popperNode)],`scroll`,()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){let e=this.$_referenceNode.getBoundingClientRect(),t=this.$_popperNode.querySelector(`.v-popper__wrapper`),n=t.parentNode.getBoundingClientRect(),r=e.x+e.width/2-(n.left+t.offsetLeft),i=e.y+e.height/2-(n.top+t.offsetTop);this.result.transformOrigin=`${r}px ${i}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":``});let e=this.showGroup;if(e){let t;for(let n=0;n<pa.length;n++)t=pa[n],t.showGroup!==e&&(t.hide(),t.$emit(`close-group`))}pa.push(this),document.body.classList.add(`v-popper--some-open`);for(let e of aa(this.theme))ga(e).push(this),document.body.classList.add(`v-popper--some-open--${e}`);this.$emit(`apply-show`),this.classes.showFrom=!0,this.classes.showTo=!1,this.classes.hideFrom=!1,this.classes.hideTo=!1,await fa(),this.classes.showFrom=!1,this.classes.showTo=!0,this.noAutoFocus||this.$_popperNode.focus()},async $_applyHide(e=!1){if(this.shownChildren.size>0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,da(pa,this),pa.length===0&&document.body.classList.remove(`v-popper--some-open`);for(let e of aa(this.theme)){let t=ga(e);da(t,this),t.length===0&&document.body.classList.remove(`v-popper--some-open--${e}`)}ma===this&&(ma=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);let t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners(`scroll`),this.$emit(`apply-hide`),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await fa(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e==`string`?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw Error(`No container for popover: `+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){let e=e=>{this.isShown&&!this.$_hideInProgress||(e.usedByTooltip=!0,!this.$_preventShow&&this.show({event:e}))};this.$_registerTriggerListeners(this.$_targetNodes,la,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],la,this.popperTriggers,this.popperShowTriggers,e);let t=e=>{e.usedByTooltip||this.hide({event:e})};this.$_registerTriggerListeners(this.$_targetNodes,ua,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],ua,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,n){this.$_events.push({targetNodes:e,eventType:t,handler:n}),e.forEach(e=>e.addEventListener(t,n,oa?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,n,r,i){let a=n;r!=null&&(a=typeof r==`function`?r(a):r),a.forEach(n=>{let r=t[n];r&&this.$_registerEventListeners(e,r,i)})},$_removeEventListeners(e){let t=[];this.$_events.forEach(n=>{let{targetNodes:r,eventType:i,handler:a}=n;!e||e===i?r.forEach(e=>e.removeEventListener(i,a)):t.push(n)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit(`close-directive`):this.$emit(`auto-hide`),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(let n of this.$_targetNodes){let r=n.getAttribute(e);r&&(n.removeAttribute(e),n.setAttribute(t,r))}},$_applyAttrsToTarget(e){for(let t of this.$_targetNodes)for(let n in e){let r=e[n];r==null?t.removeAttribute(n):t.setAttribute(n,r)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){let e=this.$_referenceNode.getBoundingClientRect();if(ka>=e.left&&ka<=e.right&&Aa>=e.top&&Aa<=e.bottom){let e=this.$_popperNode.getBoundingClientRect(),t=ka-Da,n=Aa-Oa,r=e.left+e.width/2-Da+(e.top+e.height/2)-Oa+e.width+e.height,i=Da+t*r,a=Oa+n*r;return ja(Da,Oa,i,a,e.left,e.top,e.left,e.bottom)||ja(Da,Oa,i,a,e.left,e.top,e.right,e.top)||ja(Da,Oa,i,a,e.right,e.top,e.right,e.bottom)||ja(Da,Oa,i,a,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<`u`&&typeof window<`u`){if(sa){let e=oa?{passive:!0,capture:!0}:!0;document.addEventListener(`touchstart`,e=>xa(e,!0),e),document.addEventListener(`touchend`,e=>Sa(e,!0),e)}else window.addEventListener(`mousedown`,e=>xa(e,!1),!0),window.addEventListener(`click`,e=>Sa(e,!1),!0);window.addEventListener(`resize`,Ea)}function xa(e,t){if(na.autoHideOnMousedown)Ca(e,t);else for(let t=0;t<pa.length;t++){let n=pa[t];try{n.mouseDownContains=n.popperNode().contains(e.target)}catch{}}}function Sa(e,t){na.autoHideOnMousedown||Ca(e,t)}function Ca(e,t){let n={};for(let r=pa.length-1;r>=0;r--){let i=pa[r];try{let r=i.containsGlobalTarget=i.mouseDownContains||i.popperNode().contains(e.target);i.pendingHide=!1,requestAnimationFrame(()=>{if(i.pendingHide=!1,!n[i.randomId]&&wa(i,r,e)){if(i.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&r){let e=i.parentPopper;for(;e;)n[e.randomId]=!0,e=e.parentPopper;return}let a=i.parentPopper;for(;a&&wa(a,a.containsGlobalTarget,e);)a.$_handleGlobalClose(e,t),a=a.parentPopper}})}catch{}}}function wa(e,t,n){return n.closeAllPopover||n.closePopover&&t||Ta(e,n)&&!t}function Ta(e,t){if(typeof e.autoHide==`function`){let n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function Ea(){for(let e=0;e<pa.length;e++)pa[e].$_computePosition()}let Da=0,Oa=0,ka=0,Aa=0;typeof window<`u`&&window.addEventListener(`mousemove`,e=>{Da=ka,Oa=Aa,ka=e.clientX,Aa=e.clientY},oa?{passive:!0}:void 0);function ja(e,t,n,r,i,a,o,s){let c=((o-i)*(t-a)-(s-a)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t)),l=((n-e)*(t-a)-(r-t)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t));return c>=0&&c<=1&&l>=0&&l<=1}const Ma={extends:ba()},Na=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};function Pa(e,t,n,r,i,a){return P(),u(`div`,{ref:`reference`,class:D([`v-popper`,{"v-popper--shown":e.slotData.isShown}])},[z(e.$slots,`default`,O(v(e.slotData)))],2)}const Fa=Na(Ma,[[`render`,Pa]]);function Ia(){var e=window.navigator.userAgent,t=e.indexOf(`MSIE `);if(t>0)return parseInt(e.substring(t+5,e.indexOf(`.`,t)),10);var n=e.indexOf(`Trident/`);if(n>0){var r=e.indexOf(`rv:`);return parseInt(e.substring(r+3,e.indexOf(`.`,r)),10)}var i=e.indexOf(`Edge/`);return i>0?parseInt(e.substring(i+5,e.indexOf(`.`,i)),10):-1}let La;function Ra(){Ra.init||(Ra.init=!0,La=Ia()!==-1)}var za={name:`ResizeObserver`,props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:[`notify`],mounted(){Ra(),E(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});let e=document.createElement(`object`);this._resizeObject=e,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,-1),e.onload=this.addResizeHandlers,e.type=`text/html`,La&&this.$el.appendChild(e),e.data=`about:blank`,La||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit(`notify`,{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener(`resize`,this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!La&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener(`resize`,this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Ba=_e(`data-v-b329ee4c`);te(`data-v-b329ee4c`);const Va={class:`resize-observer`,tabindex:`-1`};F();const Ha=Ba((e,t,n,r,i,a)=>(P(),c(`div`,Va)));za.render=Ha,za.__scopeId=`data-v-b329ee4c`,za.__file=`src/components/ResizeObserver.vue`;const Ua=(e=`theme`)=>({computed:{themeClass(){return ia(this[e])}}}),Wa=h({name:`VPopperContent`,components:{ResizeObserver:za},mixins:[Ua()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:[`hide`,`resize`],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Ga=[`id`,`aria-hidden`,`tabindex`,`data-popper-placement`],Ka={ref:`inner`,class:`v-popper__inner`},qa=d(`div`,{class:`v-popper__arrow-outer`},null,-1),Ja=d(`div`,{class:`v-popper__arrow-inner`},null,-1),Ya=[qa,Ja];function Xa(e,t,r,i,a,o){let s=re(`ResizeObserver`);return P(),u(`div`,{id:e.popperId,ref:`popover`,class:D([`v-popper__popper`,[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:k(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?`false`:`true`,tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||=he(t=>e.autoHide&&e.$emit(`hide`),[`esc`])},[d(`div`,{class:`v-popper__backdrop`,onClick:t[0]||=t=>e.autoHide&&e.$emit(`hide`)}),d(`div`,{class:`v-popper__wrapper`,style:k(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[d(`div`,Ka,[e.mounted?(P(),u(n,{key:0},[d(`div`,null,[z(e.$slots,`default`)]),e.handleResize?(P(),c(s,{key:0,onNotify:t[1]||=t=>e.$emit(`resize`,t)})):l(``,!0)],64)):l(``,!0)],512),d(`div`,{ref:`arrow`,class:`v-popper__arrow-container`,style:k(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Ya,4)],4)],46,Ga)}const Za=Na(Wa,[[`render`,Xa]]),Qa={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}};let $a=function(){};typeof window<`u`&&($a=window.Element);const eo=h({name:`VPopperWrapper`,components:{Popper:Fa,PopperContent:Za},mixins:[Qa,Ua(`finalTheme`)],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,$a,Boolean],default:void 0},boundary:{type:[String,$a],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function to(e,t,n,r,i,a){let o=re(`PopperContent`),s=re(`Popper`);return P(),c(s,T({ref:`popper`},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||=()=>e.$emit(`show`),onHide:t[1]||=()=>e.$emit(`hide`),"onUpdate:shown":t[2]||=t=>e.$emit(`update:shown`,t),onApplyShow:t[3]||=()=>e.$emit(`apply-show`),onApplyHide:t[4]||=()=>e.$emit(`apply-hide`),onCloseGroup:t[5]||=()=>e.$emit(`close-group`),onCloseDirective:t[6]||=()=>e.$emit(`close-directive`),onAutoHide:t[7]||=()=>e.$emit(`auto-hide`),onResize:t[8]||=()=>e.$emit(`resize`)}),{default:G(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,show:s,hide:c,handleResize:l,onResize:u,classes:d,result:f})=>[z(e.$slots,`default`,{shown:n,show:s,hide:c}),m(o,{ref:`popperContent`,"popper-id":t,theme:e.finalTheme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":l,classes:d,result:f,onHide:c,onResize:u},{default:G(()=>[z(e.$slots,`popper`,{shown:n,hide:c})]),_:2},1032,[`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:3},16,[`theme`,`target-nodes`,`popper-node`,`class`])}const no=Na(eo,[[`render`,to]]),ro={...no,name:`VDropdown`,vPopperTheme:`dropdown`},io={...no,name:`VMenu`,vPopperTheme:`menu`},ao={...no,name:`VTooltip`,vPopperTheme:`tooltip`},oo=h({name:`VTooltipDirective`,components:{Popper:ba(),PopperContent:Za},mixins:[Qa],inheritAttrs:!1,props:{theme:{type:String,default:`tooltip`},html:{type:Boolean,default:e=>ra(e.theme,`html`)},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>ra(e.theme,`loadingContent`)},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content==`function`},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content==`function`&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;let e=++this.$_fetchId,t=this.content(this);t.then?t.then(t=>this.onResult(e,t)):this.onResult(e,t)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),so=[`innerHTML`],co=[`textContent`];function lo(e,t,n,r,i,a){let o=re(`PopperContent`),s=re(`Popper`);return P(),c(s,T({ref:`popper`},e.$attrs,{theme:e.theme,"target-nodes":e.targetNodes,"popper-node":()=>e.$refs.popperContent.$el,onApplyShow:e.onShow,onApplyHide:e.onHide}),{default:G(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,hide:s,handleResize:c,onResize:l,classes:d,result:f})=>[m(o,{ref:`popperContent`,class:D({"v-popper--tooltip-loading":e.loading}),"popper-id":t,theme:e.theme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":c,classes:d,result:f,onHide:s,onResize:l},{default:G(()=>[e.html?(P(),u(`div`,{key:0,innerHTML:e.finalContent},null,8,so)):(P(),u(`div`,{key:1,textContent:V(e.finalContent)},null,8,co))]),_:2},1032,[`class`,`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:1},16,[`theme`,`target-nodes`,`popper-node`,`onApplyShow`,`onApplyHide`])}const uo=Na(oo,[[`render`,lo]]),fo=`v-popper--has-tooltip`;function po(e,t){let n=e.placement;if(!n&&t)for(let e of ca)t[e]&&(n=e);return n||=ra(e.theme||`tooltip`,`placement`),n}function mo(e,t,n){let r,i=typeof t;return r=i===`string`?{content:t}:t&&i===`object`?t:{content:!1},r.placement=po(r,n),r.targetNodes=()=>[e],r.referenceNode=()=>e,r}let ho,go,_o=0;function vo(){if(ho)return;go=L([]),ho=s({name:`VTooltipDirectiveApp`,setup(){return{directives:go}},render(){return this.directives.map(e=>y(uo,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});let e=document.createElement(`div`);document.body.appendChild(e),ho.mount(e)}function yo(e,t,n){vo();let r=L(mo(e,t,n)),i=L(!1),a={id:_o++,options:r,shown:i};return go.value.push(a),e.classList&&e.classList.add(fo),e.$_popper={options:r,item:a,show(){i.value=!0},hide(){i.value=!1}}}function bo(e){if(e.$_popper){let t=go.value.indexOf(e.$_popper.item);t!==-1&&go.value.splice(t,1),delete e.$_popper,delete e.$_popperOldShown,delete e.$_popperMountTarget}e.classList&&e.classList.remove(fo)}function xo(e,{value:t,modifiers:n}){let r=mo(e,t,n);if(!r.content||ra(r.theme||`tooltip`,`disabled`))bo(e);else{let i;e.$_popper?(i=e.$_popper,i.options.value=r):i=yo(e,t,n),typeof t.shown<`u`&&t.shown!==e.$_popperOldShown&&(e.$_popperOldShown=t.shown,t.shown?i.show():i.hide())}}const So={beforeMount:xo,updated:xo,beforeUnmount(e){bo(e)}};function Co(e){e.addEventListener(`mousedown`,To),e.addEventListener(`click`,To),e.addEventListener(`touchstart`,Eo,oa?{passive:!0}:!1)}function wo(e){e.removeEventListener(`mousedown`,To),e.removeEventListener(`click`,To),e.removeEventListener(`touchstart`,Eo),e.removeEventListener(`touchend`,Do),e.removeEventListener(`touchcancel`,Oo)}function To(e){let t=e.currentTarget;e.closePopover=!t.$_vclosepopover_touch,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}function Eo(e){if(e.changedTouches.length===1){let t=e.currentTarget;t.$_vclosepopover_touch=!0;let n=e.changedTouches[0];t.$_vclosepopover_touchPoint=n,t.addEventListener(`touchend`,Do),t.addEventListener(`touchcancel`,Oo)}}function Do(e){let t=e.currentTarget;if(t.$_vclosepopover_touch=!1,e.changedTouches.length===1){let n=e.changedTouches[0],r=t.$_vclosepopover_touchPoint;e.closePopover=Math.abs(n.screenY-r.screenY)<20&&Math.abs(n.screenX-r.screenX)<20,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}}function Oo(e){let t=e.currentTarget;t.$_vclosepopover_touch=!1}const ko={beforeMount(e,{value:t,modifiers:n}){e.$_closePopoverModifiers=n,(typeof t>`u`||t)&&Co(e)},updated(e,{value:t,oldValue:n,modifiers:r}){e.$_closePopoverModifiers=r,t!==n&&(typeof t>`u`||t?Co(e):wo(e))},beforeUnmount(e){wo(e)}},Ao=na,jo=So,Mo=So,No=ko,Po=ko,Fo=ro,Io=io,Lo=ba,Ro=Za,zo=Qa,Bo=no,Vo=Ua,Ho=ao,Uo=uo;function Wo(e,t={}){e.$_vTooltipInstalled||(e.$_vTooltipInstalled=!0,ta(na,t),e.directive(`tooltip`,So),e.directive(`close-popper`,ko),e.component(`VTooltip`,ao),e.component(`VDropdown`,ro),e.component(`VMenu`,io))}const Go={version:`5.2.2`,install:Wo,options:na};var Ko=h({__name:`Dropdown`,props:w({value:{},thin:{type:Boolean,default:!0},flat:{type:Boolean,default:!0},disabled:{type:Boolean},icon:{},color:{},triggerClass:{},iconEnd:{},border:{type:Boolean},outline:{type:Boolean},round:{type:Boolean},placement:{default:`bottom-start`},disablePlacement:{type:Boolean,default:!1},noAutoFocus:{type:Boolean},autoHide:{type:Boolean,default:!0},triggers:{default:()=>[`click`]},showTriggers:{},hideTriggers:{},popperTriggers:{default:()=>[]},popperShowTriggers:{default:()=>[]},popperHideTriggers:{default:()=>[]},showGroup:{},delay:{}},{shown:{type:Boolean,default:!1},shownModifiers:{}}),emits:w([`show`,`hide`],[`update:shown`]),setup(e,{expose:t,emit:n}){let r=n,i=o(()=>{if(e.icon)return e.icon;if(!e.value)return`more_vert`}),a=L(),s=L(),l=ce(e,`shown`),u=()=>{var e;return(e=a.value)?.show()};function f(){var e,t;(e=s.value)?.focus(),(t=a.value)?.hide()}let{isMobile:p}=ET(),h=o(()=>e.disablePlacement&&p),g=o(()=>e.showTriggers===void 0?e.triggers:e.showTriggers),_=o(()=>e.hideTriggers===void 0?e.triggers.length===1&&e.triggers[0]===`click`?[`click`]:e.triggers.includes(`hover`)?[...e.triggers,`click`]:e.triggers:e.hideTriggers),v=o(()=>e.popperTriggers.length>0?e.popperTriggers:e.triggers.includes(`hover`)?[`hover`]:[]),y=o(()=>{let t=Array.isArray(e.popperShowTriggers)&&e.popperShowTriggers.length>0;if(t)return e.popperShowTriggers;if(e.triggers.includes(`hover`))return[`hover`]}),b=o(()=>{let t=Array.isArray(e.popperHideTriggers)&&e.popperHideTriggers.length>0;return t?e.popperHideTriggers:e.triggers.includes(`hover`)?[`hover`]:[]}),x=o(()=>e.autoHide),S=o(()=>e.delay===void 0?e.triggers.includes(`hover`)?{show:0,hide:10}:0:e.delay);return t({show:u,hide:f,shown:l}),(e,t)=>(P(),c(U(Fo),{ref_key:`ddownRef`,ref:a,shown:l.value,"onUpdate:shown":t[0]||=e=>l.value=e,disabled:e.disabled,noAutoFocus:e.noAutoFocus,"positioning-disabled":h.value,placement:e.placement,autoHide:x.value,delay:S.value,triggers:e.triggers,showTriggers:g.value,hideTriggers:_.value,popperTriggers:v.value,popperShowTriggers:y.value,popperHideTriggers:b.value,showGroup:e.showGroup,onHide:t[1]||=e=>r(`hide`),onShow:t[2]||=e=>r(`show`)},{popper:G(({hide:t,show:n,shown:r})=>[z(e.$slots,`default`,{hide:t,show:n,shown:r})]),default:G(()=>[d(`div`,{ref_key:`triggerRef`,ref:s},null,512),z(e.$slots,`trigger`,{show:u,hide:f,shown:l.value},()=>[m(U(J),{class:D(e.triggerClass),iconEnd:e.iconEnd,icon:i.value,value:e.value,thin:e.thin,flat:e.flat,outline:e.outline,round:e.round,color:e.color},null,8,[`class`,`iconEnd`,`icon`,`value`,`thin`,`flat`,`outline`,`round`,`color`])])]),_:3},8,[`shown`,`disabled`,`noAutoFocus`,`positioning-disabled`,`placement`,`autoHide`,`delay`,`triggers`,`showTriggers`,`hideTriggers`,`popperTriggers`,`popperShowTriggers`,`popperHideTriggers`,`showGroup`]))}}),qo=Ko;const Jo={class:`px-1 pt-025 pb-1`},Yo={class:`ms-1`};var Xo=h({__name:`FieldSetVue`,props:{label:{},legend:{}},setup(e){return(e,t)=>(P(),u(`fieldset`,Jo,[d(`legend`,Yo,V(e.legend||e.label),1),z(e.$slots,`default`,{},void 0,!0)]))}}),Zo=q(Xo,[[`__scopeId`,`data-v-f7e758e5`]]),Qo=h({__name:`Flag`,props:{country:{},size:{},circle:{type:Boolean},square:{type:Boolean}},setup(e){let t=e,n=o(()=>!!(t.circle||t.square)),r=o(()=>`${t.size||1}rem`),i=o(()=>{let e=t.country.toLowerCase();e===`ac`&&(e=`sh-ac`);let r=`https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.0.0/flags`;return n.value?`url(${r}/1x1/${e.toLowerCase()}.svg)`:`url(${r}/4x3/${e.toLowerCase()}.svg)`});return(e,t)=>(P(),u(`span`,{class:D([`fi`,{fis:n.value,circle:e.circle}]),style:k({height:r.value,backgroundImage:i.value})},null,6))}}),$o=q(Qo,[[`__scopeId`,`data-v-f99f1900`]]),es={};xe(es,{arrField:()=>ys,bglForm:()=>hs,checkField:()=>cs,colorField:()=>_s,dateField:()=>us,emailField:()=>ls,findBglFieldById:()=>vs,frmRow:()=>fs,getBaseField:()=>ts,numField:()=>ds,rangeField:()=>ms,richText:()=>ns,selectField:()=>os,slctField:()=>ss,telField:()=>gs,txtField:()=>rs,uploadField:()=>ps,useForm:()=>bs});function ts(e,t={},n={}){return typeof t==`object`?{id:e,...t}:{id:e,label:t,...n}}function ns(e,t,n){return{$el:`richtext`,class:n?.class,required:n?.required,id:e,label:t,vIf:n?.vIf,transform:n?.transform,placeholder:n?.placeholder,attrs:{height:n?.height,autocomplete:n?.autocomplete}}}function rs(e,t,n){return{$el:`text`,id:e,label:t,class:n?.class,required:n?.required,placeholder:n?.placeholder,helptext:n?.helptext,disabled:n?.disabled,defaultValue:n?.defaultValue,vIf:n?.vIf,transform:n?.transform,attrs:{autocomplete:n?.autocomplete,pattern:n?.pattern,multiline:n?.multiline,autoheight:n?.autoheight,code:n?.code,rows:n?.rows,icon:n?.icon,iconStart:n?.iconStart,type:n?.type}}}function os(e,t,n,r){return{$el:`select`,id:e,label:t,class:r?.class,required:r?.required,helptext:r?.helptext,disabled:r?.disabled,defaultValue:r?.defaultValue,vIf:r?.vIf,transform:r?.transform,options:n,attrs:{...r?.attrs,searchable:r?.searchable,multiselect:r?.multiselect,clearable:r?.clearable}}}const ss=os;function cs(e,t,n){return{$el:`check`,id:e,label:t,class:n?.class,required:n?.required,helptext:n?.helptext,disabled:n?.disabled,defaultValue:n?.defaultValue,vIf:n?.vIf,transform:n?.transform,attrs:{...n?.attrs,value:n?.value}}}function ls(e,t,n){return{$el:`email`,id:e,label:t,class:n?.class,required:n?.required,vIf:n?.vIf,transform:n?.transform,attrs:{autocorrect:n?.autocorrect,serverValidate:n?.serverValidate,preventFakeEmails:n?.preventFakeEmails,pattern:n?.pattern}}}function us(e,t,n){return{$el:`date`,class:n?.class,required:n?.required,id:e,disabled:n?.disabled,label:t,defaultValue:n?.defaultValue,vIf:n?.vIf,transform:n?.transform,attrs:{disabled:n?.disabled,autocomplete:n?.autocomplete,enableTime:n?.enableTime,mode:n?.mode,locale:n?.locale,timezone:n?.timezone}}}function ds(e,t,n){return{$el:`number`,class:n?.class,required:n?.required,defaultValue:n?.defaultValue,id:e,label:t,disabled:n?.disabled,placeholder:n?.placeholder,helptext:n?.helptext,vIf:n?.vIf,transform:n?.transform,attrs:{autocomplete:n?.autocomplete,step:n?.step,min:n?.min,max:n?.max,layout:n?.layout,padZero:n?.padZero,center:n?.center,useGrouping:n?.useGrouping}}}function fs(...e){return{$el:`div`,class:`flex gap-1 m_block align-items-end`,children:e}}function ps(e,t,n){return{$el:`upload`,id:e,label:t,class:n?.class,required:n?.required,helptext:n?.helptext,disabled:n?.disabled,defaultValue:n?.defaultValue,vIf:n?.vIf,transform:n?.transform,attrs:{...n}}}function ms(e,t,n){return{$el:`range`,id:e,label:t,vIf:n?.vIf,transform:n?.transform,attrs:{autocomplete:n?.autocomplete,min:n?.min,max:n?.max,step:n?.step,rtl:n?.rtl,multiRange:n?.multiRange,formatValue:n?.formatValue}}}function hs(e,...t){return typeof e==`string`?{$el:`bagelform`,id:e,attrs:{schema:[e,...t]}}:{$el:`bagelform`,attrs:{schema:[e,...t]}}}function gs(e,t,n){return{$el:`tel`,id:e,label:t,vIf:n?.vIf,attrs:n,class:n?.class,transform:n?.transform}}function _s(e,t,n){return{$el:`color`,id:e,label:t,vIf:n?.vIf,attrs:n,class:n?.class,transform:n?.transform}}function vs(e,t){for(let n of t){if(n.id===e)return n;if(n.children&&Number(n.children.length)>0){let t=n.children.filter(e=>typeof e==`object`&&`$el`in e),r=vs(e,t);if(r)return r}}}function ys(e,t,n,r){let i=typeof n==`string`?{type:n}:{schema:n},a={delete:!0,add:!0,...r,...i};return{label:t,id:e,class:r?.class,$el:`array`,vIf:r?.vIf,transform:r?.transform,attrs:a}}function bs(){return{txtField:rs,selectField:os,checkField:cs,dateField:us,numField:ds,emailField:ls,frmRow:fs,uploadField:ps,rangeField:ms,bglForm:hs,telField:gs,colorField:_s,arrField:ys,richText:ns,findBglFieldById:vs,getBaseField:ts}}const xs=ne({defaultLang:``,availableLangs:[],lang:`en`});function Ss(e){return e?e[xs.lang]||e[xs.defaultLang]||``:(console.warn(`No language element provided for $tdb function`),``)}function Cs(){let e=o({get:()=>xs.lang,set:e=>xs.lang=e}),t=o({get:()=>xs.availableLangs,set:e=>xs.availableLangs=e}),n=o({get:()=>xs.defaultLang,set:e=>xs.defaultLang=e});return{lang:e,$tdb:Ss,availableLangs:t,defaultLang:n}}function ws(e,t){return t===`titleCase`?e.split(`_`).map(e=>e[0].toUpperCase()+e.slice(1).toLocaleLowerCase()).join(` `):t===`pascal`?e.split(`_`).map(e=>e[0].toUpperCase()+e.slice(1).toLocaleLowerCase()).join(``):t===`camel`?e.split(`_`).map((e,t)=>t===0?e:e[0].toUpperCase()+e.slice(1)).join(``):t===`snake`?[...e].map(e=>e===e.toUpperCase()?`_${e.toLowerCase()}`:e).join(``):e}const Ts=new Map;function Es(e,t=500){clearTimeout(Ts.get(e));let n=setTimeout(()=>{e(),Ts.delete(e)},t);Ts.set(e,n)}function Ds(e){return e.toLowerCase().replace(/[^a-z0-9-\s]/g,``).split(/[\s-]+/).join(`-`)}function Os(e){return e===void 0?e:e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)||e}async function ks(e,t){await navigator.clipboard.writeText(e),t&&t(`Copied to clipboard`)}function As(...e){return e=e.flatMap(e=>e.split(/\s/)),e.map(e=>e.charAt(0)).join(``)}function js(e,t){e.key===`Escape`&&t()}function Ms(e,t,...n){return n.map(n=>typeof n==`function`?n(e,t):n).join(` `)}function Ns(e,t,n){if(!e)return{};let r=[`class`,`onClick`],i=Object.entries(e).filter(([e])=>!r.includes(e)).map(([e,r])=>[e,typeof r==`function`?r(t,n):r]),a=Object.fromEntries(i);for(let t of r.slice(1))e[t]&&(a[t]=e[t]);return a}function Ps(e,t){var n;return e[`v-if`]===void 0?!0:typeof e[`v-if`]==`boolean`?e[`v-if`]:typeof e[`v-if`]==`string`?!0:typeof e[`v-if`]==`function`?(n=e[`v-if`])?.call(e,t?.[e.id],t):!0}function Fs(e,t){if(t)return e?e[t]:void 0}const Is=e=>!Number.isNaN(Date.parse(e));function Ls(e,t){let n=Array.from(new Set((e??[]).flatMap(Object.keys))),r=n.map(e=>({id:e,label:Os(e),transform:t=>{let n=[`created_at`,`updated_at`];return n.includes(e)?t&&new Date(t).toLocaleString():t}}));return t?r.filter(e=>t.includes(e.id)||!e.id):r}function Rs(e=100){return new Promise(t=>setTimeout(t,e))}const zs=new Map;async function Bs(e,t){let n=t?.id||e;if(await Rs(1),zs.has(n)){let e=zs.get(n);if(e)return e}if(t?.id&&document.getElementById(t.id)||document.querySelector(`script[src="${e}"]`))return Promise.resolve();let r=new Promise((r,i)=>{let a=document.createElement(`script`);a.src=e,t?.id&&(a.id=t.id),a.onload=()=>{r(),zs.delete(n)},a.onerror=e=>{i(Error(String(e))),zs.delete(n)},document.head.append(a)});return zs.set(n,r),r}function Vs(e){return new Promise((t,n)=>{if(document.querySelector(`link[href="${e}"]`)){t();return}let r=document.createElement(`link`);r.href=e,r.rel=`stylesheet`,r.onload=()=>{t()},r.onerror=n,document.head.append(r)})}function Hs(e){return e.startsWith(`https://`)?e:(e=e.replace(/http:\/\//,``),`https://${e}`)}function Us(e,t=`px`){return typeof e==`number`?`${e}${t}`:e}const Ws=`https://files.bagel.design`.replace(/\/$/,``),Gs=void 0,Ks=/^https?:\/\/|^\/\//;function qs(e){return!e||Ks.test(e)?e:e.startsWith(`static/`)?`${Gs}/${e}`:`${Ws}/${e}`}function Js(e,t,n=void 0){if(!t)return e;let r=t.split(/[.[]/),i=e;for(let e of r){if(!i||typeof i!=`object`||!(e in i))return n;i=i[e]}return i??n}const Ys=e=>e.replace(/http:\/\//,`//`);function Xs(e,t){let n=document.createElement(`a`);if(n.target=`_blank`,typeof e==`string`){n.href=Ys(e);let r=e.split(`/`).pop();n.download=t||r||`download`}else{let r=URL.createObjectURL(e);n.href=r,n.download=t||`download`,URL.revokeObjectURL(r)}document.body.appendChild(n),n.click(),document.body.removeChild(n)}var Zs=h({__name:`BagelForm`,props:{modelValue:{default:void 0},schema:{type:[Object,Function],default:void 0},tag:{default:`form`},class:{default:``},onSubmit:{}},emits:[`update:modelValue`],setup(e,{expose:t,emit:r}){let i=e,a=r,s=e=>e&&JSON.parse(JSON.stringify(e)),d=L(),f=L(s(i.modelValue??{})),p=L(s(i.modelValue??{})),m=L(`idle`),h=o(()=>H(i.schema)),g=o(()=>{try{return JSON.stringify(f.value)!==JSON.stringify(p.value)}catch{return!1}});j(()=>{i.modelValue&&(p.value=s(i.modelValue)),_()}),W(()=>i.modelValue,e=>{e!==void 0&&(f.value=s(e))},{immediate:!0,deep:!0});function _(){let e=h.value;if(!e)return;let t=e=>{for(let n of e){if(!n||typeof n!=`object`)continue;let e=typeof n.id==`string`&&n.id.length>0,r=Object.prototype.hasOwnProperty.call(n,`defaultValue`)&&n.defaultValue!==void 0;if(e&&r){let e=Js(f.value,n.id,void 0);(e===void 0||e===``)&&v({fieldId:n.id,value:n.defaultValue})}Array.isArray(n.children)&&n.children.length&&t(n.children)}};t(e)}W(h,()=>{_()},{deep:!0});function v({fieldId:e,value:t}){let n=e?.split(`.`)||[],r=s(f.value),i=r;for(let e=0;e<n.length-1;e++){let t=n[e];(!i[t]||typeof i[t]!=`object`)&&(i[t]={}),i=i[t]}i[n[n.length-1]]=t,f.value=r,a(`update:modelValue`,f.value)}let y=()=>{var e;return(e=d.value)?.reportValidity()??!1},b=()=>{var e;return(e=d.value)?.checkValidity()??!1},x=L();async function S(){try{var e;let t=y();if(!t||m.value===`submitting`)return;m.value=`submitting`,await(e=i.onSubmit)?.call(i,f.value),p.value=s(f.value),m.value=`success`,window.parent.postMessage({type:`BAGEL_FORM_SUCCESS`,data:JSON.stringify(f.value)},`*`)}catch(e){m.value=`error`,x.value=e,console.error(`Submit error:`,x.value)}}let{renderField:C}=dr({mode:`form`,getFormData:()=>f.value,onUpdateModelValue:(e,t)=>{var n;e.id&&(v({fieldId:e.id,value:t}),(n=e.onUpdate)?.call(e,t,f.value))}}),w=e=>C(e);function T(e){let t=e.target;if(t.name){let e=t.type===`checkbox`?t.checked:t.value;v({fieldId:t.name,value:e})}}return t({form:d,isDirty:g,validateForm:y,checkValidity:b}),(e,t)=>(P(),u(n,null,[m.value!==`success`||!e.$slots.success?(P(),u(n,{key:0},[i.tag===`form`?(P(),u(`form`,{key:0,ref_key:`form`,ref:d,class:D(i.class),onSubmit:ge(S,[`prevent`]),onInput:T},[h.value?(P(!0),u(n,{key:0},R(h.value,e=>(P(),c(ae(w(e)),{key:e.id}))),128)):z(e.$slots,`default`,{key:1}),z(e.$slots,`submit`,{submit:S,isDirty:g.value,validateForm:y,formState:m.value})],34)):(P(),u(n,{key:1},[h.value?(P(!0),u(n,{key:0},R(h.value,e=>(P(),c(ae(w(e)),{key:e.id,class:D(i.class)},null,8,[`class`]))),128)):l(``,!0)],64))],64)):l(``,!0),m.value===`success`?z(e.$slots,`success`,{key:1}):l(``,!0),m.value===`error`?z(e.$slots,`error`,{key:2,error:x.value}):l(``,!0)],64))}}),Qs=Zs;const $s={class:`bgl-multi-step-form`},ec={key:0,class:`bgl-step-progress`},tc={class:`bgl-steps-indicator`},nc=[`onClick`],rc={key:0,class:`bgl-step-label`},ic={class:`bgl-form-wrapper`},ac={class:`bgl-step-controls`};var oc=h({__name:`BglMultiStepForm`,props:w({bagelFormProps:{default:()=>({})},schema:{},showProgress:{type:Boolean,default:!1},rtl:{type:Boolean,default:!1},stepLabels:{},allowStepNavigation:{type:Boolean,default:!1},validateOnSteps:{type:Boolean,default:!0},direction:{default:`auto`}},{modelValue:{default:()=>({}),required:!0},modelModifiers:{}}),emits:w([`submit`,`stepChange`],[`update:modelValue`]),setup(e,{expose:t,emit:r}){var a;let s=e,p=r,h=L(),g=ce(e,`modelValue`),_=L(0),y=L(0),b=L([]);function x(){if(!h.value)return!1;let e=h.value.validateForm();return e&&!b.value.includes(_.value)&&b.value.push(_.value),e}let S=o(()=>IT({schema:H(s.schema)})),C=o(()=>{let e=S.value;return e.filter((e,t)=>{if(e.vIf!==void 0||e[`v-if`]!==void 0){let t=e.vIf??e[`v-if`];if(typeof t==`function`)return t(void 0,g.value);if(typeof t==`boolean`)return t;if(typeof t==`string`)return!!t}return!0})}),w=o(()=>C.value.length),k=o(()=>{let e=[];return S.value.forEach((t,n)=>{let r=t.vIf??t[`v-if`],i=!0;r!==void 0&&(typeof r==`function`?i=r(void 0,g.value):typeof r==`boolean`?i=r:typeof r==`string`&&(i=!!r)),i&&e.push(n)}),e}),A=o(()=>{let e=k.value[_.value];return[S.value[e]]}),j=L(s.rtl?`right`:`left`);W(()=>_.value,(e,t)=>{s.direction===`auto`?j.value=s.rtl?e>t?`right`:`left`:e>t?`left`:`right`:j.value=s.direction,y.value=t,p(`stepChange`,{newStep:e,oldStep:t,totalSteps:w.value,direction:j.value})});let M=o(()=>_.value===w.value-1),N=o(()=>e=>b.value.includes(e)),ee=L(!1);async function F(){var e;await E(),s.validateOnSteps?ee.value=(e=h.value)?.checkValidity()??!1:ee.value=!0}function I(){_.value>0&&_.value--}let te=L();async function ne(){s.validateOnSteps&&x()===!1||(M.value||_.value++,await Rs(400),F())}async function re(e){if(e<_.value||b.value.includes(e))return _.value=e,!0;if(e>_.value){if(s.validateOnSteps&&x()===!1)return!1;for(let n=_.value+1;n<=e;n++)if(_.value=n,await E(),await Rs(100),s.validateOnSteps){var t;let e=(t=h.value)?.checkValidity()??!1;if(e)b.value.includes(n)||b.value.push(n);else return!1}return!0}return!1}function ie(){x()!==!1&&p(`submit`,g.value)}function ae(){b.value=[],_.value=0}return W(()=>g.value,()=>{F(),_.value>=w.value&&w.value>0&&(_.value=0)},{deep:!0}),t({submit:ie,validateForm:x,checkValidity:(a=h.value)?.checkValidity,isDirty:o(()=>{var e;return(e=h.value)?.isDirty}),reset:ae,isLastStep:M,goToStep:re,currentStep:_,totalSteps:o(()=>w.value),isStepValid:ee,nextStep:ne,prevStep:I}),(e,t)=>(P(),u(`div`,$s,[e.showProgress?(P(),u(`div`,ec,[z(e.$slots,`progress`,O(v({currentStep:_.value,totalSteps:w.value,goToStep:re,stepLabels:s.stepLabels,allowStepNavigation:s.allowStepNavigation,isStepValidated:N.value})),()=>[d(`div`,tc,[(P(!0),u(n,null,R(w.value,(e,t)=>(P(),u(`div`,{key:t,class:D([`bgl-step-indicator`,[{active:t===_.value},{completed:t<_.value||N.value(t)},{clickable:s.allowStepNavigation}]]),onClick:e=>s.allowStepNavigation&&re(t)},[d(`span`,null,V(t+1),1),s.stepLabels&&s.stepLabels[t]?(P(),u(`span`,rc,V(s.stepLabels[t]),1)):l(``,!0)],10,nc))),128))])],!0)])):l(``,!0),d(`div`,ic,[m(i,{name:j.value===`right`?`slide-right`:`slide-left`,mode:`out-in`},{default:G(()=>[(P(),u(`div`,{key:_.value,ref_key:`formContainer`,ref:te,class:`bgl-form-container`},[m(U(Qs),T({ref_key:`formRef`,ref:h,modelValue:g.value,"onUpdate:modelValue":t[0]||=e=>g.value=e,schema:A.value},e.bagelFormProps),f({_:2},[e.$slots.success?{name:`success`,fn:G(()=>[z(e.$slots,`success`,{},void 0,!0)]),key:`0`}:void 0,e.$slots.error?{name:`error`,fn:G(()=>[z(e.$slots,`error`,{},void 0,!0)]),key:`1`}:void 0]),1040,[`modelValue`,`schema`])]))]),_:3},8,[`name`]),d(`div`,ac,[z(e.$slots,`steppers`,O(v({prevStep:I,nextStep:ne,submit:ie,currentStep:_.value,totalSteps:w.value,isLastStep:M.value,isStepValid:ee.value})),()=>[_.value===0?l(``,!0):(P(),c(U(J),{key:0,color:`gray`,icon:`arrow_back`,onClick:I})),M.value?(P(),c(U(J),{key:2,value:`Submit`,onClick:ie})):(P(),c(U(J),{key:1,icon:`arrow_forward`,disabled:s.validateOnSteps&&!ee.value,onClick:ne},null,8,[`disabled`]))],!0)])])]))}}),sc=q(oc,[[`__scopeId`,`data-v-1e915d1e`]]);const cc={key:0,class:`label mb-05`},lc={class:`ps-025 border-start mb-05`},uc={key:0,class:`flex-center h-300px`},dc={key:1,class:`py-1`},fc={key:0,class:`minimizedText txt14 p-025 opacity-7`},pc={class:`bg-gray-80 -my-05 px-025 pt-065 pb-05 txt-center space-between flex column`};var mc=h({__name:`FieldArray`,props:{el:{default:`div`},id:{},label:{},placeholder:{},children:{},class:{type:[String,Number,Boolean,Object,Function]},attrs:{},required:{type:Boolean},disabled:{type:Boolean},helptext:{},options:{},defaultValue:{},add:{type:Boolean,default:!0},delete:{type:Boolean,default:!0},transform:{},schema:{},modelValue:{},type:{default:`object`}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t,a=Qs,s=L([]),f=L(r.modelValue||[]),p=L(`loaded`),m=o(()=>r.type===`text`?[{id:`value`,type:`text`,label:``,$el:`text`}]:r.type===`number`?[{id:`value`,type:`number`,label:``,$el:`number`}]:[]),h=o(()=>r.type===`object`?H(r.schema):m.value);W(()=>r.modelValue,e=>{f.value=e||[]},{deep:!0});function g(){i(`update:modelValue`,f.value)}function _(e){f.value.splice(e,1),g()}function v(){let e={text:``,number:0,object:{}};f.value.push(e[r.type]),g()}function y(e){s.value[e]=!s.value[e]}function b(e,t){r.type===`text`||r.type===`number`?f.value[e]=r.type===`number`?Number(t.value):t.value:f.value[e]=t,g()}let x=o(()=>r.type===`text`||r.type===`number`),S=o(()=>{var e;return x.value||r.type===`object`&&Number((e=h.value)?.length)>0}),C=o(()=>{var e,t;return Number((e=h.value)?.length)>2||(t=h.value)?.some(e=>e.$el===`richtext`)});return(e,t)=>(P(),u(`div`,{class:D(r.class)},[e.label?(P(),u(`p`,cc,V(e.label),1)):l(``,!0),d(`div`,lc,[p.value===`loaded`?S.value?(P(),u(n,{key:2},[(P(!0),u(n,null,R(f.value,(t,n)=>(P(),u(`div`,{key:n,outline:``,thin:``,class:D([`mb-05 itemBox transition ps-05 pb-025 pt-025 radius-05 gap-05 overflow-hidden`,{minimized:s.value[n]}])},[s.value[n]?(P(),u(`p`,fc,V(e.label)+` `+V(n+1),1)):(P(),c(U(a),{key:1,"model-value":x.value?{value:t}:t,schema:U(h),"onUpdate:modelValue":e=>b(n,e)},null,8,[`model-value`,`schema`,`onUpdate:modelValue`])),d(`div`,pc,[C.value?(P(),c(U(J),{key:0,class:`block rotate-180 txt10 opacity-7 p-025`,flat:``,thin:``,icon:`keyboard_arrow_down`,onClick:e=>y(n)},null,8,[`onClick`])):l(``,!0),r.delete?(P(),c(U(J),{key:1,icon:`delete`,class:`txt10 opacity-7`,thin:``,flat:``,onClick:e=>_(n)},null,8,[`onClick`])):l(``,!0)])],2))),128)),e.add?(P(),c(U(J),{key:0,thin:``,icon:`add`,color:`gray`,class:`txt12 arrayAddButton`,onClick:v},{default:G(()=>[d(`p`,null,V(e.label),1)]),_:1})):l(``,!0)],64)):(P(),u(`div`,dc,t[0]||=[d(`p`,{class:`opacity-7`},` No schema available `,-1)])):(P(),u(`div`,uc,[p.value===`loading`?(P(),c(U(IC),{key:0})):p.value===`error`?(P(),c(U($),{key:1,icon:`error`,color:`red`})):l(``,!0)]))])],2))}}),hc=mc;const gc={class:`primary-checkbox`};var _c=h({__name:`Checkbox`,props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=ce(e,`modelValue`);return(e,n)=>(P(),u(`label`,gc,[z(e.$slots,`label`,{},void 0,!0),K(d(`input`,{"onUpdate:modelValue":n[0]||=e=>t.value=e,type:`checkbox`},null,512),[[ue,t.value]])]))}}),vc=q(_c,[[`__scopeId`,`data-v-73f1d9ad`]]);const yc=[`title`],bc=[`id`,`disabled`,`value`,`required`],xc=[`for`];var Sc=h({__name:`CheckInput`,props:w({label:{},id:{},title:{},small:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean},defaultValue:{default:!1},value:{}},{modelValue:{default:void 0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=o(()=>e.id||Math.random().toString(36).slice(7)),n=ce(e,`modelValue`);return j(()=>{n.value===void 0&&(n.value=e.defaultValue)}),(e,r)=>(P(),u(`div`,{class:D([`bagel-input bgl-checkbox align-items-center ps-025`,{small:e.small}]),title:e.title},[K(d(`input`,{id:t.value+e.value,"onUpdate:modelValue":r[0]||=e=>n.value=e,disabled:e.disabled,value:e.value,required:e.required,type:`checkbox`,class:`me-05`},null,8,bc),[[ue,n.value]]),d(`label`,{for:t.value+e.value},[z(e.$slots,`label`,{},()=>[p(V(e.label),1)],!0)],8,xc)],10,yc))}}),Cc=q(Sc,[[`__scopeId`,`data-v-083702e1`]]);function wc(e=`dark`){let t=L(null),n=L(!1),r=L(e),i=e=>e===`dark`?`atom-one-dark`:e===`light`?`atom-one-light`:e,a=e=>`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.0/styles/${e}.min.css`,o=()=>{document.querySelectorAll(`link[rel="stylesheet"]`).forEach(e=>{if(e instanceof HTMLLinkElement&&e.href.includes(`/styles/`)){var t;e.href.includes(`highlight.js`)&&(t=e.parentElement)?.removeChild(e)}})},s=async e=>{let t=i(e);if(t!==r.value)try{o();let e=a(t);console.log(`setTheme`,e),await Vs(e),r.value=t}catch(e){console.error(`Failed to apply theme. Falling back to atom-one-dark:`,e),o(),r.value=`atom-one-dark`;let t=a(r.value);await Vs(t)}},c=async()=>{if(!n.value)try{await Bs(`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.0/highlight.min.js`,{id:`hljs-cdn`}),await s(r.value),window.hljs?(t.value=window.hljs,n.value=!0):console.error(`Failed to load highlight.js`)}catch(e){console.error(`Error loading highlight.js:`,e)}},l=e=>e.replace(/[&<>"']/g,e=>{let t={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};return t[e]||``}),u=(e,n,r=!0,i=!0)=>{if(!t.value)return l(e);try{let a=n||``;if(a&&!r&&!t.value.getLanguage(a))return console.warn(`The language "${a}" is not available.`),l(e);let o=r?t.value.highlightAuto(e):t.value.highlight(e,{language:a,ignoreIllegals:i});return o.value||l(e)}catch(t){return console.error(`Highlighting error:`,t),l(e)}};return{hljs:t,loaded:n,loadHighlight:c,setTheme:s,currentTheme:r,escapeHtml:l,highlightCode:u}}const Tc={key:0,class:`label`},Ec={class:`editor-content-papa relative`},Dc={class:`code-display`,wrap:``},Oc=[`innerHTML`],kc=[`value`];var Ac=h({__name:`Index`,props:{language:{type:String,default:`html`},readonly:{type:Boolean,default:!1},modelValue:{type:String,default:``},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0},label:{type:String,default:``},height:{type:String,default:`240px`},disabled:{type:Boolean,default:!1},theme:{type:String,default:`dark`}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=L(n.modelValue||``),a=L(),{loaded:s,loadHighlight:c,highlightCode:f,setTheme:p}=wc(n.theme),m=o(()=>{let e=n.height??`240px`;return e.match(/^\d+$/)?`${e}px`:e}),h=o(()=>f(i.value,n.language,n.autodetect,n.ignoreIllegals));function g(e){let t=e.target;i.value=t.value,r(`update:modelValue`,i.value)}function _(e){if(e.key!==`Tab`)return;e.preventDefault();let t=e.target,n=t.selectionStart,a=t.selectionEnd,o=`${i.value.substring(0,n)} ${i.value.substring(a)}`;i.value=o,r(`update:modelValue`,i.value),setTimeout(()=>{t.selectionStart=t.selectionEnd=n+2},0)}return j(async()=>{await c()}),W(()=>n.theme,e=>{p(e)}),W(()=>n.modelValue,e=>{e!==void 0&&e!==i.value&&(i.value=e)},{immediate:!0}),(t,n)=>(P(),u(`div`,{class:`code-editor-container ltr`,style:k({maxHeight:m.value})},[e.label?(P(),u(`label`,Tc,V(e.label),1)):l(``,!0),U(s)?(P(),u(`div`,{key:1,ref_key:`editorRef`,ref:a,class:`code-editor-grandpa hljs`},[d(`div`,Ec,[d(`pre`,Dc,[d(`code`,{innerHTML:h.value},null,8,Oc)]),!e.readonly&&!e.disabled?(P(),u(`textarea`,{key:0,value:i.value,class:`code-input`,spellcheck:`false`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,onInput:g,onKeydown:_},null,40,kc)):l(``,!0)])],512)):l(``,!0)],4))}}),jc=q(Ac,[[`__scopeId`,`data-v-206c54b2`]]);const Mc=[`title`],Nc={class:`flex bg-input rounded px-025 colorInputPickWrap`},Pc=[`id`,`placeholder`,`required`];var Fc=h({__name:`ColorInput`,props:{label:{},id:{},placeholder:{},modelValue:{},editMode:{type:Boolean,default:!0},small:{type:Boolean},required:{type:Boolean},nativeInputAttrs:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=L(n.modelValue);return W(()=>i.value,e=>{r(`update:modelValue`,e)}),(e,t)=>(P(),u(`div`,{class:D([`bagel-input`,{small:e.small}]),title:e.label},[d(`label`,null,[p(V(e.label)+` `,1),d(`div`,Nc,[K(d(`input`,T({id:e.id,"onUpdate:modelValue":t[0]||=e=>i.value=e,class:[`border`,{"no-edit":!e.editMode,"opacity-1":!i.value}],type:`color`,placeholder:e.placeholder||e.label,required:e.required},e.nativeInputAttrs),null,16,Pc),[[pe,i.value]]),K(d(`input`,{"onUpdate:modelValue":t[1]||=e=>i.value=e,class:`flex-grow-1 border colorInputPick`,type:`text`,placeholder:`Enter color`},null,512),[[pe,i.value]]),m(U(J),{class:D({"not-allowed opacity-3":!i.value}),round:``,flat:``,thin:``,icon:`clear`,onClick:t[2]||=e=>i.value=``},null,8,[`class`])])])],10,Mc))}}),Ic=Fc;const Lc=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/,Rc=/^\d{4}-\d{2}-\d{2}$/;let zc=function(e){return e.REGULAR=`regular`,e.SHORTENED=`shortened`,e.FLEXIBLE=`flexible`,e}({}),Bc=function(e){return e[e.MIDNIGHT=0]=`MIDNIGHT`,e[e.ONE_AM=100]=`ONE_AM`,e[e.TWO_AM=200]=`TWO_AM`,e[e.THREE_AM=300]=`THREE_AM`,e[e.FOUR_AM=400]=`FOUR_AM`,e[e.FIVE_AM=500]=`FIVE_AM`,e[e.SIX_AM=600]=`SIX_AM`,e[e.SEVEN_AM=700]=`SEVEN_AM`,e[e.EIGHT_AM=800]=`EIGHT_AM`,e[e.NINE_AM=900]=`NINE_AM`,e[e.TEN_AM=1e3]=`TEN_AM`,e[e.ELEVEN_AM=1100]=`ELEVEN_AM`,e[e.TWELVE_PM=1200]=`TWELVE_PM`,e[e.ONE_PM=1300]=`ONE_PM`,e[e.TWO_PM=1400]=`TWO_PM`,e[e.THREE_PM=1500]=`THREE_PM`,e[e.FOUR_PM=1600]=`FOUR_PM`,e[e.FIVE_PM=1700]=`FIVE_PM`,e[e.SIX_PM=1800]=`SIX_PM`,e[e.SEVEN_PM=1900]=`SEVEN_PM`,e[e.EIGHT_PM=2e3]=`EIGHT_PM`,e[e.NINE_PM=2100]=`NINE_PM`,e[e.TEN_PM=2200]=`TEN_PM`,e[e.ELEVEN_PM=2300]=`ELEVEN_PM`,e[e.TWELVE_AM=2400]=`TWELVE_AM`,e}({});var Vc=class{static getBrowserNavigatorLocale(){return typeof navigator==`object`?navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language:`en-US`}static hasSlotContent(e){return e?e().some(e=>e.type===t||Array.isArray(e.children)&&!e.children.length?!1:e.type!==r||typeof e.children==`string`&&e.children.trim()!==``):!1}static getEventType(e,t){let n=Lc.test(e.time.start)&&Lc.test(e.time.end),r=Rc.test(e.time.start)&&Rc.test(e.time.end);if(n)return this.getTimedEventType(e,t);if(r)return this.getFullDayEventType(e,t);throw Error(`Event has invalid type`)}static getTimedEventType(e,t){if(t.dateStringsHaveEqualDates(e.time.start,e.time.end))return`SINGLE_DAY_TIMED`;if(t.dayMode===zc.FLEXIBLE){let n=t.setHourInDateTimeString(t.addDaysToDateTimeString(1,t.dateStringFrom(e.time.start)),Uc.getHourFromTimePoints(t.DAY_END));if(e.time.end<n)return`SINGLE_HYBRID_DAY_TIMED`}return`MULTI_DAY_TIMED`}static getFullDayEventType(e,t){return t.dateStringsHaveEqualDates(e.time.start,e.time.end)?`SINGLE_DAY_FULL_DAY`:`MULTI_DAY_FULL_DAY`}static isUIEventTouchEvent(e){return`touches`in e&&typeof e.touches==`object`}};let Hc=function(e){return e.SUNDAY=`sunday`,e.MONDAY=`monday`,e}({});var Uc=class t{constructor(n=Hc.MONDAY,r=null,i={start:0,end:2400}){e.defineProperty(this,`FIRST_DAY_OF_WEEK`,void 0),e.defineProperty(this,`CALENDAR_LOCALE`,void 0),e.defineProperty(this,`ALL_HOURS`,[0,100,200,300,400,500,600,700,800,900,1e3,1100,1200,1300,1400,1500,1600,1700,1800,1900,2e3,2100,2200,2300]),e.defineProperty(this,`DAY_START`,void 0),e.defineProperty(this,`DAY_END`,void 0),e.defineProperty(this,`HOURS_PER_DAY`,24),e.defineProperty(this,`MS_PER_DAY`,void 0),this.FIRST_DAY_OF_WEEK=n,this.CALENDAR_LOCALE=r||Vc.getBrowserNavigatorLocale(),this.DAY_START=i.start,this.DAY_END=i.end,this.HOURS_PER_DAY=(()=>{let e=t.getHourFromTimePoints(this.DAY_END),n=t.getHourFromTimePoints(this.DAY_START);return e>n?e-n:this.HOURS_PER_DAY-n+e})(),this.MS_PER_DAY=864e5}get dayMode(){return this.DAY_START===0&&this.DAY_END===2400?zc.REGULAR:this.DAY_START>=this.DAY_END?zc.FLEXIBLE:zc.SHORTENED}getDatesBetweenTwoDates(e,t){let n=[],r=new Date(e);for(;r<=t;)n.push(new Date(r.getFullYear(),r.getMonth(),r.getDate())),r.setDate(r.getDate()+1);return n}getCalendarWeekDateObjects(e){let t;t=this.FIRST_DAY_OF_WEEK===`sunday`?e.getDay():e.getDay()===0?6:e.getDay()-1;let n=e.getDate()-t,r=new Date(e.getFullYear(),e.getMonth(),n);return this.getDatesBetweenTwoDates(r,new Date(r.getFullYear(),r.getMonth(),r.getDate()+6))}getCalendarMonthSplitInWeeks(e,t){let n=[],r=new Date(e,t,1),i=new Date(r.getFullYear(),r.getMonth(),1),a=this.getCalendarWeekDateObjects(i);n.push(a);let o=!0,s=a[0],c=r.getMonth();for(;o;){let e=new Date(s.getFullYear(),s.getMonth(),s.getDate()+7);e.getMonth()===c?(n.push(this.getCalendarWeekDateObjects(e)),s=e):o=!1}return n}getCalendarYearMonths(e){let t=[],n=0;for(;n<=11;)t.push(new Date(e,n,1)),n++;return t}getHourAndMinutesFromTimePoints(e){let t=e.toString(),n=`0`,r=`0`;return t.length===4?(n=t[0]+t[1],r=t[2]+t[3]):t.length===3&&(n=t[0],r=t[1]+t[2]),{hour:+n,minutes:+r}}getHourLocaleStringFromHourDigits(e){let{hour:t,minutes:n}=this.getHourAndMinutesFromTimePoints(e),r=new Date(2100,0,1,+t,+n,0).toLocaleTimeString(this.CALENDAR_LOCALE,{hour:`2-digit`});return r[0]===`0`?r.substring(1):r}getLocalizedNameOfWeekday(e,t=`short`){return e.toLocaleDateString(this.CALENDAR_LOCALE,{weekday:t})}getLocalizedNameOfMonth(e,t=`short`){return e.toLocaleDateString(this.CALENDAR_LOCALE,{month:t})}getLocalizedDateString(e){return e.toLocaleDateString(this.CALENDAR_LOCALE)}getDateTimeStringFromDate(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),a=`${n}-${r>=10?r:`0${r}`}-${i>=10?i:`0${i}`}`;if(!t){let t=e.getHours(),n=e.getMinutes();return`${a} ${t>=10?t:`0${t}`}:${n>=10?n:`0${n}`}`}let o=t===`start`?`00:00`:`23:59`;return`${a} ${o}`}getLocalizedTime(e){let{year:t,month:n,date:r,hour:i,minutes:a}=this.getAllVariablesFromDateTimeString(e),o=new Date(t,n,r,i,a);return o.toLocaleTimeString(this.CALENDAR_LOCALE,{hour:`numeric`,minute:`numeric`})}getLocalizedHour(e){return e.toLocaleTimeString(this.CALENDAR_LOCALE,{hour:`2-digit`})}getLocalizedTimeRange(e,t){return`${this.getLocalizedTime(e)} - ${this.getLocalizedTime(t)}`}getAllVariablesFromDateTimeString(e){return{year:+e.substring(0,4),month:e.substring(5,7)-1,date:+e.substring(8,10),hour:this.hourFrom(e),minutes:this.minutesFrom(e)}}dateIsToday(e){let t=new Date,n=t.getFullYear(),r=t.getMonth(),i=t.getDate(),a=e.getFullYear(),o=e.getMonth(),s=e.getDate();return n===a&&r===o&&i===s}dateIsInWeek(e,t){let n=new Date(e),r=n.getDate(),i=n.getMonth(),a=n.getFullYear();for(let e of t){let t=r===e.getDate(),n=i===e.getMonth(),o=a===e.getFullYear();if(t&&n&&o)return!0}return!1}getDateStringFromDate(e){let t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return`${t}-${n>=10?n:`0${n}`}-${r>=10?r:`0${r}`}`}addMinutesToDateTimeString(e,t){let{year:n,month:r,date:i,hour:a,minutes:o}=this.getAllVariablesFromDateTimeString(t),s=new Date(n,r,i,a,o),c=new Date(s.getTime()+e*6e4);return this.getDateTimeStringFromDate(c)}addDaysToDateTimeString(e,t){return this.addMinutesToDateTimeString(e*1440,t)}dateStringsHaveEqualDates(e,t){let{year:n,month:r,date:i}=this.getAllVariablesFromDateTimeString(e),{year:a,month:o,date:s}=this.getAllVariablesFromDateTimeString(t);return n===a&&r===o&&i===s}setDateToEndOfDay(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}turnMinutesIntoPercentageOfHour(e){let t=100/60,n=t*e;return n<10?`0${n}`:n.toString()}getPercentageOfDayFromDateTimeString(e,t,n){let r=this.hourFrom(e),i=r*100,a=+e.substring(14,16),o=+this.turnMinutesIntoPercentageOfHour(+a);if(n>t){let e=n-t,r=i+o,a=r-t;return a/e*100}let s=Bc.TWELVE_AM-t,c=s+n,l=i+o,u=l>=t?l-t:s+l;return u/c*100}getTimeFromClick(e,t){if(t<=0)throw Error(`weekHeight cannot be a negative number`);if(e<0)throw Error(`clickOffsetY cannot be a negative number`);let n=this.DAY_START/100,r=t/this.HOURS_PER_DAY,i=Math.floor(e%r/(r/60));if(this.DAY_END<=this.DAY_START){let n=this.DAY_END/100,a=n*r,o=t-a;if(e>o){let t=Math.floor((e-o)/r);return`${this.doubleDigit(t)}:${this.doubleDigit(i)}`}}let a=Math.floor(e/r)+n;return`${this.doubleDigit(a)}:${this.doubleDigit(i)}`}setSegmentOfDateTimeString(e,t){if(t.hour<0||t.hour>23)throw Error(`Invalid hour`);let n=this.doubleDigit(t.hour);return e=e.replace(/\d{2}:/,`${n}:`),e}isTrailingOrLeadingDate(e,t){let n=new Date(e),r=n.getMonth();return t!==r}static getTimePointsFromHour(e){if(e<0||e>24||e%1!=0)throw Error(`Invalid day boundary`);return e===0?e:e*100}static getHourFromTimePoints(e){if(e<0||e>2400||e%100!=0)throw Error(`Invalid time points`);return e===0?e:e/100}getTimelineHours(){return this.dayMode===zc.FLEXIBLE?[...this.ALL_HOURS.filter(e=>e>=this.DAY_START),...this.ALL_HOURS.filter(e=>e<this.DAY_END)]:this.ALL_HOURS.filter(e=>e>=this.DAY_START&&e<this.DAY_END)}dateStringFrom(e){return e.substring(0,10)}timeStringFrom(e){return e.substring(11,16)}hourFrom(e){return+e.substring(11,13)}minutesFrom(e){return+e.substring(14,16)}areDaysConsecutive(e,t){let n=this.dateStringFrom(this.addDaysToDateTimeString(1,e));return n===this.dateStringFrom(t)}setHourInDateTimeString(e,t){let n=this.doubleDigit(t);return e=e.replace(/\d{2}:/,`${n}:`),e}setMinutesInDateTimeString(e,t){let n=this.doubleDigit(t);return e=e.replace(/:\d{2}/,`:${n}`),e}getDateTimeStringDayBoundariesFrom(e){if(this.DAY_END<=this.DAY_START){let t=this.addDaysToDateTimeString(1,e),n=this.setHourInDateTimeString(t,this.getHourAndMinutesFromTimePoints(this.DAY_END).hour),r=this.setHourInDateTimeString(e,this.getHourAndMinutesFromTimePoints(this.DAY_START).hour);return{start:r,end:n}}let t=this.setHourInDateTimeString(e,this.getHourAndMinutesFromTimePoints(this.DAY_START).hour),n;return this.DAY_END===Bc.TWELVE_AM?(n=this.setHourInDateTimeString(e,23),n=this.setMinutesInDateTimeString(n,59)):n=this.setHourInDateTimeString(e,this.getHourAndMinutesFromTimePoints(this.DAY_END).hour),{start:t,end:n}}doubleDigit(e){if(e<0||e>60)throw Error(`Invalid number. This is not a valid hour or minute`);return e<10?`0${e}`:String(e)}};const Wc={class:`calendar-section m_border-none px-05 m_p-0`},Gc={class:`flex space-between pb-1`},Kc={class:`flex gap-05`},qc={class:`month-year`},Jc={key:0,class:`calendar-grid grid gap-025`},Yc=[`disabled`,`onClick`],Xc={key:1,class:`month-grid grid gap-05 p-05`},Zc={key:2,class:`year-grid grid gap-05 p-0`},Qc={key:0,class:`time-picker border-start flex column gap-1 w-120px px-025`},$c={class:`flex gap-025`};var el=h({__name:`DatePicker`,props:{modelValue:{},min:{},max:{},mode:{default:()=>({mode:`day`})},firstDayOfWeek:{default:Hc.SUNDAY},locale:{default:``},enableTime:{type:Boolean,default:!1},highlightedDates:{},disabledDates:{},autoSize:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t,a=o(()=>H(r.highlightedDates)),s=o(()=>H(r.disabledDates)),f=L(new Date),h=L(`days`),g=new Uc(r.firstDayOfWeek,r.locale);function _(e){if(!e)return null;let t=typeof e==`string`?new Date(e):e;return Number.isNaN(t.getTime())?null:t}function v(){let e=e=>{if(!e)return!0;let t=_(r.min),n=_(r.max);if(t&&e<t||n&&e>n)return!0;if(Array.isArray(s.value)&&s.value.length>0){let t=s.value.some(t=>{let n=_(t);return n?e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate():!1});if(t)return!0}return!1},t=e=>{let t=_(r.min),n=_(r.max);return!!(t&&e<t.getFullYear()||n&&e>n.getFullYear())};return{isDateDisabled:e,isYearDisabled:t}}function y(){let e=o(()=>_(r.modelValue));return{selectedDate:e}}let{isDateDisabled:b,isYearDisabled:x}=v(),{selectedDate:S}=y();function C(){let e=o(()=>{let e=f.value.getFullYear(),t=f.value.getMonth(),n=g.getCalendarMonthSplitInWeeks(e,t);for(;n.length<6;){let e=n[n.length-1],t=e[e.length-1],r=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1),i=g.getCalendarWeekDateObjects(r);n.push(i)}return n.flat()}),t=o(()=>({month:f.value.getMonth(),year:f.value.getFullYear(),formatted:{month:g.getLocalizedNameOfMonth(f.value,`long`),year:g.getLocalizedDateString(f.value).split(`/`).pop()}})),n=o(()=>Array.from({length:12},(e,n)=>{let r=new Date(t.value.year,n,1);return{name:g.getLocalizedNameOfMonth(r,`short`),value:n,disabled:b(r)}})),i=o(()=>{let e=t.value.year-10;return Array.from({length:18},(t,n)=>({value:e+n,disabled:x(e+n)}))}),s=o(()=>{let e=new Date;return e.setDate(e.getDate()-e.getDay()+(r.firstDayOfWeek===Hc.MONDAY?1:0)),Array.from({length:7},(t,n)=>{let r=new Date(e);return r.setDate(e.getDate()+n),g.getLocalizedNameOfWeekday(r,`short`)})}),c=e=>!e||!S.value?!1:e.getFullYear()===S.value.getFullYear()&&e.getMonth()===S.value.getMonth()&&e.getDate()===S.value.getDate(),l=e=>e?g.dateIsToday(e):!1,u=e=>g.isTrailingOrLeadingDate(e,f.value.getMonth()),d=o(()=>e=>!e||!Array.isArray(a.value)||!a.value.length?!1:a.value.some(t=>{let n=_(t);return n?e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate():!1}));return{currentMonthDays:e,currentMonthValue:t,months:n,years:i,weekDays:s,isSelected:c,isToday:l,isNotInMonth:u,isHighlighted:d}}function w(){let e=e=>{f.value=new Date(f.value.getFullYear(),e,1),h.value=`days`},t=e=>{f.value=new Date(e,f.value.getMonth(),1),h.value=`months`},n=()=>{f.value=new Date(f.value.getFullYear(),f.value.getMonth()-1,1)},r=()=>{f.value=new Date(f.value.getFullYear(),f.value.getMonth()+1,1)},i=()=>{let e=h.value===`months`?1:21;f.value=new Date(f.value.getFullYear()-e,f.value.getMonth(),1)},a=()=>{let e=h.value===`months`?1:21;f.value=new Date(f.value.getFullYear()+e,f.value.getMonth(),1)};return{selectMonth:e,selectYear:t,previousMonth:n,nextMonth:r,previousYear:i,nextYear:a}}function T(){let e=o(()=>{var e;return(e=S.value)?.getHours()??0}),t=o(()=>{var e;return(e=S.value)?.getMinutes()??0}),n=e=>{if(!S.value)return;let t=new Date(S.value);t.setHours(e),E(t)},r=e=>{if(!S.value)return;let t=new Date(S.value);t.setMinutes(e),E(t)};return{hours:e,minutes:t,handleHourInput:n,handleMinuteInput:r}}function E(e){if(r.enableTime)i(`update:modelValue`,e.toISOString());else{let t=new Date(e);t.setHours(0,0,0,0),i(`update:modelValue`,t.toISOString())}}let{currentMonthDays:O,currentMonthValue:k,months:A,years:j,weekDays:M,isSelected:N,isToday:ee,isNotInMonth:F,isHighlighted:I}=C(),{selectMonth:te,selectYear:ne,previousMonth:z,nextMonth:re,previousYear:ie,nextYear:ae}=w(),{hours:B,minutes:oe,handleHourInput:se,handleMinuteInput:ce}=T();function le(e){if(e)if(r.enableTime){var t,n;let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=(t=S.value)?.getHours()??new Date().getHours(),a=(n=S.value)?.getMinutes()??new Date().getMinutes();r.setHours(i),r.setMinutes(a),E(r)}else{let t=new Date(e.getFullYear(),e.getMonth(),e.getDate());E(t)}}return(e,t)=>(P(),u(`div`,{class:D([`ltr gap-075 m_flex-wrap calendar-container justify-content-center h-100p`,{flex:!e.autoSize}])},[d(`div`,Wc,[d(`div`,Gc,[h.value===`days`?(P(),u(n,{key:0},[m(U(J),{flat:``,thin:``,icon:`chevron_left`,onClick:U(z)},null,8,[`onClick`]),d(`div`,Kc,[m(U(J),{flat:``,thin:``,class:`month-btn`,onClick:t[0]||=e=>h.value=`months`},{default:G(()=>[p(V(U(k).formatted.month),1)]),_:1}),m(U(J),{flat:``,thin:``,class:`year-btn`,onClick:t[1]||=e=>h.value=`years`},{default:G(()=>[p(V(U(k).formatted.year),1)]),_:1})]),m(U(J),{flat:``,thin:``,icon:`chevron_right`,onClick:U(re)},null,8,[`onClick`])],64)):(P(),u(n,{key:1},[m(U(J),{flat:``,thin:``,icon:`chevron_left`,onClick:U(ie)},null,8,[`onClick`]),d(`span`,qc,V(U(k).formatted.year),1),m(U(J),{flat:``,thin:``,icon:`chevron_right`,onClick:U(ae)},null,8,[`onClick`])],64))]),h.value===`days`?(P(),u(`div`,Jc,[(P(!0),u(n,null,R(U(M),e=>(P(),u(`div`,{key:e,class:`txt-center txt-12 opacity-6`},V(e),1))),128)),(P(!0),u(n,null,R(U(O),e=>(P(),u(`button`,{key:e?.toISOString(),type:`button`,class:D([`day aspect-ratio-1 flex align-items-center justify-content-center pointer round txt14 p-0`,{selected:U(N)(e),today:U(ee)(e),disabled:U(b)(e),"not-in-month":U(F)(e),highlighted:U(I)(e)}]),disabled:U(b)(e),onClick:t=>le(e)},V(e?.getDate()),11,Yc))),128))])):h.value===`months`?(P(),u(`div`,Xc,[(P(!0),u(n,null,R(U(A),e=>(P(),c(U(J),{key:e.value,thin:``,flat:e.value!==U(k).month,disabled:e.disabled,value:e.name,onClick:t=>U(te)(e.value)},null,8,[`flat`,`disabled`,`value`,`onClick`]))),128))])):(P(),u(`div`,Zc,[(P(!0),u(n,null,R(U(j),e=>(P(),c(U(J),{key:e.value,thin:``,flat:e.value!==U(k).year,disabled:e.disabled,value:e.value.toString(),onClick:t=>U(ne)(e.value)},null,8,[`flat`,`disabled`,`value`,`onClick`]))),128))]))]),e.enableTime&&h.value===`days`?(P(),u(`div`,Qc,[d(`div`,$c,[m(U(Ml),{center:``,modelValue:U(B),disabled:!U(S),min:0,max:23,layout:`vertical`,padZero:2,"onUpdate:modelValue":U(se)},null,8,[`modelValue`,`disabled`,`onUpdate:modelValue`]),t[2]||=d(`p`,{class:`pb-075`},` : `,-1),m(U(Ml),{center:``,modelValue:U(oe),disabled:!U(S),min:0,max:59,padZero:2,layout:`vertical`,"onUpdate:modelValue":U(ce)},null,8,[`modelValue`,`disabled`,`onUpdate:modelValue`])])])):l(``,!0)],2))}}),tl=q(el,[[`__scopeId`,`data-v-5b483d05`]]);const nl=[`title`],rl={key:0},il={key:0,class:`required`};var al=h({__name:`DateInput`,props:w({required:{type:Boolean},label:{},editMode:{type:Boolean,default:!0},small:{type:Boolean,default:!1},enableTime:{type:Boolean,default:!1},modelValue:{},min:{},max:{},mode:{default:()=>({mode:`day`})},defaultValue:{},firstDayOfWeek:{default:Hc.SUNDAY},locale:{default:``},center:{type:Boolean}},{modelValue:{required:!0,default:()=>new Date},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=ce(e,`modelValue`),r=L(!1);function i(){let e=e=>e?$E(e,{fmt:t.enableTime?`DD.MM.YY HH:mm`:`DD.MM.YY`}):``,n=e=>{let t=new Date(e);if(!Number.isNaN(t.getTime()))return t;let n=e.split(/[/.-]/);if(n.length===3){let[e,t,r]=n.map(e=>Number.parseInt(e,10));if(!Number.isNaN(e)&&!Number.isNaN(t)&&!Number.isNaN(r)){let n=new Date(r,t-1,e);if(n.getFullYear()===r&&n.getMonth()===t-1&&n.getDate()===e)return n}}return null},r=e=>{if(t.enableTime)return e.toISOString();{let t=new Date(e);return t.setHours(0,0,0,0),t.toISOString().split(`T`)[0]}};return{formatDisplayDate:e,parseUserInput:n,normalizeDate:r}}let{formatDisplayDate:a,parseUserInput:o,normalizeDate:s}=i();function c(){let e=L(``),t=t=>{let r=t.target;e.value=r.value;let i=o(r.value);i&&(n.value=s(i))},i=e=>{e.preventDefault(),e.stopPropagation(),r.value=!0},a=e=>{e.preventDefault(),e.stopPropagation()},c=t=>{if(t.key===`Escape`)r.value=!1;else if(t.key===`Enter`&&e.value){let t=o(e.value);t&&(n.value=s(t),r.value=!1)}};return{inputValue:e,handleInput:t,handleFocus:i,handleClick:a,handleKeydown:c}}let{handleInput:f,handleFocus:h,handleClick:g,handleKeydown:_}=c(),v=L(null),y=L(null);return j(()=>{Tt(v.value,()=>{r.value=!1},{ignore:()=>[y.value]})}),(e,t)=>(P(),u(`div`,{class:D([`bagel-input`,{small:e.small}]),title:e.label,onFocusin:t[4]||=(...e)=>U(h)&&U(h)(...e)},[e.label?(P(),u(`label`,rl,[p(V(e.label)+` `,1),e.required?(P(),u(`span`,il,`*`)):l(``,!0)])):l(``,!0),m(U(qo),{shown:r.value,placement:`bottom-start`,autoHide:!1,triggers:[`click`]},{trigger:G(()=>[d(`div`,{ref_key:`datePickerRef`,ref:v,class:`date-picker-container`,onMousedown:t[0]||=ge(()=>{},[`stop`]),onClick:t[1]||=ge(()=>{},[`stop`])},[m(U(G_),{modelValue:U(a)(n.value),iconStart:`calendar`,min:U(a)(e.min),max:U(a)(e.max),required:e.required,disabled:!e.editMode,class:D([`date-input m-0`,{"txt-center":e.center}]),readonly:!1,onInput:U(f),onFocus:U(h),onClick:U(g),onKeydown:U(_)},null,8,[`modelValue`,`min`,`max`,`required`,`disabled`,`class`,`onInput`,`onFocus`,`onClick`,`onKeydown`])],544)]),default:G(()=>[d(`div`,{ref_key:`calendarRef`,ref:y,onClick:t[3]||=ge(()=>{},[`stop`])},[m(tl,{modelValue:n.value,"onUpdate:modelValue":t[2]||=e=>n.value=e,min:e.min,max:e.max,mode:e.mode,firstDayOfWeek:e.firstDayOfWeek,locale:e.locale,enableTime:e.enableTime},null,8,[`modelValue`,`min`,`max`,`mode`,`firstDayOfWeek`,`locale`,`enableTime`])],512)]),_:1},8,[`shown`])],42,nl))}}),ol=al;const sl=[`jpeg`,`png`,`webp`,`avif`,`apng`,`gif`,`avifs`,`svg`,`bmp`,`jpg`,`heic`,`heif`,`ico`,`cur`,`tif`,`tiff`],cl=RegExp(`(${sl.join(`|`)})$`,`i`),ll=[`mp4`,`webm`,`ogg`,`mov`,`avi`,`flv`,`wmv`,`mkv`,`ts`,`m3u8`],ul=RegExp(`(${ll.join(`|`)})$`,`i`),dl=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-0-9]+\.)+[a-z]{2,}))$/i,fl=[`title`],pl=[`for`],ml={class:`flex`},hl={key:0},gl={key:1,class:`opacity-7 light`},_l={key:3,class:`validating`},vl=[`id`,`name`,`title`,`placeholder`,`disabled`,`required`];var yl=h({__name:`EmailInput`,props:{id:{},title:{},helptext:{},name:{},placeholder:{},modelValue:{default:``},label:{},small:{type:Boolean},required:{type:Boolean},pattern:{default:`[a-z0-9._%+\\-]+@[a-z0-9.\\-]+\\.[a-z]{2,}`},defaultValue:{},shrink:{type:Boolean},disabled:{type:Boolean},nativeInputAttrs:{},icon:{},iconStart:{},autocomplete:{},autofocus:{type:Boolean},onFocusout:{},onFocus:{},autocorrect:{type:Boolean,default:!0},serverValidate:{type:Boolean,default:!1},preventFakeEmails:{type:Boolean,default:!1},validate:{},getFormData:{}},emits:[`update:modelValue`,`debounce`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=[`gmail.com`,`yahoo.com`,`hotmail.com`,`outlook.com`,`aol.com`,`icloud.com`,`protonmail.com`,`mail.com`,`zoho.com`,`yandex.com`,`gmx.com`,`live.com`,`msn.com`],o=`mailinator.com,tempmail.com,10minutemail.com,guerrillamail.com,guerrillamail.info,throwawaymail.com,yopmail.com,tempinbox.com,dispostable.com,mailnesia.com,trashmail.com,sharklasers.com,temp-mail.org,fakeinbox.com,getnada.com,armyspy.com,cuvox.de,dayrep.com,einrot.com,fleckens.hu,gustr.com,jourrapide.com,rhyta.com,superrito.com,teleworm.us,nbmbb.com,poplk.com`.split(`,`),s=L(``),f=L(null),m=L(``),h=L(!1),g=L(!0),_=new Map,v=L();function y(e){if(e){if(!dl.test(e))return`Please enter a valid email address`;if(r.preventFakeEmails&&e.includes(`@`)){let[,t]=e.split(`@`);if(t){let e=t.toLowerCase();if(o.includes(e))return`Please use a non-disposable email address`}}if(m.value)return m.value}}let b=dt(()=>{i(`debounce`,s.value)},700);function S(){if(!v.value||(v.value.setCustomValidity(``),!s.value))return;let e=y(s.value);typeof e==`string`&&v.value.setCustomValidity(e)}async function C(e){if(!(!r.serverValidate||!e||!dl.test(e))){if(_.has(e)){g.value=_.get(e)||!1;return}h.value=!0,m.value=``;try{var t;let r=await fetch(`https://api.mailcheck.ai/domain/${e.split(`@`)[1]}`,{method:`GET`,headers:{"Content-Type":`application/json`}});if(!r.ok)throw Error(`Validation service unavailable`);let i=await r.json(),a=i.status===`valid`||i.has_mx===!0;if(g.value=a,_.set(e,a),a)(t=v.value)?.setCustomValidity(``);else{var n;m.value=`This email domain appears to be invalid`,(n=v.value)?.setCustomValidity(m.value)}}catch(e){console.error(`Email validation error:`,e)}finally{h.value=!1}}}function w(e){if(!r.autocorrect||!e)return;if(e.includes(`@`)&&!e.includes(`.`)){let[t,n]=e.split(`@`),r=n.toLowerCase();for(let e of a)if(e.startsWith(r)){f.value=`${t}@${e}`;return}}if(!e.includes(`@`))return;let[t,n]=e.split(`@`),i=n.toLowerCase();if(a.includes(i)){f.value=null;return}for(let e of a)if(k(i,e)<=2){f.value=`${t}@${e}`.toLowerCase();return}f.value=null}function O(){f.value&&(s.value=f.value,f.value=null,i(`update:modelValue`,s.value),b())}function k(e,t){let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=e.length;r++)for(let i=1;i<=t.length;i++){let a=e[r-1]===t[i-1]?0:1;n[r][i]=Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+a)}return n[e.length][t.length]}let A=dt(()=>C(s.value),1e3);function M(){r.disabled||(f.value=null,S(),r.serverValidate&&A(),i(`update:modelValue`,s.value),b())}function N(e){w(s.value),r.serverValidate&&dl.test(s.value)&&C(s.value),r.onFocusout&&r.onFocusout(e)}W(()=>r.modelValue,e=>{e!==s.value&&(s.value=e||``,E(()=>{S()}))},{immediate:!0}),W(()=>s.value,()=>{S()},{immediate:!0});let ee=()=>document.activeElement===v.value,F=()=>{var e;return(e=v.value)?.focus()};return t({focus:F,hasFocus:ee}),j(()=>{r.autofocus&&setTimeout(()=>{var e;return(e=v.value)?.focus()},10),r.defaultValue&&!r.modelValue&&(s.value=r.defaultValue)}),(e,t)=>{let n=ie(`pattern`);return P(),u(`div`,{class:D([`bagel-input text-input`,{small:e.small,shrink:e.shrink,textInputIconWrap:e.icon,txtInputIconStart:e.iconStart,"is-validating":h.value}]),title:e.title},[d(`label`,{for:e.id},[d(`div`,ml,[p(V(e.label)+` `,1),e.required?(P(),u(`span`,hl,`*`)):l(``,!0),e.helptext?(P(),u(`span`,gl,V(e.helptext),1)):l(``,!0),f.value?(P(),u(`span`,{key:2,class:`pointer nowrap inline-block ms-auto color-red txt-10px p-0`,onClick:ge(O,[`prevent`])},` did you mean `+V(f.value)+`? `,1)):l(``,!0),h.value?(P(),u(`span`,_l,`Validating email...`)):l(``,!0)]),K(d(`input`,T({id:e.id,ref_key:`input`,ref:v,"onUpdate:modelValue":t[0]||=e=>x(s)?s.value=e:s=e,class:`ltr`,name:e.name,title:e.title,autocomplete:`email`,type:`email`,placeholder:e.placeholder||e.label,disabled:e.disabled,required:e.required},e.nativeInputAttrs,{onFocusout:N,onFocus:t[1]||=(...t)=>e.onFocus&&e.onFocus(...t),onInput:M}),null,16,vl),[[pe,U(s)],[n,void 0,`lower`]]),e.iconStart?(P(),c(U($),{key:0,class:`iconStart`,icon:e.iconStart},null,8,[`icon`])):l(``,!0),e.icon?(P(),c(U($),{key:1,icon:e.icon},null,8,[`icon`])):l(``,!0)],8,pl)],10,fl)}}}),bl=q(yl,[[`__scopeId`,`data-v-e3d13caa`]]);const xl=[`title`],Sl={key:0},Cl=[`value`,`placeholder`];var wl=h({__name:`JSONInput`,props:{description:{default:``},label:{default:``},modelValue:{},placeholder:{default:``},editMode:{type:Boolean,default:!0},small:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;function r(e){let t=e.target;n(`update:modelValue`,t.value)}return(e,t)=>{let n=re(`LangText`);return P(),u(`div`,{class:D([`bagel-input`,{small:e.small}]),title:e.description},[e.label?(P(),u(`label`,Sl,[m(n,{input:e.label},null,8,[`input`])])):l(``,!0),d(`textarea`,{value:e.modelValue,class:D({"no-edit":!e.editMode}),placeholder:e.placeholder,onInput:r},null,42,Cl)],10,xl)}}}),Tl=q(wl,[[`__scopeId`,`data-v-1cbaeab2`]]);const El=[`for`],Dl={key:0,class:`block`},Ol=[`id`,`placeholder`,`disabled`,`required`,`readonly`,`pattern`,`onKeydown`],kl={key:1,class:`opacity-7 light`},Al={key:5,class:`flex column spinner`};var jl=h({__name:`NumberInput`,props:{modelValue:{},min:{},max:{},step:{default:1},spinner:{type:Boolean,default:!0},iconStart:{},icon:{},label:{},defaultValue:{},placeholder:{},disabled:{type:Boolean},required:{type:Boolean},id:{},helptext:{},layout:{},center:{type:Boolean},padZero:{default:1},useGrouping:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t,r=L();j(()=>{let t=e.modelValue===void 0?void 0:Number.parseFloat(`${e.modelValue}`),n=e.defaultValue===void 0?void 0:Number.parseFloat(`${e.defaultValue}`);r.value=t??n});let i=[`horizontal`,`vertical`];function a(...t){var n;let r=t.map(e=>e||0),i=(n=e.step.toString().split(`.`)[1])?.length||0;return Number.parseFloat(r.reduce((e,t)=>e+t,0).toFixed(i))}function s(...t){var n;let r=t.map(e=>e||0),i=r.shift()||0,a=(n=e.step.toString().split(`.`)[1])?.length||0;return Number.parseFloat(r.reduce((e,t)=>e-t,i).toFixed(a))}let f=o(()=>e.max===void 0||a(r.value,e.step)<=e.max),p=o(()=>e.min===void 0||s(r.value,e.step)>=e.min);function h(){f.value&&(r.value=a(r.value??0,e.step),n(`update:modelValue`,r.value))}function g(){p.value&&(r.value=s(r.value||0,e.step),n(`update:modelValue`,r.value))}function _(t){if(Number.isNaN(t))return``;let n=new Intl.NumberFormat(`en-US`,{minimumFractionDigits:0,maximumFractionDigits:20,useGrouping:e.useGrouping}),r=n.format(t),[i,a]=r.split(`.`),o=e.padZero&&e.padZero>i.replace(/,/g,``).length?`0`.repeat(e.padZero-i.replace(/,/g,``).length):``;return a?`${o}${i}.${a}`:`${o}${i}`}let v=L(``);function y(){let e=v.value.replace(/[^\d.-]/g,``),t=[``,`-`,`.`,`-.`].includes(e),i=v.value.endsWith(`.`),a=/\.\d*0$/.test(e);if(t||i||a){n(`update:modelValue`,e===`-`?`-`:e);return}r.value=Number.parseFloat(e),v.value=t?``:_(r.value),n(`update:modelValue`,r.value)}return W(()=>r.value,()=>{E(()=>{v.value.endsWith(`.`)||/\.\d*0$/.test(v.value)||(v.value=r.value===void 0?``:_(r.value))})}),W(()=>e.modelValue,e=>{if(e!==r.value){if(typeof e==`string`&&(e===`-`||e.endsWith(`.`))){v.value=e;return}r.value=Number.parseFloat(`${e}`)||0}},{immediate:!0}),(e,t)=>{let n=ie(`pattern`);return P(),u(`div`,{class:D([`bagel-input num-input`,{textInputSpinnerWrap:e.icon||e.spinner,txtInputIconStart:e.iconStart}])},[d(`div`,{for:e.id},[e.label?(P(),u(`label`,Dl,V(e.label),1)):l(``,!0),d(`div`,{class:D([`gap-025`,{"column flex":e.layout===`vertical`,flex:e.layout===`horizontal`}])},[e.layout&&i.includes(e.layout)?(P(),c(U(J),{key:0,flat:``,icon:`add`,class:D([`radius`,[{"bgl-big-ctrl-num-btn":e.layout===`vertical`}]]),tabindex:`-1`,onClick:h},null,8,[`class`])):l(``,!0),K(d(`input`,{id:e.id,"onUpdate:modelValue":t[0]||=e=>x(v)?v.value=e:v=e,type:`text`,class:D({"txt-center":e.center,min0:e.layout,"bgl-number-input":e.layout!==`vertical`&&e.layout!==`horizontal`}),placeholder:e.placeholder||e.label,disabled:e.disabled,required:e.required,readonly:e.disabled,inputmode:`decimal`,autocomplete:`off`,pattern:e.useGrouping?`^-?\\d{1,3}(,\\d{3})*(.\\d+)?$`:`^-?\\d*.?d*$`,autocorrect:`off`,spellcheck:`false`,onInput:y,onKeydown:[he(ge(h,[`prevent`]),[`up`]),he(ge(g,[`prevent`]),[`down`])]},null,42,Ol),[[pe,U(v),void 0,{trim:!0}],[n,void 0,void 0,{number:!0}]]),e.helptext?(P(),u(`p`,kl,V(e.helptext),1)):l(``,!0),e.iconStart?(P(),c(U($),{key:2,class:`iconStart`,icon:e.iconStart},null,8,[`icon`])):l(``,!0),e.icon?(P(),c(U($),{key:3,icon:e.icon},null,8,[`icon`])):l(``,!0),e.layout&&i.includes(e.layout)?(P(),c(U(J),{key:4,flat:``,icon:`remove`,class:D([`radius`,[{"bgl-big-ctrl-num-btn":e.layout===`vertical`}]]),tabindex:`-1`,onClick:g},null,8,[`class`])):l(``,!0),e.spinner&&(!e.layout||!i.includes(e.layout))?(P(),u(`div`,Al,[m(U(J),{icon:`add`,flat:``,thin:``,class:`bgl-ctrl-num-btn ctrl-add top-bgl-ctrl-num-btn`,disabled:!f.value,tabindex:`-1`,onClick:h},null,8,[`disabled`]),m(U(J),{icon:`remove`,flat:``,thin:``,class:`bgl-ctrl-num-btn ctrl-remove`,disabled:!p.value,tabindex:`-1`,onClick:g},null,8,[`disabled`])])):l(``,!0)],2)],8,El)],2)}}}),Ml=q(jl,[[`__scopeId`,`data-v-8c81dffe`]]);const Nl=[`value`,`autofocus`,`onKeydown`,`onPaste`];var Pl=h({__name:`OTP`,props:{digitCount:{},default:{},modelValue:{}},emits:[`update:modelValue`,`complete`],setup(e,{emit:t}){let r=e,i=t,a=ne([]),o=L();function s(e,t){e.preventDefault();let{clipboardData:n}=e,r=n?.getData(`text`).replaceAll(/\D/g,``),i=[...r??``];if(i){for(let e=0;e<i.length;e++){let n=i[e];t+e<a.length&&(a[t+e]=n)}c()}}function c(){i(`update:modelValue`,a.join(``)),d()&&i(`complete`,a.join(``))}function l(e,t){let n=[`Tab`,`ArrowRight`,`ArrowLeft`,`Control`,`Shift`,`Alt`,`Meta`];if(n.includes(e.key))return;let i=[`ArrowUp`,`ArrowDown`];if(i.includes(e.key)){e.preventDefault();return}if(e.key===`Backspace`){if(a[t]=void 0,t!==0){var s;let e=(s=o.value)?.children[t-1];e.focus()}c();return}let l=/^\d$/;l.test(e.key)&&(a[t]=e.key,t!==r.digitCount-1&&setTimeout(()=>{var e;let n=(e=o.value)?.children[t+1];n.focus()},10),c())}if(r.default&&r.default.length===r.digitCount)for(let e=0;e<r.digitCount;e++)a[e]=r.default.charAt(e);else for(let e=0;e<r.digitCount;e++)a[e]=void 0;function d(){for(let e of a)if(e===void 0)return!1;return!0}return(e,t)=>(P(),u(`div`,{ref_key:`otpCont`,ref:o,class:`otp_wrap`},[(P(!0),u(n,null,R(a,(e,n)=>(P(),u(`input`,{key:n,value:a[n]||``,type:`number`,inputmode:`numeric`,class:`digit-box`,autofocus:n===0,maxlength:`1`,pattern:`[0-9]*`,oninput:`this.value = this.value.slice(0, 1)`,onKeydown:e=>l(e,n),onPaste:e=>s(e,n),onKeyup:t[0]||=ge(()=>{},[`prevent`])},null,40,Nl))),128))],512))}}),Fl=q(Pl,[[`__scopeId`,`data-v-ab0a46bf`]]);const Il={class:`relative passwordInput`},Ll={class:`m-password position-bottom-end flex column justify-content-center`};var Rl=h({__name:`PasswordInput`,props:w({id:{},title:{},helptext:{},placeholder:{},label:{default:``},small:{type:Boolean},dense:{type:Boolean},required:{type:Boolean},pattern:{},shrink:{type:Boolean},disabled:{type:Boolean},name:{},nativeInputAttrs:{},icon:{},iconStart:{},multiline:{type:Boolean},autoheight:{type:Boolean},code:{type:Boolean},lines:{},autofocus:{type:Boolean},debounceDelay:{},autocomplete:{default:`current-password`},onFocusout:{}},{modelValue:{},modelModifiers:{},showPwd:{type:Boolean,default:!1},showPwdModifiers:{}}),emits:[`update:modelValue`,`update:showPwd`],setup(e){let t=e,n=ce(e,`modelValue`),r=ce(e,`showPwd`),i=o(()=>r.value?`visibility_off`:`visibility`),a=o(()=>r.value?`text`:`password`);return(e,o)=>(P(),u(`div`,Il,[m(U(G_),T({modelValue:n.value,"onUpdate:modelValue":o[0]||=e=>n.value=e},t,{type:a.value,class:`mb-0`,name:t.name}),null,16,[`modelValue`,`type`,`name`]),d(`div`,Ll,[m(U(J),{flat:``,thin:``,class:`mx-05`,icon:i.value,onClick:o[1]||=e=>r.value=!r.value},null,8,[`icon`])])]))}}),zl=Rl;const Bl=[`for`],Vl=[`id`,`disabled`,`name`,`value`,`required`],Hl={class:`flex w-100 gap-1 flex-wrap m_gap-05 m_gap-row-025`},Ul=[`src`,`alt`],Wl={class:``},Gl={key:0,class:`m-0 m_txt-14 line-height-14 pb-025`},Kl={key:1,class:`txt-gray txt-12 m-0`};var ql=h({__name:`RadioGroup`,props:w({id:{},groupName:{},options:{},deletable:{type:Boolean},required:{type:Boolean},error:{},disabled:{type:Boolean},thin:{type:Boolean},flat:{type:Boolean},invertedActive:{type:Boolean},align:{default:`center`}},{modelValue:{},modelModifiers:{}}),emits:w([`delete`,`focus`,`blur`,`change`],[`update:modelValue`]),setup(e,{emit:t}){let r=e,i=t,a=o(()=>r.groupName||r.id||Math.random().toString(36).substring(2,15)),s=ce(e,`modelValue`),f=L([]),p=o(()=>Array.isArray(r.options)?r.options:f.value);async function m(){if(typeof r.options==`function`)try{f.value=await r.options()}catch{f.value=[]}}W(()=>r.options,()=>{f.value=[],m()},{immediate:!0,deep:!0});let h=L(!1),g=o(()=>({"has-error":!!r.error,"is-disabled":r.disabled,"is-focused":h.value}));function _(){h.value=!0,i(`focus`)}function v(){h.value=!1,i(`blur`)}function y(){i(`change`,s.value)}return(e,t)=>(P(),u(`div`,{class:D(g.value)},[(P(!0),u(n,null,R(p.value,(n,r)=>(P(),u(`label`,{key:n.id||`${a.value}-${r}`,class:D([`border rounded flex mb-05 active-list-item hover`,{"p-05 gap-025":e.thin,"py-1 gap-075":!e.thin,"bg-gray-light":!e.flat,"align-items-start":e.align===`start`||e.align===`top`,"align-items-center":e.align===`center`,"align-items-end":e.align===`end`||e.align===`bottom`,invertedActive:e.invertedActive}]),for:n.id||`${a.value}-${r}`},[K(d(`input`,{id:n.id||`${a.value}-${r}`,"onUpdate:modelValue":t[0]||=e=>s.value=e,disabled:e.disabled,class:D([`radio-input-list`,{"mt-025":e.align===`start`||e.align===`top`,"mb-025":e.align===`end`||e.align===`bottom`}]),type:`radio`,name:a.value,value:n.value,required:e.required,onFocus:_,onBlur:v,onChange:y},null,42,Vl),[[fe,s.value]]),d(`div`,Hl,[n.imgSrc?(P(),u(`img`,{key:0,class:`bg-popup shadow-light py-025 radius-05 m_w40`,height:`40`,src:n.imgSrc,alt:n.imgAlt},null,8,Ul)):l(``,!0),d(`div`,Wl,[n.label?(P(),u(`p`,Gl,V(n.label),1)):l(``,!0),n.subLabel?(P(),u(`p`,Kl,V(n.subLabel),1)):l(``,!0)]),z(e.$slots,`radioItem`,T({ref_for:!0},n),void 0,!0)]),e.deletable?(P(),c(U(J),{key:0,class:`ms-auto`,flat:``,thin:``,icon:`delete`,onClick:t=>e.$emit(`delete`,n)},null,8,[`onClick`])):l(``,!0)],10,Bl))),128))],2))}}),Jl=q(ql,[[`__scopeId`,`data-v-4d8eb29b`]]);const Yl={class:`bagel-input`},Xl={class:`pb-025`},Zl={class:`flex gap-05 flex-wrap`},Ql=[`id`,`name`,`value`,`checked`],$l=[`for`];var eu=h({__name:`RadioPillsInput`,props:{options:{},modelValue:{default:``},id:{default:()=>`radio-pill-${Math.random().toString(36).slice(2,9)}`},label:{default:``}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t;function a(e){return typeof e==`string`?e:typeof e==`number`?`${e}`:typeof e==`boolean`?e?`Yes`:`No`:e.label}function o(e){return typeof e==`string`||typeof e==`number`?e:typeof e==`boolean`?e?`Yes`:`No`:e.value}let s=L(r.modelValue);function c(e){var t;let n=(t=e.target)?.value;i(`update:modelValue`,n),s.value=n}return W(()=>r.modelValue,(e,t)=>{e===t||t===void 0||s.value!==e&&(s.value=e)},{immediate:!0}),j(()=>{s.value=r.modelValue}),(e,t)=>(P(),u(`div`,Yl,[d(`label`,Xl,V(e.label),1),d(`div`,Zl,[(P(!0),u(n,null,R(e.options,(t,n)=>(P(),u(`div`,{key:n,class:`radio-pill`},[d(`input`,{id:`${e.id}-${o(t)}`,type:`radio`,name:e.id,value:o(t),checked:U(s)===o(t),onChange:c},null,40,Ql),d(`label`,{for:`${e.id}-${o(t)}`},V(a(t)),9,$l)]))),128))])]))}}),tu=q(eu,[[`__scopeId`,`data-v-68b4cdd0`]]);const nu=[`dir`],ru={key:0,class:`label`},iu={class:`range-slider relative w-100`},au=[`id`,`value`,`min`,`max`,`step`,`required`,`disabled`,`aria-label`],ou=[`value`,`min`,`max`,`step`,`required`,`disabled`],su={class:`track absolute pointer-events-none overflow-hidden round`},cu={class:`txt-center txt-14 user-select-none range-slider-txt flex space-between opacity-4 mx-05`};var lu=h({__name:`RangeInput`,props:{modelValue:{},min:{},max:{},step:{},required:{type:Boolean},label:{},disabled:{type:Boolean},id:{},rtl:{type:Boolean},multiRange:{type:Boolean},formatValue:{type:Function}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{min:i=0,max:a=100,step:s=1,multiRange:c=!1,formatValue:f=e=>e.toString()}=n,m=L(Array.isArray(n.modelValue)?n.modelValue[0]:n.modelValue??i),h=L(Array.isArray(n.modelValue)?n.modelValue[1]:a),g=o(()=>Math.min(Math.max(m.value,i),c?h.value:a)),_=o(()=>Math.max(Math.min(h.value,a),m.value)),v=o(()=>(g.value-i)/(a-i)*100),y=o(()=>(_.value-i)/(a-i)*100);W(()=>n.modelValue,e=>{Array.isArray(e)&&c?(m.value=e[0]??i,h.value=e[1]??a):Array.isArray(e)||(m.value=e??i,h.value=a)},{immediate:!0});function b(e,t){t?m.value=e:h.value=e,r(`update:modelValue`,c?[g.value,_.value]:g.value)}let x=o(()=>c?{left:`${v.value}%`,width:`${y.value-v.value}%`}:n.rtl?{left:`${100-v.value}%`,width:`${v.value}%`}:{left:`0`,width:`${v.value}%`}),S=o(()=>f(g.value)),C=o(()=>f(_.value));return(e,t)=>(P(),u(`div`,{dir:e.rtl?`rtl`:`ltr`},[n.label?(P(),u(`label`,ru,V(n.label),1)):l(``,!0),d(`div`,iu,[d(`input`,{id:e.id,value:g.value,class:`from`,type:`range`,min:U(i),max:U(a),step:U(s),required:e.required,disabled:e.disabled,"aria-label":U(c)?`Minimum value`:`Value`,onInput:t[0]||=e=>b(+e.target.value,!0)},null,40,au),U(c)?(P(),u(`input`,{key:0,value:_.value,class:`to`,type:`range`,min:U(i),max:U(a),step:U(s),required:e.required,disabled:e.disabled,"aria-label":`Maximum value`,onInput:t[1]||=e=>b(+e.target.value,!1)},null,40,ou)):l(``,!0),d(`div`,su,[d(`div`,{class:`active-range absolute h-100 pointer-events-none bg-primary`,style:k(x.value)},null,4)]),g.value===U(i)?l(``,!0):(P(),u(`p`,{key:1,class:`txt-center txt-12 range-slider-position-txt absolute line-height-1`,style:k({"--progress":`${v.value}`})},[U(c)?l(``,!0):z(e.$slots,`progress`,{key:0,progress:S.value,min:U(f)(U(i)),max:U(f)(U(a))},()=>[p(V(S.value),1)],!0),U(c)?z(e.$slots,`from`,{key:1,from:S.value,to:C.value,min:U(f)(U(i)),max:U(f)(U(a))},()=>[p(V(S.value),1)],!0):l(``,!0)],4)),U(c)&&_.value!==U(a)?(P(),u(`p`,{key:2,class:`txt-center txt-12 range-slider-position-txt line-height-1 absolute`,style:k({"--progress":`${y.value}`})},[z(e.$slots,`to`,{to:C.value,from:S.value,min:U(f)(U(i)),max:U(f)(U(a))},()=>[p(V(C.value),1)],!0)],4)):l(``,!0)]),d(`p`,cu,[z(e.$slots,`min`,{max:U(f)(U(a)),min:U(f)(U(i)),from:S.value,to:C.value,progress:S.value},()=>[d(`span`,null,V(U(f)(U(i))),1)],!0),z(e.$slots,`max`,{max:U(f)(U(a)),min:U(f)(U(i)),from:S.value,to:C.value,progress:S.value},()=>[d(`span`,null,V(U(f)(U(a))),1)],!0)])],8,nu))}}),uu=q(lu,[[`__scopeId`,`data-v-46e22f3e`]]);const du=[`mergeCells`,`splitCells`,`addRowBefore`,`addRowAfter`,`deleteRow`,`insertColumnLeft`,`insertColumnRight`,`deleteColumn`,`alignLeft`,`alignCenter`,`alignRight`,`alignJustify`,`deleteTable`],fu=[`h2`,`h3`,`h4`,`h5`,`h6`,`separator`,`p`,`blockquote`,`orderedList`,`unorderedList`,`separator`,`bold`,`italic`,`underline`,`separator`,`link`,`image`,`embed`,`clear`,`splitView`,`fullScreen`],pu=[`h2`,`h3`,`h4`,`h5`,`h6`,`separator`,`bold`,`italic`,`underline`,`separator`,`fontColor`,`bgColor`,`separator`,`p`,`blockquote`,`orderedList`,`unorderedList`,`indent`,`outdent`,`separator`,`link`,`image`,`embed`,`separator`,`splitView`,`clear`,`insertTable`,...du,`separator`,`undo`,`redo`,`fullScreen`],mu=[{name:`h2`,label:`h2`,icon:`format_h2`},{name:`h3`,label:`h3`,icon:`format_h3`},{name:`h4`,label:`h4`,icon:`format_h4`},{name:`h5`,label:`h5`,icon:`format_h5`},{name:`h6`,label:`h6`,icon:`format_h6`},{name:`p`,label:`Paragraph`,icon:`format_paragraph`},{name:`blockquote`,label:`Blockquote`,icon:`format_quote`},{name:`bold`,label:`Bold`,icon:`format_bold`},{name:`italic`,label:`Italic`,icon:`format_italic`},{name:`underline`,label:`Underline`,icon:`format_underlined`},{name:`orderedList`,label:`Ordered List`,icon:`format_list_numbered`},{name:`unorderedList`,label:`Unordered List`,icon:`format_list_bulleted`},{name:`link`,label:`Link`,icon:`add_link`},{name:`image`,label:`Image`,icon:`add_photo_alternate`},{name:`embed`,label:`Embed`,icon:`media_link`},{name:`splitView`,label:`Split View`,icon:`code`},{name:`clear`,label:`Clear Formatting`,icon:`format_clear`},{name:`alignLeft`,label:`Align Left`,icon:`format_align_left`},{name:`alignCenter`,label:`Align Center`,icon:`format_align_center`},{name:`alignRight`,label:`Align Right`,icon:`format_align_right`},{name:`alignJustify`,label:`Align Justify`,icon:`format_align_justify`},{name:`indent`,label:`Indent`,icon:`format_indent_increase`},{name:`outdent`,label:`Outdent`,icon:`format_indent_decrease`},{name:`fontColor`,label:`Font Color`,icon:`format_color_text`},{name:`bgColor`,label:`Background Color`,icon:`format_color_fill`},{name:`insertTable`,label:`Insert Table`,icon:`table`},{name:`deleteTable`,label:`Delete Table`,icon:`delete_sweep`},{name:`mergeCells`,label:`Merge Cells`,icon:`table_chart`},{name:`splitCells`,label:`Split Cells`,icon:`dashboard`},{name:`addRowBefore`,label:`Insert Row Above`,icon:`add_box`},{name:`addRowAfter`,label:`Insert Row Below`,icon:`vertical_align_bottom`},{name:`deleteRow`,label:`Delete Row`,icon:`remove`},{name:`insertColumnLeft`,label:`Insert Column Left`,icon:`format_indent_decrease`},{name:`insertColumnRight`,label:`Insert Column Right`,icon:`format_indent_increase`},{name:`deleteColumn`,label:`Delete Column`,icon:`view_week`},{name:`separator`},{name:`undo`,label:`Undo`,icon:`undo`},{name:`redo`,label:`Redo`,icon:`redo`},{name:`separator`},{name:`fullScreen`,label:`Full Screen`,icon:`fullscreen`,class:`ms-auto`}],hu={class:`grid grid-wrap p-05`},gu=[`onMousemove`,`onClick`],_u={class:`txt-center txt-12 color-gray`},vu=1;var yu=h({__name:`gridBox`,props:{gridSize:{}},emits:[`select`],setup(e,{emit:t}){let r=e,i=t,a=r.gridSize||5,s=L(vu),c=L(vu),l=o(()=>{let e=Math.min(s.value+1,20);return s.value>a-1?e:a}),f=o(()=>{let e=Math.min(c.value+1,20);return c.value>a-1?e:a});return(e,t)=>(P(),u(`div`,hu,[(P(!0),u(n,null,R(l.value,e=>(P(),u(`div`,{key:`row-${e}`,class:`flex`,onMouseout:t[0]||=e=>{s.value=vu,c.value=vu},onFocusout:t[1]||=e=>{s.value=vu,c.value=vu}},[(P(!0),u(n,null,R(f.value,t=>(P(),u(`div`,{key:`col-${t}`,role:`button`,tabindex:`0`,"aria-label":`Insert Table`,style:{width:`20px`,height:`20px`},class:D([`flex pointer gap-025 tableBoxSelect`,{borderSelect:s.value>=e&&c.value>=t}]),onMousemove:n=>{s.value=e,c.value=t},onClick:n=>i(`select`,`${e}x${t}`)},null,42,gu))),128))],32))),128)),d(`p`,_u,V(s.value)+`x`+V(c.value),1)]))}}),bu=q(yu,[[`__scopeId`,`data-v-2f424c9c`]]);const xu={class:`toolbar flex gap-025 pb-05 flex-wrap`,role:`toolbar`};var Su=h({__name:`EditorToolbar`,props:{config:{default:fu},selectedStyles:{}},emits:[`action`],setup(e,{emit:t}){let r=t,i=e=>mu.find(t=>t.name===e);function a(e,t){r(`action`,e,t)}return(e,t)=>{let r=ie(`tooltip`);return P(),u(`div`,xu,[(P(!0),u(n,null,R(e.config.map(i).filter(Boolean),(t,i)=>(P(),u(n,{key:i},[t.name===`insertTable`?(P(),c(U(qo),{key:0,placement:`bottom-start`,thin:``,flat:``,icon:`table`},{default:G(({hide:e})=>[m(bu,{gridSize:5,onSelect:t=>{a(`insertTable`,t),e()}},null,8,[`onSelect`])]),_:1})):t.name===`separator`?t.name===`separator`?(P(),u(`span`,{key:`separator-${i}`,class:`opacity-2 mb-025`},`|`)):l(``,!0):K((P(),c(U(J),{key:1,icon:t.icon,thin:``,flat:``,"aria-label":t.name,class:D([[t.class,{active:e.selectedStyles.has(t.name)}],``]),tabindex:`-1`,onClick:e=>a(t.name)},null,8,[`icon`,`aria-label`,`class`,`onClick`])),[[r,t.label]])],64))),128))])}}}),Cu=q(Su,[[`__scopeId`,`data-v-7e9466dc`]]);function wu(e,t){let{range:n,doc:r}=t;!n||!r||e.showModalForm({title:`Upload Image`,schema:[{id:`src`,$el:`file`,attrs:{bindkey:`url`}},{id:`alt`,$el:`text`,label:`Alt Text`},fs(ds(`width`,`Width`,{min:1}),ds(`height`,`Height`,{min:1})),{id:`figcaption`,$el:`check`,label:`Show Caption`}],onSubmit:e=>{if(e.src){let i=r.createElement(`img`);Object.assign(i,{src:e.src,alt:e.alt||``,width:e.width||void 0,height:e.height||void 0});let a=e.figcaption?(()=>{let t=r.createElement(`figcaption`);t.textContent=e.alt;let n=r.createElement(`figure`);return n.append(i,t),n})():i;n.collapse(!1),n.insertNode(a),t.content=r.body.innerHTML}}})}function Tu(e,t){let{range:n,doc:r}=t;!n||!r||e.showModalForm({title:`Insert Link`,schema:[{id:`url`,$el:`text`,label:`URL`},{id:`openInNewTab`,$el:`check`,label:`Open in new tab`}],onSubmit:e=>{if(e.url){let i=r.createElement(`a`);i.href=e.url,e.openInNewTab&&(i.target=`_blank`),n.surroundContents(i),t.content=r.body.innerHTML}}})}function Eu(e,t){let{range:n,doc:r}=t;!n||!r||e.showModalForm({title:`Insert Embed`,schema:[{id:`url`,$el:`text`,label:`URL`,attrs:{placeholder:`Enter URL (YouTube, Vimeo, etc.)`}},fs(ds(`width`,`Width`,{min:200,placeholder:`560`}),ds(`height`,`Height`,{min:200,placeholder:`315`})),{id:`allowFullscreen`,$el:`check`,label:`Allow Fullscreen`,attrs:{value:!0}}],onSubmit:e=>{if(!e.url)return;let i=new URL(e.url),a=e.url;if(i.hostname.includes(`youtube.com`)||i.hostname===`youtu.be`){let e=i.hostname===`youtu.be`?i.pathname.slice(1):i.searchParams.get(`v`);e&&(a=`https://www.youtube.com/embed/${e}`)}else if(i.hostname.includes(`vimeo.com`)){let e=i.pathname.split(`/`).pop();e&&(a=`https://player.vimeo.com/video/${e}`)}let o=r.createElement(`iframe`);Object.assign(o,{src:a,width:e.width||560,height:e.height||315,frameBorder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullscreen:e.allowFullscreen});let s=r.createElement(`div`);s.style.textAlign=`center`,s.style.margin=`1em 0`,s.appendChild(o),n.deleteContents(),n.insertNode(s),t.content=r.body.innerHTML}})}function Du(e,t,n){if(!n.doc)return;let r=n.doc.createElement(`table`);r.style.width=`100%`,r.style.borderCollapse=`collapse`,r.style.marginBottom=`1rem`;let i=n.doc.createElement(`thead`),a=i.insertRow();for(let e=0;e<t;e++){let t=n.doc.createElement(`th`);t.innerHTML=`Header ${e+1}`,t.style.padding=`8px`,t.style.border=`1px solid var(--border-color, #ddd)`,t.style.backgroundColor=`var(--bgl-gray-light, #f4f4f4)`,a.appendChild(t)}r.appendChild(i);let o=n.doc.createElement(`tbody`);for(let n=0;n<e;n++){let e=o.insertRow();for(let n=0;n<t;n++){let t=e.insertCell();t.innerHTML=` `,t.style.padding=`8px`,t.style.border=`1px solid var(--border-color, #ddd)`}}r.appendChild(o);let{range:s}=n;if(s){if(s.insertNode(r),n.doc.getSelection()){let e=r.querySelector(`td`);if(e){s.selectNodeContents(e),s.collapse(!0);let t=n.doc.getSelection();t&&(t.removeAllRanges(),t.addRange(s))}}}else n.doc.body.appendChild(r);n.content=n.doc.body.innerHTML}function Ou(e,t){var n;let r=Array.from(e.cloneContents().querySelectorAll(`td`));if(r.length<2)return;let i=(n=e.startContainer.parentElement)?.closest(`td`);if(!i)return;i.colSpan=r.length,i.innerHTML=r.map(e=>e.innerHTML).join(` `),r.slice(1).forEach(e=>{let n=t.getElementById(e.id);n?.remove()});let a=t.editorState;a&&(a.content=t.body.innerHTML)}function ku(e,t){var n;let r=(n=e.startContainer.parentElement)?.closest(`td`);if(!r||!r.colSpan||r.colSpan===1)return;let i=Array(r.colSpan-1).fill(0).map(()=>{let e=t.createElement(`td`);return e.style.border=`1px solid var(--border-color)`,e.style.padding=`8px`,e.innerHTML=` `,e});r.colSpan=1,r.insertAdjacentElement(`afterend`,i[0]),i.slice(1).forEach(e=>{i[0].insertAdjacentElement(`afterend`,e)});let a=t.editorState;a&&(a.content=t.body.innerHTML)}function Au(e,t,n){var r;let i=(r=t.startContainer.parentElement)?.closest(`td`);if(!i)return;let a=i.parentElement,o=a?.parentElement;if(!a||!o)return;let s=a.cloneNode(!0);Array.from(s.cells).forEach(e=>e.innerHTML=` `),a.insertAdjacentElement(e===`before`?`beforebegin`:`afterend`,s);let c=n.editorState;c&&(c.content=n.body.innerHTML)}function ju(e){var t;let n=(t=e.startContainer.parentElement)?.closest(`td`);if(!n)return;let r=n.parentElement;if(!r)return;let i=r.ownerDocument;r.remove();let a=i.editorState;a&&(a.content=i.body.innerHTML)}function Mu(e){var t;let n=(t=e.startContainer.parentElement)?.closest(`td`);if(!n)return;let r=n.closest(`table`);if(!r)return;let i=r.ownerDocument;r.remove();let a=i.editorState;a&&(a.content=i.body.innerHTML)}function Nu(e,t){var n;let r=(n=t.startContainer.parentElement)?.closest(`td`);if(!r)return;let i=r.closest(`table`);if(!i)return;let a=r.cellIndex,{rows:o}=i;for(let t=0;t<o.length;t++){let n=o[t].insertCell(e===`after`?a+1:a);n.innerHTML=` `,n.style.border=`1px solid var(--border-color)`,n.style.padding=`8px`}let s=i.ownerDocument.editorState;s&&(s.content=i.ownerDocument.body.innerHTML)}function Pu(e){var t;let n=(t=e.startContainer.parentElement)?.closest(`td`);if(!n)return;let r=n.closest(`table`);if(!r)return;let i=n.cellIndex,{rows:a}=r,o=r.ownerDocument;for(let e=0;e<a.length;e++)a[e].deleteCell(i);a[0].cells.length===0&&r.remove();let s=o.editorState;s&&(s.content=o.body.innerHTML)}function Fu(e,t){var n;let r=(n=e.startContainer.parentElement)?.closest(`td`);if(!r)return;let i=r.closest(`table`);if(!i)return;let a=r.cellIndex,{rows:o}=i;for(let e=0;e<o.length;e++){let n=o[e].cells[a];n&&(n.style.textAlign=t)}let s=i.ownerDocument.editorState;s&&(s.content=i.ownerDocument.body.innerHTML)}function Iu(e){if(!e.doc)return null;let t=e.doc.getSelection();if(!t||!t.rangeCount)return null;let n=t.getRangeAt(0);return{selection:t,range:n}}function Lu(e){if(!e.doc)return;e.content=e.doc.body.innerHTML;let t=e.doc.getSelection();t&&t.rangeCount>0&&(e.selection=t,e.range=t.getRangeAt(0).cloneRange(),e.rangeCount=t.rangeCount)}function Ru(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;t;){if(t.matches&&t.matches(`p,h1,h2,h3,h4,h5,h6,blockquote,li,div`))return t;t=t.parentElement}return null}function zu(e,t,n){return{name:e,execute:(e,n)=>{e.doc&&(t(e,n),Lu(e))},isActive:n}}function Bu(e){let t={undo:zu(`Undo`,()=>{if(e.undoStack.length>0&&e.doc){let t=e.undoStack.pop();t!==void 0&&(e.redoStack.push(e.content),e.content=t,e.doc.body.innerHTML=t)}}),redo:zu(`Redo`,()=>{if(e.redoStack.length>0&&e.doc){let t=e.redoStack.pop();t!==void 0&&(e.undoStack.push(e.content),e.content=t,e.doc.body.innerHTML=t)}})},n={bold:zu(`Bold`,e=>{let t=Iu(e);if(!t||t.range.collapsed)return;let{range:n}=t;try{let r=e.doc.createElement(`span`);r.style.fontWeight=`bold`;try{n.surroundContents(r)}catch{let e=n.extractContents();r.appendChild(e),n.insertNode(r)}n.selectNodeContents(r),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying bold:`,e)}}),italic:zu(`Italic`,e=>{let t=Iu(e);if(!t||t.range.collapsed)return;let{range:n}=t;try{let r=e.doc.createElement(`span`);r.style.fontStyle=`italic`;try{n.surroundContents(r)}catch{let e=n.extractContents();r.appendChild(e),n.insertNode(r)}n.selectNodeContents(r),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying italic:`,e)}}),underline:zu(`Underline`,e=>{let t=Iu(e);if(!t||t.range.collapsed)return;let{range:n}=t;try{let r=e.doc.createElement(`span`);r.style.textDecoration=`underline`;try{n.surroundContents(r)}catch{let e=n.extractContents();r.appendChild(e),n.insertNode(r)}n.selectNodeContents(r),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying underline:`,e)}})},r=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`].reduce((e,t)=>({...e,[t]:zu(`Heading ${t}`,e=>{let n=Iu(e);if(!n)return;let{range:r}=n,i=Ru(r.commonAncestorContainer);if(!i)return;let a=i.tagName.toLowerCase()===t.toLowerCase(),o=a?`p`:t;try{var s;let t=e.doc.createElement(o);for(;i.firstChild;)t.appendChild(i.firstChild);(s=i.parentNode)?.replaceChild(t,i),r.selectNodeContents(t),r.collapse(!1),n.selection.removeAllRanges(),n.selection.addRange(r)}catch(e){console.error(`Error applying ${t} heading:`,e)}})}),{}),i={p:zu(`Paragraph`,e=>{let t=Iu(e);if(!t)return;let{range:n}=t,r=Ru(n.commonAncestorContainer);if(r&&r.tagName.toLowerCase()!==`p`)try{var i;let a=e.doc.createElement(`p`);for(;r.firstChild;)a.appendChild(r.firstChild);(i=r.parentNode)?.replaceChild(a,r),n.selectNodeContents(a),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying paragraph:`,e)}}),blockquote:zu(`Blockquote`,e=>{let t=Iu(e);if(!t)return;let{range:n}=t,r=Ru(n.commonAncestorContainer);if(!r)return;let i=r.tagName.toLowerCase()===`blockquote`,a=i?`p`:`blockquote`;try{var o;let i=e.doc.createElement(a);for(;r.firstChild;)i.appendChild(r.firstChild);(o=r.parentNode)?.replaceChild(i,r),n.selectNodeContents(i),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying blockquote:`,e)}})},a={orderedList:zu(`Ordered List`,e=>{let t=Iu(e);if(!t)return;let{range:n}=t,r=Ru(n.commonAncestorContainer);if(!r)return;let i=r.closest(`li`);if(i){let r=i.parentElement;if(!r)return;if(r.tagName.toLowerCase()===`ol`){var a;let o=e.doc.createElement(`p`);for(;i.firstChild;)o.appendChild(i.firstChild);(a=r.parentNode)?.insertBefore(o,r),i.remove(),r.querySelector(`li`)||r.remove(),n.selectNodeContents(o),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n);return}if(r.tagName.toLowerCase()===`ul`){var o;let t=e.doc.createElement(`ol`);for(;r.firstChild;)t.appendChild(r.firstChild);(o=r.parentNode)?.replaceChild(t,r);return}}try{var s;let i=e.doc.createElement(`ol`),a=e.doc.createElement(`li`);for(;r.firstChild;)a.appendChild(r.firstChild);i.appendChild(a),(s=r.parentNode)?.replaceChild(i,r),n.selectNodeContents(a),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error creating ordered list:`,e)}}),unorderedList:zu(`Unordered List`,e=>{let t=Iu(e);if(!t)return;let{range:n}=t,r=Ru(n.commonAncestorContainer);if(!r)return;let i=r.closest(`li`);if(i){let r=i.parentElement;if(!r)return;if(r.tagName.toLowerCase()===`ul`){var a;let o=e.doc.createElement(`p`);for(;i.firstChild;)o.appendChild(i.firstChild);(a=r.parentNode)?.insertBefore(o,r),i.remove(),r.querySelector(`li`)||r.remove(),n.selectNodeContents(o),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n);return}if(r.tagName.toLowerCase()===`ol`){var o;let t=e.doc.createElement(`ul`);for(;r.firstChild;)t.appendChild(r.firstChild);(o=r.parentNode)?.replaceChild(t,r);return}}try{var s;let i=e.doc.createElement(`ul`),a=e.doc.createElement(`li`);for(;r.firstChild;)a.appendChild(r.firstChild);i.appendChild(a),(s=r.parentNode)?.replaceChild(i,r),n.selectNodeContents(a),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error creating unordered list:`,e)}})},o={clear:zu(`Clear Formatting`,e=>{let t=Iu(e);if(!t||t.range.collapsed)return;let{range:n}=t;try{let r=n.cloneContents(),i=e.doc.createElement(`div`);i.appendChild(r);function a(t){if(t.nodeType===Node.TEXT_NODE)return t.cloneNode(!0);if(t.nodeType===Node.ELEMENT_NODE){let n=t,r=n.tagName.toLowerCase(),i=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`ul`,`ol`,`li`,`blockquote`,`div`,`table`,`tr`,`td`,`th`],o=[`b`,`i`,`u`,`strong`,`em`,`span`,`font`,`strike`,`sub`,`sup`];if(o.includes(r))return e.doc.createTextNode(n.textContent||``);if(i.includes(r)){let t=e.doc.createElement(r);return r===`a`&&n.hasAttribute(`href`)?(t.setAttribute(`href`,n.getAttribute(`href`)||``),n.hasAttribute(`target`)&&t.setAttribute(`target`,n.getAttribute(`target`)||``)):r===`img`&&(n.hasAttribute(`src`)&&t.setAttribute(`src`,n.getAttribute(`src`)||``),n.hasAttribute(`alt`)&&t.setAttribute(`alt`,n.getAttribute(`alt`)||``)),Array.from(n.childNodes).forEach(e=>{t.appendChild(a(e))}),t}}return t.cloneNode(!0)}let o=e.doc.createDocumentFragment();Array.from(i.childNodes).forEach(e=>{o.appendChild(a(e))}),n.deleteContents(),n.insertNode(o),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error clearing formatting:`,e)}})},s={insertTable:zu(`Insert Table`,(e,t)=>{let[n,r]=t?.split(`x`).map(Number)||[3,3];Du(n,r,e)}),deleteTable:zu(`Delete Table`,e=>e.range&&Mu(e.range)),mergeCells:zu(`Merge Cells`,e=>e.range&&e.doc&&Ou(e.range,e.doc)),splitCells:zu(`Split Cells`,e=>e.range&&e.doc&&ku(e.range,e.doc)),addRowBefore:zu(`Add Row Before`,e=>e.range&&e.doc&&Au(`before`,e.range,e.doc)),addRowAfter:zu(`Add Row After`,e=>e.range&&e.doc&&Au(`after`,e.range,e.doc)),deleteRow:zu(`Delete Row`,e=>e.range&&ju(e.range)),insertColumnLeft:zu(`Insert Column Left`,e=>e.range&&Nu(`before`,e.range)),insertColumnRight:zu(`Insert Column Right`,e=>e.range&&Nu(`after`,e.range)),deleteColumn:zu(`Delete Column`,e=>e.range&&Pu(e.range))},c=[`Left`,`Center`,`Right`,`Justify`].reduce((e,t)=>({...e,[`align${t}`]:zu(`Align ${t}`,e=>e.range&&Fu(e.range,t.toLowerCase()))}),{}),l={fullScreen:zu(`Full Screen`,e=>{e.isFullscreen=!e.isFullscreen},e=>e.isFullscreen),splitView:zu(`Split View`,e=>{e.isSplitView=!e.isSplitView},e=>e.isSplitView),codeView:zu(`Code View`,e=>{e.isCodeView=!e.isCodeView},e=>e.isCodeView)},u={image:zu(`Insert Image`,e=>{e.modal&&wu(e.modal,e)}),link:zu(`Insert Link`,e=>e.modal&&e.range&&Tu(e.modal,e)),embed:zu(`Insert Embed`,e=>{e.modal&&Eu(e.modal,e)})};return{...t,...n,...r,...i,...a,...o,...s,...c,...l,...u}}function Vu(e,t){return{execute(n,r){let i=t[n];i&&i.execute(e,r)},isActive(n){var r;let i=t[n];return(r=i.isActive)?.call(i,e)||!1},getValue(n){var r;let i=t[n];return(r=i.getValue)?.call(i,e)||null}}}function Hu(e,t){let n=Bu(e),r=Vu(e,n);return{execute:(n,i)=>{if(!e.doc){console.log(`[useCommands] No document available, skipping command`);return}if(t?.logCommand(n,i),[`splitView`,`codeView`,`fullScreen`].includes(n))switch(n){case`splitView`:e.isSplitView=!e.isSplitView;return;case`codeView`:e.isCodeView=!e.isCodeView;return;case`fullScreen`:e.isFullscreen=!e.isFullscreen;return}try{e.doc.body.focus()}catch(e){console.error(`[useCommands] Error focusing editor:`,e)}let a=e.doc.getSelection();a?.rangeCount&&(e.selection=a,e.range=a.getRangeAt(0).cloneRange(),e.rangeCount=a.rangeCount);try{r.execute(n,i)}catch(e){console.error(`[useCommands] Error during command execution:`,e)}},isActive:r.isActive,getValue:r.getValue}}var Uu=class{constructor(t=1e3){e.defineProperty(this,`session`,void 0),e.defineProperty(this,`maxActions`,void 0),e.defineProperty(this,`isDevelopment`,void 0),this.maxActions=t,this.session=this.createNewSession(),this.isDevelopment=!1}createNewSession(){return{id:`session_${Date.now()}`,startTime:Date.now(),actions:[]}}getNodeDescription(e){var t;if(e.nodeType===Node.TEXT_NODE)return`Text("${(t=e.textContent)?.slice(0,20)}${e.textContent&&e.textContent.length>20?`...`:``}")`;let n=e;return`${n.tagName.toLowerCase()}${n.id?`#${n.id}`:``}`}captureState(e){if(!e.doc||!e.selection)return{content:``,selection:null,activeStyles:[],caretPosition:null};let{selection:t}=e,n=t.rangeCount?t.getRangeAt(0):null;return{content:e.doc.body.innerHTML,selection:n?{start:n.startOffset,end:n.endOffset,collapsed:n.collapsed,text:n.toString()}:null,activeStyles:Array.from(e.selectedStyles),caretPosition:n?{node:this.getNodeDescription(n.startContainer),offset:n.startOffset}:null}}logCommand(e,t,n){this.addAction({type:`command`,name:e,timestamp:Date.now(),details:{value:t},state:this.captureState(n)})}logPaste(e,t){this.addAction({type:`paste`,name:`paste`,timestamp:Date.now(),details:{html:e.getData(`text/html`),text:e.getData(`text/plain`),types:Array.from(e.types)},state:this.captureState(t)})}logKeyboard(e,t){this.addAction({type:`keyboard`,name:`keypress`,timestamp:Date.now(),details:{key:e.key,code:e.code,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey,meta:e.metaKey},state:this.captureState(t)})}logSelection(e){this.addAction({type:`selection`,name:`selection_change`,timestamp:Date.now(),details:{},state:this.captureState(e)})}logInput(e,t,n){this.addAction({type:`input`,name:e,timestamp:Date.now(),details:{data:t},state:this.captureState(n)})}addAction(e){this.session.actions.push(e),this.session.actions.length>this.maxActions&&this.session.actions.shift(),this.isDevelopment&&console.log(`Editor Action:`,e)}getSession(){return this.session}clearSession(){this.session=this.createNewSession()}exportSession(){return JSON.stringify(this.session,null,2)}downloadSession(){let e=new Blob([this.exportSession()],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`editor_session_${this.session.id}.json`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)}exportSessionWithPrompt(e){let t={message:e||`here is a debug log, can you analyze and fix accordingly?`,session:this.session};return JSON.stringify(t,null,2)}};function Wu(e,t){let n=t.getSelection();if(!n||!n.rangeCount)return!1;let r=n.getRangeAt(0),i=r.commonAncestorContainer,a=i.nodeType===Node.TEXT_NODE?i.parentElement:i;if(!a)return!1;let o=(e,t)=>e?t(e)?!0:o(e.parentElement,t):!1,s={bold:e=>{var t;let n=(t=e.tagName)?.toLowerCase();if(n===`strong`||n===`b`)return!0;let r=window.getComputedStyle(e);return r.fontWeight===`bold`||r.fontWeight===`700`},italic:e=>{var t;let n=(t=e.tagName)?.toLowerCase();if(n===`em`||n===`i`)return!0;let r=window.getComputedStyle(e);return r.fontStyle===`italic`},underline:e=>{var t;let n=(t=e.tagName)?.toLowerCase();if(n===`u`)return!0;let r=window.getComputedStyle(e);return r.textDecoration.includes(`underline`)},h1:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h1`},h2:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h2`},h3:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h3`},h4:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h4`},h5:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h5`},h6:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h6`},p:e=>{var t;return(t=e.tagName)?.toLowerCase()===`p`},blockquote:e=>{var t;return(t=e.tagName)?.toLowerCase()===`blockquote`},orderedList:e=>!!e.closest(`ol`),unorderedList:e=>!!e.closest(`ul`)};if([`splitView`,`codeView`,`fullScreen`].includes(e))return!1;let c=s[e];return c?o(a,c):o(a,t=>{var n;return(n=t.tagName)?.toLowerCase()===e.toLowerCase()})}function Gu(e){let t=document.createElement(`div`);t.innerHTML=e;let n=[],r=[];return t.querySelectorAll(`iframe`).forEach((e,t)=>{let i=`<!--iframe-${t}-->`;n.push(e.cloneNode(!0)),r.push(i),e.replaceWith(i)}),{html:t.innerHTML,iframes:n}}function Ku(e,t,n){let r=/<!--iframe-(\d+)-->/g;e.body.innerHTML=t.replace(r,(e,t)=>{let r=n[Number(t)];return r?r.outerHTML:``})}function qu(){let e=BE(),t=null,n=ne({content:``,doc:void 0,selection:null,selectedStyles:new Set,isFullscreen:!1,isSplitView:!1,isCodeView:!1,hasInit:!1,undoStack:[],redoStack:[],rangeCount:0,range:null,modal:e,debug:void 0}),r={styles:()=>{if(!n.doc)return;let e=new Set,t=[`bold`,`italic`,`underline`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`blockquote`,`p`,`orderedList`,`unorderedList`];t.forEach(t=>{n.doc&&Wu(t,n.doc)&&e.add(t)}),n.selectedStyles=e},content:e=>{if(!n.doc)return;let t=n.doc.body.innerHTML;t!==n.content&&(n.undoStack.push(n.content),n.redoStack=[]);let r=n.doc.getSelection(),i=r?.rangeCount?r.getRangeAt(0).cloneRange():null;if(e===`html`){let e=Gu(n.content);n.doc.body.innerHTML=e.html,setTimeout(()=>{if(n.doc&&(Ku(n.doc,n.content,e.iframes),i&&r))try{r.removeAllRanges(),r.addRange(i)}catch{}},0)}else n.doc.body.textContent=n.content},selection:()=>{if(!n.doc)return;let e=n.doc.getSelection();if(e)try{if(!n.doc.body.contains(e.anchorNode)){n.doc.body.focus();return}let t=!n.selection||n.selection!==e||n.rangeCount!==e.rangeCount||e.rangeCount>0&&n.range&&(n.range.startContainer!==e.getRangeAt(0).startContainer||n.range.startOffset!==e.getRangeAt(0).startOffset||n.range.endContainer!==e.getRangeAt(0).endContainer||n.range.endOffset!==e.getRangeAt(0).endOffset);t&&(n.selection=e,n.rangeCount=e.rangeCount,e.rangeCount>0&&(n.range=e.getRangeAt(0).cloneRange()),requestAnimationFrame(()=>{r.styles()}))}catch{n.selection=null,n.range=null,n.rangeCount=0,n.selectedStyles=new Set}}},i={undo:()=>{if(n.undoStack.length===0)return;n.redoStack.push(n.content);let e=n.undoStack.pop();e!==void 0&&(n.content=e,r.content(`html`))},redo:()=>{if(n.redoStack.length===0)return;n.undoStack.push(n.content);let e=n.redoStack.pop();e!==void 0&&(n.content=e,r.content(`html`))}},a={emptyTags:e=>{let t=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT,null),n=[],r=t.nextNode();for(;r;){var i;if([`br`,`img`,`hr`,`input`].includes(r.tagName.toLowerCase())){r=t.nextNode();continue}let a=(i=r.textContent)?.trim()||``,o=r.innerHTML.trim(),s=o===`<br>`||o===`<br/>`,c=o===` `||a===`\xA0`,l=!a&&!o,u=r.parentElement===e.body;(l||c||s&&!u)&&n.push(r),r=t.nextNode()}n.forEach(e=>{e.remove()})},normalizeContent:e=>{var t;let n=e.createTreeWalker(e.body,NodeFilter.SHOW_TEXT),r=[],i;for(;i=n.nextNode();)i.parentElement===e.body&&(t=i.textContent)?.trim()&&r.push(i);r.forEach(t=>{let n=e.createElement(`p`);n.dir=e.body.dir,n.appendChild(t.cloneNode()),e.body.replaceChild(n,t)})}};function o(e){t&&(t(),t=null);let i=!1,a={input:()=>{if(i)return;i=!0;let t=e.body.innerHTML;t!==n.content&&(n.content=t),i=!1},selectionchange:()=>{i||r.selection()},mouseup:()=>{i||r.selection()},keyup:e=>{i||[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(e.key)&&r.selection()}};return Object.entries(a).forEach(([t,n])=>{e.addEventListener(t,n)}),t=()=>{Object.entries(a).forEach(([t,n])=>{e.removeEventListener(t,n)})},t}function s(e){if(n.hasInit&&t&&(t(),t=null),n.doc=e,n.hasInit=!0,e.editorState=n,n.content&&n.content.trim()&&!n.content.match(/^<p(?:\s[^>]*)?>(?:<br\s*\/?>)?\s*<\/p>$/i)){let t=Gu(n.content);e.body.innerHTML=t.html,setTimeout(()=>{n.doc&&Ku(e,n.content,t.iframes)},0)}if(a.normalizeContent(e),e.body.firstElementChild){let t=e.createRange(),r=e.getSelection();r&&(t.selectNodeContents(e.body),t.collapse(!1),r.removeAllRanges(),r.addRange(t),n.range=t.cloneRange(),n.selection=r,n.rangeCount=r.rangeCount)}else{let t=e.getSelection();if(t){let r=e.createRange();r.setStart(e.body,0),r.setEnd(e.body,0),t.removeAllRanges(),t.addRange(r),n.range=r.cloneRange(),n.selection=t,n.rangeCount=t.rangeCount}}t=o(e)}function c(){if(!n.debug){let e=new Uu,t={debugger:e,logCommand:(t,r)=>{e.logCommand(t,r,n)},getSession:()=>e.getSession(),clearSession:()=>{e.clearSession()},downloadSession:()=>{e.downloadSession()},exportDebugWithPrompt:t=>e.exportSessionWithPrompt(t)};n.debug=t}}return typeof window<`u`&&window.addEventListener(`beforeunload`,()=>{t&&t()}),{state:n,init:s,updateState:r,history:i,initDebugger:c,cleanup:()=>{t&&(t(),t=null)}}}const Ju=[{key:`b`,command:`bold`},{key:`i`,command:`italic`},{key:`u`,command:`underline`},{key:`z`,command:`undo`},{key:`z`,modifiers:{shift:!0},command:`redo`},{key:`y`,command:`redo`},{key:`.`,modifiers:{shift:!0},command:`orderedList`},{key:`/`,modifiers:{shift:!0},command:`unorderedList`},{key:`]`,command:`indent`},{key:`[`,command:`outdent`},...Array.from({length:6},(e,t)=>({key:String(t+1),modifiers:{alt:!0},command:`h${t+1}`}))];function Yu(e,t){e.addEventListener(`keydown`,n=>{if(n.key===`Enter`&&!n.shiftKey){var r;let t=e.getSelection();if(!t||!t.rangeCount)return;let s=t.getRangeAt(0),c=s.commonAncestorContainer,l=(r=c.nodeType===3?c.parentElement:c)?.closest(`li`);if(l){if(s.collapsed&&Xu(l,s))if(Zu(l)){n.preventDefault();let r=l.parentElement;if(!r)return;if(l.remove(),!r.querySelector(`li`)){var i;let n=e.createElement(`p`);n.innerHTML=``,(i=r.parentNode)?.replaceChild(n,r),s.selectNodeContents(n),s.collapse(!0),t.removeAllRanges(),t.addRange(s)}}else{n.preventDefault();let r=e.createElement(`li`);r.innerHTML=``,l.insertAdjacentElement(`afterend`,r),s.selectNodeContents(r),s.collapse(!0),t.removeAllRanges(),t.addRange(s)}}else{var a,o;let r=(a=c.nodeType===3?c.parentElement:c)?.closest(`p,h1,h2,h3,h4,h5,h6,blockquote,div`);if(r&&s.collapsed){if(Xu(r,s)){n.preventDefault();let i=e.createElement(`p`);i.innerHTML=``,r.insertAdjacentElement(`afterend`,i),s.selectNodeContents(i),s.collapse(!0),t.removeAllRanges(),t.addRange(s)}}else if(!r&&(o=e.body.textContent)?.trim()){n.preventDefault();let r=e.body.textContent||``,i=s.startOffset,a=r.substring(0,i).trim(),o=r.substring(i).trim();if(e.body.innerHTML=``,a){let t=e.createElement(`p`);t.textContent=a,e.body.appendChild(t)}let c=e.createElement(`p`);c.textContent=o,e.body.appendChild(c),s.selectNodeContents(c),s.collapse(!0),t.removeAllRanges(),t.addRange(s)}}}if(!n.ctrlKey&&!n.metaKey)return;let s=Ju.find(e=>{let t=e.key===n.key,r=!e.modifiers||(!e.modifiers.ctrl||n.ctrlKey||n.metaKey)&&(!e.modifiers.alt||n.altKey)&&(!e.modifiers.shift||n.shiftKey);return t&&r});s&&(n.preventDefault(),t.execute(s.command))})}function Xu(e,t){var n;if(e.nodeType===3)return t.startOffset===e.length;let{lastChild:r}=e;return r?r.nodeType===3?t.startContainer===r&&t.startOffset===(n=r.textContent)?.length:t.startContainer===e&&t.startOffset===e.childNodes.length:!0}function Zu(e){var t;let n=(t=e.textContent)?.replace(/\s/g,``)||``;if(n)return!1;let r=e.getElementsByTagName(`br`);return r.length===0?!0:r.length===1&&e.childNodes.length<=2}const Qu={class:`bagel-input`},$u={key:1,class:`flex`};var ed=h({__name:`index`,props:{modelValue:{},toolbarConfig:{},debug:{type:Boolean},label:{},height:{}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=L(),s=qu(),f=L(!1),h=L(!1);s.state.content=r.modelValue,r.debug&&s.initDebugger();let g=Hu(s.state,s.state.debug),_=o(()=>s.state.debug),v=o(()=>/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(r.modelValue)),y=o(()=>typeof r.height==`number`?`${r.height}px`:typeof r.height==`string`?r.height:`240px`);N(()=>{s.cleanup()});function b(e){e.addEventListener(`input`,()=>{var t;if(!e.body.firstElementChild||!(t=e.body.textContent)?.trim()&&!e.body.querySelector(`p,h1,h2,h3,h4,h5,h6,blockquote,ul,ol,table`)){var n;if((n=e.body.textContent)?.trim()){let t=e.createElement(`p`);for(t.dir=e.body.dir;e.body.firstChild;)t.appendChild(e.body.firstChild);e.body.appendChild(t);let n=e.getSelection();if(n){let r=e.createRange();r.selectNodeContents(t),r.collapse(!1),n.removeAllRanges(),n.addRange(r)}s.state.content=e.body.innerHTML}}}),e.addEventListener(`keydown`,t=>{if(t.key===`Backspace`){let r=e.getSelection();if(!r||!r.rangeCount)return;let i=r.getRangeAt(0),a=e.body.querySelectorAll(`p,h1,h2,h3,h4,h5,h6,blockquote,li,div`);if(a.length<=1){var n;let o=a[0];if(o&&((n=o.textContent)?.trim()===``&&i.collapsed||i.startContainer===o&&i.endContainer===o&&i.startOffset===0&&i.endOffset===o.childNodes.length)){t.preventDefault(),o.innerHTML=``;let n=e.createRange();n.selectNodeContents(o),n.collapse(!0),r.removeAllRanges(),r.addRange(n),s.state.content=e.body.innerHTML}}}}),e.addEventListener(`paste`,t=>{setTimeout(()=>{var t;let n=e.createTreeWalker(e.body,NodeFilter.SHOW_TEXT),r=[],i;for(;i=n.nextNode();)i.parentElement===e.body&&(t=i.textContent)?.trim()&&r.push(i);r.forEach(t=>{let n=e.createElement(`p`);n.dir=e.body.dir,n.appendChild(t.cloneNode()),e.body.replaceChild(n,t)}),r.length>0&&(s.state.content=e.body.innerHTML)},0)})}async function x(){if(!(f.value||!a.value||h.value)){f.value=!0;try{var e;let t=await import(`./editor-sxMLITHI.js`),n=`
|
|
9
|
+
`,document.head.appendChild(e)}}let s={animation:150,mode:`line`,ghostClass:`draggable-ghost`,dragClass:`draggable-dragging`,dropIndicatorClass:`draggable-drop-indicator`,...e},c=0,l=0,u=0,d=0,f=0,p,m=null,h=-1,g=0,_=150,v=new Map;function y(e){if(!o)return null;let t=e.cloneNode(!0),n=e.getBoundingClientRect();return t.style.position=`fixed`,t.style.margin=`0`,t.style.top=`${n.top}px`,t.style.left=`${n.left}px`,t.style.width=`${n.width}px`,t.style.height=`${n.height}px`,t.style.transform=`translate3d(0, 0, 0)`,t.style.pointerEvents=`none`,t.style.zIndex=`9999`,t.style.cursor=`grabbing`,t.style.willChange=`transform`,t.classList.add(s.ghostClass),document.body.appendChild(t),t}function b(e){if(!o)return null;let t=document.createElement(`div`);t.classList.add(s.dropIndicatorClass),t.style.position=`fixed`,t.style.pointerEvents=`none`,t.style.zIndex=`9999`,t.style.height=`2px`,t.style.background=`var(--primary-color, #0066ff)`,t.style.boxShadow=`0 0 4px rgba(0, 102, 255, 0.5)`,t.style.transition=`all 0.15s ease`,t.style.display=`none`;let n=document.createElement(`div`);return n.style.position=`absolute`,n.style.left=`-4px`,n.style.top=`-3px`,n.style.width=`8px`,n.style.height=`8px`,n.style.borderRadius=`50%`,n.style.background=`var(--primary-color, #0066ff)`,t.appendChild(n),document.body.appendChild(t),t}function x(e,t){if(!i.value)return;let n=e.getBoundingClientRect();i.value.style.display=`block`,i.value.style.width=`${n.width}px`,i.value.style.left=`${n.left}px`,t?i.value.style.top=`${n.bottom}px`:i.value.style.top=`${n.top}px`}function S(e){let t=e;for(;t&&(!(`__drag_group`in t)||t.dataset.draggable===`false`);)t=t.parentElement;return t}function C(e){return e.style.opacity=`0.4`,e.style.transform=`scale(0.95)`,e.offsetHeight}function w(e){return e.style.opacity=`0.5`,2}function T(e){v.clear(),e.forEach((e,t)=>{let n=e.getBoundingClientRect();v.set(t,{top:n.top,bottom:n.bottom})})}function E(e,t,n,r){let i=Date.now();if(i-g<_)return h===-1?n:h;v.size===0&&T(t);let a=e.clientY,o=t.indexOf(r),s=v.get(o);if(!s)return n;let c=s.bottom-s.top,l=a-s.top,u=c*.3,d=c*.7,f=o;return o===n?l>d&&(f+=1):o===h?f=o>n?l<u?o:o+1:l>d?o+1:o:l>c*.6&&(f+=1),h=f,g=i,f}function D(){if(o){if(document.removeEventListener(`mousemove`,M),document.removeEventListener(`mouseup`,ee),document.removeEventListener(`keydown`,O),document.removeEventListener(`touchmove`,F),document.removeEventListener(`touchend`,I),document.removeEventListener(`touchcancel`,I),window.removeEventListener(`blur`,D),r.value&&(r.value.style.opacity=`0`,r.value.style.transform+=` scale(0.8)`,setTimeout(()=>{var e;(e=r.value)==null||(e=e.parentNode)==null||e.removeChild(r.value),r.value=null},150)),i.value&&(i.value.style.opacity=`0`,setTimeout(()=>{var e;(e=i.value)==null||(e=e.parentNode)==null||e.removeChild(i.value),i.value=null},150)),n.value){let e=n.value.__drag_list;e?.forEach(e=>{e.style.transition=``,e.style.transform=``,e.style.opacity=``}),n.value.classList.remove(s.dragClass),n.value=null}t.value=!1,a.value=null,o&&(document.body.style.userSelect=``,document.body.style.webkitUserSelect=``,document.body.style.cursor=``),m&&(cancelAnimationFrame(m),m=null),h=-1,g=0,v.clear()}}function O(e){e.key===`Escape`&&t.value&&D()}function k(e){var a;if(!o||s.disabled||e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)return;let p=S(e.target);if(!p||p.dataset.draggable===`false`)return;if(s.handle){let t=e.target.closest(s.handle);if(!t||!p.contains(t))return}e.preventDefault(),t.value=!0,n.value=p,c=e.clientX,l=e.clientY;let m=p.getBoundingClientRect();u=m.left,d=m.top,r.value=y(p),r.value&&(r.value.style.left=`${u}px`,r.value.style.top=`${d}px`),s.mode===`line`&&(i.value=b(p)),p.classList.add(s.dragClass),f=s.mode===`ghost`?C(p):w(p),(a=s.onStart)?.call(s,e),o&&(document.body.style.userSelect=`none`,document.body.style.webkitUserSelect=`none`,document.body.style.cursor=`grabbing`,window.addEventListener(`blur`,D),document.addEventListener(`mousemove`,M),document.addEventListener(`mouseup`,ee),document.addEventListener(`keydown`,O))}function A(e){let t=e.parentElement;for(;t;){let{overflow:e,overflowY:n}=window.getComputedStyle(t);if(/auto|scroll/.test(e+n))return t;t=t.parentElement}return document.scrollingElement||document.documentElement||document.body}function j(e){n.value&&(m&&cancelAnimationFrame(m),m=requestAnimationFrame(()=>{let t=A(n.value),r=t.getBoundingClientRect(),i=50,a=Math.min(20,r.height*.1),{scrollTop:o}=t,s=t.scrollHeight-t.clientHeight;if(e.clientY-r.top<i){let e=Math.max(0,o-a);t.scrollTop=e}else if(r.bottom-e.clientY<i){let e=Math.min(s,o+a);t.scrollTop=e}}))}function M(e){if(!t.value||!n.value)return;if(r.value){let t=e.clientX-c,n=e.clientY-l;r.value.style.transform=`translate3d(${t}px, ${n}px, 0)`}let o=n.value.__drag_list,u=o.filter(e=>e.dataset.draggable!==`false`),d=u.indexOf(n.value),p=document.elementFromPoint(e.clientX,e.clientY),m=S(p);if(!m||m.__drag_group!==n.value.__drag_group){i.value&&(i.value.style.display=`none`);return}let h=E(e,u,d,m);if(a.value!==m||a.value.__intended_index!==h){if(a.value=m,a.value.__intended_index=h,i.value&&s.mode===`line`){let e=h>d;x(m,e)}let e=f;u.forEach(t=>{if(t.style.transition=`transform ${s.animation}ms cubic-bezier(0.2, 0, 0, 1)`,t.style.transform=`translate3d(0, 0, 0)`,t===n.value){if(s.mode===`ghost`){let n=(h-d)*e;t.style.transform=`translate3d(0, ${n}px, 0)`}}else{let n=u.indexOf(t);d<h?n>d&&n<=h&&(t.style.transform=`translate3d(0, -${e}px, 0)`):d>h&&n>=h&&n<d&&(t.style.transform=`translate3d(0, ${e}px, 0)`)}})}j(e)}function ee(e){if(!t.value||!n.value||!a.value){D();return}let r=n.value.__drag_list;if(!r||!r.length){D();return}let i=r.filter(e=>e.dataset.draggable!==`false`),o=i.indexOf(n.value),c=a.value.__intended_index;if(o!==-1&&c!==-1){var l;r.forEach(e=>{e.style.transition=`none`,e.style.transform=``}),document.body.offsetHeight;let t=new MouseEvent(`mouseup`,e);t.oldIndex=o,t.newIndex=c,t.item=n.value.__drag_data,(l=s.onEnd)?.call(s,t)}D()}function P(e){var a;if(!o||s.disabled||!e.target)return;let p=e.touches[0];if(!p)return;let m=e.target,h=S(m);if(!h)return;let{handle:g}=s;if(g&&!m.closest(g))return;e.preventDefault(),t.value=!0,n.value=h,c=p.clientX,l=p.clientY;let _=h.getBoundingClientRect();u=_.left,d=_.top,r.value=y(h),r.value&&(r.value.style.left=`${u}px`,r.value.style.top=`${d}px`),s.mode===`line`&&(i.value=b(h)),n.value.classList.add(s.dragClass),f=s.mode===`ghost`?C(n.value):w(n.value),(a=s.onStart)?.call(s,e),o&&(document.body.style.userSelect=`none`,document.body.style.webkitUserSelect=`none`,document.body.style.cursor=`grabbing`,window.addEventListener(`blur`,D),document.addEventListener(`touchmove`,F,{passive:!1}),document.addEventListener(`touchend`,I),document.addEventListener(`touchcancel`,I))}function F(e){e.preventDefault();let t=e.touches[0];if(!t)return;let n={clientX:t.clientX,clientY:t.clientY,target:document.elementFromPoint(t.clientX,t.clientY)};M(n),j(n)}function I(e){let t=e.changedTouches[0];if(!t)return;let n={clientX:t.clientX,clientY:t.clientY,target:document.elementFromPoint(t.clientX,t.clientY)};ee(n),document.removeEventListener(`touchmove`,F),document.removeEventListener(`touchend`,I),document.removeEventListener(`touchcancel`,I)}function te(s){if(!o)return;p?.(),t.value=!1,n.value=null,r.value=null,i.value=null,a.value=null;let c=Array.from(s.children);c.forEach(e=>{delete e.__drag_group,delete e.__drag_index,delete e.__drag_list});let l=0;c.forEach((t,n)=>{t.dataset.draggable!==`false`&&(t.style.userSelect=`none`,t.style.webkitUserSelect=`none`,t.__drag_group=e.group,t.__drag_index=l++,t.__drag_list=c.filter(e=>e.dataset.draggable!==`false`),e.items&&(t.__drag_data=e.items[n]),t.addEventListener(`mousedown`,k),t.addEventListener(`touchstart`,P))}),p=()=>{c.forEach(e=>{e.removeEventListener(`mousedown`,k),e.removeEventListener(`touchstart`,P),delete e.__drag_group,delete e.__drag_index,delete e.__drag_list}),D()}}return N(()=>{p?.()}),{isDragging:t,dragElement:n,initDraggableContainer:te}}var Pr=h({__name:`Draggable`,props:{modelValue:{},group:{},handle:{},mode:{default:`line`},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`start`,`end`],setup(e,{emit:t}){let r=e,i=t,a=L(),{initDraggableContainer:o}=Nr({group:r.group,handle:r.handle,mode:r.mode,disabled:r.disabled,items:r.modelValue,onStart:e=>{i(`start`,e)},onEnd:e=>{let t=[...r.modelValue],[n]=t.splice(e.oldIndex,1);t.splice(e.newIndex,0,n),i(`update:modelValue`,t),i(`end`,e),E(()=>{a.value&&o(a.value)})}});return W(()=>r.modelValue,()=>{a.value&&o(a.value)},{deep:!0}),j(()=>{a.value&&o(a.value)}),(e,t)=>(P(),u(`div`,{ref_key:`dragContainer`,ref:a},[(P(!0),u(n,null,R(e.modelValue,(t,n)=>z(e.$slots,`default`,{key:n,item:t,index:n})),128))],512))}}),Fr=Pr;const Ir={mounted(e,t){let{initDraggableContainer:n}=Nr(t.value||{});n(e)},updated(e,t){if(t.value!==t.oldValue){let{initDraggableContainer:n}=Nr(t.value||{});n(e)}}},Lr={key:0,class:`drag-overlay`};var Rr=h({__name:`DragOver`,props:{multiple:{type:Boolean},accept:{},disabled:{type:Boolean},browse:{type:Boolean}},emits:[`addFiles`],setup(e,{emit:t}){let n=e,r=t,i=L(!1),a=L(0);function o(e){n.disabled||(e.preventDefault(),e.stopPropagation(),a.value++,i.value=!0)}function s(e){n.disabled||(e.preventDefault(),e.stopPropagation())}function c(e){n.disabled||(e.preventDefault(),e.stopPropagation(),a.value--,a.value===0&&(i.value=!1))}function d(e){if(!n.browse||n.disabled)return;e.preventDefault(),e.stopPropagation();let t=document.createElement(`input`);t.type=`file`,t.multiple=!!n.multiple,t.accept=n.accept||`*`,t.onchange=e=>{let{files:t}=e.target;t&&r(`addFiles`,t)},t.click()}function f(e){n.disabled||(e.preventDefault(),e.stopPropagation(),a.value=0,i.value=!1,e.dataTransfer&&r(`addFiles`,e.dataTransfer.files))}return(e,t)=>(P(),u(`div`,{class:D([`drag-over-container`,{"is-dragging":i.value,"is-disabled":e.disabled}]),onDragenter:o,onDragover:s,onDragleave:c,onDrop:f,onClick:d},[z(e.$slots,`default`,{},void 0,!0),i.value&&!e.disabled?(P(),u(`div`,Lr,[m(U($),{name:`download`,color:`white`,size:`2`})])):l(``,!0)],34))}}),zr=q(Rr,[[`__scopeId`,`data-v-2d9b6701`]]);const Br=[`top`,`right`,`bottom`,`left`],Vr=[`start`,`end`],Hr=Br.reduce((e,t)=>e.concat(t,t+`-`+Vr[0],t+`-`+Vr[1]),[]),Ur=Math.min,Wr=Math.max,Gr={left:`right`,right:`left`,bottom:`top`,top:`bottom`},Kr={start:`end`,end:`start`};function qr(e,t,n){return Wr(e,Ur(t,n))}function Jr(e,t){return typeof e==`function`?e(t):e}function Yr(e){return e.split(`-`)[0]}function Xr(e){return e.split(`-`)[1]}function Zr(e){return e===`x`?`y`:`x`}function Qr(e){return e===`y`?`height`:`width`}function $r(e){return[`top`,`bottom`].includes(Yr(e))?`y`:`x`}function ei(e){return Zr($r(e))}function ti(e,t,n){n===void 0&&(n=!1);let r=Xr(e),i=ei(e),a=Qr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=oi(o)),[o,oi(o)]}function ni(e){let t=oi(e);return[ri(e),t,ri(t)]}function ri(e){return e.replace(/start|end/g,e=>Kr[e])}function ii(e,t,n){let r=[`left`,`right`],i=[`right`,`left`],a=[`top`,`bottom`],o=[`bottom`,`top`];switch(e){case`top`:case`bottom`:return n?t?i:r:t?r:i;case`left`:case`right`:return t?a:o;default:return[]}}function ai(e,t,n,r){let i=Xr(e),a=ii(Yr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ri)))),a}function oi(e){return e.replace(/left|right|bottom|top/g,e=>Gr[e])}function si(e){return{top:0,right:0,bottom:0,left:0,...e}}function ci(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:si(e)}function li(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ui(e,t,n){let{reference:r,floating:i}=e,a=$r(t),o=ei(t),s=Qr(o),c=Yr(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Xr(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}const di=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=a.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ui(l,r,c),f=r,p={},m=0;for(let n=0;n<s.length;n++){let{name:a,fn:h}=s[n],{x:g,y:_,data:v,reset:y}=await h({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:p,rects:l,platform:o,elements:{reference:e,floating:t}});u=g??u,d=_??d,p={...p,[a]:{...p[a],...v}},y&&m<=50&&(m++,typeof y==`object`&&(y.placement&&(f=y.placement),y.rects&&(l=y.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):y.rects),{x:u,y:d}=ui(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:p}};async function fi(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=Jr(t,e),m=ci(p),h=d===`floating`?`reference`:`floating`,g=s[f?h:d],_=li(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(g)))??!0?g:g.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,y=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),b=await(a.isElement==null?void 0:a.isElement(y))&&await(a.getScale==null?void 0:a.getScale(y))||{x:1,y:1},x=li(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:y,strategy:c}):v);return{top:(_.top-x.top+m.top)/b.y,bottom:(x.bottom-_.bottom+m.bottom)/b.y,left:(_.left-x.left+m.left)/b.x,right:(x.right-_.right+m.right)/b.x}}const pi=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Jr(e,t)||{};if(l==null)return{};let d=ci(u),f={x:n,y:r},p=ei(i),m=Qr(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ur(d[_],T),D=Ur(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=qr(O,A,k),M=!c.arrow&&Xr(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}});function mi(e,t,n){let r=e?[...n.filter(t=>Xr(t)===e),...n.filter(t=>Xr(t)!==e)]:n.filter(e=>Yr(e)===e);return r.filter(n=>e?Xr(n)===e||(t?ri(n)!==n:!1):!0)}const hi=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){var n,r,i;let{rects:a,middlewareData:o,placement:s,platform:c,elements:l}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:f=Hr,autoAlignment:p=!0,...m}=Jr(e,t),h=d!==void 0||f===Hr?mi(d||null,p,f):f,g=await fi(t,m),_=(n=o.autoPlacement)?.index||0,v=h[_];if(v==null)return{};let y=ti(v,a,await(c.isRTL==null?void 0:c.isRTL(l.floating)));if(s!==v)return{reset:{placement:h[0]}};let b=[g[Yr(v)],g[y[0]],g[y[1]]],x=[...(r=o.autoPlacement)?.overflows||[],{placement:v,overflows:b}],S=h[_+1];if(S)return{data:{index:_+1,overflows:x},reset:{placement:S}};let C=x.map(e=>{let t=Xr(e.placement);return[e.placement,t&&u?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),w=C.filter(e=>e[2].slice(0,Xr(e[0])?2:3).every(e=>e<=0)),T=(i=w[0])?.[0]||C[0][0];return T===s?{}:{data:{index:_+1,overflows:x},reset:{placement:T}}}}},gi=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n,r;let{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p=`bestFit`,fallbackAxisSideDirection:m=`none`,flipAlignment:h=!0,...g}=Jr(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};let _=Yr(i),v=$r(s),y=Yr(s)===s,b=await(c.isRTL==null?void 0:c.isRTL(l.floating)),x=f||(y||!h?[oi(s)]:ni(s)),S=m!==`none`;!f&&S&&x.push(...ai(s,h,m,b));let C=[s,...x],w=await fi(t,g),T=[],E=(r=a.flip)?.overflows||[];if(u&&T.push(w[_]),d){let e=ti(i,o,b);T.push(w[e[0]],w[e[1]])}if(E=[...E,{placement:i,overflows:T}],!T.every(e=>e<=0)){var D,O;let e=((D=a.flip)?.index||0)+1,t=C[e];if(t){var k;let n=d===`alignment`?v!==$r(t):!1,r=(k=E[0])?.overflows[0]>0;if(!n||r)return{data:{index:e,overflows:E},reset:{placement:t}}}let n=(O=E.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?.placement;if(!n)switch(p){case`bestFit`:{var A;let e=(A=E.filter(e=>{if(S){let t=$r(e.placement);return t===v||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?.[0];e&&(n=e);break}case`initialPlacement`:n=s;break}if(i!==n)return{reset:{placement:n}}}return{}}}};async function _i(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Yr(n),s=Xr(n),c=$r(n)===`y`,l=[`left`,`top`].includes(o)?-1:1,u=a&&c?-1:1,d=Jr(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}const vi=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n,r;let{x:i,y:a,placement:o,middlewareData:s}=t,c=await _i(t,e);return o===(n=s.offset)?.placement&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:a+c.y,data:{...c,placement:o}}}}},yi=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:a=!0,crossAxis:o=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Jr(e,t),l={x:n,y:r},u=await fi(t,c),d=$r(Yr(i)),f=Zr(d),p=l[f],m=l[d];if(a){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=p+u[e],r=p-u[t];p=qr(n,p,r)}if(o){let e=d===`y`?`top`:`left`,t=d===`y`?`bottom`:`right`,n=m+u[e],r=m-u[t];m=qr(n,m,r)}let h=s.fn({...t,[f]:p,[d]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:a,[d]:o}}}}}},bi=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Jr(e,t),u=await fi(t,l),d=Yr(i),f=Xr(i),p=$r(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ur(h-u[g],v),x=Ur(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Wr(u.left,0),t=Wr(u.right,0),n=Wr(u.top,0),r=Wr(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Wr(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Wr(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function xi(e){var t;return(t=e.ownerDocument)?.defaultView||window}function Si(e){return xi(e).getComputedStyle(e)}const Ci=Math.min,wi=Math.max,Ti=Math.round;function Ei(e){let t=Si(e),n=parseFloat(t.width),r=parseFloat(t.height),i=e.offsetWidth,a=e.offsetHeight,o=Ti(n)!==i||Ti(r)!==a;return o&&(n=i,r=a),{width:n,height:r,fallback:o}}function Di(e){return Mi(e)?(e.nodeName||``).toLowerCase():``}let Oi;function ki(){if(Oi)return Oi;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(Oi=e.brands.map(e=>e.brand+`/`+e.version).join(` `),Oi):navigator.userAgent}function Ai(e){return e instanceof xi(e).HTMLElement}function ji(e){return e instanceof xi(e).Element}function Mi(e){return e instanceof xi(e).Node}function Ni(e){return typeof ShadowRoot>`u`?!1:e instanceof xi(e).ShadowRoot||e instanceof ShadowRoot}function Pi(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Si(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&![`inline`,`contents`].includes(i)}function Fi(e){return[`table`,`td`,`th`].includes(Di(e))}function Ii(e){let t=/firefox/i.test(ki()),n=Si(e),r=n.backdropFilter||n.WebkitBackdropFilter;return n.transform!==`none`||n.perspective!==`none`||!!r&&r!==`none`||t&&n.willChange===`filter`||t&&!!n.filter&&n.filter!==`none`||[`transform`,`perspective`].some(e=>n.willChange.includes(e))||[`paint`,`layout`,`strict`,`content`].some(e=>{let t=n.contain;return t!=null&&t.includes(e)})}function Li(){return!/^((?!chrome|android).)*safari/i.test(ki())}function Ri(e){return[`html`,`body`,`#document`].includes(Di(e))}function zi(e){return ji(e)?e:e.contextElement}const Bi={x:1,y:1};function Vi(e){let t=zi(e);if(!Ai(t))return Bi;let n=t.getBoundingClientRect(),{width:r,height:i,fallback:a}=Ei(t),o=(a?Ti(n.width):n.width)/r,s=(a?Ti(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}function Hi(e,t,n,r){var i,a;t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),s=zi(e),c=Bi;t&&(r?ji(r)&&(c=Vi(r)):c=Vi(e));let l=s?xi(s):window,u=!Li()&&n,d=(o.left+(u&&(i=l.visualViewport)?.offsetLeft||0))/c.x,f=(o.top+(u&&(a=l.visualViewport)?.offsetTop||0))/c.y,p=o.width/c.x,m=o.height/c.y;if(s){let e=xi(s),t=r&&ji(r)?xi(r):r,n=e.frameElement;for(;n&&r&&t!==e;){let e=Vi(n),t=n.getBoundingClientRect(),r=getComputedStyle(n);t.x+=(n.clientLeft+parseFloat(r.paddingLeft))*e.x,t.y+=(n.clientTop+parseFloat(r.paddingTop))*e.y,d*=e.x,f*=e.y,p*=e.x,m*=e.y,d+=t.x,f+=t.y,n=xi(n).frameElement}}return{width:p,height:m,top:f,right:d+p,bottom:f+m,left:d,x:d,y:f}}function Ui(e){return((Mi(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wi(e){return ji(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Gi(e){return Hi(Ui(e)).left+Wi(e).scrollLeft}function Ki(e){if(Di(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ni(e)&&e.host||Ui(e);return Ni(t)?t.host:t}function qi(e){let t=Ki(e);return Ri(t)?t.ownerDocument.body:Ai(t)&&Pi(t)?t:qi(t)}function Ji(e,t){var n;t===void 0&&(t=[]);let r=qi(e),i=r===(n=e.ownerDocument)?.body,a=xi(r);return i?t.concat(a,a.visualViewport||[],Pi(r)?r:[]):t.concat(r,Ji(r))}function Yi(e,t,n){return t===`viewport`?li(function(e,t){let n=xi(e),r=Ui(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Li();(e||!e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s,y:c}}(e,n)):ji(t)?li(function(e,t){let n=Hi(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ai(e)?Vi(e):{x:1,y:1};return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n)):li(function(e){let t=Ui(e),n=Wi(e),r=e.ownerDocument.body,i=wi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=wi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Gi(e),s=-n.scrollTop;return Si(r).direction===`rtl`&&(o+=wi(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}(Ui(e)))}function Xi(e){return Ai(e)&&Si(e).position!==`fixed`?e.offsetParent:null}function Zi(e){let t=xi(e),n=Xi(e);for(;n&&Fi(n)&&Si(n).position===`static`;)n=Xi(n);return n&&(Di(n)===`html`||Di(n)===`body`&&Si(n).position===`static`&&!Ii(n))?t:n||function(e){let t=Ki(e);for(;Ai(t)&&!Ri(t);){if(Ii(t))return t;t=Ki(t)}return null}(e)||t}function Qi(e,t,n){let r=Ai(t),i=Ui(t),a=Hi(e,!0,n===`fixed`,t),o={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&n!==`fixed`)if((Di(t)!==`body`||Pi(i))&&(o=Wi(t)),Ai(t)){let e=Hi(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=Gi(i));return{x:a.left+o.scrollLeft-s.x,y:a.top+o.scrollTop-s.y,width:a.width,height:a.height}}const $i={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=n===`clippingAncestors`?function(e,t){let n=t.get(e);if(n)return n;let r=Ji(e).filter(e=>ji(e)&&Di(e)!==`body`),i=null,a=Si(e).position===`fixed`,o=a?Ki(e):e;for(;ji(o)&&!Ri(o);){let e=Si(o),t=Ii(o);(a?t||i:t||e.position!==`static`||!i||![`absolute`,`fixed`].includes(i.position))?i=e:r=r.filter(e=>e!==o),o=Ki(o)}return t.set(e,r),r}(t,this._c):[].concat(n),o=[...a,r],s=o[0],c=o.reduce((e,n)=>{let r=Yi(t,n,i);return e.top=wi(r.top,e.top),e.right=Ci(r.right,e.right),e.bottom=Ci(r.bottom,e.bottom),e.left=wi(r.left,e.left),e},Yi(t,s,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=Ai(n),a=Ui(n);if(n===a)return t;let o={scrollLeft:0,scrollTop:0},s={x:1,y:1},c={x:0,y:0};if((i||!i&&r!==`fixed`)&&((Di(n)!==`body`||Pi(a))&&(o=Wi(n)),Ai(n))){let e=Hi(n);s=Vi(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-o.scrollLeft*s.x+c.x,y:t.y*s.y-o.scrollTop*s.y+c.y}},isElement:ji,getDimensions:function(e){return Ai(e)?Ei(e):e.getBoundingClientRect()},getOffsetParent:Zi,getDocumentElement:Ui,getScale:Vi,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e,i=this.getOffsetParent||Zi,a=this.getDimensions;return{reference:Qi(t,await i(n),r),floating:{x:0,y:0,...await a(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>Si(e).direction===`rtl`},ea=(e,t,n)=>{let r=new Map,i={platform:$i,...n},a={...i.platform,_c:r};return di(e,t,{...i,platform:a})};function ta(e,t){for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(typeof t[n]==`object`&&e[n]?ta(e[n],t[n]):e[n]=t[n])}const na={disabled:!1,distance:5,skidding:0,container:`body`,boundary:void 0,instantMove:!1,disposeTimeout:150,popperTriggers:[],strategy:`absolute`,preventOverflow:!0,flip:!0,shift:!0,overflowPadding:0,arrowPadding:0,arrowOverflow:!0,autoHideOnMousedown:!1,themes:{tooltip:{placement:`top`,triggers:[`hover`,`focus`,`touch`],hideTriggers:e=>[...e,`click`],delay:{show:200,hide:0},handleResize:!1,html:!1,loadingContent:`...`},dropdown:{placement:`bottom`,triggers:[`click`],delay:0,handleResize:!0,autoHide:!0},menu:{$extend:`dropdown`,triggers:[`hover`,`focus`],popperTriggers:[`hover`],delay:{show:0,hide:400}}}};function ra(e,t){let n=na.themes[e]||{},r;do r=n[t],typeof r>`u`?n.$extend?n=na.themes[n.$extend]||{}:(n=null,r=na[t]):n=null;while(n);return r}function ia(e){let t=[e],n=na.themes[e]||{};do n.$extend&&!n.$resetCss?(t.push(n.$extend),n=na.themes[n.$extend]||{}):n=null;while(n);return t.map(e=>`v-popper--theme-${e}`)}function aa(e){let t=[e],n=na.themes[e]||{};do n.$extend?(t.push(n.$extend),n=na.themes[n.$extend]||{}):n=null;while(n);return t}let oa=!1;if(typeof window<`u`){oa=!1;try{let e=Object.defineProperty({},`passive`,{get(){oa=!0}});window.addEventListener(`test`,null,e)}catch{}}let sa=!1;typeof window<`u`&&typeof navigator<`u`&&(sa=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream);const ca=[`auto`,`top`,`bottom`,`left`,`right`].reduce((e,t)=>e.concat([t,`${t}-start`,`${t}-end`]),[]),la={hover:`mouseenter`,focus:`focus`,click:`click`,touch:`touchstart`,pointer:`pointerdown`},ua={hover:`mouseleave`,focus:`blur`,click:`click`,touch:`touchend`,pointer:`pointerup`};function da(e,t){let n=e.indexOf(t);n!==-1&&e.splice(n,1)}function fa(){return new Promise(e=>requestAnimationFrame(()=>{requestAnimationFrame(e)}))}const pa=[];let ma=null;const ha={};function ga(e){let t=ha[e];return t||=ha[e]=[],t}let _a=function(){};typeof window<`u`&&(_a=window.Element);function va(e){return function(t){return ra(t.theme,e)}}const ya=`__floating-vue__popper`,ba=()=>h({name:`VPopper`,provide(){return{[ya]:{parentPopper:this}}},inject:{[ya]:{default:null}},props:{theme:{type:String,required:!0},targetNodes:{type:Function,required:!0},referenceNode:{type:Function,default:null},popperNode:{type:Function,required:!0},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:va(`disabled`)},positioningDisabled:{type:Boolean,default:va(`positioningDisabled`)},placement:{type:String,default:va(`placement`),validator:e=>ca.includes(e)},delay:{type:[String,Number,Object],default:va(`delay`)},distance:{type:[Number,String],default:va(`distance`)},skidding:{type:[Number,String],default:va(`skidding`)},triggers:{type:Array,default:va(`triggers`)},showTriggers:{type:[Array,Function],default:va(`showTriggers`)},hideTriggers:{type:[Array,Function],default:va(`hideTriggers`)},popperTriggers:{type:Array,default:va(`popperTriggers`)},popperShowTriggers:{type:[Array,Function],default:va(`popperShowTriggers`)},popperHideTriggers:{type:[Array,Function],default:va(`popperHideTriggers`)},container:{type:[String,Object,_a,Boolean],default:va(`container`)},boundary:{type:[String,_a],default:va(`boundary`)},strategy:{type:String,validator:e=>[`absolute`,`fixed`].includes(e),default:va(`strategy`)},autoHide:{type:[Boolean,Function],default:va(`autoHide`)},handleResize:{type:Boolean,default:va(`handleResize`)},instantMove:{type:Boolean,default:va(`instantMove`)},eagerMount:{type:Boolean,default:va(`eagerMount`)},popperClass:{type:[String,Array,Object],default:va(`popperClass`)},computeTransformOrigin:{type:Boolean,default:va(`computeTransformOrigin`)},autoMinSize:{type:Boolean,default:va(`autoMinSize`)},autoSize:{type:[Boolean,String],default:va(`autoSize`)},autoMaxSize:{type:Boolean,default:va(`autoMaxSize`)},autoBoundaryMaxSize:{type:Boolean,default:va(`autoBoundaryMaxSize`)},preventOverflow:{type:Boolean,default:va(`preventOverflow`)},overflowPadding:{type:[Number,String],default:va(`overflowPadding`)},arrowPadding:{type:[Number,String],default:va(`arrowPadding`)},arrowOverflow:{type:Boolean,default:va(`arrowOverflow`)},flip:{type:Boolean,default:va(`flip`)},shift:{type:Boolean,default:va(`shift`)},shiftCrossAxis:{type:Boolean,default:va(`shiftCrossAxis`)},noAutoFocus:{type:Boolean,default:va(`noAutoFocus`)},disposeTimeout:{type:Number,default:va(`disposeTimeout`)}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},data(){return{isShown:!1,isMounted:!1,skipTransition:!1,classes:{showFrom:!1,showTo:!1,hideFrom:!1,hideTo:!0},result:{x:0,y:0,placement:``,strategy:this.strategy,arrow:{x:0,y:0,centerOffset:0},transformOrigin:null},randomId:`popper_${[Math.random(),Date.now()].map(e=>e.toString(36).substring(2,10)).join(`_`)}`,shownChildren:new Set,lastAutoHide:!0,pendingHide:!1,containsGlobalTarget:!1,isDisposed:!0,mouseDownContains:!1}},computed:{popperId(){return this.ariaId==null?this.randomId:this.ariaId},shouldMountContent(){return this.eagerMount||this.isMounted},slotData(){return{popperId:this.popperId,isShown:this.isShown,shouldMountContent:this.shouldMountContent,skipTransition:this.skipTransition,autoHide:typeof this.autoHide==`function`?this.lastAutoHide:this.autoHide,show:this.show,hide:this.hide,handleResize:this.handleResize,onResize:this.onResize,classes:{...this.classes,popperClass:this.popperClass},result:this.positioningDisabled?null:this.result,attrs:this.$attrs}},parentPopper(){var e;return(e=this[ya])?.parentPopper},hasPopperShowTriggerHover(){var e,t;return(e=this.popperTriggers)?.includes(`hover`)||(t=this.popperShowTriggers)?.includes(`hover`)}},watch:{shown:`$_autoShowHide`,disabled(e){e?this.dispose():this.init()},async container(){this.isShown&&(this.$_ensureTeleport(),await this.$_computePosition())},triggers:{handler:`$_refreshListeners`,deep:!0},positioningDisabled:`$_refreshListeners`,...[`placement`,`distance`,`skidding`,`boundary`,`strategy`,`overflowPadding`,`arrowPadding`,`preventOverflow`,`shift`,`shiftCrossAxis`,`flip`].reduce((e,t)=>(e[t]=`$_computePosition`,e),{})},created(){this.autoMinSize&&console.warn('[floating-vue] `autoMinSize` option is deprecated. Use `autoSize="min"` instead.'),this.autoMaxSize&&console.warn("[floating-vue] `autoMaxSize` option is deprecated. Use `autoBoundaryMaxSize` instead.")},mounted(){this.init(),this.$_detachPopperNode()},activated(){this.$_autoShowHide()},deactivated(){this.hide()},beforeUnmount(){this.dispose()},methods:{show({event:e=null,skipDelay:t=!1,force:n=!1}={}){var r,i;(r=this.parentPopper)!=null&&r.lockedChild&&this.parentPopper.lockedChild!==this||(this.pendingHide=!1,(n||!this.disabled)&&((i=this.parentPopper)?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.$_scheduleShow(e,t),this.$emit(`show`),this.$_showFrameLocked=!0,requestAnimationFrame(()=>{this.$_showFrameLocked=!1})),this.$emit(`update:shown`,!0))},hide({event:e=null,skipDelay:t=!1}={}){var n;if(!this.$_hideInProgress){if(this.shownChildren.size>0){this.pendingHide=!0;return}if(this.hasPopperShowTriggerHover&&this.$_isAimingPopper()){this.parentPopper&&(this.parentPopper.lockedChild=this,clearTimeout(this.parentPopper.lockedChildTimer),this.parentPopper.lockedChildTimer=setTimeout(()=>{this.parentPopper.lockedChild===this&&(this.parentPopper.lockedChild.hide({skipDelay:t}),this.parentPopper.lockedChild=null)},1e3));return}(n=this.parentPopper)?.lockedChild===this&&(this.parentPopper.lockedChild=null),this.pendingHide=!1,this.$_scheduleHide(e,t),this.$emit(`hide`),this.$emit(`update:shown`,!1)}},init(){var e;this.isDisposed&&(this.isDisposed=!1,this.isMounted=!1,this.$_events=[],this.$_preventShow=!1,this.$_referenceNode=(e=this.referenceNode)?.call(this)??this.$el,this.$_targetNodes=this.targetNodes().filter(e=>e.nodeType===e.ELEMENT_NODE),this.$_popperNode=this.popperNode(),this.$_innerNode=this.$_popperNode.querySelector(`.v-popper__inner`),this.$_arrowNode=this.$_popperNode.querySelector(`.v-popper__arrow-container`),this.$_swapTargetAttrs(`title`,`data-original-title`),this.$_detachPopperNode(),this.triggers.length&&this.$_addEventListeners(),this.shown&&this.show())},dispose(){this.isDisposed||(this.isDisposed=!0,this.$_removeEventListeners(),this.hide({skipDelay:!0}),this.$_detachPopperNode(),this.isMounted=!1,this.isShown=!1,this.$_updateParentShownChildren(!1),this.$_swapTargetAttrs(`data-original-title`,`title`))},async onResize(){this.isShown&&(await this.$_computePosition(),this.$emit(`resize`))},async $_computePosition(){if(this.isDisposed||this.positioningDisabled)return;let e={strategy:this.strategy,middleware:[]};(this.distance||this.skidding)&&e.middleware.push(vi({mainAxis:this.distance,crossAxis:this.skidding}));let t=this.placement.startsWith(`auto`);if(t?e.middleware.push(hi({alignment:this.placement.split(`-`)[1]??``})):e.placement=this.placement,this.preventOverflow&&(this.shift&&e.middleware.push(yi({padding:this.overflowPadding,boundary:this.boundary,crossAxis:this.shiftCrossAxis})),!t&&this.flip&&e.middleware.push(gi({padding:this.overflowPadding,boundary:this.boundary}))),e.middleware.push(pi({element:this.$_arrowNode,padding:this.arrowPadding})),this.arrowOverflow&&e.middleware.push({name:`arrowOverflow`,fn:({placement:e,rects:t,middlewareData:n})=>{let r,{centerOffset:i}=n.arrow;return r=e.startsWith(`top`)||e.startsWith(`bottom`)?Math.abs(i)>t.reference.width/2:Math.abs(i)>t.reference.height/2,{data:{overflow:r}}}}),this.autoMinSize||this.autoSize){let t=this.autoSize?this.autoSize:this.autoMinSize?`min`:null;e.middleware.push({name:`autoSize`,fn:({rects:e,placement:n,middlewareData:r})=>{var i;if((i=r.autoSize)!=null&&i.skip)return{};let a,o;return n.startsWith(`top`)||n.startsWith(`bottom`)?a=e.reference.width:o=e.reference.height,this.$_innerNode.style[t===`min`?`minWidth`:t===`max`?`maxWidth`:`width`]=a==null?null:`${a}px`,this.$_innerNode.style[t===`min`?`minHeight`:t===`max`?`maxHeight`:`height`]=o==null?null:`${o}px`,{data:{skip:!0},reset:{rects:!0}}}})}(this.autoMaxSize||this.autoBoundaryMaxSize)&&(this.$_innerNode.style.maxWidth=null,this.$_innerNode.style.maxHeight=null,e.middleware.push(bi({boundary:this.boundary,padding:this.overflowPadding,apply:({availableWidth:e,availableHeight:t})=>{this.$_innerNode.style.maxWidth=e==null?null:`${e}px`,this.$_innerNode.style.maxHeight=t==null?null:`${t}px`}})));let n=await ea(this.$_referenceNode,this.$_popperNode,e);Object.assign(this.result,{x:n.x,y:n.y,placement:n.placement,strategy:n.strategy,arrow:{...n.middlewareData.arrow,...n.middlewareData.arrowOverflow}})},$_scheduleShow(e,t=!1){if(this.$_updateParentShownChildren(!0),this.$_hideInProgress=!1,clearTimeout(this.$_scheduleTimer),ma&&this.instantMove&&ma.instantMove&&ma!==this.parentPopper){ma.$_applyHide(!0),this.$_applyShow(!0);return}t?this.$_applyShow():this.$_scheduleTimer=setTimeout(this.$_applyShow.bind(this),this.$_computeDelay(`show`))},$_scheduleHide(e,t=!1){if(this.shownChildren.size>0){this.pendingHide=!0;return}this.$_updateParentShownChildren(!1),this.$_hideInProgress=!0,clearTimeout(this.$_scheduleTimer),this.isShown&&(ma=this),t?this.$_applyHide():this.$_scheduleTimer=setTimeout(this.$_applyHide.bind(this),this.$_computeDelay(`hide`))},$_computeDelay(e){let t=this.delay;return parseInt(t&&t[e]||t||0)},async $_applyShow(e=!1){clearTimeout(this.$_disposeTimer),clearTimeout(this.$_scheduleTimer),this.skipTransition=e,!this.isShown&&(this.$_ensureTeleport(),await fa(),await this.$_computePosition(),await this.$_applyShowEffect(),this.positioningDisabled||this.$_registerEventListeners([...Ji(this.$_referenceNode),...Ji(this.$_popperNode)],`scroll`,()=>{this.$_computePosition()}))},async $_applyShowEffect(){if(this.$_hideInProgress)return;if(this.computeTransformOrigin){let e=this.$_referenceNode.getBoundingClientRect(),t=this.$_popperNode.querySelector(`.v-popper__wrapper`),n=t.parentNode.getBoundingClientRect(),r=e.x+e.width/2-(n.left+t.offsetLeft),i=e.y+e.height/2-(n.top+t.offsetTop);this.result.transformOrigin=`${r}px ${i}px`}this.isShown=!0,this.$_applyAttrsToTarget({"aria-describedby":this.popperId,"data-popper-shown":``});let e=this.showGroup;if(e){let t;for(let n=0;n<pa.length;n++)t=pa[n],t.showGroup!==e&&(t.hide(),t.$emit(`close-group`))}pa.push(this),document.body.classList.add(`v-popper--some-open`);for(let e of aa(this.theme))ga(e).push(this),document.body.classList.add(`v-popper--some-open--${e}`);this.$emit(`apply-show`),this.classes.showFrom=!0,this.classes.showTo=!1,this.classes.hideFrom=!1,this.classes.hideTo=!1,await fa(),this.classes.showFrom=!1,this.classes.showTo=!0,this.noAutoFocus||this.$_popperNode.focus()},async $_applyHide(e=!1){if(this.shownChildren.size>0){this.pendingHide=!0,this.$_hideInProgress=!1;return}if(clearTimeout(this.$_scheduleTimer),!this.isShown)return;this.skipTransition=e,da(pa,this),pa.length===0&&document.body.classList.remove(`v-popper--some-open`);for(let e of aa(this.theme)){let t=ga(e);da(t,this),t.length===0&&document.body.classList.remove(`v-popper--some-open--${e}`)}ma===this&&(ma=null),this.isShown=!1,this.$_applyAttrsToTarget({"aria-describedby":void 0,"data-popper-shown":void 0}),clearTimeout(this.$_disposeTimer);let t=this.disposeTimeout;t!==null&&(this.$_disposeTimer=setTimeout(()=>{this.$_popperNode&&(this.$_detachPopperNode(),this.isMounted=!1)},t)),this.$_removeEventListeners(`scroll`),this.$emit(`apply-hide`),this.classes.showFrom=!1,this.classes.showTo=!1,this.classes.hideFrom=!0,this.classes.hideTo=!1,await fa(),this.classes.hideFrom=!1,this.classes.hideTo=!0},$_autoShowHide(){this.shown?this.show():this.hide()},$_ensureTeleport(){if(this.isDisposed)return;let e=this.container;if(typeof e==`string`?e=window.document.querySelector(e):e===!1&&(e=this.$_targetNodes[0].parentNode),!e)throw Error(`No container for popover: `+this.container);e.appendChild(this.$_popperNode),this.isMounted=!0},$_addEventListeners(){let e=e=>{this.isShown&&!this.$_hideInProgress||(e.usedByTooltip=!0,!this.$_preventShow&&this.show({event:e}))};this.$_registerTriggerListeners(this.$_targetNodes,la,this.triggers,this.showTriggers,e),this.$_registerTriggerListeners([this.$_popperNode],la,this.popperTriggers,this.popperShowTriggers,e);let t=e=>{e.usedByTooltip||this.hide({event:e})};this.$_registerTriggerListeners(this.$_targetNodes,ua,this.triggers,this.hideTriggers,t),this.$_registerTriggerListeners([this.$_popperNode],ua,this.popperTriggers,this.popperHideTriggers,t)},$_registerEventListeners(e,t,n){this.$_events.push({targetNodes:e,eventType:t,handler:n}),e.forEach(e=>e.addEventListener(t,n,oa?{passive:!0}:void 0))},$_registerTriggerListeners(e,t,n,r,i){let a=n;r!=null&&(a=typeof r==`function`?r(a):r),a.forEach(n=>{let r=t[n];r&&this.$_registerEventListeners(e,r,i)})},$_removeEventListeners(e){let t=[];this.$_events.forEach(n=>{let{targetNodes:r,eventType:i,handler:a}=n;!e||e===i?r.forEach(e=>e.removeEventListener(i,a)):t.push(n)}),this.$_events=t},$_refreshListeners(){this.isDisposed||(this.$_removeEventListeners(),this.$_addEventListeners())},$_handleGlobalClose(e,t=!1){this.$_showFrameLocked||(this.hide({event:e}),e.closePopover?this.$emit(`close-directive`):this.$emit(`auto-hide`),t&&(this.$_preventShow=!0,setTimeout(()=>{this.$_preventShow=!1},300)))},$_detachPopperNode(){this.$_popperNode.parentNode&&this.$_popperNode.parentNode.removeChild(this.$_popperNode)},$_swapTargetAttrs(e,t){for(let n of this.$_targetNodes){let r=n.getAttribute(e);r&&(n.removeAttribute(e),n.setAttribute(t,r))}},$_applyAttrsToTarget(e){for(let t of this.$_targetNodes)for(let n in e){let r=e[n];r==null?t.removeAttribute(n):t.setAttribute(n,r)}},$_updateParentShownChildren(e){let t=this.parentPopper;for(;t;)e?t.shownChildren.add(this.randomId):(t.shownChildren.delete(this.randomId),t.pendingHide&&t.hide()),t=t.parentPopper},$_isAimingPopper(){let e=this.$_referenceNode.getBoundingClientRect();if(ka>=e.left&&ka<=e.right&&Aa>=e.top&&Aa<=e.bottom){let e=this.$_popperNode.getBoundingClientRect(),t=ka-Da,n=Aa-Oa,r=e.left+e.width/2-Da+(e.top+e.height/2)-Oa+e.width+e.height,i=Da+t*r,a=Oa+n*r;return ja(Da,Oa,i,a,e.left,e.top,e.left,e.bottom)||ja(Da,Oa,i,a,e.left,e.top,e.right,e.top)||ja(Da,Oa,i,a,e.right,e.top,e.right,e.bottom)||ja(Da,Oa,i,a,e.left,e.bottom,e.right,e.bottom)}return!1}},render(){return this.$slots.default(this.slotData)}});if(typeof document<`u`&&typeof window<`u`){if(sa){let e=oa?{passive:!0,capture:!0}:!0;document.addEventListener(`touchstart`,e=>xa(e,!0),e),document.addEventListener(`touchend`,e=>Sa(e,!0),e)}else window.addEventListener(`mousedown`,e=>xa(e,!1),!0),window.addEventListener(`click`,e=>Sa(e,!1),!0);window.addEventListener(`resize`,Ea)}function xa(e,t){if(na.autoHideOnMousedown)Ca(e,t);else for(let t=0;t<pa.length;t++){let n=pa[t];try{n.mouseDownContains=n.popperNode().contains(e.target)}catch{}}}function Sa(e,t){na.autoHideOnMousedown||Ca(e,t)}function Ca(e,t){let n={};for(let r=pa.length-1;r>=0;r--){let i=pa[r];try{let r=i.containsGlobalTarget=i.mouseDownContains||i.popperNode().contains(e.target);i.pendingHide=!1,requestAnimationFrame(()=>{if(i.pendingHide=!1,!n[i.randomId]&&wa(i,r,e)){if(i.$_handleGlobalClose(e,t),!e.closeAllPopover&&e.closePopover&&r){let e=i.parentPopper;for(;e;)n[e.randomId]=!0,e=e.parentPopper;return}let a=i.parentPopper;for(;a&&wa(a,a.containsGlobalTarget,e);)a.$_handleGlobalClose(e,t),a=a.parentPopper}})}catch{}}}function wa(e,t,n){return n.closeAllPopover||n.closePopover&&t||Ta(e,n)&&!t}function Ta(e,t){if(typeof e.autoHide==`function`){let n=e.autoHide(t);return e.lastAutoHide=n,n}return e.autoHide}function Ea(){for(let e=0;e<pa.length;e++)pa[e].$_computePosition()}let Da=0,Oa=0,ka=0,Aa=0;typeof window<`u`&&window.addEventListener(`mousemove`,e=>{Da=ka,Oa=Aa,ka=e.clientX,Aa=e.clientY},oa?{passive:!0}:void 0);function ja(e,t,n,r,i,a,o,s){let c=((o-i)*(t-a)-(s-a)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t)),l=((n-e)*(t-a)-(r-t)*(e-i))/((s-a)*(n-e)-(o-i)*(r-t));return c>=0&&c<=1&&l>=0&&l<=1}const Ma={extends:ba()},Na=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};function Pa(e,t,n,r,i,a){return P(),u(`div`,{ref:`reference`,class:D([`v-popper`,{"v-popper--shown":e.slotData.isShown}])},[z(e.$slots,`default`,O(v(e.slotData)))],2)}const Fa=Na(Ma,[[`render`,Pa]]);function Ia(){var e=window.navigator.userAgent,t=e.indexOf(`MSIE `);if(t>0)return parseInt(e.substring(t+5,e.indexOf(`.`,t)),10);var n=e.indexOf(`Trident/`);if(n>0){var r=e.indexOf(`rv:`);return parseInt(e.substring(r+3,e.indexOf(`.`,r)),10)}var i=e.indexOf(`Edge/`);return i>0?parseInt(e.substring(i+5,e.indexOf(`.`,i)),10):-1}let La;function Ra(){Ra.init||(Ra.init=!0,La=Ia()!==-1)}var za={name:`ResizeObserver`,props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:[`notify`],mounted(){Ra(),E(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});let e=document.createElement(`object`);this._resizeObject=e,e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`tabindex`,-1),e.onload=this.addResizeHandlers,e.type=`text/html`,La&&this.$el.appendChild(e),e.data=`about:blank`,La||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit(`notify`,{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener(`resize`,this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!La&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener(`resize`,this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const Ba=_e(`data-v-b329ee4c`);te(`data-v-b329ee4c`);const Va={class:`resize-observer`,tabindex:`-1`};F();const Ha=Ba((e,t,n,r,i,a)=>(P(),c(`div`,Va)));za.render=Ha,za.__scopeId=`data-v-b329ee4c`,za.__file=`src/components/ResizeObserver.vue`;const Ua=(e=`theme`)=>({computed:{themeClass(){return ia(this[e])}}}),Wa=h({name:`VPopperContent`,components:{ResizeObserver:za},mixins:[Ua()],props:{popperId:String,theme:String,shown:Boolean,mounted:Boolean,skipTransition:Boolean,autoHide:Boolean,handleResize:Boolean,classes:Object,result:Object},emits:[`hide`,`resize`],methods:{toPx(e){return e!=null&&!isNaN(e)?`${e}px`:null}}}),Ga=[`id`,`aria-hidden`,`tabindex`,`data-popper-placement`],Ka={ref:`inner`,class:`v-popper__inner`},qa=d(`div`,{class:`v-popper__arrow-outer`},null,-1),Ja=d(`div`,{class:`v-popper__arrow-inner`},null,-1),Ya=[qa,Ja];function Xa(e,t,r,i,a,o){let s=re(`ResizeObserver`);return P(),u(`div`,{id:e.popperId,ref:`popover`,class:D([`v-popper__popper`,[e.themeClass,e.classes.popperClass,{"v-popper__popper--shown":e.shown,"v-popper__popper--hidden":!e.shown,"v-popper__popper--show-from":e.classes.showFrom,"v-popper__popper--show-to":e.classes.showTo,"v-popper__popper--hide-from":e.classes.hideFrom,"v-popper__popper--hide-to":e.classes.hideTo,"v-popper__popper--skip-transition":e.skipTransition,"v-popper__popper--arrow-overflow":e.result&&e.result.arrow.overflow,"v-popper__popper--no-positioning":!e.result}]]),style:k(e.result?{position:e.result.strategy,transform:`translate3d(${Math.round(e.result.x)}px,${Math.round(e.result.y)}px,0)`}:void 0),"aria-hidden":e.shown?`false`:`true`,tabindex:e.autoHide?0:void 0,"data-popper-placement":e.result?e.result.placement:void 0,onKeyup:t[2]||=he(t=>e.autoHide&&e.$emit(`hide`),[`esc`])},[d(`div`,{class:`v-popper__backdrop`,onClick:t[0]||=t=>e.autoHide&&e.$emit(`hide`)}),d(`div`,{class:`v-popper__wrapper`,style:k(e.result?{transformOrigin:e.result.transformOrigin}:void 0)},[d(`div`,Ka,[e.mounted?(P(),u(n,{key:0},[d(`div`,null,[z(e.$slots,`default`)]),e.handleResize?(P(),c(s,{key:0,onNotify:t[1]||=t=>e.$emit(`resize`,t)})):l(``,!0)],64)):l(``,!0)],512),d(`div`,{ref:`arrow`,class:`v-popper__arrow-container`,style:k(e.result?{left:e.toPx(e.result.arrow.x),top:e.toPx(e.result.arrow.y)}:void 0)},Ya,4)],4)],46,Ga)}const Za=Na(Wa,[[`render`,Xa]]),Qa={methods:{show(...e){return this.$refs.popper.show(...e)},hide(...e){return this.$refs.popper.hide(...e)},dispose(...e){return this.$refs.popper.dispose(...e)},onResize(...e){return this.$refs.popper.onResize(...e)}}};let $a=function(){};typeof window<`u`&&($a=window.Element);const eo=h({name:`VPopperWrapper`,components:{Popper:Fa,PopperContent:Za},mixins:[Qa,Ua(`finalTheme`)],props:{theme:{type:String,default:null},referenceNode:{type:Function,default:null},shown:{type:Boolean,default:!1},showGroup:{type:String,default:null},ariaId:{default:null},disabled:{type:Boolean,default:void 0},positioningDisabled:{type:Boolean,default:void 0},placement:{type:String,default:void 0},delay:{type:[String,Number,Object],default:void 0},distance:{type:[Number,String],default:void 0},skidding:{type:[Number,String],default:void 0},triggers:{type:Array,default:void 0},showTriggers:{type:[Array,Function],default:void 0},hideTriggers:{type:[Array,Function],default:void 0},popperTriggers:{type:Array,default:void 0},popperShowTriggers:{type:[Array,Function],default:void 0},popperHideTriggers:{type:[Array,Function],default:void 0},container:{type:[String,Object,$a,Boolean],default:void 0},boundary:{type:[String,$a],default:void 0},strategy:{type:String,default:void 0},autoHide:{type:[Boolean,Function],default:void 0},handleResize:{type:Boolean,default:void 0},instantMove:{type:Boolean,default:void 0},eagerMount:{type:Boolean,default:void 0},popperClass:{type:[String,Array,Object],default:void 0},computeTransformOrigin:{type:Boolean,default:void 0},autoMinSize:{type:Boolean,default:void 0},autoSize:{type:[Boolean,String],default:void 0},autoMaxSize:{type:Boolean,default:void 0},autoBoundaryMaxSize:{type:Boolean,default:void 0},preventOverflow:{type:Boolean,default:void 0},overflowPadding:{type:[Number,String],default:void 0},arrowPadding:{type:[Number,String],default:void 0},arrowOverflow:{type:Boolean,default:void 0},flip:{type:Boolean,default:void 0},shift:{type:Boolean,default:void 0},shiftCrossAxis:{type:Boolean,default:void 0},noAutoFocus:{type:Boolean,default:void 0},disposeTimeout:{type:Number,default:void 0}},emits:{show:()=>!0,hide:()=>!0,"update:shown":e=>!0,"apply-show":()=>!0,"apply-hide":()=>!0,"close-group":()=>!0,"close-directive":()=>!0,"auto-hide":()=>!0,resize:()=>!0},computed:{finalTheme(){return this.theme??this.$options.vPopperTheme}},methods:{getTargetNodes(){return Array.from(this.$el.children).filter(e=>e!==this.$refs.popperContent.$el)}}});function to(e,t,n,r,i,a){let o=re(`PopperContent`),s=re(`Popper`);return P(),c(s,T({ref:`popper`},e.$props,{theme:e.finalTheme,"target-nodes":e.getTargetNodes,"popper-node":()=>e.$refs.popperContent.$el,class:[e.themeClass],onShow:t[0]||=()=>e.$emit(`show`),onHide:t[1]||=()=>e.$emit(`hide`),"onUpdate:shown":t[2]||=t=>e.$emit(`update:shown`,t),onApplyShow:t[3]||=()=>e.$emit(`apply-show`),onApplyHide:t[4]||=()=>e.$emit(`apply-hide`),onCloseGroup:t[5]||=()=>e.$emit(`close-group`),onCloseDirective:t[6]||=()=>e.$emit(`close-directive`),onAutoHide:t[7]||=()=>e.$emit(`auto-hide`),onResize:t[8]||=()=>e.$emit(`resize`)}),{default:G(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,show:s,hide:c,handleResize:l,onResize:u,classes:d,result:f})=>[z(e.$slots,`default`,{shown:n,show:s,hide:c}),m(o,{ref:`popperContent`,"popper-id":t,theme:e.finalTheme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":l,classes:d,result:f,onHide:c,onResize:u},{default:G(()=>[z(e.$slots,`popper`,{shown:n,hide:c})]),_:2},1032,[`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:3},16,[`theme`,`target-nodes`,`popper-node`,`class`])}const no=Na(eo,[[`render`,to]]),ro={...no,name:`VDropdown`,vPopperTheme:`dropdown`},io={...no,name:`VMenu`,vPopperTheme:`menu`},ao={...no,name:`VTooltip`,vPopperTheme:`tooltip`},oo=h({name:`VTooltipDirective`,components:{Popper:ba(),PopperContent:Za},mixins:[Qa],inheritAttrs:!1,props:{theme:{type:String,default:`tooltip`},html:{type:Boolean,default:e=>ra(e.theme,`html`)},content:{type:[String,Number,Function],default:null},loadingContent:{type:String,default:e=>ra(e.theme,`loadingContent`)},targetNodes:{type:Function,required:!0}},data(){return{asyncContent:null}},computed:{isContentAsync(){return typeof this.content==`function`},loading(){return this.isContentAsync&&this.asyncContent==null},finalContent(){return this.isContentAsync?this.loading?this.loadingContent:this.asyncContent:this.content}},watch:{content:{handler(){this.fetchContent(!0)},immediate:!0},async finalContent(){await this.$nextTick(),this.$refs.popper.onResize()}},created(){this.$_fetchId=0},methods:{fetchContent(e){if(typeof this.content==`function`&&this.$_isShown&&(e||!this.$_loading&&this.asyncContent==null)){this.asyncContent=null,this.$_loading=!0;let e=++this.$_fetchId,t=this.content(this);t.then?t.then(t=>this.onResult(e,t)):this.onResult(e,t)}},onResult(e,t){e===this.$_fetchId&&(this.$_loading=!1,this.asyncContent=t)},onShow(){this.$_isShown=!0,this.fetchContent()},onHide(){this.$_isShown=!1}}}),so=[`innerHTML`],co=[`textContent`];function lo(e,t,n,r,i,a){let o=re(`PopperContent`),s=re(`Popper`);return P(),c(s,T({ref:`popper`},e.$attrs,{theme:e.theme,"target-nodes":e.targetNodes,"popper-node":()=>e.$refs.popperContent.$el,onApplyShow:e.onShow,onApplyHide:e.onHide}),{default:G(({popperId:t,isShown:n,shouldMountContent:r,skipTransition:i,autoHide:a,hide:s,handleResize:c,onResize:l,classes:d,result:f})=>[m(o,{ref:`popperContent`,class:D({"v-popper--tooltip-loading":e.loading}),"popper-id":t,theme:e.theme,shown:n,mounted:r,"skip-transition":i,"auto-hide":a,"handle-resize":c,classes:d,result:f,onHide:s,onResize:l},{default:G(()=>[e.html?(P(),u(`div`,{key:0,innerHTML:e.finalContent},null,8,so)):(P(),u(`div`,{key:1,textContent:V(e.finalContent)},null,8,co))]),_:2},1032,[`class`,`popper-id`,`theme`,`shown`,`mounted`,`skip-transition`,`auto-hide`,`handle-resize`,`classes`,`result`,`onHide`,`onResize`])]),_:1},16,[`theme`,`target-nodes`,`popper-node`,`onApplyShow`,`onApplyHide`])}const uo=Na(oo,[[`render`,lo]]),fo=`v-popper--has-tooltip`;function po(e,t){let n=e.placement;if(!n&&t)for(let e of ca)t[e]&&(n=e);return n||=ra(e.theme||`tooltip`,`placement`),n}function mo(e,t,n){let r,i=typeof t;return r=i===`string`?{content:t}:t&&i===`object`?t:{content:!1},r.placement=po(r,n),r.targetNodes=()=>[e],r.referenceNode=()=>e,r}let ho,go,_o=0;function vo(){if(ho)return;go=L([]),ho=s({name:`VTooltipDirectiveApp`,setup(){return{directives:go}},render(){return this.directives.map(e=>y(uo,{...e.options,shown:e.shown||e.options.shown,key:e.id}))},devtools:{hide:!0}});let e=document.createElement(`div`);document.body.appendChild(e),ho.mount(e)}function yo(e,t,n){vo();let r=L(mo(e,t,n)),i=L(!1),a={id:_o++,options:r,shown:i};return go.value.push(a),e.classList&&e.classList.add(fo),e.$_popper={options:r,item:a,show(){i.value=!0},hide(){i.value=!1}}}function bo(e){if(e.$_popper){let t=go.value.indexOf(e.$_popper.item);t!==-1&&go.value.splice(t,1),delete e.$_popper,delete e.$_popperOldShown,delete e.$_popperMountTarget}e.classList&&e.classList.remove(fo)}function xo(e,{value:t,modifiers:n}){let r=mo(e,t,n);if(!r.content||ra(r.theme||`tooltip`,`disabled`))bo(e);else{let i;e.$_popper?(i=e.$_popper,i.options.value=r):i=yo(e,t,n),typeof t.shown<`u`&&t.shown!==e.$_popperOldShown&&(e.$_popperOldShown=t.shown,t.shown?i.show():i.hide())}}const So={beforeMount:xo,updated:xo,beforeUnmount(e){bo(e)}};function Co(e){e.addEventListener(`mousedown`,To),e.addEventListener(`click`,To),e.addEventListener(`touchstart`,Eo,oa?{passive:!0}:!1)}function wo(e){e.removeEventListener(`mousedown`,To),e.removeEventListener(`click`,To),e.removeEventListener(`touchstart`,Eo),e.removeEventListener(`touchend`,Do),e.removeEventListener(`touchcancel`,Oo)}function To(e){let t=e.currentTarget;e.closePopover=!t.$_vclosepopover_touch,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}function Eo(e){if(e.changedTouches.length===1){let t=e.currentTarget;t.$_vclosepopover_touch=!0;let n=e.changedTouches[0];t.$_vclosepopover_touchPoint=n,t.addEventListener(`touchend`,Do),t.addEventListener(`touchcancel`,Oo)}}function Do(e){let t=e.currentTarget;if(t.$_vclosepopover_touch=!1,e.changedTouches.length===1){let n=e.changedTouches[0],r=t.$_vclosepopover_touchPoint;e.closePopover=Math.abs(n.screenY-r.screenY)<20&&Math.abs(n.screenX-r.screenX)<20,e.closeAllPopover=t.$_closePopoverModifiers&&!!t.$_closePopoverModifiers.all}}function Oo(e){let t=e.currentTarget;t.$_vclosepopover_touch=!1}const ko={beforeMount(e,{value:t,modifiers:n}){e.$_closePopoverModifiers=n,(typeof t>`u`||t)&&Co(e)},updated(e,{value:t,oldValue:n,modifiers:r}){e.$_closePopoverModifiers=r,t!==n&&(typeof t>`u`||t?Co(e):wo(e))},beforeUnmount(e){wo(e)}},Ao=na,jo=So,Mo=So,No=ko,Po=ko,Fo=ro,Io=io,Lo=ba,Ro=Za,zo=Qa,Bo=no,Vo=Ua,Ho=ao,Uo=uo;function Wo(e,t={}){e.$_vTooltipInstalled||(e.$_vTooltipInstalled=!0,ta(na,t),e.directive(`tooltip`,So),e.directive(`close-popper`,ko),e.component(`VTooltip`,ao),e.component(`VDropdown`,ro),e.component(`VMenu`,io))}const Go={version:`5.2.2`,install:Wo,options:na};var Ko=h({__name:`Dropdown`,props:w({value:{},thin:{type:Boolean,default:!0},flat:{type:Boolean,default:!0},disabled:{type:Boolean},icon:{},color:{},triggerClass:{},iconEnd:{},border:{type:Boolean},outline:{type:Boolean},round:{type:Boolean},placement:{default:`bottom-start`},disablePlacement:{type:Boolean,default:!1},noAutoFocus:{type:Boolean},autoHide:{type:Boolean,default:!0},triggers:{default:()=>[`click`]},showTriggers:{},hideTriggers:{},popperTriggers:{default:()=>[]},popperShowTriggers:{default:()=>[]},popperHideTriggers:{default:()=>[]},showGroup:{},delay:{}},{shown:{type:Boolean,default:!1},shownModifiers:{}}),emits:w([`show`,`hide`],[`update:shown`]),setup(e,{expose:t,emit:n}){let r=n,i=o(()=>{if(e.icon)return e.icon;if(!e.value)return`more_vert`}),a=L(),s=L(),l=ce(e,`shown`),u=()=>{var e;return(e=a.value)?.show()};function f(){var e,t;(e=s.value)?.focus(),(t=a.value)?.hide()}let{isMobile:p}=ET(),h=o(()=>e.disablePlacement&&p),g=o(()=>e.showTriggers===void 0?e.triggers:e.showTriggers),_=o(()=>e.hideTriggers===void 0?e.triggers.length===1&&e.triggers[0]===`click`?[`click`]:e.triggers.includes(`hover`)?[...e.triggers,`click`]:e.triggers:e.hideTriggers),v=o(()=>e.popperTriggers.length>0?e.popperTriggers:e.triggers.includes(`hover`)?[`hover`]:[]),y=o(()=>{let t=Array.isArray(e.popperShowTriggers)&&e.popperShowTriggers.length>0;if(t)return e.popperShowTriggers;if(e.triggers.includes(`hover`))return[`hover`]}),b=o(()=>{let t=Array.isArray(e.popperHideTriggers)&&e.popperHideTriggers.length>0;return t?e.popperHideTriggers:e.triggers.includes(`hover`)?[`hover`]:[]}),x=o(()=>e.autoHide),S=o(()=>e.delay===void 0?e.triggers.includes(`hover`)?{show:0,hide:10}:0:e.delay);return t({show:u,hide:f,shown:l}),(e,t)=>(P(),c(U(Fo),{ref_key:`ddownRef`,ref:a,shown:l.value,"onUpdate:shown":t[0]||=e=>l.value=e,disabled:e.disabled,noAutoFocus:e.noAutoFocus,"positioning-disabled":h.value,placement:e.placement,autoHide:x.value,delay:S.value,triggers:e.triggers,showTriggers:g.value,hideTriggers:_.value,popperTriggers:v.value,popperShowTriggers:y.value,popperHideTriggers:b.value,showGroup:e.showGroup,onHide:t[1]||=e=>r(`hide`),onShow:t[2]||=e=>r(`show`)},{popper:G(({hide:t,show:n,shown:r})=>[z(e.$slots,`default`,{hide:t,show:n,shown:r})]),default:G(()=>[d(`div`,{ref_key:`triggerRef`,ref:s},null,512),z(e.$slots,`trigger`,{show:u,hide:f,shown:l.value},()=>[m(U(J),{class:D(e.triggerClass),iconEnd:e.iconEnd,icon:i.value,value:e.value,thin:e.thin,flat:e.flat,outline:e.outline,round:e.round,color:e.color},null,8,[`class`,`iconEnd`,`icon`,`value`,`thin`,`flat`,`outline`,`round`,`color`])])]),_:3},8,[`shown`,`disabled`,`noAutoFocus`,`positioning-disabled`,`placement`,`autoHide`,`delay`,`triggers`,`showTriggers`,`hideTriggers`,`popperTriggers`,`popperShowTriggers`,`popperHideTriggers`,`showGroup`]))}}),qo=Ko;const Jo={class:`px-1 pt-025 pb-1`},Yo={class:`ms-1`};var Xo=h({__name:`FieldSetVue`,props:{label:{},legend:{}},setup(e){return(e,t)=>(P(),u(`fieldset`,Jo,[d(`legend`,Yo,V(e.legend||e.label),1),z(e.$slots,`default`,{},void 0,!0)]))}}),Zo=q(Xo,[[`__scopeId`,`data-v-f7e758e5`]]),Qo=h({__name:`Flag`,props:{country:{},size:{},circle:{type:Boolean},square:{type:Boolean}},setup(e){let t=e,n=o(()=>!!(t.circle||t.square)),r=o(()=>`${t.size||1}rem`),i=o(()=>{let e=t.country.toLowerCase();e===`ac`&&(e=`sh-ac`);let r=`https://cdn.jsdelivr.net/gh/lipis/flag-icons@7.0.0/flags`;return n.value?`url(${r}/1x1/${e.toLowerCase()}.svg)`:`url(${r}/4x3/${e.toLowerCase()}.svg)`});return(e,t)=>(P(),u(`span`,{class:D([`fi`,{fis:n.value,circle:e.circle}]),style:k({height:r.value,backgroundImage:i.value})},null,6))}}),$o=q(Qo,[[`__scopeId`,`data-v-f99f1900`]]),es={};xe(es,{arrField:()=>ys,bglForm:()=>hs,checkField:()=>cs,colorField:()=>_s,dateField:()=>us,emailField:()=>ls,findBglFieldById:()=>vs,frmRow:()=>fs,getBaseField:()=>ts,numField:()=>ds,rangeField:()=>ms,richText:()=>ns,selectField:()=>os,slctField:()=>ss,telField:()=>gs,txtField:()=>rs,uploadField:()=>ps,useForm:()=>bs});function ts(e,t={},n={}){return typeof t==`object`?{id:e,...t}:{id:e,label:t,...n}}function ns(e,t,n){return{$el:`richtext`,class:n?.class,required:n?.required,id:e,label:t,vIf:n?.vIf,transform:n?.transform,placeholder:n?.placeholder,attrs:{height:n?.height,autocomplete:n?.autocomplete}}}function rs(e,t,n){return{$el:`text`,id:e,label:t,class:n?.class,required:n?.required,placeholder:n?.placeholder,helptext:n?.helptext,disabled:n?.disabled,defaultValue:n?.defaultValue,vIf:n?.vIf,transform:n?.transform,attrs:{autocomplete:n?.autocomplete,pattern:n?.pattern,multiline:n?.multiline,autoheight:n?.autoheight,code:n?.code,rows:n?.rows,icon:n?.icon,iconStart:n?.iconStart,type:n?.type}}}function os(e,t,n,r){return{$el:`select`,id:e,label:t,class:r?.class,required:r?.required,helptext:r?.helptext,disabled:r?.disabled,defaultValue:r?.defaultValue,vIf:r?.vIf,transform:r?.transform,options:n,attrs:{...r?.attrs,searchable:r?.searchable,multiselect:r?.multiselect,clearable:r?.clearable}}}const ss=os;function cs(e,t,n){return{$el:`check`,id:e,label:t,class:n?.class,required:n?.required,helptext:n?.helptext,disabled:n?.disabled,defaultValue:n?.defaultValue,vIf:n?.vIf,transform:n?.transform,attrs:{...n?.attrs,value:n?.value}}}function ls(e,t,n){return{$el:`email`,id:e,label:t,class:n?.class,required:n?.required,vIf:n?.vIf,transform:n?.transform,attrs:{autocorrect:n?.autocorrect,serverValidate:n?.serverValidate,preventFakeEmails:n?.preventFakeEmails,pattern:n?.pattern}}}function us(e,t,n){return{$el:`date`,class:n?.class,required:n?.required,id:e,disabled:n?.disabled,label:t,defaultValue:n?.defaultValue,vIf:n?.vIf,transform:n?.transform,attrs:{disabled:n?.disabled,autocomplete:n?.autocomplete,enableTime:n?.enableTime,mode:n?.mode,locale:n?.locale,timezone:n?.timezone}}}function ds(e,t,n){return{$el:`number`,class:n?.class,required:n?.required,defaultValue:n?.defaultValue,id:e,label:t,disabled:n?.disabled,placeholder:n?.placeholder,helptext:n?.helptext,vIf:n?.vIf,transform:n?.transform,attrs:{autocomplete:n?.autocomplete,step:n?.step,min:n?.min,max:n?.max,layout:n?.layout,padZero:n?.padZero,center:n?.center,useGrouping:n?.useGrouping}}}function fs(...e){return{$el:`div`,class:`flex gap-1 m_block align-items-end`,children:e}}function ps(e,t,n){return{$el:`upload`,id:e,label:t,class:n?.class,required:n?.required,helptext:n?.helptext,disabled:n?.disabled,defaultValue:n?.defaultValue,vIf:n?.vIf,transform:n?.transform,attrs:{...n}}}function ms(e,t,n){return{$el:`range`,id:e,label:t,vIf:n?.vIf,transform:n?.transform,attrs:{autocomplete:n?.autocomplete,min:n?.min,max:n?.max,step:n?.step,rtl:n?.rtl,multiRange:n?.multiRange,formatValue:n?.formatValue}}}function hs(e,...t){return typeof e==`string`?{$el:`bagelform`,id:e,attrs:{schema:[e,...t]}}:{$el:`bagelform`,attrs:{schema:[e,...t]}}}function gs(e,t,n){return{$el:`tel`,id:e,label:t,vIf:n?.vIf,attrs:n,class:n?.class,transform:n?.transform}}function _s(e,t,n){return{$el:`color`,id:e,label:t,vIf:n?.vIf,attrs:n,class:n?.class,transform:n?.transform}}function vs(e,t){for(let n of t){if(n.id===e)return n;if(n.children&&Number(n.children.length)>0){let t=n.children.filter(e=>typeof e==`object`&&`$el`in e),r=vs(e,t);if(r)return r}}}function ys(e,t,n,r){let i=typeof n==`string`?{type:n}:{schema:n},a={delete:!0,add:!0,...r,...i};return{label:t,id:e,class:r?.class,$el:`array`,vIf:r?.vIf,transform:r?.transform,attrs:a}}function bs(){return{txtField:rs,selectField:os,checkField:cs,dateField:us,numField:ds,emailField:ls,frmRow:fs,uploadField:ps,rangeField:ms,bglForm:hs,telField:gs,colorField:_s,arrField:ys,richText:ns,findBglFieldById:vs,getBaseField:ts}}const xs=ne({defaultLang:``,availableLangs:[],lang:`en`});function Ss(e){return e?e[xs.lang]||e[xs.defaultLang]||``:(console.warn(`No language element provided for $tdb function`),``)}function Cs(){let e=o({get:()=>xs.lang,set:e=>xs.lang=e}),t=o({get:()=>xs.availableLangs,set:e=>xs.availableLangs=e}),n=o({get:()=>xs.defaultLang,set:e=>xs.defaultLang=e});return{lang:e,$tdb:Ss,availableLangs:t,defaultLang:n}}function ws(e,t){return t===`titleCase`?e.split(`_`).map(e=>e[0].toUpperCase()+e.slice(1).toLocaleLowerCase()).join(` `):t===`pascal`?e.split(`_`).map(e=>e[0].toUpperCase()+e.slice(1).toLocaleLowerCase()).join(``):t===`camel`?e.split(`_`).map((e,t)=>t===0?e:e[0].toUpperCase()+e.slice(1)).join(``):t===`snake`?[...e].map(e=>e===e.toUpperCase()?`_${e.toLowerCase()}`:e).join(``):e}const Ts=new Map;function Es(e,t=500){clearTimeout(Ts.get(e));let n=setTimeout(()=>{e(),Ts.delete(e)},t);Ts.set(e,n)}function Ds(e){return e.toLowerCase().replace(/[^a-z0-9-\s]/g,``).split(/[\s-]+/).join(`-`)}function Os(e){return e===void 0?e:e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)||e}async function ks(e,t){await navigator.clipboard.writeText(e),t&&t(`Copied to clipboard`)}function As(...e){return e=e.flatMap(e=>e.split(/\s/)),e.map(e=>e.charAt(0)).join(``)}function js(e,t){e.key===`Escape`&&t()}function Ms(e,t,...n){return n.map(n=>typeof n==`function`?n(e,t):n).join(` `)}function Ns(e,t,n){if(!e)return{};let r=[`class`,`onClick`],i=Object.entries(e).filter(([e])=>!r.includes(e)).map(([e,r])=>[e,typeof r==`function`?r(t,n):r]),a=Object.fromEntries(i);for(let t of r.slice(1))e[t]&&(a[t]=e[t]);return a}function Ps(e,t){var n;return e[`v-if`]===void 0?!0:typeof e[`v-if`]==`boolean`?e[`v-if`]:typeof e[`v-if`]==`string`?!0:typeof e[`v-if`]==`function`?(n=e[`v-if`])?.call(e,t?.[e.id],t):!0}function Fs(e,t){if(t)return e?e[t]:void 0}const Is=e=>!Number.isNaN(Date.parse(e));function Ls(e,t){let n=Array.from(new Set((e??[]).flatMap(Object.keys))),r=n.map(e=>({id:e,label:Os(e),transform:t=>{let n=[`created_at`,`updated_at`];return n.includes(e)?t&&new Date(t).toLocaleString():t}}));return t?r.filter(e=>t.includes(e.id)||!e.id):r}function Rs(e=100){return new Promise(t=>setTimeout(t,e))}const zs=new Map;async function Bs(e,t){let n=t?.id||e;if(await Rs(1),zs.has(n)){let e=zs.get(n);if(e)return e}if(t?.id&&document.getElementById(t.id)||document.querySelector(`script[src="${e}"]`))return Promise.resolve();let r=new Promise((r,i)=>{let a=document.createElement(`script`);a.src=e,t?.id&&(a.id=t.id),a.onload=()=>{r(),zs.delete(n)},a.onerror=e=>{i(Error(String(e))),zs.delete(n)},document.head.append(a)});return zs.set(n,r),r}function Vs(e){return new Promise((t,n)=>{if(document.querySelector(`link[href="${e}"]`)){t();return}let r=document.createElement(`link`);r.href=e,r.rel=`stylesheet`,r.onload=()=>{t()},r.onerror=n,document.head.append(r)})}function Hs(e){return e.startsWith(`https://`)?e:(e=e.replace(/http:\/\//,``),`https://${e}`)}function Us(e,t=`px`){return typeof e==`number`?`${e}${t}`:e}const Ws=`https://files.bagel.design`.replace(/\/$/,``),Gs=void 0,Ks=/^https?:\/\/|^\/\//;function qs(e){return!e||Ks.test(e)?e:e.startsWith(`static/`)?`${Gs}/${e}`:`${Ws}/${e}`}function Js(e,t,n=void 0){if(!t)return e;let r=t.split(/[.[]/),i=e;for(let e of r){if(!i||typeof i!=`object`||!(e in i))return n;i=i[e]}return i??n}const Ys=e=>e.replace(/http:\/\//,`//`);function Xs(e,t){let n=document.createElement(`a`);if(n.target=`_blank`,typeof e==`string`){n.href=Ys(e);let r=e.split(`/`).pop();n.download=t||r||`download`}else{let r=URL.createObjectURL(e);n.href=r,n.download=t||`download`,URL.revokeObjectURL(r)}document.body.appendChild(n),n.click(),document.body.removeChild(n)}var Zs=h({__name:`BagelForm`,props:{modelValue:{default:void 0},schema:{type:[Object,Function],default:void 0},tag:{default:`form`},class:{default:``},onSubmit:{}},emits:[`update:modelValue`],setup(e,{expose:t,emit:r}){let i=e,a=r,s=e=>e&&JSON.parse(JSON.stringify(e)),d=L(),f=L(s(i.modelValue??{})),p=L(s(i.modelValue??{})),m=L(`idle`),h=o(()=>H(i.schema)),g=o(()=>{try{return JSON.stringify(f.value)!==JSON.stringify(p.value)}catch{return!1}});j(()=>{i.modelValue&&(p.value=s(i.modelValue)),_()}),W(()=>i.modelValue,e=>{e!==void 0&&(f.value=s(e))},{immediate:!0,deep:!0});function _(){let e=h.value;if(!e)return;let t=e=>{for(let n of e){if(!n||typeof n!=`object`)continue;let e=typeof n.id==`string`&&n.id.length>0,r=Object.prototype.hasOwnProperty.call(n,`defaultValue`)&&n.defaultValue!==void 0;if(e&&r){let e=Js(f.value,n.id,void 0);(e===void 0||e===``)&&v({fieldId:n.id,value:n.defaultValue})}Array.isArray(n.children)&&n.children.length&&t(n.children)}};t(e)}W(h,()=>{_()},{deep:!0});function v({fieldId:e,value:t}){let n=e?.split(`.`)||[],r=s(f.value),i=r;for(let e=0;e<n.length-1;e++){let t=n[e];(!i[t]||typeof i[t]!=`object`)&&(i[t]={}),i=i[t]}i[n[n.length-1]]=t,f.value=r,a(`update:modelValue`,f.value)}let y=()=>{var e;return(e=d.value)?.reportValidity()??!1},b=()=>{var e;return(e=d.value)?.checkValidity()??!1},x=L();async function S(){try{var e;let t=y();if(!t||m.value===`submitting`)return;m.value=`submitting`,await(e=i.onSubmit)?.call(i,f.value),p.value=s(f.value),m.value=`success`,window.parent.postMessage({type:`BAGEL_FORM_SUCCESS`,data:JSON.stringify(f.value)},`*`)}catch(e){m.value=`error`,x.value=e,console.error(`Submit error:`,x.value)}}let{renderField:C}=dr({mode:`form`,getFormData:()=>f.value,onUpdateModelValue:(e,t)=>{var n;e.id&&(v({fieldId:e.id,value:t}),(n=e.onUpdate)?.call(e,t,f.value))}}),w=e=>C(e);function T(e){let t=e.target;if(t.name){let e=t.type===`checkbox`?t.checked:t.value;v({fieldId:t.name,value:e})}}return t({form:d,isDirty:g,validateForm:y,checkValidity:b}),(e,t)=>(P(),u(n,null,[m.value!==`success`||!e.$slots.success?(P(),u(n,{key:0},[i.tag===`form`?(P(),u(`form`,{key:0,ref_key:`form`,ref:d,class:D(i.class),onSubmit:ge(S,[`prevent`]),onInput:T},[h.value?(P(!0),u(n,{key:0},R(h.value,e=>(P(),c(ae(w(e)),{key:e.id}))),128)):z(e.$slots,`default`,{key:1}),z(e.$slots,`submit`,{submit:S,isDirty:g.value,validateForm:y,formState:m.value})],34)):(P(),u(n,{key:1},[h.value?(P(!0),u(n,{key:0},R(h.value,e=>(P(),c(ae(w(e)),{key:e.id,class:D(i.class)},null,8,[`class`]))),128)):l(``,!0)],64))],64)):l(``,!0),m.value===`success`?z(e.$slots,`success`,{key:1}):l(``,!0),m.value===`error`?z(e.$slots,`error`,{key:2,error:x.value}):l(``,!0)],64))}}),Qs=Zs;const $s={class:`bgl-multi-step-form`},ec={key:0,class:`bgl-step-progress`},tc={class:`bgl-steps-indicator`},nc=[`onClick`],rc={key:0,class:`bgl-step-label`},ic={class:`bgl-form-wrapper`},ac={class:`bgl-step-controls`};var oc=h({__name:`BglMultiStepForm`,props:w({bagelFormProps:{default:()=>({})},schema:{},showProgress:{type:Boolean,default:!1},rtl:{type:Boolean,default:!1},stepLabels:{},allowStepNavigation:{type:Boolean,default:!1},validateOnSteps:{type:Boolean,default:!0},direction:{default:`auto`}},{modelValue:{default:()=>({}),required:!0},modelModifiers:{}}),emits:w([`submit`,`stepChange`],[`update:modelValue`]),setup(e,{expose:t,emit:r}){var a;let s=e,p=r,h=L(),g=ce(e,`modelValue`),_=L(0),y=L(0),b=L([]);function x(){if(!h.value)return!1;let e=h.value.validateForm();return e&&!b.value.includes(_.value)&&b.value.push(_.value),e}let S=o(()=>IT({schema:H(s.schema)})),C=o(()=>{let e=S.value;return e.filter((e,t)=>{if(e.vIf!==void 0||e[`v-if`]!==void 0){let t=e.vIf??e[`v-if`];if(typeof t==`function`)return t(void 0,g.value);if(typeof t==`boolean`)return t;if(typeof t==`string`)return!!t}return!0})}),w=o(()=>C.value.length),k=o(()=>{let e=[];return S.value.forEach((t,n)=>{let r=t.vIf??t[`v-if`],i=!0;r!==void 0&&(typeof r==`function`?i=r(void 0,g.value):typeof r==`boolean`?i=r:typeof r==`string`&&(i=!!r)),i&&e.push(n)}),e}),A=o(()=>{let e=k.value[_.value];return[S.value[e]]}),j=L(s.rtl?`right`:`left`);W(()=>_.value,(e,t)=>{s.direction===`auto`?j.value=s.rtl?e>t?`right`:`left`:e>t?`left`:`right`:j.value=s.direction,y.value=t,p(`stepChange`,{newStep:e,oldStep:t,totalSteps:w.value,direction:j.value})});let M=o(()=>_.value===w.value-1),N=o(()=>e=>b.value.includes(e)),ee=L(!1);async function F(){var e;await E(),s.validateOnSteps?ee.value=(e=h.value)?.checkValidity()??!1:ee.value=!0}function I(){_.value>0&&_.value--}let te=L();async function ne(){s.validateOnSteps&&x()===!1||(M.value||_.value++,await Rs(400),F())}async function re(e){if(e<_.value||b.value.includes(e))return _.value=e,!0;if(e>_.value){if(s.validateOnSteps&&x()===!1)return!1;for(let n=_.value+1;n<=e;n++)if(_.value=n,await E(),await Rs(100),s.validateOnSteps){var t;let e=(t=h.value)?.checkValidity()??!1;if(e)b.value.includes(n)||b.value.push(n);else return!1}return!0}return!1}function ie(){x()!==!1&&p(`submit`,g.value)}function ae(){b.value=[],_.value=0}return W(()=>g.value,()=>{F(),_.value>=w.value&&w.value>0&&(_.value=0)},{deep:!0}),t({submit:ie,validateForm:x,checkValidity:(a=h.value)?.checkValidity,isDirty:o(()=>{var e;return(e=h.value)?.isDirty}),reset:ae,isLastStep:M,goToStep:re,currentStep:_,totalSteps:o(()=>w.value),isStepValid:ee,nextStep:ne,prevStep:I}),(e,t)=>(P(),u(`div`,$s,[e.showProgress?(P(),u(`div`,ec,[z(e.$slots,`progress`,O(v({currentStep:_.value,totalSteps:w.value,goToStep:re,stepLabels:s.stepLabels,allowStepNavigation:s.allowStepNavigation,isStepValidated:N.value})),()=>[d(`div`,tc,[(P(!0),u(n,null,R(w.value,(e,t)=>(P(),u(`div`,{key:t,class:D([`bgl-step-indicator`,[{active:t===_.value},{completed:t<_.value||N.value(t)},{clickable:s.allowStepNavigation}]]),onClick:e=>s.allowStepNavigation&&re(t)},[d(`span`,null,V(t+1),1),s.stepLabels&&s.stepLabels[t]?(P(),u(`span`,rc,V(s.stepLabels[t]),1)):l(``,!0)],10,nc))),128))])],!0)])):l(``,!0),d(`div`,ic,[m(i,{name:j.value===`right`?`slide-right`:`slide-left`,mode:`out-in`},{default:G(()=>[(P(),u(`div`,{key:_.value,ref_key:`formContainer`,ref:te,class:`bgl-form-container`},[m(U(Qs),T({ref_key:`formRef`,ref:h,modelValue:g.value,"onUpdate:modelValue":t[0]||=e=>g.value=e,schema:A.value},e.bagelFormProps),f({_:2},[e.$slots.success?{name:`success`,fn:G(()=>[z(e.$slots,`success`,{},void 0,!0)]),key:`0`}:void 0,e.$slots.error?{name:`error`,fn:G(()=>[z(e.$slots,`error`,{},void 0,!0)]),key:`1`}:void 0]),1040,[`modelValue`,`schema`])]))]),_:3},8,[`name`]),d(`div`,ac,[z(e.$slots,`steppers`,O(v({prevStep:I,nextStep:ne,submit:ie,currentStep:_.value,totalSteps:w.value,isLastStep:M.value,isStepValid:ee.value})),()=>[_.value===0?l(``,!0):(P(),c(U(J),{key:0,color:`gray`,icon:`arrow_back`,onClick:I})),M.value?(P(),c(U(J),{key:2,value:`Submit`,onClick:ie})):(P(),c(U(J),{key:1,icon:`arrow_forward`,disabled:s.validateOnSteps&&!ee.value,onClick:ne},null,8,[`disabled`]))],!0)])])]))}}),sc=q(oc,[[`__scopeId`,`data-v-1e915d1e`]]);const cc={key:0,class:`label mb-05`},lc={class:`ps-025 border-start mb-05`},uc={key:0,class:`flex-center h-300px`},dc={key:1,class:`py-1`},fc={key:0,class:`minimizedText txt14 p-025 opacity-7`},pc={class:`bg-gray-80 -my-05 px-025 pt-065 pb-05 txt-center space-between flex column`};var mc=h({__name:`FieldArray`,props:{el:{default:`div`},id:{},label:{},placeholder:{},children:{},class:{type:[String,Number,Boolean,Object,Function]},attrs:{},required:{type:Boolean},disabled:{type:Boolean},helptext:{},options:{},defaultValue:{},add:{type:Boolean,default:!0},delete:{type:Boolean,default:!0},transform:{},schema:{},modelValue:{},type:{default:`object`}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t,a=Qs,s=L([]),f=L(r.modelValue||[]),p=L(`loaded`),m=o(()=>r.type===`text`?[{id:`value`,type:`text`,label:``,$el:`text`}]:r.type===`number`?[{id:`value`,type:`number`,label:``,$el:`number`}]:[]),h=o(()=>r.type===`object`?H(r.schema):m.value);W(()=>r.modelValue,e=>{f.value=e||[]},{deep:!0});function g(){i(`update:modelValue`,f.value)}function _(e){f.value.splice(e,1),g()}function v(){let e={text:``,number:0,object:{}};f.value.push(e[r.type]),g()}function y(e){s.value[e]=!s.value[e]}function b(e,t){r.type===`text`||r.type===`number`?f.value[e]=r.type===`number`?Number(t.value):t.value:f.value[e]=t,g()}let x=o(()=>r.type===`text`||r.type===`number`),S=o(()=>{var e;return x.value||r.type===`object`&&Number((e=h.value)?.length)>0}),C=o(()=>{var e,t;return Number((e=h.value)?.length)>2||(t=h.value)?.some(e=>e.$el===`richtext`)});return(e,t)=>(P(),u(`div`,{class:D(r.class)},[e.label?(P(),u(`p`,cc,V(e.label),1)):l(``,!0),d(`div`,lc,[p.value===`loaded`?S.value?(P(),u(n,{key:2},[(P(!0),u(n,null,R(f.value,(t,n)=>(P(),u(`div`,{key:n,outline:``,thin:``,class:D([`mb-05 itemBox transition ps-05 pb-025 pt-025 radius-05 gap-05 overflow-hidden`,{minimized:s.value[n]}])},[s.value[n]?(P(),u(`p`,fc,V(e.label)+` `+V(n+1),1)):(P(),c(U(a),{key:1,"model-value":x.value?{value:t}:t,schema:U(h),"onUpdate:modelValue":e=>b(n,e)},null,8,[`model-value`,`schema`,`onUpdate:modelValue`])),d(`div`,pc,[C.value?(P(),c(U(J),{key:0,class:`block rotate-180 txt10 opacity-7 p-025`,flat:``,thin:``,icon:`keyboard_arrow_down`,onClick:e=>y(n)},null,8,[`onClick`])):l(``,!0),r.delete?(P(),c(U(J),{key:1,icon:`delete`,class:`txt10 opacity-7`,thin:``,flat:``,onClick:e=>_(n)},null,8,[`onClick`])):l(``,!0)])],2))),128)),e.add?(P(),c(U(J),{key:0,thin:``,icon:`add`,color:`gray`,class:`txt12 arrayAddButton`,onClick:v},{default:G(()=>[d(`p`,null,V(e.label),1)]),_:1})):l(``,!0)],64)):(P(),u(`div`,dc,t[0]||=[d(`p`,{class:`opacity-7`},` No schema available `,-1)])):(P(),u(`div`,uc,[p.value===`loading`?(P(),c(U(IC),{key:0})):p.value===`error`?(P(),c(U($),{key:1,icon:`error`,color:`red`})):l(``,!0)]))])],2))}}),hc=mc;const gc={class:`primary-checkbox`};var _c=h({__name:`Checkbox`,props:{modelValue:{type:Boolean,default:!1},modelModifiers:{}},emits:[`update:modelValue`],setup(e){let t=ce(e,`modelValue`);return(e,n)=>(P(),u(`label`,gc,[z(e.$slots,`label`,{},void 0,!0),K(d(`input`,{"onUpdate:modelValue":n[0]||=e=>t.value=e,type:`checkbox`},null,512),[[ue,t.value]])]))}}),vc=q(_c,[[`__scopeId`,`data-v-73f1d9ad`]]);const yc=[`title`],bc=[`id`,`disabled`,`value`,`required`],xc=[`for`];var Sc=h({__name:`CheckInput`,props:w({label:{},id:{},title:{},small:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean},defaultValue:{default:!1},value:{}},{modelValue:{default:void 0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=o(()=>e.id||Math.random().toString(36).slice(7)),n=ce(e,`modelValue`);return j(()=>{n.value===void 0&&(n.value=e.defaultValue)}),(e,r)=>(P(),u(`div`,{class:D([`bagel-input bgl-checkbox align-items-center ps-025`,{small:e.small}]),title:e.title},[K(d(`input`,{id:t.value+e.value,"onUpdate:modelValue":r[0]||=e=>n.value=e,disabled:e.disabled,value:e.value,required:e.required,type:`checkbox`,class:`me-05`},null,8,bc),[[ue,n.value]]),d(`label`,{for:t.value+e.value},[z(e.$slots,`label`,{},()=>[p(V(e.label),1)],!0)],8,xc)],10,yc))}}),Cc=q(Sc,[[`__scopeId`,`data-v-083702e1`]]);function wc(e=`dark`){let t=L(null),n=L(!1),r=L(e),i=e=>e===`dark`?`atom-one-dark`:e===`light`?`atom-one-light`:e,a=e=>`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.0/styles/${e}.min.css`,o=()=>{document.querySelectorAll(`link[rel="stylesheet"]`).forEach(e=>{if(e instanceof HTMLLinkElement&&e.href.includes(`/styles/`)){var t;e.href.includes(`highlight.js`)&&(t=e.parentElement)?.removeChild(e)}})},s=async e=>{let t=i(e);if(t!==r.value)try{o();let e=a(t);console.log(`setTheme`,e),await Vs(e),r.value=t}catch(e){console.error(`Failed to apply theme. Falling back to atom-one-dark:`,e),o(),r.value=`atom-one-dark`;let t=a(r.value);await Vs(t)}},c=async()=>{if(!n.value)try{await Bs(`https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.11.0/highlight.min.js`,{id:`hljs-cdn`}),await s(r.value),window.hljs?(t.value=window.hljs,n.value=!0):console.error(`Failed to load highlight.js`)}catch(e){console.error(`Error loading highlight.js:`,e)}},l=e=>e.replace(/[&<>"']/g,e=>{let t={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};return t[e]||``}),u=(e,n,r=!0,i=!0)=>{if(!t.value)return l(e);try{let a=n||``;if(a&&!r&&!t.value.getLanguage(a))return console.warn(`The language "${a}" is not available.`),l(e);let o=r?t.value.highlightAuto(e):t.value.highlight(e,{language:a,ignoreIllegals:i});return o.value||l(e)}catch(t){return console.error(`Highlighting error:`,t),l(e)}};return{hljs:t,loaded:n,loadHighlight:c,setTheme:s,currentTheme:r,escapeHtml:l,highlightCode:u}}const Tc={key:0,class:`label`},Ec={class:`editor-content-papa relative`},Dc={class:`code-display`,wrap:``},Oc=[`innerHTML`],kc=[`value`];var Ac=h({__name:`Index`,props:{language:{type:String,default:`html`},readonly:{type:Boolean,default:!1},modelValue:{type:String,default:``},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0},label:{type:String,default:``},height:{type:String,default:`240px`},disabled:{type:Boolean,default:!1},theme:{type:String,default:`dark`}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=L(n.modelValue||``),a=L(),{loaded:s,loadHighlight:c,highlightCode:f,setTheme:p}=wc(n.theme),m=o(()=>{let e=n.height??`240px`;return e.match(/^\d+$/)?`${e}px`:e}),h=o(()=>f(i.value,n.language,n.autodetect,n.ignoreIllegals));function g(e){let t=e.target;i.value=t.value,r(`update:modelValue`,i.value)}function _(e){if(e.key!==`Tab`)return;e.preventDefault();let t=e.target,n=t.selectionStart,a=t.selectionEnd,o=`${i.value.substring(0,n)} ${i.value.substring(a)}`;i.value=o,r(`update:modelValue`,i.value),setTimeout(()=>{t.selectionStart=t.selectionEnd=n+2},0)}return j(async()=>{await c()}),W(()=>n.theme,e=>{p(e)}),W(()=>n.modelValue,e=>{e!==void 0&&e!==i.value&&(i.value=e)},{immediate:!0}),(t,n)=>(P(),u(`div`,{class:`code-editor-container ltr`,style:k({maxHeight:m.value})},[e.label?(P(),u(`label`,Tc,V(e.label),1)):l(``,!0),U(s)?(P(),u(`div`,{key:1,ref_key:`editorRef`,ref:a,class:`code-editor-grandpa hljs`},[d(`div`,Ec,[d(`pre`,Dc,[d(`code`,{innerHTML:h.value},null,8,Oc)]),!e.readonly&&!e.disabled?(P(),u(`textarea`,{key:0,value:i.value,class:`code-input`,spellcheck:`false`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,onInput:g,onKeydown:_},null,40,kc)):l(``,!0)])],512)):l(``,!0)],4))}}),jc=q(Ac,[[`__scopeId`,`data-v-206c54b2`]]);const Mc=[`title`],Nc={class:`flex bg-input rounded px-025 colorInputPickWrap`},Pc=[`id`,`placeholder`,`required`];var Fc=h({__name:`ColorInput`,props:{label:{},id:{},placeholder:{},modelValue:{},editMode:{type:Boolean,default:!0},small:{type:Boolean},required:{type:Boolean},nativeInputAttrs:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=L(n.modelValue);return W(()=>i.value,e=>{r(`update:modelValue`,e)}),(e,t)=>(P(),u(`div`,{class:D([`bagel-input`,{small:e.small}]),title:e.label},[d(`label`,null,[p(V(e.label)+` `,1),d(`div`,Nc,[K(d(`input`,T({id:e.id,"onUpdate:modelValue":t[0]||=e=>i.value=e,class:[`border`,{"no-edit":!e.editMode,"opacity-1":!i.value}],type:`color`,placeholder:e.placeholder||e.label,required:e.required},e.nativeInputAttrs),null,16,Pc),[[pe,i.value]]),K(d(`input`,{"onUpdate:modelValue":t[1]||=e=>i.value=e,class:`flex-grow-1 border colorInputPick`,type:`text`,placeholder:`Enter color`},null,512),[[pe,i.value]]),m(U(J),{class:D({"not-allowed opacity-3":!i.value}),round:``,flat:``,thin:``,icon:`clear`,onClick:t[2]||=e=>i.value=``},null,8,[`class`])])])],10,Mc))}}),Ic=Fc;const Lc=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/,Rc=/^\d{4}-\d{2}-\d{2}$/;let zc=function(e){return e.REGULAR=`regular`,e.SHORTENED=`shortened`,e.FLEXIBLE=`flexible`,e}({}),Bc=function(e){return e[e.MIDNIGHT=0]=`MIDNIGHT`,e[e.ONE_AM=100]=`ONE_AM`,e[e.TWO_AM=200]=`TWO_AM`,e[e.THREE_AM=300]=`THREE_AM`,e[e.FOUR_AM=400]=`FOUR_AM`,e[e.FIVE_AM=500]=`FIVE_AM`,e[e.SIX_AM=600]=`SIX_AM`,e[e.SEVEN_AM=700]=`SEVEN_AM`,e[e.EIGHT_AM=800]=`EIGHT_AM`,e[e.NINE_AM=900]=`NINE_AM`,e[e.TEN_AM=1e3]=`TEN_AM`,e[e.ELEVEN_AM=1100]=`ELEVEN_AM`,e[e.TWELVE_PM=1200]=`TWELVE_PM`,e[e.ONE_PM=1300]=`ONE_PM`,e[e.TWO_PM=1400]=`TWO_PM`,e[e.THREE_PM=1500]=`THREE_PM`,e[e.FOUR_PM=1600]=`FOUR_PM`,e[e.FIVE_PM=1700]=`FIVE_PM`,e[e.SIX_PM=1800]=`SIX_PM`,e[e.SEVEN_PM=1900]=`SEVEN_PM`,e[e.EIGHT_PM=2e3]=`EIGHT_PM`,e[e.NINE_PM=2100]=`NINE_PM`,e[e.TEN_PM=2200]=`TEN_PM`,e[e.ELEVEN_PM=2300]=`ELEVEN_PM`,e[e.TWELVE_AM=2400]=`TWELVE_AM`,e}({});var Vc=class{static getBrowserNavigatorLocale(){return typeof navigator==`object`?navigator.languages&&navigator.languages.length?navigator.languages[0]:navigator.language:`en-US`}static hasSlotContent(e){return e?e().some(e=>e.type===t||Array.isArray(e.children)&&!e.children.length?!1:e.type!==r||typeof e.children==`string`&&e.children.trim()!==``):!1}static getEventType(e,t){let n=Lc.test(e.time.start)&&Lc.test(e.time.end),r=Rc.test(e.time.start)&&Rc.test(e.time.end);if(n)return this.getTimedEventType(e,t);if(r)return this.getFullDayEventType(e,t);throw Error(`Event has invalid type`)}static getTimedEventType(e,t){if(t.dateStringsHaveEqualDates(e.time.start,e.time.end))return`SINGLE_DAY_TIMED`;if(t.dayMode===zc.FLEXIBLE){let n=t.setHourInDateTimeString(t.addDaysToDateTimeString(1,t.dateStringFrom(e.time.start)),Uc.getHourFromTimePoints(t.DAY_END));if(e.time.end<n)return`SINGLE_HYBRID_DAY_TIMED`}return`MULTI_DAY_TIMED`}static getFullDayEventType(e,t){return t.dateStringsHaveEqualDates(e.time.start,e.time.end)?`SINGLE_DAY_FULL_DAY`:`MULTI_DAY_FULL_DAY`}static isUIEventTouchEvent(e){return`touches`in e&&typeof e.touches==`object`}};let Hc=function(e){return e.SUNDAY=`sunday`,e.MONDAY=`monday`,e}({});var Uc=class t{constructor(n=Hc.MONDAY,r=null,i={start:0,end:2400}){e.defineProperty(this,`FIRST_DAY_OF_WEEK`,void 0),e.defineProperty(this,`CALENDAR_LOCALE`,void 0),e.defineProperty(this,`ALL_HOURS`,[0,100,200,300,400,500,600,700,800,900,1e3,1100,1200,1300,1400,1500,1600,1700,1800,1900,2e3,2100,2200,2300]),e.defineProperty(this,`DAY_START`,void 0),e.defineProperty(this,`DAY_END`,void 0),e.defineProperty(this,`HOURS_PER_DAY`,24),e.defineProperty(this,`MS_PER_DAY`,void 0),this.FIRST_DAY_OF_WEEK=n,this.CALENDAR_LOCALE=r||Vc.getBrowserNavigatorLocale(),this.DAY_START=i.start,this.DAY_END=i.end,this.HOURS_PER_DAY=(()=>{let e=t.getHourFromTimePoints(this.DAY_END),n=t.getHourFromTimePoints(this.DAY_START);return e>n?e-n:this.HOURS_PER_DAY-n+e})(),this.MS_PER_DAY=864e5}get dayMode(){return this.DAY_START===0&&this.DAY_END===2400?zc.REGULAR:this.DAY_START>=this.DAY_END?zc.FLEXIBLE:zc.SHORTENED}getDatesBetweenTwoDates(e,t){let n=[],r=new Date(e);for(;r<=t;)n.push(new Date(r.getFullYear(),r.getMonth(),r.getDate())),r.setDate(r.getDate()+1);return n}getCalendarWeekDateObjects(e){let t;t=this.FIRST_DAY_OF_WEEK===`sunday`?e.getDay():e.getDay()===0?6:e.getDay()-1;let n=e.getDate()-t,r=new Date(e.getFullYear(),e.getMonth(),n);return this.getDatesBetweenTwoDates(r,new Date(r.getFullYear(),r.getMonth(),r.getDate()+6))}getCalendarMonthSplitInWeeks(e,t){let n=[],r=new Date(e,t,1),i=new Date(r.getFullYear(),r.getMonth(),1),a=this.getCalendarWeekDateObjects(i);n.push(a);let o=!0,s=a[0],c=r.getMonth();for(;o;){let e=new Date(s.getFullYear(),s.getMonth(),s.getDate()+7);e.getMonth()===c?(n.push(this.getCalendarWeekDateObjects(e)),s=e):o=!1}return n}getCalendarYearMonths(e){let t=[],n=0;for(;n<=11;)t.push(new Date(e,n,1)),n++;return t}getHourAndMinutesFromTimePoints(e){let t=e.toString(),n=`0`,r=`0`;return t.length===4?(n=t[0]+t[1],r=t[2]+t[3]):t.length===3&&(n=t[0],r=t[1]+t[2]),{hour:+n,minutes:+r}}getHourLocaleStringFromHourDigits(e){let{hour:t,minutes:n}=this.getHourAndMinutesFromTimePoints(e),r=new Date(2100,0,1,+t,+n,0).toLocaleTimeString(this.CALENDAR_LOCALE,{hour:`2-digit`});return r[0]===`0`?r.substring(1):r}getLocalizedNameOfWeekday(e,t=`short`){return e.toLocaleDateString(this.CALENDAR_LOCALE,{weekday:t})}getLocalizedNameOfMonth(e,t=`short`){return e.toLocaleDateString(this.CALENDAR_LOCALE,{month:t})}getLocalizedDateString(e){return e.toLocaleDateString(this.CALENDAR_LOCALE)}getDateTimeStringFromDate(e,t){let n=e.getFullYear(),r=e.getMonth()+1,i=e.getDate(),a=`${n}-${r>=10?r:`0${r}`}-${i>=10?i:`0${i}`}`;if(!t){let t=e.getHours(),n=e.getMinutes();return`${a} ${t>=10?t:`0${t}`}:${n>=10?n:`0${n}`}`}let o=t===`start`?`00:00`:`23:59`;return`${a} ${o}`}getLocalizedTime(e){let{year:t,month:n,date:r,hour:i,minutes:a}=this.getAllVariablesFromDateTimeString(e),o=new Date(t,n,r,i,a);return o.toLocaleTimeString(this.CALENDAR_LOCALE,{hour:`numeric`,minute:`numeric`})}getLocalizedHour(e){return e.toLocaleTimeString(this.CALENDAR_LOCALE,{hour:`2-digit`})}getLocalizedTimeRange(e,t){return`${this.getLocalizedTime(e)} - ${this.getLocalizedTime(t)}`}getAllVariablesFromDateTimeString(e){return{year:+e.substring(0,4),month:e.substring(5,7)-1,date:+e.substring(8,10),hour:this.hourFrom(e),minutes:this.minutesFrom(e)}}dateIsToday(e){let t=new Date,n=t.getFullYear(),r=t.getMonth(),i=t.getDate(),a=e.getFullYear(),o=e.getMonth(),s=e.getDate();return n===a&&r===o&&i===s}dateIsInWeek(e,t){let n=new Date(e),r=n.getDate(),i=n.getMonth(),a=n.getFullYear();for(let e of t){let t=r===e.getDate(),n=i===e.getMonth(),o=a===e.getFullYear();if(t&&n&&o)return!0}return!1}getDateStringFromDate(e){let t=e.getFullYear(),n=e.getMonth()+1,r=e.getDate();return`${t}-${n>=10?n:`0${n}`}-${r>=10?r:`0${r}`}`}addMinutesToDateTimeString(e,t){let{year:n,month:r,date:i,hour:a,minutes:o}=this.getAllVariablesFromDateTimeString(t),s=new Date(n,r,i,a,o),c=new Date(s.getTime()+e*6e4);return this.getDateTimeStringFromDate(c)}addDaysToDateTimeString(e,t){return this.addMinutesToDateTimeString(e*1440,t)}dateStringsHaveEqualDates(e,t){let{year:n,month:r,date:i}=this.getAllVariablesFromDateTimeString(e),{year:a,month:o,date:s}=this.getAllVariablesFromDateTimeString(t);return n===a&&r===o&&i===s}setDateToEndOfDay(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59,59,999)}turnMinutesIntoPercentageOfHour(e){let t=100/60,n=t*e;return n<10?`0${n}`:n.toString()}getPercentageOfDayFromDateTimeString(e,t,n){let r=this.hourFrom(e),i=r*100,a=+e.substring(14,16),o=+this.turnMinutesIntoPercentageOfHour(+a);if(n>t){let e=n-t,r=i+o,a=r-t;return a/e*100}let s=Bc.TWELVE_AM-t,c=s+n,l=i+o,u=l>=t?l-t:s+l;return u/c*100}getTimeFromClick(e,t){if(t<=0)throw Error(`weekHeight cannot be a negative number`);if(e<0)throw Error(`clickOffsetY cannot be a negative number`);let n=this.DAY_START/100,r=t/this.HOURS_PER_DAY,i=Math.floor(e%r/(r/60));if(this.DAY_END<=this.DAY_START){let n=this.DAY_END/100,a=n*r,o=t-a;if(e>o){let t=Math.floor((e-o)/r);return`${this.doubleDigit(t)}:${this.doubleDigit(i)}`}}let a=Math.floor(e/r)+n;return`${this.doubleDigit(a)}:${this.doubleDigit(i)}`}setSegmentOfDateTimeString(e,t){if(t.hour<0||t.hour>23)throw Error(`Invalid hour`);let n=this.doubleDigit(t.hour);return e=e.replace(/\d{2}:/,`${n}:`),e}isTrailingOrLeadingDate(e,t){let n=new Date(e),r=n.getMonth();return t!==r}static getTimePointsFromHour(e){if(e<0||e>24||e%1!=0)throw Error(`Invalid day boundary`);return e===0?e:e*100}static getHourFromTimePoints(e){if(e<0||e>2400||e%100!=0)throw Error(`Invalid time points`);return e===0?e:e/100}getTimelineHours(){return this.dayMode===zc.FLEXIBLE?[...this.ALL_HOURS.filter(e=>e>=this.DAY_START),...this.ALL_HOURS.filter(e=>e<this.DAY_END)]:this.ALL_HOURS.filter(e=>e>=this.DAY_START&&e<this.DAY_END)}dateStringFrom(e){return e.substring(0,10)}timeStringFrom(e){return e.substring(11,16)}hourFrom(e){return+e.substring(11,13)}minutesFrom(e){return+e.substring(14,16)}areDaysConsecutive(e,t){let n=this.dateStringFrom(this.addDaysToDateTimeString(1,e));return n===this.dateStringFrom(t)}setHourInDateTimeString(e,t){let n=this.doubleDigit(t);return e=e.replace(/\d{2}:/,`${n}:`),e}setMinutesInDateTimeString(e,t){let n=this.doubleDigit(t);return e=e.replace(/:\d{2}/,`:${n}`),e}getDateTimeStringDayBoundariesFrom(e){if(this.DAY_END<=this.DAY_START){let t=this.addDaysToDateTimeString(1,e),n=this.setHourInDateTimeString(t,this.getHourAndMinutesFromTimePoints(this.DAY_END).hour),r=this.setHourInDateTimeString(e,this.getHourAndMinutesFromTimePoints(this.DAY_START).hour);return{start:r,end:n}}let t=this.setHourInDateTimeString(e,this.getHourAndMinutesFromTimePoints(this.DAY_START).hour),n;return this.DAY_END===Bc.TWELVE_AM?(n=this.setHourInDateTimeString(e,23),n=this.setMinutesInDateTimeString(n,59)):n=this.setHourInDateTimeString(e,this.getHourAndMinutesFromTimePoints(this.DAY_END).hour),{start:t,end:n}}doubleDigit(e){if(e<0||e>60)throw Error(`Invalid number. This is not a valid hour or minute`);return e<10?`0${e}`:String(e)}};const Wc={class:`calendar-section m_border-none px-05 pb-05 pt-025 m_p-0`},Gc={class:`flex space-between pb-1`},Kc={class:`flex gap-05`},qc={class:`month-year`},Jc={key:0,class:`calendar-grid grid gap-025`},Yc=[`disabled`,`onClick`],Xc={key:1,class:`month-grid grid gap-05 p-05`},Zc={key:2,class:`year-grid grid gap-05 p-0`},Qc={key:0,class:`time-picker border-start flex column gap-1 w-120px px-025`},$c={class:`flex gap-025`};var el=h({__name:`DatePicker`,props:{modelValue:{},min:{},max:{},mode:{default:()=>({mode:`day`})},firstDayOfWeek:{default:Hc.SUNDAY},locale:{default:``},enableTime:{type:Boolean,default:!1},highlightedDates:{},disabledDates:{},autoSize:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t,a=o(()=>H(r.highlightedDates)),s=o(()=>H(r.disabledDates)),f=L(new Date),h=L(`days`),g=new Uc(r.firstDayOfWeek,r.locale);function _(e){if(!e)return null;let t=typeof e==`string`?new Date(e):e;return Number.isNaN(t.getTime())?null:t}function v(){let e=e=>{if(!e)return!0;let t=_(r.min),n=_(r.max);if(t&&e<t||n&&e>n)return!0;if(Array.isArray(s.value)&&s.value.length>0){let t=s.value.some(t=>{let n=_(t);return n?e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate():!1});if(t)return!0}return!1},t=e=>{let t=_(r.min),n=_(r.max);return!!(t&&e<t.getFullYear()||n&&e>n.getFullYear())};return{isDateDisabled:e,isYearDisabled:t}}function y(){let e=o(()=>_(r.modelValue));return{selectedDate:e}}let{isDateDisabled:b,isYearDisabled:x}=v(),{selectedDate:S}=y();function C(){let e=o(()=>{let e=f.value.getFullYear(),t=f.value.getMonth(),n=g.getCalendarMonthSplitInWeeks(e,t);for(;n.length<6;){let e=n[n.length-1],t=e[e.length-1],r=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1),i=g.getCalendarWeekDateObjects(r);n.push(i)}return n.flat()}),t=o(()=>({month:f.value.getMonth(),year:f.value.getFullYear(),formatted:{month:g.getLocalizedNameOfMonth(f.value,`long`),year:g.getLocalizedDateString(f.value).split(`/`).pop()}})),n=o(()=>Array.from({length:12},(e,n)=>{let r=new Date(t.value.year,n,1);return{name:g.getLocalizedNameOfMonth(r,`short`),value:n,disabled:b(r)}})),i=o(()=>{let e=t.value.year-10;return Array.from({length:18},(t,n)=>({value:e+n,disabled:x(e+n)}))}),s=o(()=>{let e=new Date;return e.setDate(e.getDate()-e.getDay()+(r.firstDayOfWeek===Hc.MONDAY?1:0)),Array.from({length:7},(t,n)=>{let r=new Date(e);return r.setDate(e.getDate()+n),g.getLocalizedNameOfWeekday(r,`short`)})}),c=e=>!e||!S.value?!1:e.getFullYear()===S.value.getFullYear()&&e.getMonth()===S.value.getMonth()&&e.getDate()===S.value.getDate(),l=e=>e?g.dateIsToday(e):!1,u=e=>g.isTrailingOrLeadingDate(e,f.value.getMonth()),d=o(()=>e=>!e||!Array.isArray(a.value)||!a.value.length?!1:a.value.some(t=>{let n=_(t);return n?e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate():!1}));return{currentMonthDays:e,currentMonthValue:t,months:n,years:i,weekDays:s,isSelected:c,isToday:l,isNotInMonth:u,isHighlighted:d}}function w(){let e=e=>{f.value=new Date(f.value.getFullYear(),e,1),h.value=`days`},t=e=>{f.value=new Date(e,f.value.getMonth(),1),h.value=`months`},n=()=>{f.value=new Date(f.value.getFullYear(),f.value.getMonth()-1,1)},r=()=>{f.value=new Date(f.value.getFullYear(),f.value.getMonth()+1,1)},i=()=>{let e=h.value===`months`?1:21;f.value=new Date(f.value.getFullYear()-e,f.value.getMonth(),1)},a=()=>{let e=h.value===`months`?1:21;f.value=new Date(f.value.getFullYear()+e,f.value.getMonth(),1)};return{selectMonth:e,selectYear:t,previousMonth:n,nextMonth:r,previousYear:i,nextYear:a}}function T(){let e=o(()=>{var e;return(e=S.value)?.getHours()??0}),t=o(()=>{var e;return(e=S.value)?.getMinutes()??0}),n=e=>{if(!S.value)return;let t=new Date(S.value);t.setHours(e),E(t)},r=e=>{if(!S.value)return;let t=new Date(S.value);t.setMinutes(e),E(t)};return{hours:e,minutes:t,handleHourInput:n,handleMinuteInput:r}}function E(e){if(r.enableTime)i(`update:modelValue`,e.toISOString());else{let t=new Date(e);t.setHours(0,0,0,0),i(`update:modelValue`,t.toISOString())}}let{currentMonthDays:O,currentMonthValue:k,months:A,years:j,weekDays:M,isSelected:N,isToday:ee,isNotInMonth:F,isHighlighted:I}=C(),{selectMonth:te,selectYear:ne,previousMonth:z,nextMonth:re,previousYear:ie,nextYear:ae}=w(),{hours:B,minutes:oe,handleHourInput:se,handleMinuteInput:ce}=T();function le(e){if(e)if(r.enableTime){var t,n;let r=new Date(e.getFullYear(),e.getMonth(),e.getDate()),i=(t=S.value)?.getHours()??new Date().getHours(),a=(n=S.value)?.getMinutes()??new Date().getMinutes();r.setHours(i),r.setMinutes(a),E(r)}else{let t=new Date(e.getFullYear(),e.getMonth(),e.getDate());E(t)}}return(e,t)=>(P(),u(`div`,{class:D([`ltr gap-075 m_flex-wrap calendar-container justify-content-center h-100p border p-025`,{flex:!e.autoSize}])},[d(`div`,Wc,[d(`div`,Gc,[h.value===`days`?(P(),u(n,{key:0},[m(U(J),{flat:``,thin:``,icon:`chevron_left`,onClick:U(z)},null,8,[`onClick`]),d(`div`,Kc,[m(U(J),{flat:``,thin:``,class:`month-btn`,onClick:t[0]||=e=>h.value=`months`},{default:G(()=>[p(V(U(k).formatted.month),1)]),_:1}),m(U(J),{flat:``,thin:``,class:`year-btn`,onClick:t[1]||=e=>h.value=`years`},{default:G(()=>[p(V(U(k).formatted.year),1)]),_:1})]),m(U(J),{flat:``,thin:``,icon:`chevron_right`,onClick:U(re)},null,8,[`onClick`])],64)):(P(),u(n,{key:1},[m(U(J),{flat:``,thin:``,icon:`chevron_left`,onClick:U(ie)},null,8,[`onClick`]),d(`span`,qc,V(U(k).formatted.year),1),m(U(J),{flat:``,thin:``,icon:`chevron_right`,onClick:U(ae)},null,8,[`onClick`])],64))]),h.value===`days`?(P(),u(`div`,Jc,[(P(!0),u(n,null,R(U(M),e=>(P(),u(`div`,{key:e,class:`txt-center txt-12 opacity-6`},V(e),1))),128)),(P(!0),u(n,null,R(U(O),e=>(P(),u(`button`,{key:e?.toISOString(),type:`button`,class:D([`day aspect-ratio-1 flex align-items-center justify-content-center pointer round txt14 p-0`,{selected:U(N)(e),today:U(ee)(e),disabled:U(b)(e),"not-in-month":U(F)(e),highlighted:U(I)(e)}]),disabled:U(b)(e),onClick:t=>le(e)},V(e?.getDate()),11,Yc))),128))])):h.value===`months`?(P(),u(`div`,Xc,[(P(!0),u(n,null,R(U(A),e=>(P(),c(U(J),{key:e.value,thin:``,flat:e.value!==U(k).month,disabled:e.disabled,value:e.name,onClick:t=>U(te)(e.value)},null,8,[`flat`,`disabled`,`value`,`onClick`]))),128))])):(P(),u(`div`,Zc,[(P(!0),u(n,null,R(U(j),e=>(P(),c(U(J),{key:e.value,thin:``,flat:e.value!==U(k).year,disabled:e.disabled,value:e.value.toString(),onClick:t=>U(ne)(e.value)},null,8,[`flat`,`disabled`,`value`,`onClick`]))),128))]))]),e.enableTime&&h.value===`days`?(P(),u(`div`,Qc,[d(`div`,$c,[m(U(Ml),{center:``,modelValue:U(B),disabled:!U(S),min:0,max:23,layout:`vertical`,padZero:2,"onUpdate:modelValue":U(se)},null,8,[`modelValue`,`disabled`,`onUpdate:modelValue`]),t[2]||=d(`p`,{class:`pb-075`},` : `,-1),m(U(Ml),{center:``,modelValue:U(oe),disabled:!U(S),min:0,max:59,padZero:2,layout:`vertical`,"onUpdate:modelValue":U(ce)},null,8,[`modelValue`,`disabled`,`onUpdate:modelValue`])])])):l(``,!0)],2))}}),tl=q(el,[[`__scopeId`,`data-v-55eb37a5`]]);const nl=[`title`],rl={key:0},il={key:0,class:`required`};var al=h({__name:`DateInput`,props:w({required:{type:Boolean},label:{},editMode:{type:Boolean,default:!0},small:{type:Boolean,default:!1},enableTime:{type:Boolean,default:!1},modelValue:{},min:{},max:{},mode:{default:()=>({mode:`day`})},defaultValue:{},firstDayOfWeek:{default:Hc.SUNDAY},locale:{default:``},center:{type:Boolean}},{modelValue:{required:!0,default:()=>new Date},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=ce(e,`modelValue`),r=L(!1);function i(){let e=e=>e?$E(e,{fmt:t.enableTime?`DD.MM.YY HH:mm`:`DD.MM.YY`}):``,n=e=>{let t=new Date(e);if(!Number.isNaN(t.getTime()))return t;let n=e.split(/[/.-]/);if(n.length===3){let[e,t,r]=n.map(e=>Number.parseInt(e,10));if(!Number.isNaN(e)&&!Number.isNaN(t)&&!Number.isNaN(r)){let n=new Date(r,t-1,e);if(n.getFullYear()===r&&n.getMonth()===t-1&&n.getDate()===e)return n}}return null},r=e=>{if(t.enableTime)return e.toISOString();{let t=new Date(e);return t.setHours(0,0,0,0),t.toISOString().split(`T`)[0]}};return{formatDisplayDate:e,parseUserInput:n,normalizeDate:r}}let{formatDisplayDate:a,parseUserInput:o,normalizeDate:s}=i();function c(){let e=L(``),t=t=>{let r=t.target;e.value=r.value;let i=o(r.value);i&&(n.value=s(i))},i=e=>{e.preventDefault(),e.stopPropagation(),r.value=!0},a=e=>{e.preventDefault(),e.stopPropagation()},c=t=>{if(t.key===`Escape`)r.value=!1;else if(t.key===`Enter`&&e.value){let t=o(e.value);t&&(n.value=s(t),r.value=!1)}};return{inputValue:e,handleInput:t,handleFocus:i,handleClick:a,handleKeydown:c}}let{handleInput:f,handleFocus:h,handleClick:g,handleKeydown:_}=c(),v=L(null),y=L(null);return j(()=>{Tt(v.value,()=>{r.value=!1},{ignore:()=>[y.value]})}),(e,t)=>(P(),u(`div`,{class:D([`bagel-input`,{small:e.small}]),title:e.label,onFocusin:t[4]||=(...e)=>U(h)&&U(h)(...e)},[e.label?(P(),u(`label`,rl,[p(V(e.label)+` `,1),e.required?(P(),u(`span`,il,`*`)):l(``,!0)])):l(``,!0),m(U(qo),{shown:r.value,placement:`bottom-start`,autoHide:!1,triggers:[`click`]},{trigger:G(()=>[d(`div`,{ref_key:`datePickerRef`,ref:v,class:`date-picker-container`,onMousedown:t[0]||=ge(()=>{},[`stop`]),onClick:t[1]||=ge(()=>{},[`stop`])},[m(U(G_),{modelValue:U(a)(n.value),iconStart:`calendar`,min:U(a)(e.min),max:U(a)(e.max),required:e.required,disabled:!e.editMode,class:D([`date-input m-0`,{"txt-center":e.center}]),readonly:!1,onInput:U(f),onFocus:U(h),onClick:U(g),onKeydown:U(_)},null,8,[`modelValue`,`min`,`max`,`required`,`disabled`,`class`,`onInput`,`onFocus`,`onClick`,`onKeydown`])],544)]),default:G(()=>[d(`div`,{ref_key:`calendarRef`,ref:y,onClick:t[3]||=ge(()=>{},[`stop`])},[m(tl,{modelValue:n.value,"onUpdate:modelValue":t[2]||=e=>n.value=e,min:e.min,max:e.max,mode:e.mode,firstDayOfWeek:e.firstDayOfWeek,locale:e.locale,enableTime:e.enableTime},null,8,[`modelValue`,`min`,`max`,`mode`,`firstDayOfWeek`,`locale`,`enableTime`])],512)]),_:1},8,[`shown`])],42,nl))}}),ol=al;const sl=[`jpeg`,`png`,`webp`,`avif`,`apng`,`gif`,`avifs`,`svg`,`bmp`,`jpg`,`heic`,`heif`,`ico`,`cur`,`tif`,`tiff`],cl=RegExp(`(${sl.join(`|`)})$`,`i`),ll=[`mp4`,`webm`,`ogg`,`mov`,`avi`,`flv`,`wmv`,`mkv`,`ts`,`m3u8`],ul=RegExp(`(${ll.join(`|`)})$`,`i`),dl=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-0-9]+\.)+[a-z]{2,}))$/i,fl=[`title`],pl=[`for`],ml={class:`flex`},hl={key:0},gl={key:1,class:`opacity-7 light`},_l={key:3,class:`validating`},vl=[`id`,`name`,`title`,`placeholder`,`disabled`,`required`];var yl=h({__name:`EmailInput`,props:{id:{},title:{},helptext:{},name:{},placeholder:{},modelValue:{default:``},label:{},small:{type:Boolean},required:{type:Boolean},pattern:{default:`[a-z0-9._%+\\-]+@[a-z0-9.\\-]+\\.[a-z]{2,}`},defaultValue:{},shrink:{type:Boolean},disabled:{type:Boolean},nativeInputAttrs:{},icon:{},iconStart:{},autocomplete:{},autofocus:{type:Boolean},onFocusout:{},onFocus:{},autocorrect:{type:Boolean,default:!0},serverValidate:{type:Boolean,default:!1},preventFakeEmails:{type:Boolean,default:!1},validate:{},getFormData:{}},emits:[`update:modelValue`,`debounce`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=[`gmail.com`,`yahoo.com`,`hotmail.com`,`outlook.com`,`aol.com`,`icloud.com`,`protonmail.com`,`mail.com`,`zoho.com`,`yandex.com`,`gmx.com`,`live.com`,`msn.com`],o=`mailinator.com,tempmail.com,10minutemail.com,guerrillamail.com,guerrillamail.info,throwawaymail.com,yopmail.com,tempinbox.com,dispostable.com,mailnesia.com,trashmail.com,sharklasers.com,temp-mail.org,fakeinbox.com,getnada.com,armyspy.com,cuvox.de,dayrep.com,einrot.com,fleckens.hu,gustr.com,jourrapide.com,rhyta.com,superrito.com,teleworm.us,nbmbb.com,poplk.com`.split(`,`),s=L(``),f=L(null),m=L(``),h=L(!1),g=L(!0),_=new Map,v=L();function y(e){if(e){if(!dl.test(e))return`Please enter a valid email address`;if(r.preventFakeEmails&&e.includes(`@`)){let[,t]=e.split(`@`);if(t){let e=t.toLowerCase();if(o.includes(e))return`Please use a non-disposable email address`}}if(m.value)return m.value}}let b=dt(()=>{i(`debounce`,s.value)},700);function S(){if(!v.value||(v.value.setCustomValidity(``),!s.value))return;let e=y(s.value);typeof e==`string`&&v.value.setCustomValidity(e)}async function C(e){if(!(!r.serverValidate||!e||!dl.test(e))){if(_.has(e)){g.value=_.get(e)||!1;return}h.value=!0,m.value=``;try{var t;let r=await fetch(`https://api.mailcheck.ai/domain/${e.split(`@`)[1]}`,{method:`GET`,headers:{"Content-Type":`application/json`}});if(!r.ok)throw Error(`Validation service unavailable`);let i=await r.json(),a=i.status===`valid`||i.has_mx===!0;if(g.value=a,_.set(e,a),a)(t=v.value)?.setCustomValidity(``);else{var n;m.value=`This email domain appears to be invalid`,(n=v.value)?.setCustomValidity(m.value)}}catch(e){console.error(`Email validation error:`,e)}finally{h.value=!1}}}function w(e){if(!r.autocorrect||!e)return;if(e.includes(`@`)&&!e.includes(`.`)){let[t,n]=e.split(`@`),r=n.toLowerCase();for(let e of a)if(e.startsWith(r)){f.value=`${t}@${e}`;return}}if(!e.includes(`@`))return;let[t,n]=e.split(`@`),i=n.toLowerCase();if(a.includes(i)){f.value=null;return}for(let e of a)if(k(i,e)<=2){f.value=`${t}@${e}`.toLowerCase();return}f.value=null}function O(){f.value&&(s.value=f.value,f.value=null,i(`update:modelValue`,s.value),b())}function k(e,t){let n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=e.length;r++)for(let i=1;i<=t.length;i++){let a=e[r-1]===t[i-1]?0:1;n[r][i]=Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+a)}return n[e.length][t.length]}let A=dt(()=>C(s.value),1e3);function M(){r.disabled||(f.value=null,S(),r.serverValidate&&A(),i(`update:modelValue`,s.value),b())}function N(e){w(s.value),r.serverValidate&&dl.test(s.value)&&C(s.value),r.onFocusout&&r.onFocusout(e)}W(()=>r.modelValue,e=>{e!==s.value&&(s.value=e||``,E(()=>{S()}))},{immediate:!0}),W(()=>s.value,()=>{S()},{immediate:!0});let ee=()=>document.activeElement===v.value,F=()=>{var e;return(e=v.value)?.focus()};return t({focus:F,hasFocus:ee}),j(()=>{r.autofocus&&setTimeout(()=>{var e;return(e=v.value)?.focus()},10),r.defaultValue&&!r.modelValue&&(s.value=r.defaultValue)}),(e,t)=>{let n=ie(`pattern`);return P(),u(`div`,{class:D([`bagel-input text-input`,{small:e.small,shrink:e.shrink,textInputIconWrap:e.icon,txtInputIconStart:e.iconStart,"is-validating":h.value}]),title:e.title},[d(`label`,{for:e.id},[d(`div`,ml,[p(V(e.label)+` `,1),e.required?(P(),u(`span`,hl,`*`)):l(``,!0),e.helptext?(P(),u(`span`,gl,V(e.helptext),1)):l(``,!0),f.value?(P(),u(`span`,{key:2,class:`pointer nowrap inline-block ms-auto color-red txt-10px p-0`,onClick:ge(O,[`prevent`])},` did you mean `+V(f.value)+`? `,1)):l(``,!0),h.value?(P(),u(`span`,_l,`Validating email...`)):l(``,!0)]),K(d(`input`,T({id:e.id,ref_key:`input`,ref:v,"onUpdate:modelValue":t[0]||=e=>x(s)?s.value=e:s=e,class:`ltr`,name:e.name,title:e.title,autocomplete:`email`,type:`email`,placeholder:e.placeholder||e.label,disabled:e.disabled,required:e.required},e.nativeInputAttrs,{onFocusout:N,onFocus:t[1]||=(...t)=>e.onFocus&&e.onFocus(...t),onInput:M}),null,16,vl),[[pe,U(s)],[n,void 0,`lower`]]),e.iconStart?(P(),c(U($),{key:0,class:`iconStart`,icon:e.iconStart},null,8,[`icon`])):l(``,!0),e.icon?(P(),c(U($),{key:1,icon:e.icon},null,8,[`icon`])):l(``,!0)],8,pl)],10,fl)}}}),bl=q(yl,[[`__scopeId`,`data-v-e3d13caa`]]);const xl=[`title`],Sl={key:0},Cl=[`value`,`placeholder`];var wl=h({__name:`JSONInput`,props:{description:{default:``},label:{default:``},modelValue:{},placeholder:{default:``},editMode:{type:Boolean,default:!0},small:{type:Boolean}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;function r(e){let t=e.target;n(`update:modelValue`,t.value)}return(e,t)=>{let n=re(`LangText`);return P(),u(`div`,{class:D([`bagel-input`,{small:e.small}]),title:e.description},[e.label?(P(),u(`label`,Sl,[m(n,{input:e.label},null,8,[`input`])])):l(``,!0),d(`textarea`,{value:e.modelValue,class:D({"no-edit":!e.editMode}),placeholder:e.placeholder,onInput:r},null,42,Cl)],10,xl)}}}),Tl=q(wl,[[`__scopeId`,`data-v-1cbaeab2`]]);const El=[`for`],Dl={key:0,class:`block`},Ol=[`id`,`placeholder`,`disabled`,`required`,`readonly`,`pattern`,`onKeydown`],kl={key:1,class:`opacity-7 light`},Al={key:5,class:`flex column spinner`};var jl=h({__name:`NumberInput`,props:{modelValue:{},min:{},max:{},step:{default:1},spinner:{type:Boolean,default:!0},iconStart:{},icon:{},label:{},defaultValue:{},placeholder:{},disabled:{type:Boolean},required:{type:Boolean},id:{},helptext:{},layout:{},center:{type:Boolean},padZero:{default:1},useGrouping:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t,r=L();j(()=>{let t=e.modelValue===void 0?void 0:Number.parseFloat(`${e.modelValue}`),n=e.defaultValue===void 0?void 0:Number.parseFloat(`${e.defaultValue}`);r.value=t??n});let i=[`horizontal`,`vertical`];function a(...t){var n;let r=t.map(e=>e||0),i=(n=e.step.toString().split(`.`)[1])?.length||0;return Number.parseFloat(r.reduce((e,t)=>e+t,0).toFixed(i))}function s(...t){var n;let r=t.map(e=>e||0),i=r.shift()||0,a=(n=e.step.toString().split(`.`)[1])?.length||0;return Number.parseFloat(r.reduce((e,t)=>e-t,i).toFixed(a))}let f=o(()=>e.max===void 0||a(r.value,e.step)<=e.max),p=o(()=>e.min===void 0||s(r.value,e.step)>=e.min);function h(){f.value&&(r.value=a(r.value??0,e.step),n(`update:modelValue`,r.value))}function g(){p.value&&(r.value=s(r.value||0,e.step),n(`update:modelValue`,r.value))}function _(t){if(Number.isNaN(t))return``;let n=new Intl.NumberFormat(`en-US`,{minimumFractionDigits:0,maximumFractionDigits:20,useGrouping:e.useGrouping}),r=n.format(t),[i,a]=r.split(`.`),o=e.padZero&&e.padZero>i.replace(/,/g,``).length?`0`.repeat(e.padZero-i.replace(/,/g,``).length):``;return a?`${o}${i}.${a}`:`${o}${i}`}let v=L(``);function y(){let e=v.value.replace(/[^\d.-]/g,``),t=[``,`-`,`.`,`-.`].includes(e),i=v.value.endsWith(`.`),a=/\.\d*0$/.test(e);if(t||i||a){n(`update:modelValue`,e===`-`?`-`:e);return}r.value=Number.parseFloat(e),v.value=t?``:_(r.value),n(`update:modelValue`,r.value)}return W(()=>r.value,()=>{E(()=>{v.value.endsWith(`.`)||/\.\d*0$/.test(v.value)||(v.value=r.value===void 0?``:_(r.value))})}),W(()=>e.modelValue,e=>{if(e!==r.value){if(typeof e==`string`&&(e===`-`||e.endsWith(`.`))){v.value=e;return}r.value=Number.parseFloat(`${e}`)||0}},{immediate:!0}),(e,t)=>{let n=ie(`pattern`);return P(),u(`div`,{class:D([`bagel-input num-input`,{textInputSpinnerWrap:e.icon||e.spinner,txtInputIconStart:e.iconStart}])},[d(`div`,{for:e.id},[e.label?(P(),u(`label`,Dl,V(e.label),1)):l(``,!0),d(`div`,{class:D([`gap-025`,{"column flex":e.layout===`vertical`,flex:e.layout===`horizontal`}])},[e.layout&&i.includes(e.layout)?(P(),c(U(J),{key:0,flat:``,icon:`add`,class:D([`radius`,[{"bgl-big-ctrl-num-btn":e.layout===`vertical`}]]),tabindex:`-1`,onClick:h},null,8,[`class`])):l(``,!0),K(d(`input`,{id:e.id,"onUpdate:modelValue":t[0]||=e=>x(v)?v.value=e:v=e,type:`text`,class:D({"txt-center":e.center,min0:e.layout,"bgl-number-input":e.layout!==`vertical`&&e.layout!==`horizontal`}),placeholder:e.placeholder||e.label,disabled:e.disabled,required:e.required,readonly:e.disabled,inputmode:`decimal`,autocomplete:`off`,pattern:e.useGrouping?`^-?\\d{1,3}(,\\d{3})*(.\\d+)?$`:`^-?\\d*.?d*$`,autocorrect:`off`,spellcheck:`false`,onInput:y,onKeydown:[he(ge(h,[`prevent`]),[`up`]),he(ge(g,[`prevent`]),[`down`])]},null,42,Ol),[[pe,U(v),void 0,{trim:!0}],[n,void 0,void 0,{number:!0}]]),e.helptext?(P(),u(`p`,kl,V(e.helptext),1)):l(``,!0),e.iconStart?(P(),c(U($),{key:2,class:`iconStart`,icon:e.iconStart},null,8,[`icon`])):l(``,!0),e.icon?(P(),c(U($),{key:3,icon:e.icon},null,8,[`icon`])):l(``,!0),e.layout&&i.includes(e.layout)?(P(),c(U(J),{key:4,flat:``,icon:`remove`,class:D([`radius`,[{"bgl-big-ctrl-num-btn":e.layout===`vertical`}]]),tabindex:`-1`,onClick:g},null,8,[`class`])):l(``,!0),e.spinner&&(!e.layout||!i.includes(e.layout))?(P(),u(`div`,Al,[m(U(J),{icon:`add`,flat:``,thin:``,class:`bgl-ctrl-num-btn ctrl-add top-bgl-ctrl-num-btn`,disabled:!f.value,tabindex:`-1`,onClick:h},null,8,[`disabled`]),m(U(J),{icon:`remove`,flat:``,thin:``,class:`bgl-ctrl-num-btn ctrl-remove`,disabled:!p.value,tabindex:`-1`,onClick:g},null,8,[`disabled`])])):l(``,!0)],2)],8,El)],2)}}}),Ml=q(jl,[[`__scopeId`,`data-v-8c81dffe`]]);const Nl=[`value`,`autofocus`,`onKeydown`,`onPaste`];var Pl=h({__name:`OTP`,props:{digitCount:{},default:{},modelValue:{}},emits:[`update:modelValue`,`complete`],setup(e,{emit:t}){let r=e,i=t,a=ne([]),o=L();function s(e,t){e.preventDefault();let{clipboardData:n}=e,r=n?.getData(`text`).replaceAll(/\D/g,``),i=[...r??``];if(i){for(let e=0;e<i.length;e++){let n=i[e];t+e<a.length&&(a[t+e]=n)}c()}}function c(){i(`update:modelValue`,a.join(``)),d()&&i(`complete`,a.join(``))}function l(e,t){let n=[`Tab`,`ArrowRight`,`ArrowLeft`,`Control`,`Shift`,`Alt`,`Meta`];if(n.includes(e.key))return;let i=[`ArrowUp`,`ArrowDown`];if(i.includes(e.key)){e.preventDefault();return}if(e.key===`Backspace`){if(a[t]=void 0,t!==0){var s;let e=(s=o.value)?.children[t-1];e.focus()}c();return}let l=/^\d$/;l.test(e.key)&&(a[t]=e.key,t!==r.digitCount-1&&setTimeout(()=>{var e;let n=(e=o.value)?.children[t+1];n.focus()},10),c())}if(r.default&&r.default.length===r.digitCount)for(let e=0;e<r.digitCount;e++)a[e]=r.default.charAt(e);else for(let e=0;e<r.digitCount;e++)a[e]=void 0;function d(){for(let e of a)if(e===void 0)return!1;return!0}return(e,t)=>(P(),u(`div`,{ref_key:`otpCont`,ref:o,class:`otp_wrap`},[(P(!0),u(n,null,R(a,(e,n)=>(P(),u(`input`,{key:n,value:a[n]||``,type:`number`,inputmode:`numeric`,class:`digit-box`,autofocus:n===0,maxlength:`1`,pattern:`[0-9]*`,oninput:`this.value = this.value.slice(0, 1)`,onKeydown:e=>l(e,n),onPaste:e=>s(e,n),onKeyup:t[0]||=ge(()=>{},[`prevent`])},null,40,Nl))),128))],512))}}),Fl=q(Pl,[[`__scopeId`,`data-v-ab0a46bf`]]);const Il={class:`relative passwordInput`},Ll={class:`m-password position-bottom-end flex column justify-content-center`};var Rl=h({__name:`PasswordInput`,props:w({id:{},title:{},helptext:{},placeholder:{},label:{default:``},small:{type:Boolean},dense:{type:Boolean},required:{type:Boolean},pattern:{},shrink:{type:Boolean},disabled:{type:Boolean},name:{},nativeInputAttrs:{},icon:{},iconStart:{},multiline:{type:Boolean},autoheight:{type:Boolean},code:{type:Boolean},lines:{},autofocus:{type:Boolean},debounceDelay:{},autocomplete:{default:`current-password`},onFocusout:{}},{modelValue:{},modelModifiers:{},showPwd:{type:Boolean,default:!1},showPwdModifiers:{}}),emits:[`update:modelValue`,`update:showPwd`],setup(e){let t=e,n=ce(e,`modelValue`),r=ce(e,`showPwd`),i=o(()=>r.value?`visibility_off`:`visibility`),a=o(()=>r.value?`text`:`password`);return(e,o)=>(P(),u(`div`,Il,[m(U(G_),T({modelValue:n.value,"onUpdate:modelValue":o[0]||=e=>n.value=e},t,{type:a.value,class:`mb-0`,name:t.name}),null,16,[`modelValue`,`type`,`name`]),d(`div`,Ll,[m(U(J),{flat:``,thin:``,class:`mx-05`,icon:i.value,onClick:o[1]||=e=>r.value=!r.value},null,8,[`icon`])])]))}}),zl=Rl;const Bl=[`for`],Vl=[`id`,`disabled`,`name`,`value`,`required`],Hl={class:`flex w-100 gap-1 flex-wrap m_gap-05 m_gap-row-025`},Ul=[`src`,`alt`],Wl={class:``},Gl={key:0,class:`m-0 m_txt-14 line-height-14 pb-025`},Kl={key:1,class:`txt-gray txt-12 m-0`};var ql=h({__name:`RadioGroup`,props:w({id:{},groupName:{},options:{},deletable:{type:Boolean},required:{type:Boolean},error:{},disabled:{type:Boolean},thin:{type:Boolean},flat:{type:Boolean},invertedActive:{type:Boolean},align:{default:`center`}},{modelValue:{},modelModifiers:{}}),emits:w([`delete`,`focus`,`blur`,`change`],[`update:modelValue`]),setup(e,{emit:t}){let r=e,i=t,a=o(()=>r.groupName||r.id||Math.random().toString(36).substring(2,15)),s=ce(e,`modelValue`),f=L([]),p=o(()=>Array.isArray(r.options)?r.options:f.value);async function m(){if(typeof r.options==`function`)try{f.value=await r.options()}catch{f.value=[]}}W(()=>r.options,()=>{f.value=[],m()},{immediate:!0,deep:!0});let h=L(!1),g=o(()=>({"has-error":!!r.error,"is-disabled":r.disabled,"is-focused":h.value}));function _(){h.value=!0,i(`focus`)}function v(){h.value=!1,i(`blur`)}function y(){i(`change`,s.value)}return(e,t)=>(P(),u(`div`,{class:D(g.value)},[(P(!0),u(n,null,R(p.value,(n,r)=>(P(),u(`label`,{key:n.id||`${a.value}-${r}`,class:D([`border rounded flex mb-05 active-list-item hover`,{"p-05 gap-025":e.thin,"py-1 gap-075":!e.thin,"bg-gray-light":!e.flat,"align-items-start":e.align===`start`||e.align===`top`,"align-items-center":e.align===`center`,"align-items-end":e.align===`end`||e.align===`bottom`,invertedActive:e.invertedActive}]),for:n.id||`${a.value}-${r}`},[K(d(`input`,{id:n.id||`${a.value}-${r}`,"onUpdate:modelValue":t[0]||=e=>s.value=e,disabled:e.disabled,class:D([`radio-input-list`,{"mt-025":e.align===`start`||e.align===`top`,"mb-025":e.align===`end`||e.align===`bottom`}]),type:`radio`,name:a.value,value:n.value,required:e.required,onFocus:_,onBlur:v,onChange:y},null,42,Vl),[[fe,s.value]]),d(`div`,Hl,[n.imgSrc?(P(),u(`img`,{key:0,class:`bg-popup shadow-light py-025 radius-05 m_w40`,height:`40`,src:n.imgSrc,alt:n.imgAlt},null,8,Ul)):l(``,!0),d(`div`,Wl,[n.label?(P(),u(`p`,Gl,V(n.label),1)):l(``,!0),n.subLabel?(P(),u(`p`,Kl,V(n.subLabel),1)):l(``,!0)]),z(e.$slots,`radioItem`,T({ref_for:!0},n),void 0,!0)]),e.deletable?(P(),c(U(J),{key:0,class:`ms-auto`,flat:``,thin:``,icon:`delete`,onClick:t=>e.$emit(`delete`,n)},null,8,[`onClick`])):l(``,!0)],10,Bl))),128))],2))}}),Jl=q(ql,[[`__scopeId`,`data-v-4d8eb29b`]]);const Yl={class:`bagel-input`},Xl={class:`pb-025`},Zl={class:`flex gap-05 flex-wrap`},Ql=[`id`,`name`,`value`,`checked`],$l=[`for`];var eu=h({__name:`RadioPillsInput`,props:{options:{},modelValue:{default:``},id:{default:()=>`radio-pill-${Math.random().toString(36).slice(2,9)}`},label:{default:``}},emits:[`update:modelValue`],setup(e,{emit:t}){let r=e,i=t;function a(e){return typeof e==`string`?e:typeof e==`number`?`${e}`:typeof e==`boolean`?e?`Yes`:`No`:e.label}function o(e){return typeof e==`string`||typeof e==`number`?e:typeof e==`boolean`?e?`Yes`:`No`:e.value}let s=L(r.modelValue);function c(e){var t;let n=(t=e.target)?.value;i(`update:modelValue`,n),s.value=n}return W(()=>r.modelValue,(e,t)=>{e===t||t===void 0||s.value!==e&&(s.value=e)},{immediate:!0}),j(()=>{s.value=r.modelValue}),(e,t)=>(P(),u(`div`,Yl,[d(`label`,Xl,V(e.label),1),d(`div`,Zl,[(P(!0),u(n,null,R(e.options,(t,n)=>(P(),u(`div`,{key:n,class:`radio-pill`},[d(`input`,{id:`${e.id}-${o(t)}`,type:`radio`,name:e.id,value:o(t),checked:U(s)===o(t),onChange:c},null,40,Ql),d(`label`,{for:`${e.id}-${o(t)}`},V(a(t)),9,$l)]))),128))])]))}}),tu=q(eu,[[`__scopeId`,`data-v-68b4cdd0`]]);const nu=[`dir`],ru={key:0,class:`label`},iu={class:`range-slider relative w-100`},au=[`id`,`value`,`min`,`max`,`step`,`required`,`disabled`,`aria-label`],ou=[`value`,`min`,`max`,`step`,`required`,`disabled`],su={class:`track absolute pointer-events-none overflow-hidden round`},cu={class:`txt-center txt-14 user-select-none range-slider-txt flex space-between opacity-4 mx-05`};var lu=h({__name:`RangeInput`,props:{modelValue:{},min:{},max:{},step:{},required:{type:Boolean},label:{},disabled:{type:Boolean},id:{},rtl:{type:Boolean},multiRange:{type:Boolean},formatValue:{type:Function}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{min:i=0,max:a=100,step:s=1,multiRange:c=!1,formatValue:f=e=>e.toString()}=n,m=L(Array.isArray(n.modelValue)?n.modelValue[0]:n.modelValue??i),h=L(Array.isArray(n.modelValue)?n.modelValue[1]:a),g=o(()=>Math.min(Math.max(m.value,i),c?h.value:a)),_=o(()=>Math.max(Math.min(h.value,a),m.value)),v=o(()=>(g.value-i)/(a-i)*100),y=o(()=>(_.value-i)/(a-i)*100);W(()=>n.modelValue,e=>{Array.isArray(e)&&c?(m.value=e[0]??i,h.value=e[1]??a):Array.isArray(e)||(m.value=e??i,h.value=a)},{immediate:!0});function b(e,t){t?m.value=e:h.value=e,r(`update:modelValue`,c?[g.value,_.value]:g.value)}let x=o(()=>c?{left:`${v.value}%`,width:`${y.value-v.value}%`}:n.rtl?{left:`${100-v.value}%`,width:`${v.value}%`}:{left:`0`,width:`${v.value}%`}),S=o(()=>f(g.value)),C=o(()=>f(_.value));return(e,t)=>(P(),u(`div`,{dir:e.rtl?`rtl`:`ltr`},[n.label?(P(),u(`label`,ru,V(n.label),1)):l(``,!0),d(`div`,iu,[d(`input`,{id:e.id,value:g.value,class:`from`,type:`range`,min:U(i),max:U(a),step:U(s),required:e.required,disabled:e.disabled,"aria-label":U(c)?`Minimum value`:`Value`,onInput:t[0]||=e=>b(+e.target.value,!0)},null,40,au),U(c)?(P(),u(`input`,{key:0,value:_.value,class:`to`,type:`range`,min:U(i),max:U(a),step:U(s),required:e.required,disabled:e.disabled,"aria-label":`Maximum value`,onInput:t[1]||=e=>b(+e.target.value,!1)},null,40,ou)):l(``,!0),d(`div`,su,[d(`div`,{class:`active-range absolute h-100 pointer-events-none bg-primary`,style:k(x.value)},null,4)]),g.value===U(i)?l(``,!0):(P(),u(`p`,{key:1,class:`txt-center txt-12 range-slider-position-txt absolute line-height-1`,style:k({"--progress":`${v.value}`})},[U(c)?l(``,!0):z(e.$slots,`progress`,{key:0,progress:S.value,min:U(f)(U(i)),max:U(f)(U(a))},()=>[p(V(S.value),1)],!0),U(c)?z(e.$slots,`from`,{key:1,from:S.value,to:C.value,min:U(f)(U(i)),max:U(f)(U(a))},()=>[p(V(S.value),1)],!0):l(``,!0)],4)),U(c)&&_.value!==U(a)?(P(),u(`p`,{key:2,class:`txt-center txt-12 range-slider-position-txt line-height-1 absolute`,style:k({"--progress":`${y.value}`})},[z(e.$slots,`to`,{to:C.value,from:S.value,min:U(f)(U(i)),max:U(f)(U(a))},()=>[p(V(C.value),1)],!0)],4)):l(``,!0)]),d(`p`,cu,[z(e.$slots,`min`,{max:U(f)(U(a)),min:U(f)(U(i)),from:S.value,to:C.value,progress:S.value},()=>[d(`span`,null,V(U(f)(U(i))),1)],!0),z(e.$slots,`max`,{max:U(f)(U(a)),min:U(f)(U(i)),from:S.value,to:C.value,progress:S.value},()=>[d(`span`,null,V(U(f)(U(a))),1)],!0)])],8,nu))}}),uu=q(lu,[[`__scopeId`,`data-v-46e22f3e`]]);const du=[`mergeCells`,`splitCells`,`addRowBefore`,`addRowAfter`,`deleteRow`,`insertColumnLeft`,`insertColumnRight`,`deleteColumn`,`alignLeft`,`alignCenter`,`alignRight`,`alignJustify`,`deleteTable`],fu=[`h2`,`h3`,`h4`,`h5`,`h6`,`separator`,`p`,`blockquote`,`orderedList`,`unorderedList`,`separator`,`bold`,`italic`,`underline`,`separator`,`link`,`image`,`embed`,`clear`,`splitView`,`fullScreen`],pu=[`h2`,`h3`,`h4`,`h5`,`h6`,`separator`,`bold`,`italic`,`underline`,`separator`,`fontColor`,`bgColor`,`separator`,`p`,`blockquote`,`orderedList`,`unorderedList`,`indent`,`outdent`,`separator`,`link`,`image`,`embed`,`separator`,`splitView`,`clear`,`insertTable`,...du,`separator`,`undo`,`redo`,`fullScreen`],mu=[{name:`h2`,label:`h2`,icon:`format_h2`},{name:`h3`,label:`h3`,icon:`format_h3`},{name:`h4`,label:`h4`,icon:`format_h4`},{name:`h5`,label:`h5`,icon:`format_h5`},{name:`h6`,label:`h6`,icon:`format_h6`},{name:`p`,label:`Paragraph`,icon:`format_paragraph`},{name:`blockquote`,label:`Blockquote`,icon:`format_quote`},{name:`bold`,label:`Bold`,icon:`format_bold`},{name:`italic`,label:`Italic`,icon:`format_italic`},{name:`underline`,label:`Underline`,icon:`format_underlined`},{name:`orderedList`,label:`Ordered List`,icon:`format_list_numbered`},{name:`unorderedList`,label:`Unordered List`,icon:`format_list_bulleted`},{name:`link`,label:`Link`,icon:`add_link`},{name:`image`,label:`Image`,icon:`add_photo_alternate`},{name:`embed`,label:`Embed`,icon:`media_link`},{name:`splitView`,label:`Split View`,icon:`code`},{name:`clear`,label:`Clear Formatting`,icon:`format_clear`},{name:`alignLeft`,label:`Align Left`,icon:`format_align_left`},{name:`alignCenter`,label:`Align Center`,icon:`format_align_center`},{name:`alignRight`,label:`Align Right`,icon:`format_align_right`},{name:`alignJustify`,label:`Align Justify`,icon:`format_align_justify`},{name:`indent`,label:`Indent`,icon:`format_indent_increase`},{name:`outdent`,label:`Outdent`,icon:`format_indent_decrease`},{name:`fontColor`,label:`Font Color`,icon:`format_color_text`},{name:`bgColor`,label:`Background Color`,icon:`format_color_fill`},{name:`insertTable`,label:`Insert Table`,icon:`table`},{name:`deleteTable`,label:`Delete Table`,icon:`delete_sweep`},{name:`mergeCells`,label:`Merge Cells`,icon:`table_chart`},{name:`splitCells`,label:`Split Cells`,icon:`dashboard`},{name:`addRowBefore`,label:`Insert Row Above`,icon:`add_box`},{name:`addRowAfter`,label:`Insert Row Below`,icon:`vertical_align_bottom`},{name:`deleteRow`,label:`Delete Row`,icon:`remove`},{name:`insertColumnLeft`,label:`Insert Column Left`,icon:`format_indent_decrease`},{name:`insertColumnRight`,label:`Insert Column Right`,icon:`format_indent_increase`},{name:`deleteColumn`,label:`Delete Column`,icon:`view_week`},{name:`separator`},{name:`undo`,label:`Undo`,icon:`undo`},{name:`redo`,label:`Redo`,icon:`redo`},{name:`separator`},{name:`fullScreen`,label:`Full Screen`,icon:`fullscreen`,class:`ms-auto`}],hu={class:`grid grid-wrap p-05`},gu=[`onMousemove`,`onClick`],_u={class:`txt-center txt-12 color-gray`},vu=1;var yu=h({__name:`gridBox`,props:{gridSize:{}},emits:[`select`],setup(e,{emit:t}){let r=e,i=t,a=r.gridSize||5,s=L(vu),c=L(vu),l=o(()=>{let e=Math.min(s.value+1,20);return s.value>a-1?e:a}),f=o(()=>{let e=Math.min(c.value+1,20);return c.value>a-1?e:a});return(e,t)=>(P(),u(`div`,hu,[(P(!0),u(n,null,R(l.value,e=>(P(),u(`div`,{key:`row-${e}`,class:`flex`,onMouseout:t[0]||=e=>{s.value=vu,c.value=vu},onFocusout:t[1]||=e=>{s.value=vu,c.value=vu}},[(P(!0),u(n,null,R(f.value,t=>(P(),u(`div`,{key:`col-${t}`,role:`button`,tabindex:`0`,"aria-label":`Insert Table`,style:{width:`20px`,height:`20px`},class:D([`flex pointer gap-025 tableBoxSelect`,{borderSelect:s.value>=e&&c.value>=t}]),onMousemove:n=>{s.value=e,c.value=t},onClick:n=>i(`select`,`${e}x${t}`)},null,42,gu))),128))],32))),128)),d(`p`,_u,V(s.value)+`x`+V(c.value),1)]))}}),bu=q(yu,[[`__scopeId`,`data-v-2f424c9c`]]);const xu={class:`toolbar flex gap-025 pb-05 flex-wrap`,role:`toolbar`};var Su=h({__name:`EditorToolbar`,props:{config:{default:fu},selectedStyles:{}},emits:[`action`],setup(e,{emit:t}){let r=t,i=e=>mu.find(t=>t.name===e);function a(e,t){r(`action`,e,t)}return(e,t)=>{let r=ie(`tooltip`);return P(),u(`div`,xu,[(P(!0),u(n,null,R(e.config.map(i).filter(Boolean),(t,i)=>(P(),u(n,{key:i},[t.name===`insertTable`?(P(),c(U(qo),{key:0,placement:`bottom-start`,thin:``,flat:``,icon:`table`},{default:G(({hide:e})=>[m(bu,{gridSize:5,onSelect:t=>{a(`insertTable`,t),e()}},null,8,[`onSelect`])]),_:1})):t.name===`separator`?t.name===`separator`?(P(),u(`span`,{key:`separator-${i}`,class:`opacity-2 mb-025`},`|`)):l(``,!0):K((P(),c(U(J),{key:1,icon:t.icon,thin:``,flat:``,"aria-label":t.name,class:D([[t.class,{active:e.selectedStyles.has(t.name)}],``]),tabindex:`-1`,onClick:e=>a(t.name)},null,8,[`icon`,`aria-label`,`class`,`onClick`])),[[r,t.label]])],64))),128))])}}}),Cu=q(Su,[[`__scopeId`,`data-v-7e9466dc`]]);function wu(e,t){let{range:n,doc:r}=t;!n||!r||e.showModalForm({title:`Upload Image`,schema:[{id:`src`,$el:`file`,attrs:{bindkey:`url`}},{id:`alt`,$el:`text`,label:`Alt Text`},fs(ds(`width`,`Width`,{min:1}),ds(`height`,`Height`,{min:1})),{id:`figcaption`,$el:`check`,label:`Show Caption`}],onSubmit:e=>{if(e.src){let i=r.createElement(`img`);Object.assign(i,{src:e.src,alt:e.alt||``,width:e.width||void 0,height:e.height||void 0});let a=e.figcaption?(()=>{let t=r.createElement(`figcaption`);t.textContent=e.alt;let n=r.createElement(`figure`);return n.append(i,t),n})():i;n.collapse(!1),n.insertNode(a),t.content=r.body.innerHTML}}})}function Tu(e,t){let{range:n,doc:r}=t;!n||!r||e.showModalForm({title:`Insert Link`,schema:[{id:`url`,$el:`text`,label:`URL`},{id:`openInNewTab`,$el:`check`,label:`Open in new tab`}],onSubmit:e=>{if(e.url){let i=r.createElement(`a`);i.href=e.url,e.openInNewTab&&(i.target=`_blank`),n.surroundContents(i),t.content=r.body.innerHTML}}})}function Eu(e,t){let{range:n,doc:r}=t;!n||!r||e.showModalForm({title:`Insert Embed`,schema:[{id:`url`,$el:`text`,label:`URL`,attrs:{placeholder:`Enter URL (YouTube, Vimeo, etc.)`}},fs(ds(`width`,`Width`,{min:200,placeholder:`560`}),ds(`height`,`Height`,{min:200,placeholder:`315`})),{id:`allowFullscreen`,$el:`check`,label:`Allow Fullscreen`,attrs:{value:!0}}],onSubmit:e=>{if(!e.url)return;let i=new URL(e.url),a=e.url;if(i.hostname.includes(`youtube.com`)||i.hostname===`youtu.be`){let e=i.hostname===`youtu.be`?i.pathname.slice(1):i.searchParams.get(`v`);e&&(a=`https://www.youtube.com/embed/${e}`)}else if(i.hostname.includes(`vimeo.com`)){let e=i.pathname.split(`/`).pop();e&&(a=`https://player.vimeo.com/video/${e}`)}let o=r.createElement(`iframe`);Object.assign(o,{src:a,width:e.width||560,height:e.height||315,frameBorder:`0`,allow:`accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture`,allowFullscreen:e.allowFullscreen});let s=r.createElement(`div`);s.style.textAlign=`center`,s.style.margin=`1em 0`,s.appendChild(o),n.deleteContents(),n.insertNode(s),t.content=r.body.innerHTML}})}function Du(e,t,n){if(!n.doc)return;let r=n.doc.createElement(`table`);r.style.width=`100%`,r.style.borderCollapse=`collapse`,r.style.marginBottom=`1rem`;let i=n.doc.createElement(`thead`),a=i.insertRow();for(let e=0;e<t;e++){let t=n.doc.createElement(`th`);t.innerHTML=`Header ${e+1}`,t.style.padding=`8px`,t.style.border=`1px solid var(--border-color, #ddd)`,t.style.backgroundColor=`var(--bgl-gray-light, #f4f4f4)`,a.appendChild(t)}r.appendChild(i);let o=n.doc.createElement(`tbody`);for(let n=0;n<e;n++){let e=o.insertRow();for(let n=0;n<t;n++){let t=e.insertCell();t.innerHTML=` `,t.style.padding=`8px`,t.style.border=`1px solid var(--border-color, #ddd)`}}r.appendChild(o);let{range:s}=n;if(s){if(s.insertNode(r),n.doc.getSelection()){let e=r.querySelector(`td`);if(e){s.selectNodeContents(e),s.collapse(!0);let t=n.doc.getSelection();t&&(t.removeAllRanges(),t.addRange(s))}}}else n.doc.body.appendChild(r);n.content=n.doc.body.innerHTML}function Ou(e,t){var n;let r=Array.from(e.cloneContents().querySelectorAll(`td`));if(r.length<2)return;let i=(n=e.startContainer.parentElement)?.closest(`td`);if(!i)return;i.colSpan=r.length,i.innerHTML=r.map(e=>e.innerHTML).join(` `),r.slice(1).forEach(e=>{let n=t.getElementById(e.id);n?.remove()});let a=t.editorState;a&&(a.content=t.body.innerHTML)}function ku(e,t){var n;let r=(n=e.startContainer.parentElement)?.closest(`td`);if(!r||!r.colSpan||r.colSpan===1)return;let i=Array(r.colSpan-1).fill(0).map(()=>{let e=t.createElement(`td`);return e.style.border=`1px solid var(--border-color)`,e.style.padding=`8px`,e.innerHTML=` `,e});r.colSpan=1,r.insertAdjacentElement(`afterend`,i[0]),i.slice(1).forEach(e=>{i[0].insertAdjacentElement(`afterend`,e)});let a=t.editorState;a&&(a.content=t.body.innerHTML)}function Au(e,t,n){var r;let i=(r=t.startContainer.parentElement)?.closest(`td`);if(!i)return;let a=i.parentElement,o=a?.parentElement;if(!a||!o)return;let s=a.cloneNode(!0);Array.from(s.cells).forEach(e=>e.innerHTML=` `),a.insertAdjacentElement(e===`before`?`beforebegin`:`afterend`,s);let c=n.editorState;c&&(c.content=n.body.innerHTML)}function ju(e){var t;let n=(t=e.startContainer.parentElement)?.closest(`td`);if(!n)return;let r=n.parentElement;if(!r)return;let i=r.ownerDocument;r.remove();let a=i.editorState;a&&(a.content=i.body.innerHTML)}function Mu(e){var t;let n=(t=e.startContainer.parentElement)?.closest(`td`);if(!n)return;let r=n.closest(`table`);if(!r)return;let i=r.ownerDocument;r.remove();let a=i.editorState;a&&(a.content=i.body.innerHTML)}function Nu(e,t){var n;let r=(n=t.startContainer.parentElement)?.closest(`td`);if(!r)return;let i=r.closest(`table`);if(!i)return;let a=r.cellIndex,{rows:o}=i;for(let t=0;t<o.length;t++){let n=o[t].insertCell(e===`after`?a+1:a);n.innerHTML=` `,n.style.border=`1px solid var(--border-color)`,n.style.padding=`8px`}let s=i.ownerDocument.editorState;s&&(s.content=i.ownerDocument.body.innerHTML)}function Pu(e){var t;let n=(t=e.startContainer.parentElement)?.closest(`td`);if(!n)return;let r=n.closest(`table`);if(!r)return;let i=n.cellIndex,{rows:a}=r,o=r.ownerDocument;for(let e=0;e<a.length;e++)a[e].deleteCell(i);a[0].cells.length===0&&r.remove();let s=o.editorState;s&&(s.content=o.body.innerHTML)}function Fu(e,t){var n;let r=(n=e.startContainer.parentElement)?.closest(`td`);if(!r)return;let i=r.closest(`table`);if(!i)return;let a=r.cellIndex,{rows:o}=i;for(let e=0;e<o.length;e++){let n=o[e].cells[a];n&&(n.style.textAlign=t)}let s=i.ownerDocument.editorState;s&&(s.content=i.ownerDocument.body.innerHTML)}function Iu(e){if(!e.doc)return null;let t=e.doc.getSelection();if(!t||!t.rangeCount)return null;let n=t.getRangeAt(0);return{selection:t,range:n}}function Lu(e){if(!e.doc)return;e.content=e.doc.body.innerHTML;let t=e.doc.getSelection();t&&t.rangeCount>0&&(e.selection=t,e.range=t.getRangeAt(0).cloneRange(),e.rangeCount=t.rangeCount)}function Ru(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;t;){if(t.matches&&t.matches(`p,h1,h2,h3,h4,h5,h6,blockquote,li,div`))return t;t=t.parentElement}return null}function zu(e,t,n){return{name:e,execute:(e,n)=>{e.doc&&(t(e,n),Lu(e))},isActive:n}}function Bu(e){let t={undo:zu(`Undo`,()=>{if(e.undoStack.length>0&&e.doc){let t=e.undoStack.pop();t!==void 0&&(e.redoStack.push(e.content),e.content=t,e.doc.body.innerHTML=t)}}),redo:zu(`Redo`,()=>{if(e.redoStack.length>0&&e.doc){let t=e.redoStack.pop();t!==void 0&&(e.undoStack.push(e.content),e.content=t,e.doc.body.innerHTML=t)}})},n={bold:zu(`Bold`,e=>{let t=Iu(e);if(!t||t.range.collapsed)return;let{range:n}=t;try{let r=e.doc.createElement(`span`);r.style.fontWeight=`bold`;try{n.surroundContents(r)}catch{let e=n.extractContents();r.appendChild(e),n.insertNode(r)}n.selectNodeContents(r),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying bold:`,e)}}),italic:zu(`Italic`,e=>{let t=Iu(e);if(!t||t.range.collapsed)return;let{range:n}=t;try{let r=e.doc.createElement(`span`);r.style.fontStyle=`italic`;try{n.surroundContents(r)}catch{let e=n.extractContents();r.appendChild(e),n.insertNode(r)}n.selectNodeContents(r),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying italic:`,e)}}),underline:zu(`Underline`,e=>{let t=Iu(e);if(!t||t.range.collapsed)return;let{range:n}=t;try{let r=e.doc.createElement(`span`);r.style.textDecoration=`underline`;try{n.surroundContents(r)}catch{let e=n.extractContents();r.appendChild(e),n.insertNode(r)}n.selectNodeContents(r),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying underline:`,e)}})},r=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`].reduce((e,t)=>({...e,[t]:zu(`Heading ${t}`,e=>{let n=Iu(e);if(!n)return;let{range:r}=n,i=Ru(r.commonAncestorContainer);if(!i)return;let a=i.tagName.toLowerCase()===t.toLowerCase(),o=a?`p`:t;try{var s;let t=e.doc.createElement(o);for(;i.firstChild;)t.appendChild(i.firstChild);(s=i.parentNode)?.replaceChild(t,i),r.selectNodeContents(t),r.collapse(!1),n.selection.removeAllRanges(),n.selection.addRange(r)}catch(e){console.error(`Error applying ${t} heading:`,e)}})}),{}),i={p:zu(`Paragraph`,e=>{let t=Iu(e);if(!t)return;let{range:n}=t,r=Ru(n.commonAncestorContainer);if(r&&r.tagName.toLowerCase()!==`p`)try{var i;let a=e.doc.createElement(`p`);for(;r.firstChild;)a.appendChild(r.firstChild);(i=r.parentNode)?.replaceChild(a,r),n.selectNodeContents(a),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying paragraph:`,e)}}),blockquote:zu(`Blockquote`,e=>{let t=Iu(e);if(!t)return;let{range:n}=t,r=Ru(n.commonAncestorContainer);if(!r)return;let i=r.tagName.toLowerCase()===`blockquote`,a=i?`p`:`blockquote`;try{var o;let i=e.doc.createElement(a);for(;r.firstChild;)i.appendChild(r.firstChild);(o=r.parentNode)?.replaceChild(i,r),n.selectNodeContents(i),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error applying blockquote:`,e)}})},a={orderedList:zu(`Ordered List`,e=>{let t=Iu(e);if(!t)return;let{range:n}=t,r=Ru(n.commonAncestorContainer);if(!r)return;let i=r.closest(`li`);if(i){let r=i.parentElement;if(!r)return;if(r.tagName.toLowerCase()===`ol`){var a;let o=e.doc.createElement(`p`);for(;i.firstChild;)o.appendChild(i.firstChild);(a=r.parentNode)?.insertBefore(o,r),i.remove(),r.querySelector(`li`)||r.remove(),n.selectNodeContents(o),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n);return}if(r.tagName.toLowerCase()===`ul`){var o;let t=e.doc.createElement(`ol`);for(;r.firstChild;)t.appendChild(r.firstChild);(o=r.parentNode)?.replaceChild(t,r);return}}try{var s;let i=e.doc.createElement(`ol`),a=e.doc.createElement(`li`);for(;r.firstChild;)a.appendChild(r.firstChild);i.appendChild(a),(s=r.parentNode)?.replaceChild(i,r),n.selectNodeContents(a),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error creating ordered list:`,e)}}),unorderedList:zu(`Unordered List`,e=>{let t=Iu(e);if(!t)return;let{range:n}=t,r=Ru(n.commonAncestorContainer);if(!r)return;let i=r.closest(`li`);if(i){let r=i.parentElement;if(!r)return;if(r.tagName.toLowerCase()===`ul`){var a;let o=e.doc.createElement(`p`);for(;i.firstChild;)o.appendChild(i.firstChild);(a=r.parentNode)?.insertBefore(o,r),i.remove(),r.querySelector(`li`)||r.remove(),n.selectNodeContents(o),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n);return}if(r.tagName.toLowerCase()===`ol`){var o;let t=e.doc.createElement(`ul`);for(;r.firstChild;)t.appendChild(r.firstChild);(o=r.parentNode)?.replaceChild(t,r);return}}try{var s;let i=e.doc.createElement(`ul`),a=e.doc.createElement(`li`);for(;r.firstChild;)a.appendChild(r.firstChild);i.appendChild(a),(s=r.parentNode)?.replaceChild(i,r),n.selectNodeContents(a),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error creating unordered list:`,e)}})},o={clear:zu(`Clear Formatting`,e=>{let t=Iu(e);if(!t||t.range.collapsed)return;let{range:n}=t;try{let r=n.cloneContents(),i=e.doc.createElement(`div`);i.appendChild(r);function a(t){if(t.nodeType===Node.TEXT_NODE)return t.cloneNode(!0);if(t.nodeType===Node.ELEMENT_NODE){let n=t,r=n.tagName.toLowerCase(),i=[`p`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`ul`,`ol`,`li`,`blockquote`,`div`,`table`,`tr`,`td`,`th`],o=[`b`,`i`,`u`,`strong`,`em`,`span`,`font`,`strike`,`sub`,`sup`];if(o.includes(r))return e.doc.createTextNode(n.textContent||``);if(i.includes(r)){let t=e.doc.createElement(r);return r===`a`&&n.hasAttribute(`href`)?(t.setAttribute(`href`,n.getAttribute(`href`)||``),n.hasAttribute(`target`)&&t.setAttribute(`target`,n.getAttribute(`target`)||``)):r===`img`&&(n.hasAttribute(`src`)&&t.setAttribute(`src`,n.getAttribute(`src`)||``),n.hasAttribute(`alt`)&&t.setAttribute(`alt`,n.getAttribute(`alt`)||``)),Array.from(n.childNodes).forEach(e=>{t.appendChild(a(e))}),t}}return t.cloneNode(!0)}let o=e.doc.createDocumentFragment();Array.from(i.childNodes).forEach(e=>{o.appendChild(a(e))}),n.deleteContents(),n.insertNode(o),n.collapse(!1),t.selection.removeAllRanges(),t.selection.addRange(n)}catch(e){console.error(`Error clearing formatting:`,e)}})},s={insertTable:zu(`Insert Table`,(e,t)=>{let[n,r]=t?.split(`x`).map(Number)||[3,3];Du(n,r,e)}),deleteTable:zu(`Delete Table`,e=>e.range&&Mu(e.range)),mergeCells:zu(`Merge Cells`,e=>e.range&&e.doc&&Ou(e.range,e.doc)),splitCells:zu(`Split Cells`,e=>e.range&&e.doc&&ku(e.range,e.doc)),addRowBefore:zu(`Add Row Before`,e=>e.range&&e.doc&&Au(`before`,e.range,e.doc)),addRowAfter:zu(`Add Row After`,e=>e.range&&e.doc&&Au(`after`,e.range,e.doc)),deleteRow:zu(`Delete Row`,e=>e.range&&ju(e.range)),insertColumnLeft:zu(`Insert Column Left`,e=>e.range&&Nu(`before`,e.range)),insertColumnRight:zu(`Insert Column Right`,e=>e.range&&Nu(`after`,e.range)),deleteColumn:zu(`Delete Column`,e=>e.range&&Pu(e.range))},c=[`Left`,`Center`,`Right`,`Justify`].reduce((e,t)=>({...e,[`align${t}`]:zu(`Align ${t}`,e=>e.range&&Fu(e.range,t.toLowerCase()))}),{}),l={fullScreen:zu(`Full Screen`,e=>{e.isFullscreen=!e.isFullscreen},e=>e.isFullscreen),splitView:zu(`Split View`,e=>{e.isSplitView=!e.isSplitView},e=>e.isSplitView),codeView:zu(`Code View`,e=>{e.isCodeView=!e.isCodeView},e=>e.isCodeView)},u={image:zu(`Insert Image`,e=>{e.modal&&wu(e.modal,e)}),link:zu(`Insert Link`,e=>e.modal&&e.range&&Tu(e.modal,e)),embed:zu(`Insert Embed`,e=>{e.modal&&Eu(e.modal,e)})};return{...t,...n,...r,...i,...a,...o,...s,...c,...l,...u}}function Vu(e,t){return{execute(n,r){let i=t[n];i&&i.execute(e,r)},isActive(n){var r;let i=t[n];return(r=i.isActive)?.call(i,e)||!1},getValue(n){var r;let i=t[n];return(r=i.getValue)?.call(i,e)||null}}}function Hu(e,t){let n=Bu(e),r=Vu(e,n);return{execute:(n,i)=>{if(!e.doc){console.log(`[useCommands] No document available, skipping command`);return}if(t?.logCommand(n,i),[`splitView`,`codeView`,`fullScreen`].includes(n))switch(n){case`splitView`:e.isSplitView=!e.isSplitView;return;case`codeView`:e.isCodeView=!e.isCodeView;return;case`fullScreen`:e.isFullscreen=!e.isFullscreen;return}try{e.doc.body.focus()}catch(e){console.error(`[useCommands] Error focusing editor:`,e)}let a=e.doc.getSelection();a?.rangeCount&&(e.selection=a,e.range=a.getRangeAt(0).cloneRange(),e.rangeCount=a.rangeCount);try{r.execute(n,i)}catch(e){console.error(`[useCommands] Error during command execution:`,e)}},isActive:r.isActive,getValue:r.getValue}}var Uu=class{constructor(t=1e3){e.defineProperty(this,`session`,void 0),e.defineProperty(this,`maxActions`,void 0),e.defineProperty(this,`isDevelopment`,void 0),this.maxActions=t,this.session=this.createNewSession(),this.isDevelopment=!1}createNewSession(){return{id:`session_${Date.now()}`,startTime:Date.now(),actions:[]}}getNodeDescription(e){var t;if(e.nodeType===Node.TEXT_NODE)return`Text("${(t=e.textContent)?.slice(0,20)}${e.textContent&&e.textContent.length>20?`...`:``}")`;let n=e;return`${n.tagName.toLowerCase()}${n.id?`#${n.id}`:``}`}captureState(e){if(!e.doc||!e.selection)return{content:``,selection:null,activeStyles:[],caretPosition:null};let{selection:t}=e,n=t.rangeCount?t.getRangeAt(0):null;return{content:e.doc.body.innerHTML,selection:n?{start:n.startOffset,end:n.endOffset,collapsed:n.collapsed,text:n.toString()}:null,activeStyles:Array.from(e.selectedStyles),caretPosition:n?{node:this.getNodeDescription(n.startContainer),offset:n.startOffset}:null}}logCommand(e,t,n){this.addAction({type:`command`,name:e,timestamp:Date.now(),details:{value:t},state:this.captureState(n)})}logPaste(e,t){this.addAction({type:`paste`,name:`paste`,timestamp:Date.now(),details:{html:e.getData(`text/html`),text:e.getData(`text/plain`),types:Array.from(e.types)},state:this.captureState(t)})}logKeyboard(e,t){this.addAction({type:`keyboard`,name:`keypress`,timestamp:Date.now(),details:{key:e.key,code:e.code,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey,meta:e.metaKey},state:this.captureState(t)})}logSelection(e){this.addAction({type:`selection`,name:`selection_change`,timestamp:Date.now(),details:{},state:this.captureState(e)})}logInput(e,t,n){this.addAction({type:`input`,name:e,timestamp:Date.now(),details:{data:t},state:this.captureState(n)})}addAction(e){this.session.actions.push(e),this.session.actions.length>this.maxActions&&this.session.actions.shift(),this.isDevelopment&&console.log(`Editor Action:`,e)}getSession(){return this.session}clearSession(){this.session=this.createNewSession()}exportSession(){return JSON.stringify(this.session,null,2)}downloadSession(){let e=new Blob([this.exportSession()],{type:`application/json`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`editor_session_${this.session.id}.json`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)}exportSessionWithPrompt(e){let t={message:e||`here is a debug log, can you analyze and fix accordingly?`,session:this.session};return JSON.stringify(t,null,2)}};function Wu(e,t){let n=t.getSelection();if(!n||!n.rangeCount)return!1;let r=n.getRangeAt(0),i=r.commonAncestorContainer,a=i.nodeType===Node.TEXT_NODE?i.parentElement:i;if(!a)return!1;let o=(e,t)=>e?t(e)?!0:o(e.parentElement,t):!1,s={bold:e=>{var t;let n=(t=e.tagName)?.toLowerCase();if(n===`strong`||n===`b`)return!0;let r=window.getComputedStyle(e);return r.fontWeight===`bold`||r.fontWeight===`700`},italic:e=>{var t;let n=(t=e.tagName)?.toLowerCase();if(n===`em`||n===`i`)return!0;let r=window.getComputedStyle(e);return r.fontStyle===`italic`},underline:e=>{var t;let n=(t=e.tagName)?.toLowerCase();if(n===`u`)return!0;let r=window.getComputedStyle(e);return r.textDecoration.includes(`underline`)},h1:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h1`},h2:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h2`},h3:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h3`},h4:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h4`},h5:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h5`},h6:e=>{var t;return(t=e.tagName)?.toLowerCase()===`h6`},p:e=>{var t;return(t=e.tagName)?.toLowerCase()===`p`},blockquote:e=>{var t;return(t=e.tagName)?.toLowerCase()===`blockquote`},orderedList:e=>!!e.closest(`ol`),unorderedList:e=>!!e.closest(`ul`)};if([`splitView`,`codeView`,`fullScreen`].includes(e))return!1;let c=s[e];return c?o(a,c):o(a,t=>{var n;return(n=t.tagName)?.toLowerCase()===e.toLowerCase()})}function Gu(e){let t=document.createElement(`div`);t.innerHTML=e;let n=[],r=[];return t.querySelectorAll(`iframe`).forEach((e,t)=>{let i=`<!--iframe-${t}-->`;n.push(e.cloneNode(!0)),r.push(i),e.replaceWith(i)}),{html:t.innerHTML,iframes:n}}function Ku(e,t,n){let r=/<!--iframe-(\d+)-->/g;e.body.innerHTML=t.replace(r,(e,t)=>{let r=n[Number(t)];return r?r.outerHTML:``})}function qu(){let e=BE(),t=null,n=ne({content:``,doc:void 0,selection:null,selectedStyles:new Set,isFullscreen:!1,isSplitView:!1,isCodeView:!1,hasInit:!1,undoStack:[],redoStack:[],rangeCount:0,range:null,modal:e,debug:void 0}),r={styles:()=>{if(!n.doc)return;let e=new Set,t=[`bold`,`italic`,`underline`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`blockquote`,`p`,`orderedList`,`unorderedList`];t.forEach(t=>{n.doc&&Wu(t,n.doc)&&e.add(t)}),n.selectedStyles=e},content:e=>{if(!n.doc)return;let t=n.doc.body.innerHTML;t!==n.content&&(n.undoStack.push(n.content),n.redoStack=[]);let r=n.doc.getSelection(),i=r?.rangeCount?r.getRangeAt(0).cloneRange():null;if(e===`html`){let e=Gu(n.content);n.doc.body.innerHTML=e.html,setTimeout(()=>{if(n.doc&&(Ku(n.doc,n.content,e.iframes),i&&r))try{r.removeAllRanges(),r.addRange(i)}catch{}},0)}else n.doc.body.textContent=n.content},selection:()=>{if(!n.doc)return;let e=n.doc.getSelection();if(e)try{if(!n.doc.body.contains(e.anchorNode)){n.doc.body.focus();return}let t=!n.selection||n.selection!==e||n.rangeCount!==e.rangeCount||e.rangeCount>0&&n.range&&(n.range.startContainer!==e.getRangeAt(0).startContainer||n.range.startOffset!==e.getRangeAt(0).startOffset||n.range.endContainer!==e.getRangeAt(0).endContainer||n.range.endOffset!==e.getRangeAt(0).endOffset);t&&(n.selection=e,n.rangeCount=e.rangeCount,e.rangeCount>0&&(n.range=e.getRangeAt(0).cloneRange()),requestAnimationFrame(()=>{r.styles()}))}catch{n.selection=null,n.range=null,n.rangeCount=0,n.selectedStyles=new Set}}},i={undo:()=>{if(n.undoStack.length===0)return;n.redoStack.push(n.content);let e=n.undoStack.pop();e!==void 0&&(n.content=e,r.content(`html`))},redo:()=>{if(n.redoStack.length===0)return;n.undoStack.push(n.content);let e=n.redoStack.pop();e!==void 0&&(n.content=e,r.content(`html`))}},a={emptyTags:e=>{let t=e.createTreeWalker(e.body,NodeFilter.SHOW_ELEMENT,null),n=[],r=t.nextNode();for(;r;){var i;if([`br`,`img`,`hr`,`input`].includes(r.tagName.toLowerCase())){r=t.nextNode();continue}let a=(i=r.textContent)?.trim()||``,o=r.innerHTML.trim(),s=o===`<br>`||o===`<br/>`,c=o===` `||a===`\xA0`,l=!a&&!o,u=r.parentElement===e.body;(l||c||s&&!u)&&n.push(r),r=t.nextNode()}n.forEach(e=>{e.remove()})},normalizeContent:e=>{var t;let n=e.createTreeWalker(e.body,NodeFilter.SHOW_TEXT),r=[],i;for(;i=n.nextNode();)i.parentElement===e.body&&(t=i.textContent)?.trim()&&r.push(i);r.forEach(t=>{let n=e.createElement(`p`);n.dir=e.body.dir,n.appendChild(t.cloneNode()),e.body.replaceChild(n,t)})}};function o(e){t&&(t(),t=null);let i=!1,a={input:()=>{if(i)return;i=!0;let t=e.body.innerHTML;t!==n.content&&(n.content=t),i=!1},selectionchange:()=>{i||r.selection()},mouseup:()=>{i||r.selection()},keyup:e=>{i||[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(e.key)&&r.selection()}};return Object.entries(a).forEach(([t,n])=>{e.addEventListener(t,n)}),t=()=>{Object.entries(a).forEach(([t,n])=>{e.removeEventListener(t,n)})},t}function s(e){if(n.hasInit&&t&&(t(),t=null),n.doc=e,n.hasInit=!0,e.editorState=n,n.content&&n.content.trim()&&!n.content.match(/^<p(?:\s[^>]*)?>(?:<br\s*\/?>)?\s*<\/p>$/i)){let t=Gu(n.content);e.body.innerHTML=t.html,setTimeout(()=>{n.doc&&Ku(e,n.content,t.iframes)},0)}if(a.normalizeContent(e),e.body.firstElementChild){let t=e.createRange(),r=e.getSelection();r&&(t.selectNodeContents(e.body),t.collapse(!1),r.removeAllRanges(),r.addRange(t),n.range=t.cloneRange(),n.selection=r,n.rangeCount=r.rangeCount)}else{let t=e.getSelection();if(t){let r=e.createRange();r.setStart(e.body,0),r.setEnd(e.body,0),t.removeAllRanges(),t.addRange(r),n.range=r.cloneRange(),n.selection=t,n.rangeCount=t.rangeCount}}t=o(e)}function c(){if(!n.debug){let e=new Uu,t={debugger:e,logCommand:(t,r)=>{e.logCommand(t,r,n)},getSession:()=>e.getSession(),clearSession:()=>{e.clearSession()},downloadSession:()=>{e.downloadSession()},exportDebugWithPrompt:t=>e.exportSessionWithPrompt(t)};n.debug=t}}return typeof window<`u`&&window.addEventListener(`beforeunload`,()=>{t&&t()}),{state:n,init:s,updateState:r,history:i,initDebugger:c,cleanup:()=>{t&&(t(),t=null)}}}const Ju=[{key:`b`,command:`bold`},{key:`i`,command:`italic`},{key:`u`,command:`underline`},{key:`z`,command:`undo`},{key:`z`,modifiers:{shift:!0},command:`redo`},{key:`y`,command:`redo`},{key:`.`,modifiers:{shift:!0},command:`orderedList`},{key:`/`,modifiers:{shift:!0},command:`unorderedList`},{key:`]`,command:`indent`},{key:`[`,command:`outdent`},...Array.from({length:6},(e,t)=>({key:String(t+1),modifiers:{alt:!0},command:`h${t+1}`}))];function Yu(e,t){e.addEventListener(`keydown`,n=>{if(n.key===`Enter`&&!n.shiftKey){var r;let t=e.getSelection();if(!t||!t.rangeCount)return;let s=t.getRangeAt(0),c=s.commonAncestorContainer,l=(r=c.nodeType===3?c.parentElement:c)?.closest(`li`);if(l){if(s.collapsed&&Xu(l,s))if(Zu(l)){n.preventDefault();let r=l.parentElement;if(!r)return;if(l.remove(),!r.querySelector(`li`)){var i;let n=e.createElement(`p`);n.innerHTML=``,(i=r.parentNode)?.replaceChild(n,r),s.selectNodeContents(n),s.collapse(!0),t.removeAllRanges(),t.addRange(s)}}else{n.preventDefault();let r=e.createElement(`li`);r.innerHTML=``,l.insertAdjacentElement(`afterend`,r),s.selectNodeContents(r),s.collapse(!0),t.removeAllRanges(),t.addRange(s)}}else{var a,o;let r=(a=c.nodeType===3?c.parentElement:c)?.closest(`p,h1,h2,h3,h4,h5,h6,blockquote,div`);if(r&&s.collapsed){if(Xu(r,s)){n.preventDefault();let i=e.createElement(`p`);i.innerHTML=``,r.insertAdjacentElement(`afterend`,i),s.selectNodeContents(i),s.collapse(!0),t.removeAllRanges(),t.addRange(s)}}else if(!r&&(o=e.body.textContent)?.trim()){n.preventDefault();let r=e.body.textContent||``,i=s.startOffset,a=r.substring(0,i).trim(),o=r.substring(i).trim();if(e.body.innerHTML=``,a){let t=e.createElement(`p`);t.textContent=a,e.body.appendChild(t)}let c=e.createElement(`p`);c.textContent=o,e.body.appendChild(c),s.selectNodeContents(c),s.collapse(!0),t.removeAllRanges(),t.addRange(s)}}}if(!n.ctrlKey&&!n.metaKey)return;let s=Ju.find(e=>{let t=e.key===n.key,r=!e.modifiers||(!e.modifiers.ctrl||n.ctrlKey||n.metaKey)&&(!e.modifiers.alt||n.altKey)&&(!e.modifiers.shift||n.shiftKey);return t&&r});s&&(n.preventDefault(),t.execute(s.command))})}function Xu(e,t){var n;if(e.nodeType===3)return t.startOffset===e.length;let{lastChild:r}=e;return r?r.nodeType===3?t.startContainer===r&&t.startOffset===(n=r.textContent)?.length:t.startContainer===e&&t.startOffset===e.childNodes.length:!0}function Zu(e){var t;let n=(t=e.textContent)?.replace(/\s/g,``)||``;if(n)return!1;let r=e.getElementsByTagName(`br`);return r.length===0?!0:r.length===1&&e.childNodes.length<=2}const Qu={class:`bagel-input`},$u={key:1,class:`flex`};var ed=h({__name:`index`,props:{modelValue:{},toolbarConfig:{},debug:{type:Boolean},label:{},height:{}},emits:[`update:modelValue`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=L(),s=qu(),f=L(!1),h=L(!1);s.state.content=r.modelValue,r.debug&&s.initDebugger();let g=Hu(s.state,s.state.debug),_=o(()=>s.state.debug),v=o(()=>/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(r.modelValue)),y=o(()=>typeof r.height==`number`?`${r.height}px`:typeof r.height==`string`?r.height:`240px`);N(()=>{s.cleanup()});function b(e){e.addEventListener(`input`,()=>{var t;if(!e.body.firstElementChild||!(t=e.body.textContent)?.trim()&&!e.body.querySelector(`p,h1,h2,h3,h4,h5,h6,blockquote,ul,ol,table`)){var n;if((n=e.body.textContent)?.trim()){let t=e.createElement(`p`);for(t.dir=e.body.dir;e.body.firstChild;)t.appendChild(e.body.firstChild);e.body.appendChild(t);let n=e.getSelection();if(n){let r=e.createRange();r.selectNodeContents(t),r.collapse(!1),n.removeAllRanges(),n.addRange(r)}s.state.content=e.body.innerHTML}}}),e.addEventListener(`keydown`,t=>{if(t.key===`Backspace`){let r=e.getSelection();if(!r||!r.rangeCount)return;let i=r.getRangeAt(0),a=e.body.querySelectorAll(`p,h1,h2,h3,h4,h5,h6,blockquote,li,div`);if(a.length<=1){var n;let o=a[0];if(o&&((n=o.textContent)?.trim()===``&&i.collapsed||i.startContainer===o&&i.endContainer===o&&i.startOffset===0&&i.endOffset===o.childNodes.length)){t.preventDefault(),o.innerHTML=``;let n=e.createRange();n.selectNodeContents(o),n.collapse(!0),r.removeAllRanges(),r.addRange(n),s.state.content=e.body.innerHTML}}}}),e.addEventListener(`paste`,t=>{setTimeout(()=>{var t;let n=e.createTreeWalker(e.body,NodeFilter.SHOW_TEXT),r=[],i;for(;i=n.nextNode();)i.parentElement===e.body&&(t=i.textContent)?.trim()&&r.push(i);r.forEach(t=>{let n=e.createElement(`p`);n.dir=e.body.dir,n.appendChild(t.cloneNode()),e.body.replaceChild(n,t)}),r.length>0&&(s.state.content=e.body.innerHTML)},0)})}async function x(){if(!(f.value||!a.value||h.value)){f.value=!0;try{var e;let t=await import(`./editor-sxMLITHI.js`),n=`
|
|
10
10
|
<!DOCTYPE html>
|
|
11
11
|
<html>
|
|
12
12
|
<head>
|