import{m as A,N as S,bf as I,t as o,aT as v,n as y,bg as T,d as w,k as t,z as x,as as B,P as N,a2 as O,aI as K,L as _,W as D,y as E}from"./index.879f7421.js";const[H,a]=A("action-sheet"),L=S({},I,{title:String,round:o,actions:v(),closeIcon:y("cross"),closeable:o,cancelText:String,description:String,closeOnPopstate:o,closeOnClickAction:Boolean,safeAreaInsetBottom:o}),z=[...T,"round","closeOnPopstate","safeAreaInsetBottom"];var F=w({name:H,props:L,emits:["select","cancel","update:show"],setup(n,{slots:c,emit:l}){const r=e=>l("update:show",e),i=()=>{r(!1),l("cancel")},m=()=>{if(n.title)return t("div",{class:a("header")},[n.title,n.closeable&&t(O,{name:n.closeIcon,class:[a("close"),K],onClick:i},null)])},f=()=>{if(c.cancel||n.cancelText)return[t("div",{class:a("gap")},null),t("button",{type:"button",class:a("cancel"),onClick:i},[c.cancel?c.cancel():n.cancelText])]},b=(e,s)=>e.loading?t(_,{class:a("loading-icon")},null):c.action?c.action({action:e,index:s}):[t("span",{class:a("name")},[e.name]),e.subname&&t("div",{class:a("subname")},[e.subname])],h=(e,s)=>{const{color:C,loading:d,callback:u,disabled:p,className:P}=e,g=()=>{p||d||(u&&u(e),n.closeOnClickAction&&r(!1),D(()=>l("select",e,s)))};return t("button",{type:"button",style:{color:C},class:[a("item",{loading:d,disabled:p}),P],onClick:g},[b(e,s)])},k=()=>{if(n.description||c.description){const e=c.description?c.description():n.description;return t("div",{class:a("description")},[e])}};return()=>t(N,x({class:a(),position:"bottom","onUpdate:show":r},B(n,z)),{default:()=>{var e;return[m(),k(),t("div",{class:a("content")},[n.actions.map(h),(e=c.default)==null?void 0:e.call(c)]),f()]}})}});const V=E(F);export{V as A};
