PageSourceSearch

https://app.upmetrics.co/chunks/C8nFO--J.js

js upmetrics.co collected 2026-10-01 11:50:43 UTC 22,445 bytes, 1 lines download raw bytes

1import{r,j as e}from"./Dem1e8VV.js";import{u as w,o as F,c as P,D as H,ad as J,I as re,bH as he,B as g,ay as ce,aQ as pe,a_ as Ee,a$ as Se,b1 as Ne,bd as q,G as fe,V as ie,fQ as Ce,fR as Te,fS as je,fT as Ie,fU as ge,a1 as _e,fV as De,by as ne,gq as be,a8 as Oe,a9 as Re,ab as ke,cb as Ve,x as ye,y as Q,gr as we,dh as le,s as Pe,aG as Ae,aw as Le,gh as Ke,P as ve,R as He,af as G,ag as U,ah as z,ai as M,aj as Y,ak as Be,al as Ge,am as Ue,an as ze,ds as Me}from"../entry/CcVTEBpa.js";import{d as A,c as X,fq as Ye,aj as Fe,p as oe,K as de,T as We,fJ as qe,av as Je,dK as Qe,u as me,j as Xe,gF as xe,z as te,m as $e,J as Ze,bx as es,as as ss}from"./dWhdajSv.js";import"./BnZNklX7.js";import{D as ts}from"./DUXAfB85.js";import{P as as,a as rs}from"./DYAgw_3N.js";import{u as ue}from"./Cw0lg2ud.js";import{P as cs}from"./GT6AFM3O.js";import{u as is}from"./DvdT-Ow3.js";import{P as ns}from"./y0NWX92M.js";import"./phrJN640.js";import"./Dh95b2SR.js";import"./DYyFy-YE.js";import"./B_pmSX6D.js";import"./CE_AUhsl.js";import"./De7pillk.js";import"./DuSPsHJa.js";function ae({onCancel:s,onSuccess:a}){const{businessId:l,pitchId:n}=A(),t=w(),u=F(),[m]=P("pitchStudio.pitchVersions.create"),[N]=P("pitchStudio.pitchVersions.get-new-version-number"),[c,d]=r.useState({title:"",comment:"",version:""}),[E,C]=r.useState(!1);r.useEffect(()=>{!l||!n||N(l,n).then(p=>d(x=>({...x,version:p}))).catch(p=>console.error(p))},[l,n,N]);const h=E||!c.title.trim(),f=r.useCallback(async()=>{if(!(!l||!n)){C(!0);try{await m(l,n,{title:c.title,comment:c.comment}),u.success("DECK_VERSIONS.VERSION_CREATE_SUCCESS"),a()}catch(p){console.error(p),u.error()}finally{C(!1)}}},[l,n,m,c.title,c.comment,u,a]);return e.jsxs("div",{className:"p-4 space-y-4",children:[c.version&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{variant:"secondary",className:"text-xs font-mono px-1.5 py-0",children:c.version}),e.jsx("span",{className:"text-sm text-muted-foreground",children:t("DECK_VERSIONS.CREATE_LAYOUT.NEW_VERSION")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(J,{htmlFor:"deck-version-title",className:"text-xs text-muted-foreground",children:t("DECK_VERSIONS.CREATE_LAYOUT.TITLE_LABEL")}),e.jsx(re,{id:"deck-version-title",value:c.title,onChange:p=>d(x=>({...x,title:p.target.value})),placeholder:t("DECK_VERSIONS.CREATE_LAYOUT.TITLE_PLACEHOLDER"),autoFocus:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(J,{htmlFor:"deck-version-comment",className:"text-xs text-muted-foreground",children:t("DECK_VERSIONS.CREATE_LAYOUT.DESC_LABEL")}),e.jsx(he,{id:"deck-version-comment",value:c.comment,className:"min-h-[80px] resize-none",onChange:p=>d(x=>({...x,comment:p.target.value})),placeholder:t("DECK_VERSIONS.CREATE_LAYOUT.DESC_PLACEHOLDER")})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[e.jsx(g,{variant:"ghost",size:"sm",onClick:s,disabled:E,className:"cursor-pointer",children:t("DECK_VERSIONS.CREATE_LAYOUT.CANCEL_BTN")}),e.jsxs(g,{size:"sm",onClick:f,disabled:h,className:"cursor-pointer",children:[E&&e.jsx(X,{className:"size-4 animate-spin"}),t("DECK_VERSIONS.CREATE_LAYOUT.CREATE_BTN")]})]})]})}const ls=r.memo(function({version:a,title:l,isDeleting:n,isDisabled:t,onPreview:u,onRestore:m,onDelete:N}){var T,_,j,I,R;const{businessId:c}=A(),d=w(),{humanizeTimeAgo:E}=ce(),h=ue().getUpdatedBy((T=a.createdBy)!=null?T:""),f=r.useMemo(()=>{var S,i,b;return pe((b=(i=(S=a.data)==null?void 0:S.pitchThumbnails)==null?void 0:i.blocks)!=null?b:[])},[(j=(_=a.data)==null?void 0:_.pitchThumbnails)==null?void 0:j.blocks]),p=r.useCallback(()=>u(a),[u,a]),x=r.useCallback(()=>m(a),[m,a]),o=r.useCallback(()=>N(a),[N,a]);return e.jsxs("div",{className:fe("group rounded-xl border border-border bg-surface overflow-hidden","hover:border-primary/40 transition-colors duration-200",t&&"opacity-50 pointer-events-none"),children:[e.jsx("button",{type:"button",onClick:p,disabled:n,className:"w-full block cursor-pointer hover:opacity-95 transition-opacity","aria-label":d("DECK_VERSIONS.VIEW_VERSION"),children:e.jsx(as,{id:a._id,title:l,blocks:f,theme:(R=(I=a.data)==null?void 0:I.pitchDeck)==null?void 0:R.studioTheme,businessId:c!=null?c:null})}),e.jsxs("div",{className:"px-3 py-3 border-t border-border flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.version&&e.jsx(H,{className:"text-[10px] px-1.5 py-0 font-mono shrink-0 bg-primary/15 text-primary border border-primary/40",children:a.version}),e.jsx("span",{className:"text-sm font-semibold truncate text-foreground",children:l})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-1.5 text-[10px] text-muted-foreground
1/70",children:[e.jsx("span",{children:E(a.createdAt)}),h&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsxs("span",{className:"truncate",children:[d("DECK_VERSIONS.CREATED_BY")," ",h]})]})]})]}),n?e.jsx(X,{className:"size-3.5 animate-spin text-destructive shrink-0 mt-0.5"}):e.jsxs(Ee,{children:[e.jsx(Se,{asChild:!0,children:e.jsx(g,{variant:"ghost",size:"icon","aria-label":d("DECK_VERSIONS.MANAGE_MENU"),className:"size-6 shrink-0 cursor-pointer text-muted-foreground/60 hover:text-foreground -me-0.5 -mt-0.5",children:e.jsx(Ye,{className:"size-3.5"})})}),e.jsxs(Ne,{align:"end",className:"w-36",children:[e.jsxs(q,{onClick:p,className:"cursor-pointer gap-2",children:[e.jsx(Fe,{className:"size-3.5"}),d("DECK_VERSIONS.VIEW_VERSION")]}),e.jsxs(q,{onClick:x,className:"cursor-pointer gap-2",children:[e.jsx(oe,{className:"size-3.5"}),d("DECK_VERSIONS.RESTORE_VERSION")]}),e.jsxs(q,{onClick:o,className:"cursor-pointer gap-2 text-destructive focus:text-destructive",children:[e.jsx(de,{className:"size-3.5"}),d("DECK_VERSIONS.DELETE_VERSION")]})]})]})]})]})});function os({isOpen:s,version:a,onClose:l,onReturnToEditor:n}){const t=w(),{businessId:u,pitchId:m}=A(),N=F(),c=ie(),[d]=P("pitchStudio.pitchVersions.restore"),[E,C]=r.useState(!0),[h,f]=r.useState(!1),p=r.useCallback(async()=>{if(!(!u||!m||!a)){f(!0);try{await d(u,m,a._id,E),N.success("DECK_VERSIONS.VERSION_RESTORED_SUCCESS"),l(),n()}catch(x){l();const o=x;(o==null?void 0:o.error)==="no-restorable-content"?c.showConfirm({title:t("DECK_VERSIONS.RESTORE_DIALOG.NOTHING_TO_RESTORE_TITLE"),content:t("DECK_VERSIONS.RESTORE_DIALOG.NOTHING_TO_RESTORE_NOTE"),okText:t("DECK_VERSIONS.RESTORE_DIALOG.OK_BTN"),hideCancelButton:!0}):(console.error(x),N.error(o==null?void 0:o.reason))}finally{f(!1)}}},[u,m,a,E,d,N,l,n,t,c]);return e.jsx(Ce,{open:s,onOpenChange:x=>!x&&l(),children:e.jsxs(Te,{className:"max-w-md",children:[e.jsxs(je,{children:[e.jsx(Ie,{children:t("DECK_VERSIONS.RESTORE_DIALOG.TITLE")}),e.jsx(ge,{children:t("DECK_VERSIONS.RESTORE_DIALOG.DESC")})]}),e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs("div",{className:"rounded-lg border border-border bg-muted/50 px-3 py-2.5 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono shrink-0",children:a.version}),e.jsx("span",{className:"text-sm font-medium text-foreground truncate",children:a.title})]}),a.comment&&e.jsx("p",{className:"text-xs text-muted-foreground ps-0.5",children:a.comment})]}),e.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg bg-destructive/10 p-3",children:[e.jsx(We,{className:"size-4 text-destructive shrink-0 mt-0.5"}),e.jsx("p",{className:"text-sm text-destructive",children:t("DECK_VERSIONS.RESTORE_DIALOG.WARNING")})]}),e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(_e,{id:"deck-create-backup",checked:E,onCheckedChange:x=>C(x),className:"mt-0.5"}),e.jsx(J,{htmlFor:"deck-create-backup",className:"text-sm cursor-pointer leading-snug",children:t("DECK_VERSIONS.RESTORE_DIALOG.BACKUP_CHECKBOX")})]})]}),e.jsxs(De,{children:[e.jsx(g,{variant:"outline",onClick:l,disabled:h,className:"cursor-pointer",children:t("DECK_VERSIONS.RESTORE_DIALOG.CANCEL_BTN")}),e.jsxs(g,{variant:"destructive",onClick:p,disabled:h,className:"cursor-pointer",children:[h&&e.jsx(X,{className:"size-4 animate-spin"}),t("DECK_VERSIONS.RESTORE_DIALOG.RESTORE_BTN")]})]})]})})}const ds=[];function ms({version:s,isOpen:a,onClose:l,onRestore:n}){var B,L,K,k,$,Z,ee,se;
1const{businessId:t,pitchId:u}=A(),m=w(),{humanizeTimeAgo:N}=ce(),c=ue(),[d]=P("pitchStudio.pitchVersions.getPreviewSlides"),[E,C]=r.useState(null),[h,f]=r.useState(null),[p,x]=r.useState(!1),[o,T]=r.useState(0),_=r.useCallback(async()=>{var y,v;if(!(!t||!u||!(s!=null&&s._id))){x(!0);try{const D=await d(t,u,s._id);C((y=D==null?void 0:D.slides)!=null?y:[]),f((v=D==null?void 0:D.theme)!=null?v:null)}catch(D){console.error(D)}finally{x(!1)}}},[t,u,s==null?void 0:s._id,d]);r.useEffect(()=>{C(null),f(null),!(!a||!(s!=null&&s._id))&&_()},[a,s==null?void 0:s._id]);const j=r.useMemo(()=>{var y,v,D;return{...ne,...(D=(v=(y=s==null?void 0:s.data)==null?void 0:y.pitchDeck)==null?void 0:v.studioTheme)!=null?D:{},...h!=null?h:{}}},[h,(L=(B=s==null?void 0:s.data)==null?void 0:B.pitchDeck)==null?void 0:L.studioTheme]),I=E!=null?E:ds,R=r.useMemo(()=>be(j),[j]),S=is(t),i=!!((K=s==null?void 0:s.metaInfo)!=null&&K.isBackup),b=i&&((k=s==null?void 0:s.metaInfo)!=null&&k.restoreVersion)?m("DECK_VERSIONS.AUTO_BACKUP_TITLE",{version:s.metaInfo.restoreVersion}):($=s==null?void 0:s.title)!=null?$:"",O=i&&((Z=s==null?void 0:s.metaInfo)!=null&&Z.restoreVersion)?m("DECK_VERSIONS.AUTO_BACKUP_DESC",{version:s.metaInfo.restoreVersion}):(ee=s==null?void 0:s.comment)!=null?ee:"",V=c.getUpdatedBy((se=s==null?void 0:s.createdBy)!=null?se:""),W=r.useCallback(()=>{s&&n(s)},[s,n]);return e.jsx(Oe,{open:a,onOpenChange:y=>!y&&l(),children:e.jsxs(Re,{className:"w-[96vw] max-w-[1440px] sm:max-w-[1440px] h-[85vh] p-0 flex flex-col gap-0 overflow-hidden",children:[e.jsxs("div",{className:"px-5 h-14 border-b border-border pe-14 shrink-0 flex items-center gap-2",children:[(s==null?void 0:s.version)&&e.jsx(H,{className:"text-[10px] px-1.5 py-0 font-mono bg-primary/15 text-primary border border-primary/40 shrink-0",children:s.version}),e.jsx(ke,{className:"text-sm font-semibold text-foreground truncate",children:b||m("DECK_VERSIONS.TITLE")})]}),e.jsx(cs,{businessId:t!=null?t:null,slides:I,theme:j,marks:R,identity:S,isLoading:p,resetKey:s==null?void 0:s._id,selectedIndex:o,onSelectIndexChange:T,showCounter:!1}),e.jsxs("div",{className:"shrink-0 border-t border-border px-5 h-14 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 overflow-hidden",children:[e.jsxs("div",{className:"hidden sm:flex items-center gap-3 text-[11px] text-muted-foreground min-w-0 overflow-hidden",children:[O&&e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 overflow-hidden max-w-xs",children:[e.jsx(qe,{className:"size-3 shrink-0 text-muted-foreground/50"}),e.jsx("span",{className:"truncate",children:O})]}),e.jsxs("span",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx(Je,{className:"size-3"}),N(s==null?void 0:s.createdAt)]})]}),V&&e.jsxs("span",{className:"flex items-center gap-1.5 min-w-0 text-[11px] text-muted-foreground",children:[e.jsx(Qe,{className:"size-3 shrink-0"}),e.jsxs("span",{className:"truncate",children:[m("DECK_VERSIONS.CREATED_BY")," ",V]})]})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[I.length>0&&e.jsx("span",{className:"text-xs tabular-nums text-foreground font-semibold border border-border rounded-full px-3 py-1 bg-muted",children:m("PITCH_DECK_VIEWER.COUNTER",{current:o+1,total:I.length})}),e.jsxs(g,{className:"cursor-pointer gap-2 shrink-0",onClick:W,children:[e.jsx(oe,{className:"size-4"}),m("DECK_VERSIONS.RESTORE_VERSION")]})]})]})]})})}function xs({versions:s,onDelete:a,onReturnToEditor:l,showEmpty:n=!0}){var S;const t=w(),u=ie(),m=F(),[N,c]=r.useState({isOpen:!1}),[d,E]=r.useState({isOpen:!1}),[C,h]=r.useState(null),f=r.useCallback(i=>{var b,O,V;return(b=i.metaInfo)!=null&&b.isBackup&&((O=i.metaInfo)!=null&&O.restoreVersion)?t("DECK_VERSIONS.AUTO_BACKUP_TITLE",{version:i.metaInfo.restoreVersion}):(V=i.title)!=null?V:""},[t]),p=r.useCallback(async i=>{if(await u.showConfirm({title:t("DECK_VERSIONS.DELETE_DIALOG.TITLE"),content:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:t("DECK_VERSIONS.DELETE_DIALOG.DESC")}),e.jsx("div",{className:"rounded-lg border border-border bg-muted/50 px-3 py-2.5 space-y-1",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{variant:"secondary",className:"text-[10px] px-1.5 py-0 font-mono shrink-0",children:i.version}),e.jsx("span",{className:"text-sm font-medium text-foreground",children:f(i)})]})}),e.jsx("p",{className:"text-sm text-destructive",children:t("DECK_VERSIONS.DELETE_DIALOG.WARNING")})]}),variant:"destructive",okText:t("DECK_VERSIONS.DELETE_DIALOG.YES_BTN"),cancelText:t
1("DECK_VERSIONS.DELETE_DIALOG.CANCEL_BTN")})){h(i._id);try{await a(i._id),m.success("DECK_VERSIONS.VERSION_DELETED_SUCCESS")}catch(O){console.error(O),m.error()}finally{h(null)}}},[t,u,f,a,m]),x=r.useCallback(i=>E({isOpen:!0,version:i}),[]),o=r.useCallback(i=>c({isOpen:!0,version:i}),[]),T=r.useCallback(i=>{p(i)},[p]),_=r.useCallback(()=>c({isOpen:!1}),[]),j=r.useCallback(()=>E({isOpen:!1}),[]),I=r.useCallback(i=>{E({isOpen:!1}),c({isOpen:!0,version:i})},[]);if(s.length===0&&n)return e.jsx("div",{className:"flex flex-col items-center justify-center gap-2 px-6 py-16 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:t("DECK_VERSIONS.SAVE_VERSIONS_INFO")})});const R=!!C;return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-full px-4 py-4",children:e.jsx("div",{className:"flex flex-col gap-4",children:s.map(i=>e.jsx(ls,{version:i,title:f(i),isDeleting:C===i._id,isDisabled:R&&C!==i._id,onPreview:x,onRestore:o,onDelete:T},i._id))})}),N.isOpen&&e.jsx(os,{version:N.version,isOpen:N.isOpen,onClose:_,onReturnToEditor:l}),d.isOpen&&e.jsx(ms,{version:(S=d.version)!=null?S:null,isOpen:d.isOpen,onClose:j,onRestore:I})]})}function us(){const{businessId:s,pitchId:a}=A(),l=w(),n=me(),t=Ve(),[u,m]=r.useState(""),[N,c]=r.useState(!1),[d]=P("pitchStudio.pitchVersions.delete"),[E]=ye("pitchStudio.pitchVersions",s&&a?[s,a]:[]),C=Q(()=>s?t.isFeaturePermitted(s,"versions"):!1,[s]),h=Q(()=>{var o,T;return!E||!s||!a?[]:(T=(o=we.find({businessId:s,pitchId:a},{sort:{createdAt:-1}}))==null?void 0:o.fetch())!=null?T:[]},[E,s,a]),f=r.useMemo(()=>{if(!u.trim())return h;const o=u.toLowerCase();return h.filter(T=>{var _,j,I;return((_=T.title)==null?void 0:_.toLowerCase().includes(o))||((j=T.version)==null?void 0:j.toLowerCase().includes(o))||((I=T.comment)==null?void 0:I.toLowerCase().includes(o))})},[h,u]),p=r.useCallback(async o=>{!s||!a||await d(s,a,o)},[s,a,d]),x=r.useCallback(()=>{s&&a&&n(le(s,a))},[s,a,n]);return C?h.length===0?e.jsx("div",{className:"flex h-full flex-col items-center justify-center px-8",children:N?e.jsx("div",{className:"w-full max-w-md rounded-xl border border-border bg-surface shadow-sm",children:e.jsx(ae,{onCancel:()=>c(!1),onSuccess:()=>c(!1)})}):e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center",children:[e.jsx("div",{className:"flex size-14 shrink-0 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(xe,{className:"size-7 text-primary"})}),e.jsxs("div",{className:"space-y-1.5 max-w-md",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:l("DECK_VERSIONS.EMPTY_TITLE")}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:l("DECK_VERSIONS.EMPTY_DESC")})]}),e.jsxs(g,{className:"gap-1.5 cursor-pointer mt-1",onClick:()=>c(!0),children:[e.jsx(te,{className:"size-4"}),l("DECK_VERSIONS.CREATE_FIRST_VERSION")]})]})}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border shrink-0",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx($e,{className:"absolute start-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground pointer-events-none"}),e.jsx(re,{className:"ps-9 h-8 text-sm",placeholder:l("DECK_VERSIONS.SEARCH_PLACEHOLDER"),value:u,onChange:o=>m(o.target.value)})]}),e.jsxs(g,{size:"sm",className:"gap-1.5 cursor-pointer shrink-0",onClick:()=>c(!0),disabled:N,children:[e.jsx(te,{className:"size-4"}),l("DECK_VERSIONS.CREATE_VERSION")]})]}),N&&e.jsx("div",{className:"border-b border-border shrink-0 bg-muted/20",children:e.jsx(ae,{onCancel:()=>c(!1),onSuccess:()=>c(!1)})}),e.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto",children:f.length===0?e.jsx("p",{className:"px-6 py-16 text-center text-sm text-muted-foreground",children:l("DECK_VERSIONS.NO_SEARCH_RESULTS")}):s&&a&&e.jsx(xs,{versions:f,onDelete:p,onReturnToEditor:x,showEmpty:!1})})]}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 px-6 text-center",children:[e.jsx("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-xl bg-premium/10",children:e.jsx(Xe,{className:"size-6 text-premium"})}),e.jsx("p",{className:"text-sm text-muted-foreground",children:l("DECK_VERSIONS.VERSIONS_LOCKED")})]})}const hs=({text:s})=>e.jsx("span",{className:"text-destructive bg-destructive/10 border border-destructive/20 rounded-xl px-3 py-1 text-sm font-medium",children:s});function ys(){var L,K;const s=w(),a=me(),l=F(),{businessId:n="",pitchId:t=""}=A(),[u,m]=r.useState(!1),[N,c]=r.useState(!1),[d,E]=r.useState(!1),[C,h]=r.useState(!1),[f,p]=r.useState(""),[x,o]=r.useState(!1),[T]=P("pitchStudio.delete"),_=Pe(),j=Ae(),I=Le(),{items:R}=Ke(),S=r.useMemo(()=>R.find(k=>
1k._id===t),[R,t]),i=_.isCreator(n)&&!!j&&I.isFeaturePermitted(j,"incubator"),b=r.useMemo(()=>({...ne,...(S==null?void 0:S.studioTheme)||{}}),[S==null?void 0:S.studioTheme]),O=Q(()=>{var k;return((k=ve.findOne(t))==null?void 0:k.title)||s("PITCH_STUDIO_LIST.UNTITLED")},[t]),V=r.useCallback(()=>{n&&t&&a(le(n,t))},[n,t,a]),W=r.useCallback(()=>{h(!1),p("")},[]),B=r.useCallback(async()=>{if(!(!n||!t||x)){o(!0);try{await T(n,t),a(He(n))}catch(k){console.error(k),l.error(),o(!1)}}},[n,t,x,T,a,l]);return e.jsxs("div",{className:"h-full flex flex-col bg-background",children:[e.jsxs("header",{className:"flex items-center gap-2 h-[49px] px-4 border-b border-border bg-surface shrink-0",children:[e.jsxs(g,{variant:"ghost",size:"sm",className:"cursor-pointer gap-1.5 text-muted-foreground hover:text-foreground",onClick:V,children:[e.jsx(Ze,{className:"h-4 w-4"}),s("PITCH_SETTINGS.BACK_TO_EDITOR")]}),e.jsx("div",{className:"h-4 w-px bg-border shrink-0"}),e.jsx(ns,{pitchId:t||null})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"w-full max-w-5xl mx-auto p-6 space-y-6",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:s("PITCH_SETTINGS.TITLE")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s("PITCH_SETTINGS.DESCRIPTION")})]}),e.jsxs(G,{className:"border shadow-sm",children:[e.jsxs(U,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(xe,{className:"size-5"}),e.jsx(z,{className:"text-lg font-semibold",children:s("PITCH_SETTINGS.VERSION_HISTORY")})]}),e.jsx(M,{className:"text-sm text-muted-foreground leading-relaxed",children:s("PITCH_SETTINGS.VERSION_HISTORY_DESC")})]}),e.jsx(Y,{children:e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"outline",onClick:()=>m(!0),className:"font-medium cursor-pointer",children:s("PITCH_SETTINGS.MANAGE_VERSIONS")})})})]}),e.jsxs(G,{className:"border shadow-sm",children:[e.jsxs(U,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(es,{className:"size-5"}),e.jsx(z,{className:"text-lg font-semibold",children:s("PITCH_SETTINGS.DOWNLOAD_HISTORY")})]}),e.jsx(M,{className:"text-sm text-muted-foreground leading-relaxed",children:s("PITCH_SETTINGS.DOWNLOAD_HISTORY_DESC")})]}),e.jsx(Y,{children:e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"outline",onClick:()=>c(!0),className:"font-medium cursor-pointer",children:s("PITCH_SETTINGS.VIEW_DOWNLOADS")})})})]}),i&&e.jsxs(G,{className:"border shadow-sm",children:[e.jsxs(U,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ss,{className:"size-5"}),e.jsx(z,{className:"text-lg font-semibold",children:s("PITCH_SETTINGS.PUBLISH_SETTINGS")})]}),e.jsx(M,{className:"text-sm text-muted-foreground leading-relaxed",children:s("PITCH_SETTINGS.PUBLISH_SETTINGS_DESC")})]}),e.jsx(Y,{children:e.jsx("div",{className:"flex justify-end",children:e.jsx(g,{variant:"outline",onClick:()=>E(!0),className:"font-medium cursor-pointer",children:S!=null&&S.isTemplate?s("PITCH_STUDIO_LIST.MANAGE_TEMPLATE"):s("PITCH_STUDIO_LIST.PUBLISH_AS_TEMPLATE")})})})]}),e.jsxs(G,{className:"border shadow-sm",children:[e.jsxs(U,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(de,{className:"size-5 text-destructive"}),e.jsx(z,{className:"text-lg font-semibold",children:s("PITCH_SETTINGS.DELETE_PITCH")})]}),e.jsx(M,{className:"text-sm text-muted-foreground leading-relaxed",children:s("PITCH_SETTINGS.DELETE_PITCH_DESC")})]}),e.jsx(Y,{children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(hs,{text:s("PITCH_SETTINGS.CANNOT_BE_UNDONE")}),e.jsx(g,{variant:"destructive",onClick:()=>h(!0),className:"font-medium cursor-pointer",children:s("PITCH_SETTINGS.DELETE_PITCH")})]})})]}),e.jsx(Be,{open:u,onOpenChange:m,children:e.jsxs(Ge,{side:"right",className:"w-[92vw] sm:max-w-[460px] p-0 gap-0 flex flex-col bg-surface",children:[e.jsx(Ue,{className:"px-4 py-3 pe-10 border-b border-border shrink-0",children:e.jsx(ze,{className:"text-base font-semibold",children:s("PITCH_SETTINGS.VERSION_HISTORY")})}),e.jsx("div",{className:"flex-1 min-h-0",children:e.jsx(us,{})})]})}),e.jsx(Me,{open:N,onOpenChange:c,businessId:n,category:"pitch",entityId:t}),i&&d&&e.jsx(rs,{open:d,onOpenChange:E,pitchId:t,businessId:n,pitchTitle:(L=S==null?void 0:S.title)!=null?L:O,previewBlocks:(K=S==null?void 0:S.firstSlideBlocks)!=null?K:[],theme:b}),e.jsx(ts,{open:C,targetTitle:O,confirmInput:f,onConfirmInputChange:p,onConfirm:B,onClose:W,isDeleting:x})]})})]})}export{ys as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.