var J=Object.defineProperty,K=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var O=(i,t,a)=>t in i?J(i,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):i[t]=a,m=(i,t)=>{for(var a in t||(t={}))W.call(t,a)&&O(i,a,t[a]);if(N)for(var a of N(t))X.call(t,a)&&O(i,a,t[a]);return i},w=(i,t)=>K(i,Q(t));import{aa as Y,c as p,b as Z,a as M,a9 as H,m as I,d as x,r as L,w as T,f as c,o as n,j as ee,g as l,h as r,n as q,a2 as v,J as _,k as ae,L as f,M as h,_ as se,G as $,I as P,bn as te,aj as ne,H as V,l as le,i as oe,ai as ie,q as ce}from"./index-C8qz7c0N.js";const de=w(m({},Z),{customHeaderClass:I(""),modelValue:m(m({},p(!1)),Y(Boolean)),actions:H(),panels:H(),title:String,cancelText:String,closeOnClickAction:p(!0),closeOnClickModal:p(!0),duration:M(200),zIndex:M(10),lazyRender:p(!0),safeAreaInsetBottom:p(!0)}),re={name:"wd-action-sheet",options:{addGlobalClass:!0,virtualHost:!0,styleIsolation:"shared"}},ue=x(w(m({},re),{props:de,emits:["select","click-modal","cancel","closed","close","open","opened","update:modelValue"],setup(i,{emit:t}){const a=i,d=t,k=L([]),b=L(!1);T(()=>a.panels,E,{deep:!0,immediate:!0}),T(()=>a.modelValue,e=>{b.value=e},{deep:!0,immediate:!0});function z(){return a.panels.length&&!ie(a.panels[0])}function E(){k.value=z()?[a.panels]:a.panels}function A(e,g,s){if(g==="action"){if(a.actions[e].disabled||a.actions[e].loading)return;d("select",{item:a.actions[e],index:e})}else z()?d("select",{item:a.panels[Number(s)],index:s}):d("select",{item:a.panels[e][Number(s)],rowIndex:e,colIndex:s});a.closeOnClickAction&&y()}function R(){d("click-modal")}function j(){d("cancel"),y()}function y(){d("update:modelValue",!1),d("close")}function G(){d("open")}function U(){d("opened")}function D(){d("closed")}return(e,g)=>{const s=ee,S=te,F=le;return n(),c(s,null,{default:l(()=>[r(oe,{"custom-class":"wd-action-sheet__popup","custom-style":`${e.actions&&e.actions.length||e.panels&&e.panels.length?"background: transparent;":""}`,modelValue:b.value,"onUpdate:modelValue":g[0]||(g[0]=o=>b.value=o),duration:e.duration,position:"bottom","close-on-click-modal":e.closeOnClickModal,"safe-area-inset-bottom":e.safeAreaInsetBottom,"lazy-render":e.lazyRender,onEnter:G,onClose:y,onAfterEnter:U,onAfterLeave:D,onClickModal:R,"z-index":e.zIndex},{default:l(()=>[r(s,{class:v(`wd-action-sheet ${e.customClass}`),style:q(`${e.actions&&e.actions.length||e.panels&&e.panels.length?"margin: 0 10px calc(var(--window-bottom) + 10px) 10px; border-radius: 16px;":"margin-bottom: var(--window-bottom);"} ${e.customStyle}`)},{default:l(()=>[e.title?(n(),c(s,{key:0,class:v(`wd-action-sheet__header ${e.customHeaderClass}`)},{default:l(()=>[f(h(e.title)+" ",1),r(se,{"custom-class":"wd-action-sheet__close",name:"add",onClick:y})]),_:1},8,["class"])):_("",!0),e.actions&&e.actions.length?(n(),c(s,{key:1,class:"wd-action-sheet__actions"},{default:l(()=>[(n(!0),$(V,null,P(e.actions,(o,u)=>(n(),c(S,{key:u,class:v(`wd-action-sheet__action ${o.disabled?"wd-action-sheet__action--disabled":""}  ${o.loading?"wd-action-sheet__action--loading":""}`),style:q(`color: ${o.color}`),onClick:C=>A(u,"action")},{default:l(()=>[o.loading?(n(),c(ne,{key:0,"custom-class":"`wd-action-sheet__action-loading"})):(n(),c(s,{key:1,class:"wd-action-sheet__name"},{default:l(()=>[f(h(o.name),1)]),_:2},1024)),!o.loading&&o.subname?(n(),c(s,{key:2,class:"wd-action-sheet__subname"},{default:l(()=>[f(h(o.subname),1)]),_:2},1024)):_("",!0)]),_:2},1032,["class","style","onClick"]))),128))]),_:1})):_("",!0),k.value&&k.value.length?(n(),c(s,{key:2},{default:l(()=>[(n(!0),$(V,null,P(k.value,(o,u)=>(n(),c(s,{key:u,class:"wd-action-sheet__panels"},{default:l(()=>[r(s,{class:"wd-action-sheet__panels-content"},{default:l(()=>[(n(!0),$(V,null,P(o,(C,B)=>(n(),c(s,{key:B,class:"wd-action-sheet__panel",onClick:me=>A(u,"panels",B)},{default:l(()=>[r(F,{class:"wd-action-sheet__panel-img",src:C.iconUrl},null,8,["src"]),r(s,{class:"wd-action-sheet__panel-title"},{default:l(()=>[f(h(C.title),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1})):_("",!0),ae(e.$slots,"default",{},void 0,!0),e.cancelText?(n(),c(S,{key:3,class:"wd-action-sheet__cancel",onClick:j},{default:l(()=>[f(h(e.cancelText),1)]),_:1})):_("",!0)]),_:3},8,["class","style"])]),_:3},8,["custom-style","modelValue","duration","close-on-click-modal","safe-area-inset-bottom","lazy-render","z-index"])]),_:3})}}})),fe=ce(ue,[["__scopeId","data-v-04c084fb"]]);export{fe as _};
