UNPKG

decocms

Version:

Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools

4 lines (3 loc) • 18.8 kB
import{c as te,b as se,j as t,B as q,b9 as fe,m as ee,_ as me,X as he,Z as pe,Y as re,n as xe,a9 as be,a6 as ve,q as we,r as P,t as G,K as ie,a_ as ke,ai as ge,I as ye,w as Se,x as je,v as Te,D as Me}from"./index-ztdGKvBm.js";import{c as Y,T as Q,a as X}from"./tooltip-Bm0P1gm_.js";import{aq as Ce,aw as ae,aN as Pe,a as De,e as ze,b as oe,aO as Ne}from"./agent-icon-BYWtutu9.js";import{i as Oe}from"./LayoutLeft-DDtN-od-.js";import{d as Ee,e as $e,g as Be,c as Re}from"./use-org-fs-D9dHgOYs.js";import{a as Ae,b as Ue,P as Le}from"./popover-C4oz5B-L.js";import{i as _e}from"./Key01-CaJGjh13.js";function le(n){return n==="bar"?{variant:"ghost",size:"icon"}:{variant:"secondary",size:"icon-sm"}}function Ie(n){const e=te.c(73),{readUrl:l,editor:a,downloadName:m,trailing:v,className:h,placement:f}=n,r=f===void 0?"bar":f,s=se();let p;e[0]!==l?(p=new URL(l,window.location.origin).toString(),e[0]=l,e[1]=p):p=e[1];const o=p;let L;e[2]!==r?(L=le(r),e[2]=r,e[3]=L):L=e[3];const u=L;let x;e[4]!==a.agentUpdated||e[5]!==a.reload||e[6]!==s?(x=a.agentUpdated&&t.jsxs(Y,{children:[t.jsx(Q,{asChild:!0,children:t.jsxs(q,{variant:"outline",size:"sm",onClick:a.reload,children:[t.jsx(fe,{size:12}),s("deck.deckToolbar.agentUpdatedReload")]})}),t.jsx(X,{side:"bottom",children:s("deck.deckToolbar.agentRewriteWarning")})]}),e[4]=a.agentUpdated,e[5]=a.reload,e[6]=s,e[7]=x):x=e[7];let g;e[8]!==a.saving||e[9]!==s?(g=a.saving&&t.jsx("span",{className:"px-1 text-xs text-muted-foreground",children:s("deck.deckToolbar.saving")}),e[8]=a.saving,e[9]=s,e[10]=g):g=e[10];let S;e[11]!==u.size||e[12]!==u.variant||e[13]!==a||e[14]!==s?(S=a.deckDetected&&a.writable&&t.jsxs(Y,{children:[t.jsx(Q,{asChild:!0,children:t.jsx(q,{variant:a.editMode?"secondary":u.variant,size:u.size,"aria-pressed":a.editMode,"aria-label":a.editMode?s("deck.deckToolbar.doneEditing"):s("deck.deckToolbar.editInline"),className:ee(a.editMode&&"text-primary"),onClick:()=>a.setEditMode(!a.editMode),children:t.jsx(Ce,{size:14})})}),t.jsx(X,{side:"bottom",children:a.editMode?s("deck.deckToolbar.doneEditing"):s("deck.deckToolbar.editInlineTooltip")})]}),e[11]=u.size,e[12]=u.variant,e[13]=a,e[14]=s,e[15]=S):S=e[15];let w;e[16]!==o||e[17]!==u.size||e[18]!==u.variant||e[19]!==m||e[20]!==a.deckDetected||e[21]!==s?(w=a.deckDetected?t.jsxs(me,{children:[t.jsx(he,{asChild:!0,children:t.jsx(q,{variant:u.variant,size:u.size,"aria-label":s("deck.deckToolbar.download"),children:t.jsx(ae,{size:14})})}),t.jsxs(pe,{align:"end",children:[t.jsxs(re,{onClick:()=>window.open(`${o}#print`,"_blank","noopener"),children:[t.jsx(Pe,{size:14}),s("deck.deckToolbar.exportAsPdf")]}),t.jsx(re,{asChild:!0,children:t.jsxs("a",{href:o,download:m,children:[t.jsx(De,{size:14}),s("deck.deckToolbar.downloadHtml")]})})]})]}):t.jsxs(Y,{children:[t.jsx(Q,{asChild:!0,children:t.jsx(q,{variant:u.variant,size:u.size,"aria-label":s("deck.deckToolbar.download"),asChild:!0,children:t.jsx("a",{href:o,download:m,children:t.jsx(ae,{size:14})})})}),t.jsx(X,{side:"bottom",children:s("deck.deckToolbar.download")})]}),e[16]=o,e[17]=u.size,e[18]=u.variant,e[19]=m,e[20]=a.deckDetected,e[21]=s,e[22]=w):w=e[22];const j=u.variant,D=u.size;let T;e[23]!==s?(T=s("deck.deckToolbar.openInNewTab"),e[23]=s,e[24]=T):T=e[24];let M;e[25]!==o?(M=()=>window.open(o,"_blank","noopener"),e[25]=o,e[26]=M):M=e[26];let _;e[27]===Symbol.for("react.memo_cache_sentinel")?(_=t.jsx(be,{size:14}),e[27]=_):_=e[27];let d;e[28]!==u.size||e[29]!==u.variant||e[30]!==T||e[31]!==M?(d=t.jsx(Q,{asChild:!0,children:t.jsx(q,{variant:j,size:D,"aria-label":T,onClick:M,children:_})}),e[28]=u.size,e[29]=u.variant,e[30]=T,e[31]=M,e[32]=d):d=e[32];let B;e[33]!==s?(B=s("deck.deckToolbar.openInNewTab"),e[33]=s,e[34]=B):B=e[34];let R;e[35]!==B?(R=t.jsx(X,{side:"bottom",children:B}),e[35]=B,e[36]=R):R=e[36];let b;e[37]!==d||e[38]!==R?(b=t.jsxs(Y,{children:[d,R]}),e[37]=d,e[38]=R,e[39]=b):b=e[39];let E;e[40]!==b||e[41]!==x||e[42]!==g||e[43]!==S||e[44]!==w||e[45]!==v?(E=t.jsxs(t.Fragment,{children:[x,g,S,w,b,v]}),e[40]=b,e[41]=x,e[42]=g,e[43]=S,e[44]=w,e[45]=v,e[46]=E):E=e[46];const A=E;let I;e[47]!==a.railOpen||e[48]!==s?(I=a.railOpen?s("deck.deckToolbar.hideSlideList"):s("deck.deckToolbar.showSlideList"),e[47]=a.railOpen,e[48]=s,e[49]=I):I=e[49];const z=I;let $;e[50]!==u.size||e[51]!==u.variant||e[52]!==a||e[53]!==z?($=a.deckDetected&&t.jsxs(Y,{children:[t.jsx(Q,{asChild:!0,children:t.jsx(q,{variant:a.railOpen?"secondary":u.variant,size:u.size,"aria-pressed":a.railOpen,"aria-label":z,onClick:()=>a.setRailOpen(!a.railOpen),children:t.jsx(Oe,{size:14})})}),t.jsx(X,{side:"bottom",children:z})]}),e[50]=u.size,e[51]=u.variant,e[52]=a,e[53]=z,e[54]=$):$=e[54];const C=$;if(r==="topbar"){let c;return e[55]!==A||e[56]!==C?(c=t.jsxs(xe.Actions,{children:[C,A]}),e[55]=A,e[56]=C,e[57]=c):c=e[57],c}let k;e[58]!==h?(k=ee("flex h-9 shrink-0 items-center gap-1 border-b border-border/60 px-2",h),e[58]=h,e[59]=k):k=e[59];let N;e[60]!==o?(N=()=>window.open(o,"_blank","noopener"),e[60]=o,e[61]=N):N=e[61];let O;e[62]!==m?(O=t.jsx("span",{className:"truncate",children:m}),e[62]=m,e[63]=O):O=e[63];let U;e[64]!==o||e[65]!==N||e[66]!==O?(U=t.jsx("button",{type:"button",onClick:N,className:"flex min-w-0 flex-1 items-center rounded-lg px-2 py-1 text-left text-sm font-medium text-foreground transition-colors hover:bg-accent",title:o,children:O}),e[64]=o,e[65]=N,e[66]=O,e[67]=U):U=e[67];let i;return e[68]!==A||e[69]!==C||e[70]!==k||e[71]!==U?(i=t.jsxs("div",{className:k,children:[C,U,A]}),e[68]=A,e[69]=C,e[70]=k,e[71]=U,e[72]=i):i=e[72],i}const Z=1;function Fe(n){if(typeof n!="object"||n===null||n.v!==Z||n.source!=="deck-viewer")return null;const e=n;return e.type==="ready"||e.type==="state"||e.type==="op"&&typeof e.opId=="string"&&e.op?e:null}const qe=new Set(["script","style","iframe","object","embed","form","link","meta","base","animate","animatetransform","animatemotion","set"]),Ke=new Set(["href","src","xlink:href","action","formaction"]),He=new Set(["javascript:","vbscript:","data:"]);function We(n){let e;try{e=new URL(n,"https://deco.cx").protocol}catch{return!0}return e==="data:"?/^data:image\/(?!svg\+xml)[^;,]+[;,]/i.test(n.trim()):!He.has(e)}function ce(n,e){const l=n.toLowerCase();return l.startsWith("on")?!1:Ke.has(l)?We(e):!0}function Ve(n){for(const e of[...n.querySelectorAll(`${[...qe].join(",")}`)])e.remove();for(const e of[n,...n.querySelectorAll("*")])for(const l of[...e.attributes])ce(l.name,l.value)||e.removeAttribute(l.name)}class F extends Error{constructor(e,l){super(e),this.code=l,this.name="DeckOpError"}code}function de(n){return[...n.children].filter(e=>!/^(TEMPLATE|SCRIPT|STYLE)$/.test(e.tagName))}function Ye(n){const l=new DOMParser().parseFromString(n,"text/html").querySelector("deck-viewer");return l?de(l).length:null}function Qe(n,e){const l=new DOMParser().parseFromString(n,"text/html"),a=l.querySelector("deck-viewer");if(!a)throw new F("no <deck-viewer> element in source","no-viewer");const m=de(a),v=e.kind==="move"?e.from:e.at,h=m[v];if(!h)throw new F(`slide index ${v} out of range (${m.length})`,"stale-index");switch(e.kind){case"remove":{if(m.length<=1)throw new F("cannot remove the last slide","bad-op");h.remove();break}case"duplicate":{const r=h.cloneNode(!0);r.removeAttribute("id");for(const s of r.querySelectorAll("[id]"))s.removeAttribute("id");h.after(r);break}case"move":{if(e.to<0||e.to>=m.length)throw new F(`move target ${e.to} out of range`,"stale-index");if(e.to!==e.from){const r=e.to<e.from?m[e.to]:m[e.to].nextSibling;a.insertBefore(h,r)}break}case"set-attr":{if(!/^[a-zA-Z][\w-]*$/.test(e.name))throw new F(`invalid attribute name: ${e.name}`,"bad-op");if(!ce(e.name,e.value))throw new F(`unsafe attribute: ${e.name}`,"bad-op");h.setAttribute(e.name,e.value);break}case"remove-attr":{h.removeAttribute(e.name);break}case"replace":{const r=new DOMParser().parseFromString(e.html,"text/html");Ve(r.body);const s=r.body.firstElementChild;if(!s)throw new F("replace html has no root element","bad-op");h.replaceWith(l.importNode(s,!0));break}default:throw new F(`unknown op kind: ${e.kind}`,"bad-op")}return`${n.trimStart().toLowerCase().startsWith("<!doctype")?`<!DOCTYPE html> `:""}${l.documentElement.outerHTML} `}const ne="home",Xe=400,Ze=800;function Ge(n){const e=n.savePath!==void 0,{org:l}=ve(),a=we(),m=Ee(ne),[v,h]=P.useState(!1),[f,r]=P.useState(!1),[s,p]=P.useState(!1),[o,L]=P.useState(!1),[u,x]=P.useState(!1),[g,S]=P.useState(!1),[w,j]=P.useState(null),[D,T]=P.useState(null),[M,_]=P.useState(0),[d]=P.useState(()=>({iframe:null,source:null,queue:Promise.resolve(),saveTimer:null,selfMarkers:new Set})),B=v||g||u,R=()=>{n.savePath!==void 0&&(a.invalidateQueries({queryKey:ie.orgFsStat(l.id,ne,n.savePath)}),a.invalidateQueries({queryKey:ie.orgFsRecent(l.id)}))},b=i=>{d.iframe?.contentWindow?.postMessage(i,"*")},E=()=>{d.source=null,L(!1),D&&j(D),_(i=>i+1),R()};n.statMarker!==D&&(T(n.statMarker),n.statMarker!==null&&(w===null?j(n.statMarker):d.selfMarkers.has(n.statMarker)||n.statMarker!==w&&(B?L(!0):(d.source=null,j(n.statMarker)))));const A=async()=>{d.saveTimer=null;const i=d.source;if(i===null){S(!1);return}x(!0);try{const c=await m.mutateAsync({path:n.savePath,body:i});d.selfMarkers.add($e(c)),R()}catch(c){console.error("[deck-editor] save failed",c),G.error("Couldn't save deck edits — reloading the preview."),k.current.reload()}finally{x(!1),S(!1)}},I=i=>{S(!0),d.saveTimer&&clearTimeout(d.saveTimer),d.saveTimer=setTimeout(()=>{k.current.flushSave()},i)},z=(i,c,y)=>{b({v:Z,type:"ack",opId:i,ok:c,error:y})},$=async i=>{if(!e){z(i.opId,!1,"read-only preview");return}try{if(d.source===null){const y=await fetch(n.readUrl,{credentials:"include"});if(!y.ok)throw new Error(`HTTP ${y.status}`);d.source=await y.text()}const c=Ye(d.source);if(c===null||c!==i.witness.childCount)throw new F(`slide count drifted (source ${c}, iframe ${i.witness.childCount})`,"stale-index");d.source=Qe(d.source,i.op),z(i.opId,!0),I(i.op.kind==="replace"?Ze:Xe)}catch(c){console.error("[deck-editor] op failed",i.op,c),z(i.opId,!1,c instanceof Error?c.message:String(c)),G.error("That edit couldn't be saved — reloading the preview."),k.current.reload()}},C=i=>{if(!d.iframe||i.source!==d.iframe.contentWindow)return;const c=Fe(i.data);if(c){if(c.type==="ready"){r(!0),k.current.editMode?b({v:Z,type:"set-edit-mode",enabled:!0}):k.current.railOpen&&b({v:Z,type:"set-rail",open:!0});return}c.type==="op"&&(d.queue=d.queue.then(()=>k.current.handleOp(c)).catch(()=>{}))}},k=P.useRef({onMessage:C,handleOp:$,flushSave:A,reload:E,editMode:v,railOpen:s});k.current={onMessage:C,handleOp:$,flushSave:A,reload:E,editMode:v,railOpen:s};const[N]=P.useState(()=>{let i=null;return c=>{if(c){d.iframe=c;const y=K=>k.current.onMessage(K);window.addEventListener("message",y),i=()=>window.removeEventListener("message",y)}else i?.(),i=null,d.iframe=null}}),O=i=>{p(i),b({v:Z,type:"set-rail",open:i})},U=i=>{h(i),b({v:Z,type:"set-edit-mode",enabled:i}),i&&p(!0),!i&&o&&!g&&!u&&E()};return{iframeRef:N,deckDetected:f,writable:e,displayedMarker:w===null?null:`${w}.${M}`,editMode:v,setEditMode:U,railOpen:s,setRailOpen:O,saving:u,agentUpdated:o,reload:E,postToIframe:b}}const Je=300;function lt({readUrl:n,marker:e,title:l,savePath:a,trailing:m,toolbarClassName:v,placement:h}){const f=Ge({readUrl:n,statMarker:e,savePath:a}),[r,s]=P.useState(null);if(f.displayedMarker===null)return null;const p=n.includes("?")?"&":"?",o=`${n}${p}v=${encodeURIComponent(f.displayedMarker)}`,L=r===o;return t.jsxs("div",{className:"flex h-full w-full flex-col bg-background",children:[t.jsx(Ie,{readUrl:n,editor:f,downloadName:l.split("/").pop()??l,trailing:m,className:v,placement:h}),t.jsx("div",{className:"relative flex-1",children:t.jsx("iframe",{ref:f.iframeRef,src:o,onLoad:()=>s(o),sandbox:"allow-scripts allow-downloads",className:ee("absolute inset-0 block h-full w-full bg-white","transition-opacity ease-out",L?"opacity-100":"opacity-0"),style:{transitionDuration:`${Je}ms`},title:l},o)})]})}const et=[{mode:"private",labelKey:"library.fileShareButton.modeOrgOnly",Icon:ge},{mode:"public",labelKey:"library.fileShareButton.modePublic",Icon:oe},{mode:"password",labelKey:"library.fileShareButton.modePassword",Icon:_e}];function ue(n){const e=te.c(56),{volume:l,path:a,kind:m,shareMode:v,effectivePublic:h,url:f}=n,r=se(),s=Be(l),{data:p}=Re(l,a),o=p?.shareMode??v,u=(p?.effectivePublic??h)&&o==="private",x=m==="dir",g=x?"folder":"file",[S,w]=P.useState(!1),[j,D]=P.useState(""),[T,M]=P.useState(!1);let _;e[0]!==a||e[1]!==s||e[2]!==g||e[3]!==r?(_=(i,c)=>{s.mutate({path:a,mode:i,password:c},{onSuccess:()=>{w(!1),D(""),G.success(i==="private"?r("library.fileShareButton.toastOrgOnly",{subject:g}):i==="public"?r("library.fileShareButton.toastPublic",{subject:g}):r("library.fileShareButton.toastPassword",{subject:g}))},onError:y=>G.error(y instanceof Error?y.message:r("library.fileShareButton.failedUpdateSharing"))})},e[0]=a,e[1]=s,e[2]=g,e[3]=r,e[4]=_):_=e[4];const d=_;let B;e[5]!==d?(B=i=>{if(i==="password"){w(!0);return}w(!1),d(i)},e[5]=d,e[6]=B):B=e[6];const R=B,b=S?"password":o;let E;e[7]!==r||e[8]!==f?(E=async()=>{f&&(await navigator.clipboard.writeText(f),M(!0),G.success(r("library.fileShareButton.linkCopied")),setTimeout(()=>M(!1),2e3))},e[7]=r,e[8]=f,e[9]=E):E=e[9];const A=E;let I;e[10]!==T||e[11]!==A||e[12]!==r||e[13]!==f?(I=f?t.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-input bg-muted/50 px-2 py-1.5",children:[t.jsx("code",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f}),t.jsx(q,{variant:"ghost",size:"icon-xs",className:"shrink-0",onClick:A,"aria-label":r("library.fileShareButton.copyLink"),children:T?t.jsx(ke,{size:12,className:"text-success"}):t.jsx(ze,{size:12})})]}):null,e[10]=T,e[11]=A,e[12]=r,e[13]=f,e[14]=I):I=e[14];const z=I;if(u){let i;e[15]===Symbol.for("react.memo_cache_sentinel")?(i=t.jsx("div",{className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:t.jsx(oe,{size:16})}),e[15]=i):i=e[15];let c;e[16]!==r?(c=r("library.fileShareButton.sharedViaParent"),e[16]=r,e[17]=c):c=e[17];let y;e[18]!==c?(y=t.jsx("span",{className:"text-sm font-medium text-foreground",children:c}),e[18]=c,e[19]=y):y=e[19];const K=x?"files in this folder":"this file";let H;e[20]!==r||e[21]!==K?(H=r("library.fileShareButton.inheritedDescription",{target:K}),e[20]=r,e[21]=K,e[22]=H):H=e[22];let W;e[23]!==H?(W=t.jsx("span",{className:"text-xs text-muted-foreground",children:H}),e[23]=H,e[24]=W):W=e[24];let V;e[25]!==W||e[26]!==y?(V=t.jsxs("div",{className:"flex items-start gap-3",children:[i,t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[y,W]})]}),e[25]=W,e[26]=y,e[27]=V):V=e[27];let J;return e[28]!==z||e[29]!==V?(J=t.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3",children:[V,z]}),e[28]=z,e[29]=V,e[30]=J):J=e[30],J}let $;e[31]!==b||e[32]!==R||e[33]!==s.isPending||e[34]!==r?($=et.map(i=>{const{mode:c,labelKey:y,Icon:K}=i;return t.jsxs("button",{type:"button",disabled:s.isPending,onClick:()=>R(c),className:ee("flex flex-col items-center gap-1 rounded-lg px-2 py-2 text-xs font-medium transition-colors disabled:opacity-60",b===c?"bg-background text-foreground shadow-edge":"text-muted-foreground hover:text-foreground"),children:[t.jsx(K,{size:15}),r(y)]},c)}),e[31]=b,e[32]=R,e[33]=s.isPending,e[34]=r,e[35]=$):$=e[35];let C;e[36]!==$?(C=t.jsx("div",{className:"surface-inset grid grid-cols-3 gap-1 p-1",children:$}),e[36]=$,e[37]=C):C=e[37];let k;e[38]!==b||e[39]!==x||e[40]!==r?(k=b==="private"?r("library.fileShareButton.privateDescription",{target:x?"these files":"this link"}):b==="public"?r(x?"library.fileShareButton.publicFolderDescription":"library.fileShareButton.publicFileDescription"):r("library.fileShareButton.passwordDescription",{target:x?"files in this folder":"this file"}),e[38]=b,e[39]=x,e[40]=r,e[41]=k):k=e[41];let N;e[42]!==k?(N=t.jsx("p",{className:"text-xs text-muted-foreground",children:k}),e[42]=k,e[43]=N):N=e[43];let O;e[44]!==b||e[45]!==d||e[46]!==o||e[47]!==j||e[48]!==s.isPending||e[49]!==r?(O=b==="password"&&t.jsxs("form",{className:"flex items-center gap-2",onSubmit:i=>{i.preventDefault(),j&&d("password",j)},children:[t.jsx(ye,{type:"password",value:j,onChange:i=>D(i.target.value),placeholder:r(o==="password"?"library.fileShareButton.newPasswordPlaceholder":"library.fileShareButton.passwordPlaceholder"),autoComplete:"new-password",className:"h-8 text-xs"}),t.jsx(q,{type:"submit",size:"sm",className:"shrink-0",disabled:!j||s.isPending,children:r(o==="password"?"library.fileShareButton.buttonUpdate":"library.fileShareButton.buttonSet")})]}),e[44]=b,e[45]=d,e[46]=o,e[47]=j,e[48]=s.isPending,e[49]=r,e[50]=O):O=e[50];let U;return e[51]!==z||e[52]!==C||e[53]!==N||e[54]!==O?(U=t.jsxs("div",{className:"flex w-full min-w-0 flex-col gap-3",children:[C,N,O,z]}),e[51]=z,e[52]=C,e[53]=N,e[54]=O,e[55]=U):U=e[55],U}function ct(n){const e=te.c(25),{volume:l,path:a,shareMode:m,effectivePublic:v,url:h,placement:f}=n,r=f===void 0?"bar":f,s=se();let p;e[0]!==r?(p=le(r),e[0]=r,e[1]=p):p=e[1];const o=p,L=o.variant,u=o.size;let x;e[2]!==s?(x=s("library.fileShareButton.share"),e[2]=s,e[3]=x):x=e[3];let g;e[4]===Symbol.for("react.memo_cache_sentinel")?(g=t.jsx(Ne,{size:14}),e[4]=g):g=e[4];let S;e[5]!==o.size||e[6]!==o.variant||e[7]!==x?(S=t.jsx(Q,{asChild:!0,children:t.jsx(Ae,{asChild:!0,children:t.jsx(q,{variant:L,size:u,"aria-label":x,children:g})})}),e[5]=o.size,e[6]=o.variant,e[7]=x,e[8]=S):S=e[8];let w;e[9]!==s?(w=s("library.fileShareButton.share"),e[9]=s,e[10]=w):w=e[10];let j;e[11]!==w?(j=t.jsx(X,{side:"bottom",children:w}),e[11]=w,e[12]=j):j=e[12];let D;e[13]!==S||e[14]!==j?(D=t.jsxs(Y,{children:[S,j]}),e[13]=S,e[14]=j,e[15]=D):D=e[15];let T;e[16]!==v||e[17]!==a||e[18]!==m||e[19]!==h||e[20]!==l?(T=t.jsx(Ue,{align:"end",className:"w-80 p-3",children:t.jsx(ue,{volume:l,path:a,kind:"file",shareMode:m,effectivePublic:v,url:h})}),e[16]=v,e[17]=a,e[18]=m,e[19]=h,e[20]=l,e[21]=T):T=e[21];let M;return e[22]!==D||e[23]!==T?(M=t.jsxs(Le,{children:[D,T]}),e[22]=D,e[23]=T,e[24]=M):M=e[24],M}function dt(n){const e=te.c(14),{target:l,onOpenChange:a}=n,m=se(),v=!!l,h=l?.kind==="dir"?"folder":"file";let f;e[0]!==m||e[1]!==h?(f=m("library.fileShareButton.shareDialogTitle",{type:h}),e[0]=m,e[1]=h,e[2]=f):f=e[2];let r;e[3]!==f?(r=t.jsx(Se,{children:t.jsx(je,{children:f})}),e[3]=f,e[4]=r):r=e[4];let s;e[5]!==l?(s=l&&t.jsx(ue,{...l}),e[5]=l,e[6]=s):s=e[6];let p;e[7]!==r||e[8]!==s?(p=t.jsxs(Te,{className:"sm:max-w-md",children:[r,s]}),e[7]=r,e[8]=s,e[9]=p):p=e[9];let o;return e[10]!==a||e[11]!==v||e[12]!==p?(o=t.jsx(Me,{open:v,onOpenChange:a,children:p}),e[10]=a,e[11]=v,e[12]=p,e[13]=o):o=e[13],o}export{ct as F,lt as H,dt as S,le as t};