import{t as ee,a0 as te,bb as oe,a1 as ae,x as ne,r as O,z as f,bj as ie,bk as le,bc as se,a3 as re,bl as ue,T as k,O as x,bv as C,bu as E,aw as ce,s as H,Z as de,A as fe,U as ve}from"./entry.5131710f.js";import{u as he,v as A,a as me,p as _,b as ge,c as be,r as j,s as ye,e as q,d as Te}from"./position-engine.3cd7a5a0.js";const Pe=ee({name:"QTooltip",inheritAttrs:!1,props:{...he,...te,...oe,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null},transitionShow:{default:"jump-down"},transitionHide:{default:"jump-up"},anchor:{type:String,default:"bottom middle",validator:A},self:{type:String,default:"top middle",validator:A},offset:{type:Array,default:()=>[14,14],validator:me},scrollTarget:{default:void 0},delay:{type:Number,default:0},hideDelay:{type:Number,default:0}},emits:[...ae],setup(e,{slots:D,emit:b,attrs:v}){let i,l;const h=ne(),{proxy:{$q:a}}=h,s=O(null),c=O(!1),M=f(()=>_(e.anchor,a.lang.rtl)),L=f(()=>_(e.self,a.lang.rtl)),W=f(()=>e.persistent!==!0),{registerTick:N,removeTick:R}=ie(),{registerTimeout:d}=le(),{transitionProps:U,transitionStyle:z}=se(e),{localScrollTarget:y,changeScrollEvent:B,unconfigureScrollTarget:I}=ge(e,P),{anchorEl:o,canShow:Q,anchorEvents:r}=be({showing:c,configureAnchorEl:K}),{show:V,hide:m}=re({showing:c,canShow:Q,handleShow:$,handleHide:F,hideOnRouteChange:W,processOnMount:!0});Object.assign(r,{delayShow:G,delayHide:J});const{showPortal:T,hidePortal:p,renderPortal:Z}=ue(h,s,Y,"tooltip");if(a.platform.is.mobile===!0){const t={anchorEl:o,innerRef:s,onClickOutside(n){return m(n),n.target.classList.contains("q-dialog__backdrop")&&ve(n),!0}},g=f(()=>e.modelValue===null&&e.persistent!==!0&&c.value===!0);k(g,n=>{(n===!0?Te:j)(t)}),x(()=>{j(t)})}function $(t){T(),N(()=>{l=new MutationObserver(()=>u()),l.observe(s.value,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),u(),P()}),i===void 0&&(i=k(()=>a.screen.width+"|"+a.screen.height+"|"+e.self+"|"+e.anchor+"|"+a.lang.rtl,u)),d(()=>{T(!0),b("show",t)},e.transitionDuration)}function F(t){R(),p(),S(),d(()=>{p(!0),b("hide",t)},e.transitionDuration)}function S(){l!==void 0&&(l.disconnect(),l=void 0),i!==void 0&&(i(),i=void 0),I(),C(r,"tooltipTemp")}function u(){const t=s.value;o.value===null||!t||ye({el:t,offset:e.offset,anchorEl:o.value,anchorOrigin:M.value,selfOrigin:L.value,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function G(t){if(a.platform.is.mobile===!0){q(),document.body.classList.add("non-selectable");const g=o.value,n=["touchmove","touchcancel","touchend","click"].map(w=>[g,w,"delayHide","passiveCapture"]);E(r,"tooltipTemp",n)}d(()=>{V(t)},e.delay)}function J(t){a.platform.is.mobile===!0&&(C(r,"tooltipTemp"),q(),setTimeout(()=>{document.body.classList.remove("non-selectable")},10)),d(()=>{m(t)},e.hideDelay)}function K(){if(e.noParentEvent===!0||o.value===null)return;const t=a.platform.is.mobile===!0?[[o.value,"touchstart","delayShow","passive"]]:[[o.value,"mouseenter","delayShow","passive"],[o.value,"mouseleave","delayHide","passive"]];E(r,"anchor",t)}function P(){if(o.value!==null||e.scrollTarget!==void 0){y.value=ce(o.value,e.scrollTarget);const t=e.noParentEvent===!0?u:m;B(y.value,t)}}function X(){return c.value===!0?H("div",{...v,ref:s,class:["q-tooltip q-tooltip--style q-position-engine no-pointer-events",v.class],style:[v.style,z.value],role:"tooltip"},fe(D.default)):null}function Y(){return H(de,U.value,X)}return x(S),Object.assign(h.proxy,{updatePosition:u}),Z}});export{Pe as _};
