import{S as K,r as R,c as u,w as z,g as M,h as c,T as W,c6 as L,q,aX as U}from"./index-BT5eY4j5.js";import{T as X}from"./TouchSwipe-DbDTeaOO.js";function _(){let e=Object.create(null);return{getCache:(a,i)=>e[a]===void 0?e[a]=typeof i=="function"?i():i:e[a],setCache(a,i){e[a]=i},hasCache(a){return Object.hasOwnProperty.call(e,a)},clearCache(a){a!==void 0?delete e[a]:e=Object.create(null)}}}const H={name:{required:!0},disable:Boolean},k={setup(e,{slots:a}){return()=>c("div",{class:"q-panel scroll",role:"tabpanel"},q(a.default))}},J={modelValue:{required:!0},animated:Boolean,infinite:Boolean,swipeable:Boolean,vertical:Boolean,transitionPrev:String,transitionNext:String,transitionDuration:{type:[String,Number],default:300},keepAlive:Boolean,keepAliveInclude:[String,Array,RegExp],keepAliveExclude:[String,Array,RegExp],keepAliveMax:Number},Q=["update:modelValue","beforeTransition","transition"];function Y(){const{props:e,emit:a,proxy:i}=M(),{getCache:N}=_(),{registerTimeout:B}=K();let l,f;const m=R(null),o={value:null};function E(t){const n=e.vertical===!0?"up":"left";s((i.$q.lang.rtl===!0?-1:1)*(t.direction===n?1:-1))}const I=u(()=>[[X,E,void 0,{horizontal:e.vertical!==!0,vertical:e.vertical,mouse:!0}]]),O=u(()=>e.transitionPrev||`slide-${e.vertical===!0?"down":"right"}`),V=u(()=>e.transitionNext||`slide-${e.vertical===!0?"up":"left"}`),P=u(()=>`--q-transition-duration: ${e.transitionDuration}ms`),p=u(()=>typeof e.modelValue=="string"||typeof e.modelValue=="number"?e.modelValue:String(e.modelValue)),h=u(()=>({include:e.keepAliveInclude,exclude:e.keepAliveExclude,max:e.keepAliveMax})),b=u(()=>e.keepAliveInclude!==void 0||e.keepAliveExclude!==void 0);z(()=>e.modelValue,(t,n)=>{const r=d(t)===!0?g(t):-1;f!==!0&&y(r===-1?0:r<g(n)?-1:1),o.value!==r&&(o.value=r,a("beforeTransition",t,n),B(()=>{a("transition",t,n)},e.transitionDuration))});function x(){s(1)}function A(){s(-1)}function T(t){a("update:modelValue",t)}function d(t){return t!=null&&t!==""}function g(t){return l.findIndex(n=>n.props.name===t&&n.props.disable!==""&&n.props.disable!==!0)}function w(){return l.filter(t=>t.props.disable!==""&&t.props.disable!==!0)}function y(t){const n=t!==0&&e.animated===!0&&o.value!==-1?"q-transition--"+(t===-1?O.value:V.value):null;m.value!==n&&(m.value=n)}function s(t,n=o.value){let r=n+t;for(;r!==-1&&r<l.length;){const v=l[r];if(v!==void 0&&v.props.disable!==""&&v.props.disable!==!0){y(t),f=!0,a("update:modelValue",v.props.name),setTimeout(()=>{f=!1});return}r+=t}e.infinite===!0&&l.length!==0&&n!==-1&&n!==l.length&&s(t,t===-1?l.length:-1)}function C(){const t=g(e.modelValue);return o.value!==t&&(o.value=t),!0}function S(){const t=d(e.modelValue)===!0&&C()&&l[o.value];return e.keepAlive===!0?[c(U,h.value,[c(b.value===!0?N(p.value,()=>({...k,name:p.value})):k,{key:p.value,style:P.value},()=>t)])]:[c("div",{class:"q-panel scroll",style:P.value,key:p.value,role:"tabpanel"},[t])]}function j(){if(l.length!==0)return e.animated===!0?[c(W,{name:m.value},S)]:S()}function D(t){return l=L(q(t.default,[])).filter(n=>n.props!==null&&n.props.slot===void 0&&d(n.props.name)===!0),l.length}function $(){return l}return Object.assign(i,{next:x,previous:A,goTo:T}),{panelIndex:o,panelDirectives:I,updatePanelsList:D,updatePanelIndex:C,getPanelContent:j,getEnabledPanels:w,getPanels:$,isValidPanelName:d,keepAliveProps:h,needsUniqueKeepAliveWrapper:b,goToPanelByOffset:s,goToPanel:T,nextPanel:x,previousPanel:A}}export{_ as a,J as b,Q as c,Y as d,H as u};
