import{c as Q,I as ne,r as B,a as h,w as E,e as x,A as q,u as H,E as ae,h as b,T as se,g as le,d as G,B as ie,U as re}from"./index-BxiAnk4a.js";import{w as ue,u as ce,x as T,y as D,z as de,b as fe,p as he,e as ge,A as ve,B as pe,C as me,f as ye,D as Te,E as A,F as be,c as j,G as M,H as we}from"./QItemLabel-BBmtOiru.js";const Pe=Q({name:"QTooltip",inheritAttrs:!1,props:{...ue,...ce,...T,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null},transitionShow:{...T.transitionShow,default:"jump-down"},transitionHide:{...T.transitionHide,default:"jump-up"},anchor:{type:String,default:"bottom middle",validator:D},self:{type:String,default:"top middle",validator:D},offset:{type:Array,default:()=>[14,14],validator:de},scrollTarget:ne,delay:{type:Number,default:0},hideDelay:{type:Number,default:0},persistent:Boolean},emits:[...fe],setup(e,{slots:l,emit:s,attrs:r}){let o,u;const p=le(),{proxy:{$q:n}}=p,c=B(null),g=B(!1),I=h(()=>M(e.anchor,n.lang.rtl)),L=h(()=>M(e.self,n.lang.rtl)),N=h(()=>e.persistent!==!0),{registerTick:R,removeTick:U}=he(),{registerTimeout:v}=ge(),{transitionProps:_,transitionStyle:W}=ve(e),{localScrollTarget:w,changeScrollEvent:$,unconfigureScrollTarget:J}=pe(e,O),{anchorEl:a,canShow:z,anchorEvents:d}=me({showing:g,configureAnchorEl:ee}),{show:F,hide:m}=ye({showing:g,canShow:z,handleShow:K,handleHide:X,hideOnRouteChange:N,processOnMount:!0});Object.assign(d,{delayShow:Y,delayHide:Z});const{showPortal:S,hidePortal:k,renderPortal:V}=Te(p,c,oe,"tooltip");if(n.platform.is.mobile===!0){const t={anchorEl:a,innerRef:c,onClickOutside(i){return m(i),i.target.classList.contains("q-dialog__backdrop")&&ie(i),!0}},y=h(()=>e.modelValue===null&&e.persistent!==!0&&g.value===!0);E(y,i=>{(i===!0?we:A)(t)}),x(()=>{A(t)})}function K(t){S(),R(()=>{u=new MutationObserver(()=>f()),u.observe(c.value,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),f(),O()}),o===void 0&&(o=E(()=>n.screen.width+"|"+n.screen.height+"|"+e.self+"|"+e.anchor+"|"+n.lang.rtl,f)),v(()=>{S(!0),s("show",t)},e.transitionDuration)}function X(t){U(),k(),P(),v(()=>{k(!0),s("hide",t)},e.transitionDuration)}function P(){u!==void 0&&(u.disconnect(),u=void 0),o!==void 0&&(o(),o=void 0),J(),q(d,"tooltipTemp")}function f(){be({targetEl:c.value,offset:e.offset,anchorEl:a.value,anchorOrigin:I.value,selfOrigin:L.value,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function Y(t){if(n.platform.is.mobile===!0){j(),document.body.classList.add("non-selectable");const y=a.value,i=["touchmove","touchcancel","touchend","click"].map(C=>[y,C,"delayHide","passiveCapture"]);H(d,"tooltipTemp",i)}v(()=>{F(t)},e.delay)}function Z(t){n.platform.is.mobile===!0&&(q(d,"tooltipTemp"),j(),setTimeout(()=>{document.body.classList.remove("non-selectable")},10)),v(()=>{m(t)},e.hideDelay)}function ee(){if(e.noParentEvent===!0||a.value===null)return;const t=n.platform.is.mobile===!0?[[a.value,"touchstart","delayShow","passive"]]:[[a.value,"mouseenter","delayShow","passive"],[a.value,"mouseleave","delayHide","passive"]];H(d,"anchor",t)}function O(){if(a.value!==null||e.scrollTarget!==void 0){w.value=ae(a.value,e.scrollTarget);const t=e.noParentEvent===!0?f:m;$(w.value,t)}}function te(){return g.value===!0?b("div",{...r,ref:c,class:["q-tooltip q-tooltip--style q-position-engine no-pointer-events",r.class],style:[r.style,W.value],role:"tooltip"},G(l.default)):null}function oe(){return b(se,_.value,te)}return x(P),Object.assign(p.proxy,{updatePosition:f}),V}}),Oe=Q({name:"QBtnGroup",props:{unelevated:Boolean,outline:Boolean,flat:Boolean,rounded:Boolean,square:Boolean,push:Boolean,stretch:Boolean,glossy:Boolean,spread:Boolean},setup(e,{slots:l}){const s=h(()=>{const r=["unelevated","outline","flat","rounded","square","push","stretch","glossy"].filter(o=>e[o]===!0).map(o=>`q-btn-group--${o}`).join(" ");return`q-btn-group row no-wrap${r.length!==0?" "+r:""}`+(e.spread===!0?" q-btn-group--spread":" inline")});return()=>b("div",{class:s.value},G(l.default))}}),Ce=re("token",{state:()=>({token:""}),getters:{tokenDataGet(e){if(e.token!==""){let s=e.token.split(".");var l=JSON.parse(decodeURIComponent(escape(window.atob(s[1].replace(/-/g,"+").replace(/_/g,"/")))));return l}else return e.token}},actions:{tokenChange(e){this.token=e},tokenCheck(){if(this.token!==""){let s=this.token.split(".");var e=JSON.parse(decodeURIComponent(escape(window.atob(s[1].replace(/-/g,"+").replace(/_/g,"/"))))),l=e.exp-Date.parse(new Date)/1e3;l<=0&&(this.token="")}}},persist:{enable:!0}});export{Pe as Q,Oe as a,Ce as u};
