<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import{d as C,j as m,F as E,r,o as k,p as v,q as y}from"./index-p09JJVDp.js";function j(e,u){e&amp;&amp;window.dispatchEvent(new CustomEvent(e,{detail:{id:u}}))}function M(e){return e instanceof Promise}function B({actions:e,label:u,eventName:d,onPress:s,icon:l,id:i,appearance:h,preAction:a,postAction:t}){const n=e!=null&amp;&amp;e.length?C.SplitButton:C.Button;return m.jsx(n,{iconBefore:l??null,appearance:h,onPress:async()=&gt;{M(a)?await a():a==null||a(),j(d,i),M(s)?await s():s==null||s(),M(t)?await t():t==null||t()},content:e!=null&amp;&amp;e.length?m.jsx(C.Menu,{items:e==null?void 0:e.map(({id:f,label:x,eventName:c,icon:g,onPress:o})=&gt;({key:f,title:x,icon:g,onPress:()=&gt;{a==null||a(),j(c,f),o==null||o(),t==null||t()}}))}):null,children:m.jsx(E,{id:i,defaultMessage:u})})}const w=r.createContext({actions:{}});function F(){return r.useContext(w)}function L(e,u){const{actions:d}=F();k(e,u),d[e]=u}function q(e){const{pathname:u}=v(),d=y(),s=e.backPath||(u==null?void 0:u.split("/").slice(0,-1).join("/")),l=r.useMemo(()=&gt;(e.actions||[]).concat(d.filter(t=&gt;{var n;return(n=t.handle)==null?void 0:n.actions}).flatMap(t=&gt;{var n;return(n=t.handle)==null?void 0:n.actions}))??[],[d,e.actions]),i=r.useMemo(()=&gt;l.reduce((t,{eventName:n,id:f,onPress:x})=&gt;{const c=f;return n&amp;&amp;(t[c]=()=&gt;j(n,f)),x&amp;&amp;(t[c]=x),t},{}),[l]),h=r.useCallback(t=&gt;m.jsx(w.Provider,{value:{actions:i},...t}),[i]),a=r.useMemo(()=&gt;{const t=()=&gt;m.jsx(r.Fragment,{children:l.map(n=&gt;"render"in n?n.render():m.jsx(B,{...n},n.id))});return t.displayName="Actions",t},[l]);return{actions:l,Actions:a,backPath:s,AdminContextProvider:h}}export{L as a,q as u};
</pre></body></html>