import{b as P,g as b,j as p,d as h,k as x,aN as y,h as Q,a4 as j}from"./app-DzAYC6xy.js";import{b as k}from"./QSelect-CKpWbBmC.js";import{e as C,c as M}from"./position-engine-BoHh6ymb.js";const I=P({name:"QPopupProxy",props:{...C,breakpoint:{type:[String,Number],default:450}},emits:["show","hide"],setup(a,{slots:g,emit:c,attrs:f}){const{proxy:u}=b(),{$q:l}=u,n=p(!1),t=p(null),i=h(()=>parseInt(a.breakpoint,10)),{canShow:v}=M({showing:n});function r(){return l.screen.width<i.value||l.screen.height<i.value?"dialog":"menu"}const o=p(r()),m=h(()=>o.value==="menu"?{maxHeight:"99vh"}:{});x(()=>r(),e=>{n.value!==!0&&(o.value=e)});function d(e){n.value=!0,c("show",e)}function w(e){n.value=!1,o.value=r(),c("hide",e)}return Object.assign(u,{show(e){v(e)===!0&&t.value.show(e)},hide(e){t.value.hide(e)},toggle(e){t.value.toggle(e)}}),y(u,"currentComponent",()=>({type:o.value,ref:t.value})),()=>{const e={ref:t,...m.value,...f,onShow:d,onHide:w};let s;return o.value==="dialog"?s=j:(s=k,Object.assign(e,{target:a.target,contextMenu:a.contextMenu,noParentEvent:!0,separateClosePopup:!0})),Q(s,e,g.default)}}});export{I as Q};
