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