decocms
Version:
Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools
2 lines (1 loc) • 12.8 kB
JavaScript
import{c as it,b as pt,r as at,J as jt,j as e,m as et,B as tt,av as Ct}from"./index-ztdGKvBm.js";import{F as Nt}from"./agent-icon-BYWtutu9.js";import{b as Dt}from"./UserCheck01-k-4bTA2h.js";import{s as kt}from"./Plus-DWySsEmB.js";import{S as St}from"./scroll-area-Dm3EbBj1.js";import{c as wt,s as Tt,b as ct,a as dt}from"./date-utils-CrvIKg-s.js";import{N as zt}from"./category-tree-DGOo1BAt.js";import{g as Et,d as Pt}from"./item-actions-BDi0HvuM.js";import"./AlertCircle-BlMH0XE7.js";import"./Tool01-BCJ5kyrz.js";import"./ArrowUp-D5DDc3Cp.js";import"./ArrowLeft-B0PZnf1E.js";import"./ArrowRight-mzMrxxYI.js";import"./BookOpen01-DU-B3R7s.js";import"./Globe04-CeAQ1YNm.js";import"./CheckCircle-DZ8MNpCP.js";import"./ChevronDown-XsLJSrfl.js";import"./ChevronSelectorVertical-CB0fn1Nq.js";import"./ChevronUp-BQktpZWC.js";import"./UserSquare-CafFh5_d.js";import"./LinkBroken01-DfUhihLM.js";import"./CreditCard01-MY4ouqtl.js";import"./File02-DaYek2y9.js";import"./MessageCircle01-BG1RhOiZ.js";import"./SwitchHorizontal01-CMdpIiQk.js";import"./Eye-kjjhS0vP.js";import"./Fingerprint04-B2fDIuT8.js";import"./Image01-BcIZ5mtf.js";import"./Key01-CaJGjh13.js";import"./LayoutLeft-DDtN-od-.js";import"./Minus-hZzPDO0w.js";import"./Monitor01-DMFbvudn.js";import"./Sun-O9TdKcV_.js";import"./Play-BCFOaioW.js";import"./SearchMd-BD2qldmS.js";import"./ShoppingBag01-BbjW7cod.js";import"./Trash01-BxBhF2b8.js";import"./Upload01-q-rKSvZf.js";import"./Users01-DM58_gUL.js";import"./XClose-CmTuu4UN.js";import"./Zap-CBJ7My90.js";import"./index-BdQq_4o_.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DmyTA2cC.js";import"./collapsible-CadTVXY4.js";import"./use-copy-DT4_uVrH.js";import"./usage-stats-B0_Yl-r0.js";import"./utils-CVEq3hMx.js";import"./markdown-CJR_ooUO.js";import"./chat-context-DFEln8mI.js";import"./use-panel-navigate-0z93k6Ut.js";import"./thread-route-CfpvvkkL.js";import"./use-project-scope-BwqdbGG4.js";import"./repository-binding-D_Xc1yRH.js";import"./use-mcp-client-2MG3LveS.js";import"./auth-C82OPjUx.js";import"./use-view-draft-kind-BopwZu5H.js";import"./use-blog-view-DMfZjkz0.js";import"./use-organization-settings-C2vcrj4S.js";import"./schema-Bb-DbvPZ.js";import"./task-board-i6qU2BVR.js";import"./thread-intent-DyZ5A9F9.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-DdfLfQcH.js";import"./session-runtime-DBl1Hlcw.js";import"./use-entitlements-Gn1rhCN5.js";import"./use-ai-providers-Ct2xvYDX.js";import"./use-current-view-DBmQQ8uy.js";import"./use-in-settings-CFQ9B3W2.js";import"./use-decopilot-events-43RPCkUH.js";import"./use-org-fs-D9dHgOYs.js";import"./useInfiniteQuery-Ypmdjx1e.js";import"./infiniteQueryObserver-C3KEOANj.js";import"./use-mobile-C_hdQY5I.js";import"./tooltip-Bm0P1gm_.js";import"./index-CDQbtG2e.js";import"./gateway-client-B4qzR3sF.js";import"./form-DlZ0KMAb.js";import"./label-8UxgpYiA.js";import"./task-key-Bt60Ndov.js";import"./use-task-board-items-D2aUd0HA.js";import"./config-LEYSFIMn.js";import"./task-route-C3cK6F8S.js";import"./project-index-C2IrSomv.js";import"./shell-layout-UF80oiAz.js";import"./use-deployment-admin-Cr4LWHG9.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-Bg0zOPPj.js";import"./command-C3tlrKUq.js";import"./index-DMpANy5-.js";import"./integration-icon-Bo-3z9o3.js";import"./project-icon-fQqckccl.js";import"./use-navigate-to-agent-Cw8_3uU5.js";import"./use-debounced-value-DO5dvp6c.js";import"./new-project-dialog-BW6Lh52P.js";import"./repository-picker-CSaozawA.js";import"./github-icon-Bq9Ot22_.js";import"./collection-search-DkVgkcUC.js";import"./new-project-store-DID5OVrt.js";import"./legacy-admin-welcome-dialog-plmLACwz.js";import"./drawer-CROtV2u4.js";import"./required-auth-layout-Cwtu4iIe.js";import"./use-org-sso-_fzcS8V-.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-DU6s3Olv.js";import"./types-5-cDe_8u.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-C-umRrOH.js";import"./use-connection-CcG4QE1K.js";import"./use-mcp-prompts-qJSiAdA5.js";import"./use-thread-outputs-BK5BfLdO.js";import"./file-type-icon-CdjLDWdN.js";import"./section-array-field-uECXIzc8.js";import"./blocks-tab-states-8lUCpJRf.js";import"./site-editor-toast-Dq7SmLyr.js";import"./content-changes-BFwm7dNe.js";import"./sandbox-url-D3mC8qhT.js";import"./use-sandbox-events-E6fWuIsO.js";import"./use-blocks-v8-project-BPvEDyS9.js";import"./use-voice-input-BMrsODyI.js";import"./popover-C4oz5B-L.js";import"./index-CJKec1wg.js";import"./checkbox-QUuOza1H.js";import"./select-CxXZwsSr.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./utils-COdvgYqW.js";import"./sandbox-git-api-BsG4EzUP.js";import"./empty-state-I_cTbW85.js";import"./badge-DcUertOZ.js";import"./empty-state-DM4xv3sa.js";import"./delete-copy-DdlDdNyl.js";import"./use-never-published-BJeGnEQC.js";import"./hosted-reconcile-rjhKNGnc.js";import"./search-input-BQ8Dp8aD.js";import"./tabs-nQ7_UOyl.js";import"./active-indicator-CCMhAsc_.js";import"./use-file-configs-3gwPBXwK.js";import"./asset-utils-DP9aQr9Q.js";import"./index-BL01DXCf.js";import"./match-site-slug-config-B47_xZCi.js";import"./textarea-viSdm6BE.js";import"./primitives-BbUqWJzg.js";import"./use-move-blocks-Bu_TrzH9.js";import"./monaco-editor-CLzWWWtl.js";import"./editor-ipOJFDhA.js";const ft="border-success/30 bg-success/10 text-success hover:bg-success/20",xt="border-dashed border-border bg-muted text-muted-foreground hover:bg-secondary-hover hover:text-accent-foreground";function jo(h){const t=it.c(83),{decofile:b,selectedKey:d,onSelect:o,onCreate:m,onReschedule:i,isCreating:D}=h,s=D===void 0?!1:D,r=pt(),[j,C]=at.useState(null),[rt]=jt(),[n,f]=at.useState(It),p=rt.language;let N;t[0]!==n||t[1]!==p?(N=new Intl.DateTimeFormat(p,{month:"long",year:"numeric"}).format(n),t[0]=n,t[1]=p,t[2]=N):N=t[2];const v=N;let x,u,l,c,y,k,S,w,T,z;if(t[3]!==n||t[4]!==b||t[5]!==j||t[6]!==s||t[7]!==p||t[8]!==v||t[9]!==m||t[10]!==i||t[11]!==o||t[12]!==d||t[13]!==r){const ut=new Intl.DateTimeFormat(p,{weekday:"short"}),gt=new Intl.DateTimeFormat(p,{dateStyle:"long"}),{byDay:ht,undated:ot}=Et(zt(b)),st=wt(n),bt=Tt(new Date);u="flex h-full w-full flex-col";let G;t[24]===Symbol.for("react.memo_cache_sentinel")?(G=()=>f(ct(new Date)),t[24]=G):G=t[24];let I;t[25]!==r?(I=r("sandbox.postCalendar.today"),t[25]=r,t[26]=I):I=t[26];let H;t[27]!==I?(H=e.jsx(tt,{variant:"outline",size:"sm",onClick:G,children:I}),t[27]=I,t[28]=H):H=t[28];let Q;t[29]===Symbol.for("react.memo_cache_sentinel")?(Q=()=>f(Mt),t[29]=Q):Q=t[29];let U;t[30]!==r?(U=r("sandbox.postCalendar.previous"),t[30]=r,t[31]=U):U=t[31];let V;t[32]===Symbol.for("react.memo_cache_sentinel")?(V=e.jsx(Dt,{size:16}),t[32]=V):V=t[32];let _;t[33]!==U?(_=e.jsx(tt,{variant:"ghost",size:"icon",onClick:Q,"aria-label":U,children:V}),t[33]=U,t[34]=_):_=t[34];let X;t[35]===Symbol.for("react.memo_cache_sentinel")?(X=()=>f(Lt),t[35]=X):X=t[35];let $;t[36]!==r?($=r("sandbox.postCalendar.next"),t[36]=r,t[37]=$):$=t[37];let Y;t[38]===Symbol.for("react.memo_cache_sentinel")?(Y=e.jsx(Ct,{size:16}),t[38]=Y):Y=t[38];let F;t[39]!==$?(F=e.jsx(tt,{variant:"ghost",size:"icon",onClick:X,"aria-label":$,children:Y}),t[39]=$,t[40]=F):F=t[40];let O;t[41]!==v?(O=e.jsx("h2",{className:"ml-2 text-base font-semibold capitalize",children:v}),t[41]=v,t[42]=O):O=t[42];let B;t[43]!==r?(B=r("sandbox.postCalendar.legendScheduled"),t[43]=r,t[44]=B):B=t[44];let R;t[45]!==B?(R=e.jsx(mt,{className:ft,label:B}),t[45]=B,t[46]=R):R=t[46];let A;t[47]!==r?(A=r("sandbox.postCalendar.legendUnscheduled"),t[47]=r,t[48]=A):A=t[48];let K;t[49]!==A?(K=e.jsx(mt,{className:xt,label:A}),t[49]=A,t[50]=K):K=t[50];let W;t[51]!==R||t[52]!==K?(W=e.jsxs("div",{className:"ml-auto flex items-center gap-4",children:[R,K]}),t[51]=R,t[52]=K,t[53]=W):W=t[53],t[54]!==H||t[55]!==_||t[56]!==F||t[57]!==O||t[58]!==W?(l=e.jsxs("div",{className:"flex items-center gap-2 px-4 h-12 border-b shrink-0",children:[H,_,F,O,W]}),t[54]=H,t[55]=_,t[56]=F,t[57]=O,t[58]=W,t[59]=l):l=t[59],z="relative flex-1 min-h-0",x=St,T="h-full",S="flex min-w-[880px] gap-4 p-4";let J;t[60]!==r?(J=r("sandbox.postCalendar.unscheduledHint"),t[60]=r,t[61]=J):J=t[61];let Z;t[62]!==J?(Z=e.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:J}),t[62]=J,t[63]=Z):Z=t[63],w=e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"grid grid-cols-7 mb-2",children:st[0]?.map(a=>e.jsx("div",{className:"px-2 text-2xs text-muted-foreground",children:ut.format(a)},a.getDay()))}),e.jsx("div",{className:"grid grid-cols-7 gap-px overflow-hidden rounded-lg border bg-border",children:st.flat().map(a=>{const vt=a.getMonth()===n.getMonth(),yt=ht.get(Pt(a))??[];return e.jsxs("div",{onDragOver:g=>{j&&(g.preventDefault(),g.dataTransfer.dropEffect="move")},onDrop:g=>{g.preventDefault();const lt=g.dataTransfer.getData("text/plain");C(null),lt&&i(lt,a)},className:et("group/day min-h-28 space-y-1 p-2 transition-colors",vt?"bg-background":"bg-muted/40",j&&"hover:bg-accent"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:et("grid size-6 place-items-center rounded-full text-xs",a.getTime()===bt.getTime()?"bg-primary font-semibold text-primary-foreground":"text-muted-foreground"),children:a.getDate()}),e.jsx(tt,{variant:"ghost",size:"icon-xs",className:"opacity-0 transition-opacity group-hover/day:opacity-100 focus-visible:opacity-100",disabled:s,onClick:()=>m(a),"aria-label":r("sandbox.postCalendar.schedulePostOn",{date:gt.format(a)}),children:e.jsx(kt,{size:14})})]}),yt.map(g=>e.jsx(nt,{entry:g,active:g.post.key===d,draggable:g.scheduled,onSelect:o,onDragStateChange:C},g.post.key))]},a.getTime())})}),Z]}),c="w-[220px] shrink-0 space-y-2 self-start rounded-lg border border-dashed p-3",y=e.jsx("p",{className:"px-1 text-2xs font-medium text-muted-foreground",children:r("sandbox.postCalendar.undatedLabel",{count:ot.length})}),k=ot.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-2 px-2 py-8 text-center",children:[e.jsx(Nt,{size:20,className:"text-muted-foreground/60","aria-hidden":!0}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r("sandbox.postCalendar.undatedEmpty")})]}):ot.map(a=>e.jsx(nt,{entry:a,active:a.post.key===d,draggable:!1,onSelect:o,onDragStateChange:C},a.post.key)),t[3]=n,t[4]=b,t[5]=j,t[6]=s,t[7]=p,t[8]=v,t[9]=m,t[10]=i,t[11]=o,t[12]=d,t[13]=r,t[14]=x,t[15]=u,t[16]=l,t[17]=c,t[18]=y,t[19]=k,t[20]=S,t[21]=w,t[22]=T,t[23]=z}else x=t[14],u=t[15],l=t[16],c=t[17],y=t[18],k=t[19],S=t[20],w=t[21],T=t[22],z=t[23];let E;t[64]!==c||t[65]!==y||t[66]!==k?(E=e.jsxs("div",{className:c,children:[y,k]}),t[64]=c,t[65]=y,t[66]=k,t[67]=E):E=t[67];let P;t[68]!==E||t[69]!==S||t[70]!==w?(P=e.jsxs("div",{className:S,children:[w,E]}),t[68]=E,t[69]=S,t[70]=w,t[71]=P):P=t[71];let L;t[72]!==x||t[73]!==P||t[74]!==T?(L=e.jsx(x,{className:T,children:P}),t[72]=x,t[73]=P,t[74]=T,t[75]=L):L=t[75];let M;t[76]!==L||t[77]!==z?(M=e.jsx("div",{className:z,children:L}),t[76]=L,t[77]=z,t[78]=M):M=t[78];let q;return t[79]!==u||t[80]!==l||t[81]!==M?(q=e.jsxs("div",{className:u,children:[l,M]}),t[79]=u,t[80]=l,t[81]=M,t[82]=q):q=t[82],q}function Lt(h){return dt(h,1)}function Mt(h){return dt(h,-1)}function It(){return ct(new Date)}function mt(h){const t=it.c(7),{className:b,label:d}=h;let o;t[0]!==b?(o=et("size-3 rounded-sm border",b),t[0]=b,t[1]=o):o=t[1];let m;t[2]!==o?(m=e.jsx("span",{className:o}),t[2]=o,t[3]=m):m=t[3];let i;return t[4]!==d||t[5]!==m?(i=e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[m,d]}),t[4]=d,t[5]=m,t[6]=i):i=t[6],i}function nt(h){const t=it.c(23),{entry:b,active:d,draggable:o,onSelect:m,onDragStateChange:i}=h,D=pt(),{post:s,scheduled:r}=b,j=r?"sandbox.postCalendar.legendScheduled":"sandbox.postCalendar.legendUnscheduled";let C;t[0]!==D||t[1]!==j?(C=D(j),t[0]=D,t[1]=j,t[2]=C):C=t[2];const rt=C;let n;t[3]!==i||t[4]!==s.key?(n=y=>{y.dataTransfer.setData("text/plain",s.key),y.dataTransfer.effectAllowed="move",i(s.key)},t[3]=i,t[4]=s.key,t[5]=n):n=t[5];let f;t[6]!==i?(f=()=>i(null),t[6]=i,t[7]=f):f=t[7];let p;t[8]!==m||t[9]!==s.key?(p=()=>m(s.key),t[8]=m,t[9]=s.key,t[10]=p):p=t[10];const N=`${s.title} · ${rt}`,v=r?ft:xt,x=o&&"cursor-grab active:cursor-grabbing",u=d&&"ring-2 ring-primary";let l;t[11]!==v||t[12]!==x||t[13]!==u?(l=et("w-full truncate rounded-lg border px-2 py-1 text-left text-xs font-medium transition-colors",v,x,u),t[11]=v,t[12]=x,t[13]=u,t[14]=l):l=t[14];let c;return t[15]!==o||t[16]!==s.title||t[17]!==l||t[18]!==n||t[19]!==f||t[20]!==p||t[21]!==N?(c=e.jsx("button",{type:"button",draggable:o,onDragStart:n,onDragEnd:f,onClick:p,title:N,className:l,children:s.title}),t[15]=o,t[16]=s.title,t[17]=l,t[18]=n,t[19]=f,t[20]=p,t[21]=N,t[22]=c):c=t[22],c}export{jo as PostCalendar};