import{bY as R,ag as _,co as v,cp as $,l as d,cq as L,U as l,aZ as s,ap as O,c2 as S,ad as h,cr as p,aa as I}from"./index.69621fe4.js";var U=R({name:"QFooter",props:{modelValue:{type:Boolean,default:!0},reveal:Boolean,bordered:Boolean,elevated:Boolean,heightHint:{type:[String,Number],default:50}},emits:["reveal","focusin"],setup(a,{slots:q,emit:m}){const{proxy:{$q:c}}=I(),t=_($,v);if(t===v)return console.error("QFooter needs to be child of QLayout"),v;const r=d(parseInt(a.heightHint,10)),n=d(!0),g=d(L.value===!0||t.isContainer.value===!0?0:window.innerHeight),f=l(()=>a.reveal===!0||t.view.value.indexOf("F")>-1||c.platform.is.ios&&t.isContainer.value===!0),y=l(()=>t.isContainer.value===!0?t.containerHeight.value:g.value),b=l(()=>{if(a.modelValue!==!0)return 0;if(f.value===!0)return n.value===!0?r.value:0;const e=t.scroll.value.position+y.value+r.value-t.height.value;return e>0?e:0}),w=l(()=>a.modelValue!==!0||f.value===!0&&n.value!==!0),z=l(()=>a.modelValue===!0&&w.value===!0&&a.reveal===!0),x=l(()=>"q-footer q-layout__section--marginal "+(f.value===!0?"fixed":"absolute")+"-bottom"+(a.bordered===!0?" q-footer--bordered":"")+(w.value===!0?" q-footer--hidden":"")+(a.modelValue!==!0?" q-layout--prevent-focus"+(f.value!==!0?" hidden":""):"")),F=l(()=>{const e=t.rows.value.bottom,o={};return e[0]==="l"&&t.left.space===!0&&(o[c.lang.rtl===!0?"right":"left"]=`${t.left.size}px`),e[2]==="r"&&t.right.space===!0&&(o[c.lang.rtl===!0?"left":"right"]=`${t.right.size}px`),o});function u(e,o){t.update("footer",e,o)}function i(e,o){e.value!==o&&(e.value=o)}function H({height:e}){i(r,e),u("size",e)}function C(){if(a.reveal!==!0)return;const{direction:e,position:o,inflectionPoint:B}=t.scroll.value;i(n,e==="up"||o-B<100||t.height.value-y.value-o-r.value<300)}function Q(e){z.value===!0&&i(n,!0),m("focusin",e)}s(()=>a.modelValue,e=>{u("space",e),i(n,!0),t.animate()}),s(b,e=>{u("offset",e)}),s(()=>a.reveal,e=>{e===!1&&i(n,a.modelValue)}),s(n,e=>{t.animate(),m("reveal",e)}),s([r,t.scroll,t.height],C),s(()=>c.screen.height,e=>{t.isContainer.value!==!0&&i(g,e)});const V={};return t.instances.footer=V,a.modelValue===!0&&u("size",r.value),u("space",a.modelValue),u("offset",b.value),O(()=>{t.instances.footer===V&&(t.instances.footer=void 0,u("size",0),u("offset",0),u("space",!1))}),()=>{const e=S(q.default,[h(p,{debounce:0,onResize:H})]);return a.elevated===!0&&e.push(h("div",{class:"q-layout__shadow absolute-full overflow-hidden no-pointer-events"})),h("footer",{class:x.value,style:F.value,onFocusin:Q},e)}}});export{U as Q};
