1import{a as e,j as t,h as a}from"./react-query-DywPi3Wo.js";import{b0 as s,aV as o,F as n,s as r,a3 as i,dA as l,aj as c,K as d,cH as m,a4 as p,c3 as u,c2 as x,cO as h,a1 as g,dm as f}from"./index-DlKj98-E.js";import{S as y}from"./Select-DqTptZNt.js";import"./PhoneInput-CS_bESc0.js";import{I as b}from"./IndustryCombobox-CdpOAHDX.js";import{S as v}from"./SettingsFormRow-CErmIcCJ.js";import{u as w,a as j,b as k,c as _,d as N,e as S,A as C,w as A}from"./useAIMemory-CUOeuyz_.js";import{t as z}from"./notifications-CniyskoD.js";import{S as E}from"./SettingsLoading-DXsAokck.js";import{S as I}from"./SlackIcon-ClEqbyhS.js";import{I as F,a as R}from"./IntegrationDetailDialog-CvGzdvmm.js";import{a as T,S as W}from"./SettingsSection-BrTZUhCl.js";import{F as $,aw as D,aI as P}from"./fontawesome--Aw3gwP5.js";import{L as q}from"./router-CfEbv8XI.js";import{l as M,n as O}from"./useWorkspaceMergeQueries-D-PvsL4l.js";import"./react-vendor-6ULW7vKx.js";import"./ui-utils-4YCDwm7v.js";import"./state-management-D35o73Ew.js";import"./date-fns-core-DhfE3dwm.js";import"./radix-ui-CdNO4ynG.js";import"./api-utils-DeT0SS0P.js";import"./tiptap-complete-I_SUyZ8Y.js";import"./collaboration-protocols-oLklGwa8.js";import"./collaboration-provider-DYKWCpdb.js";import"./lucide-icons-B0eZXG9a.js";import"./command-utils-Ca9Q8TxB.js";import"./virtualization-CdcdMTXM.js";import"./react-day-picker-CHkWmtOp.js";import"./phone-input-DyKzjBqx.js";import"./CrmCombobox-BBRKVTN2.js";import"./CrmJobRolesService-BiduY6qX.js";import"./searchable-combobox-DVsYC37o.js";import"./workspaceApi-tIS3bgTS.js";import"./PromptFieldEditor-BXC1bF7i.js";import"./AiMemoryService-BXSn9m0M.js";import"./MergeService-CjllDHcl.js";function L({canEdit:a}){const{data:r,isLoading:i}=w(),l=j(),c=r?.slack_config,[d,m]=e.useState(""),[p,u]=e.useState(""),[x,h]=e.useState(""),g=e.useRef(!1);e.useEffect(()=>{r&&!g.current&&(g.current=!0,u(c?.default_channel_id??""))},[r,c]);const f=c?.default_channel_id??"",y=l.isPending,b=async(e,t)=>{if(!a)return;const s=e.trim(),o=t.trim();if(""!==s||o!==f)if(o)if(s||c?.has_bot_token){h("");try{await l.mutateAsync({slack_config:{...s?{bot_token:s}:{},default_channel_id:o}}),m("")}catch(r){n.error("Slack config update failed:",r)}}else h("");else h("Default Channel ID is required for workflow message delivery")};return t.jsxs("div",{className:"flex flex-col gap-4","data-testid":"workspace-slack-settings-section",children:[t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(s,{htmlFor:"slack-bot-token",children:"Bot Token"}),t.jsx(o,{id:"slack-bot-token",type:"password",placeholder:c?.has_bot_token?"â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢â¢":"xoxb-your-token-here",value:d,onChange:e=>m(e.target.value),onBlur:()=>{b(d,p)},disabled:i||y||!a,"data-testid":"slack-bot-token-input"}),t.jsx("p",{className:"text-xs text-gray-500",children:c?.has_bot_token?"Enter a new token to replace the existing one.":"Enter your Slack Bot Token (starts with xoxb-)."})]}),t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx(s,{htmlFor:"slack-channel-id",children:"Default Channel ID"}),t.jsx(o,{id:"slack-channel-id",type:"text",placeholder:"C0123456789",value:p,onChange:e=>u(e.target.value),onBlur:()=>{b(d,p)},disabled:i||y||!a,color:x?"error":"default","data-testid":"slack-channel-id-input"}),t.jsx("p",{className:"text-xs text-gray-500",children:"Required. The default channel for messages."}),x&&t.jsx("p",{className:"text-sm text-destructive",role:"alert","data-testid":"slack-config-error",children:x})]})]})}const B="workspace-slack",K="Sends workflow messages to your team from a Slack app you install once for the whole workspace.";function U(a){const s=r.c(18),{canEdit:o}=a,{data:c}=w(),d=j(),[m,p]=e.useState(!1),u=c?.slack_config,x=!!u?.has_bot_token,h=x&&!u?.default_channel_id;let g;s[0]!==d?(g=async()=>{try{await d.mutateAsync({slack_config:null}),p(!1)}catch(e){const t=e;n.error("Slack config deletion failed:",t)}},s[0]=d,s[1]=g):g=s[1];const f=g;let y,b,v,k,_,N;return s[2]===Symbol.for("react.memo_cache_sentinel")?(y=t.jsxs("div",{className:"flex flex-col gap-0.5",children:[t.jsx("h3",{className:"text-md leading-4 font-bold",children:"Worksp
1ace Integrations"}),t.jsx("p",{className:"text-sm text-gray-contio-600",children:"Connected once for everyone in this workspace."})]}),s[2]=y):y=s[2],s[3]===Symbol.for("react.memo_cache_sentinel")?(b=t.jsx(I,{}),s[3]=b):b=s[3],s[4]===Symbol.for("react.memo_cache_sentinel")?(v=()=>p(!0),s[4]=v):v=s[4],s[5]!==x||s[6]!==h?(k=t.jsx("div",{className:"grid grid-cols-1 items-stretch gap-4",children:t.jsx(R,{cardKey:B,title:"Slack",description:K,icon:b,isConnected:x,categoryLabel:l.chat,needsConfiguration:h,onOpen:v})}),s[5]=x,s[6]=h,s[7]=k):k=s[7],s[8]!==o||s[9]!==f||s[10]!==x||s[11]!==m||s[12]!==h||s[13]!==d?(_=m&&t.jsx(F,{open:!0,onOpenChange:p,integration:{integration_name:B,status:x?"configured":"empty",title:"Slack",description:K,icon:t.jsx(I,{}),largeIcon:t.jsx(I,{className:"size-14"})},category:"chat",needsConfiguration:h,settingsSection:t.jsx(L,{canEdit:o}),actions:t.jsxs("div",{className:"flex w-full flex-col gap-2",children:[o&&x&&t.jsx(i,{color:"danger",variant:"outline",size:"default",className:"w-full",onClick:()=>{f()},disabled:d.isPending,"data-testid":"workspace-slack-remove",children:d.isPending?"Removingâ¦":"Remove Integration"}),t.jsx("p",{className:"text-sm text-gray-contio-600","data-testid":"workspace-slack-hint",children:o?"Changes save as you make them. Removing the integration deletes the stored token.":"Only workspace admins can change these settings."})]})}),s[8]=o,s[9]=f,s[10]=x,s[11]=m,s[12]=h,s[13]=d,s[14]=_):_=s[14],s[15]!==k||s[16]!==_?(N=t.jsxs("section",{className:"flex w-full max-w-sm flex-col gap-4","data-testid":"workspace-integrations",children:[y,k,_]}),s[15]=k,s[16]=_,s[17]=N):N=s[17],N}const V=/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;const G=[{value:"draft_only",displayText:"Draft only"},{value:"allowlisted_domains",displayText:"Allowlisted domains"},{value:"live",displayText:"Live"}],H={draft_only:"AI-drafted emails to people outside your workspace are always saved as drafts for you to review and send.",allowlisted_domains:"AI-drafted emails are sent automatically only to recipients at the domains below. Everyone else gets a draft.",live:"AI-drafted emails to people outside your workspace are sent automatically without review."};function J(a){const o=r.c(56),{id:n,mode:l,allowedDomains:m,onSave:p,isSaving:u,readOnly:x}=a,h=void 0!==u&&u,g=void 0!==x&&x,[f,b]=e.useState(null),[v,w]=e.useState(""),[j,k]=e.useState(""),_=f??l,N="allowlisted_domains"===_,S=m.length>0,C=g||h,A=`${n}-mode`,z=`${n}-mode-description`,E=`${n}
1-domain-input`,I=`${n}-domain-error`;let F;o[0]!==l?(F=G.find(e=>e.value===l)?.displayText??l,o[0]=l,o[1]=F):F=o[1];const R=F;let T;o[2]!==p?(T=(e,t,a)=>p(e,t).then(()=>b(null),()=>{b(null),void 0!==a&&w(a)}),o[2]=p,o[3]=T):T=o[3];const W=T;let P;o[4]!==m||o[5]!==_||o[6]!==S||o[7]!==W?(P=e=>{const t=e;t!==_&&(k(""),"allowlisted_domains"!==t||S?(b(t),W(t,"allowlisted_domains"===t?[...m]:[])):b(t))},o[4]=m,o[5]=_,o[6]=S,o[7]=W,o[8]=P):P=o[8];const q=P;let M;o[9]!==m||o[10]!==v||o[11]!==W?(M=()=>{const e=function(e){let t=e.trim().toLowerCase();return t.startsWith("@")&&(t=t.slice(1)),t.startsWith("www.")&&(t=t.slice(4)),t.endsWith(".")&&(t=t.slice(0,-1)),""===t?{ok:!1,error:"Enter a domain, for example acme.com."}:t.length>253||!V.test(t)?{ok:!1,error:`"${e.trim()}" is not a valid domain.`}:{ok:!0,domain:t}}(v);e.ok?m.includes(e.domain)?k(`${e.domain} is already on the list.`):(k(""),w(""),W("allowlisted_domains",[...m,e.domain],v)):k(e.error)},o[9]=m,o[10]=v,o[11]=W,o[12]=M):M=o[12];const O=M;let L;o[13]!==m||o[14]!==W?(L=e=>{const t=m.filter(t=>t!==e);0!==t.length&&(k(""),W("allowlisted_domains",t))},o[13]=m,o[14]=W,o[15]=L):L=o[15];const B=L;let K;o[16]!==O?(K=e=>{"Enter"!==e.key&&","!==e.key||(e.preventDefault(),O())},o[16]=O,o[17]=K):K=o[17];const U=K;let J,Q,X,Y,Z;o[18]!==A?(J=t.jsx(s,{htmlFor:A,className:"text-md font-bold",children:"External email sending"}),o[18]=A,o[19]=J):J=o[19],o[20]!==g?(Q=g&&t.jsx("span",{className:"shrink-0 rounded-full bg-gray-contio-100 px-2 py-1 text-xs font-semibold text-gray-contio-600","data-testid":"external-send-read-only-badge",children:"Read only"}),o[20]=g,o[21]=Q):Q=o[21],o[22]!==Q||o[23]!==J?(X=t.jsxs("div",{className:"flex w-full items-start justify-between gap-4",children:[J,Q]}),o[22]=Q,o[23]=J,o[24]=X):X=o[24],o[25]===Symbol.for("react.memo_cache_sentinel")?(Y=[...G],o[25]=Y):Y=o[25],o[26]!==C||o[27]!==z||o[28]!==_||o[29]!==q||o[30]!==A?(Z=t.jsx(y,{id:A,selectItems:Y,value:_,onChange:q,disabled:C,"aria-label":"External email sending mode","aria-describedby":z,className:"h-[var(--height-button-lg)] w-full"}),o[26]=C,o[27]=z,o[28]=_,o[29]=q,o[30]=A,o[31]=Z):Z=o[31];const ee=H[_];let te,ae,se,oe;return o[32]!==z||o[33]!==ee?(te=t.jsx("p",{id:z,className:"text-sm text-gray-contio-600","data-testid":"external-send-mode-description",children:ee}),o[32]=z,o[33]=ee,o[34]=te):te=o[34],o[35]!==Z||o[36]!==te?(ae=t.jsxs("div",{className:"max-w-sm space-y-2","data-testid":"external-send-mode-select",children:[Z,te]}),o[35]=Z,o[36]=te,o[37]=ae):ae=o[37],o[38]!==m||o[39]!==j||o[40]!==I||o[41]!==v||o[42]!==E||o[43]!==O||o[44]!==U||o[45]!==B||o[46]!==S||o[47]!==N||o[48]!==h||o[49]!==R||o[50]!==g?(se=N&&t.jsxs("div",{className:"max-w-sm space-y-3","data-testid":"external-send-allowlist",children:[t.jsx(s,{htmlFor:E,className:"text-sm font-semibold",children:"Allowed domains"}),S?t.jsx("ul",{className:"flex flex-wrap gap-2","aria-label":"Allowed domains",children:m.map(e=>{const a=1===m.length;return t.jsxs("li",{className:"inline-flex items-center gap-1 rounded-full border border-gray-contio-200 bg-white py-0.5 pr-1 pl-3 text-sm text-gray-contio-800","data-testid":`external-send-domain-${e}`,children:[t.jsx("span",{children:e}),!g&&t.jsx(i,{type:"button",color:"muted",variant:"ghost",size:"icon-sm",className:"size-6 rounded-full","aria-label":a?`Cannot remove ${e}: at least one domain is required. Change the mode instead.`:`Remove ${e}`,title:a?"At least one domain is required. Change the mode to remove it.":void 0,disabled:h||a,onClick:()=>B(e),"data-testid":`external-send-domain-remove-${e}`,children:t.jsx($,{icon:D,className:"size-3","aria-hidden":!0})})]},e)})}):t.jsxs("p",{className:"text-sm text-coral-contio-700",role:"status","data-testid":"external-send-allowlist-empty",children:["Add at least one domain to save this mode. Until then, the saved policy (",R,") stays in effect."]}),!g&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(c,{id:E,type:"text",inputMode:"url",autoComplete:"off",placeholder:"acme.com",value:v,onChange:e=>{w(e.target.value),j&&k("")},onKeyDown:U,disabled:h,"aria-invalid":!!j||void 0,"aria-describedby":j?I:void 0,className:d("flex-1",j&&"border-destructive"),"data-testid":"external-send-domain-in
1put"}),t.jsx(i,{type:"button",color:"success",variant:"solid",size:"default",loading:h,disabled:h||""===v.trim(),onClick:O,"data-testid":"external-send-domain-add",children:"Add"})]}),j&&t.jsx("p",{id:I,className:"text-sm text-destructive",role:"alert","data-testid":"external-send-domain-error",children:j})]})]}),o[38]=m,o[39]=j,o[40]=I,o[41]=v,o[42]=E,o[43]=O,o[44]=U,o[45]=B,o[46]=S,o[47]=N,o[48]=h,o[49]=R,o[50]=g,o[51]=se):se=o[51],o[52]!==X||o[53]!==ae||o[54]!==se?(oe=t.jsxs("div",{className:"flex w-full flex-col gap-4","data-testid":"external-send-policy-editor",children:[X,ae,se]}),o[52]=X,o[53]=ae,o[54]=se,o[55]=oe):oe=o[55],oe}function Q(e){const a=r.c(12),{sourceWorkspaceName:s,className:o}=e,n=s??"Another workspace";let i,l,c,p,u,x,h;return a[0]!==o?(i=d("flex max-w-xl items-center gap-4 rounded-lg border border-brand-contio-300 bg-brand-contio-50 p-4",o),a[0]=o,a[1]=i):i=a[1],a[2]===Symbol.for("react.memo_cache_sentinel")?(l=t.jsx($,{icon:P,className:"text-base text-brand-contio-600","aria-hidden":!0}),a[2]=l):l=a[2],a[3]!==n?(c=t.jsxs("p",{className:"text-sm font-bold text-gray-contio-900",children:[n," wants to merge into this workspace"]}),a[3]=n,a[4]=c):c=a[4],a[5]===Symbol.for("react.memo_cache_sentinel")?(p=t.jsx("p",{className:"text-sm text-gray-contio-700",children:"This merge is waiting for an admin of this workspace to approve or decline it."}),a[5]=p):p=a[5],a[6]!==c?(u=t.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[c,p]}),a[6]=c,a[7]=u):u=a[7],a[8]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsx(q,{to:m,className:"shrink-0 rounded-[var(--radius-button-sm)] border border-brand-contio-600 px-[var(--spacing-button-md-padding-x)] py-[var(--spacing-button-md-padding-y)] text-[length:var(--button-font-size-md)] font-bold whitespace-nowrap text-brand-contio-700 transition-colors hover:bg-brand-contio-600 hover:text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-brand-contio-700","data-testid":"merge-pending-approval-link",children:"Review request"}),a[8]=x):x=a[8],a[9]!==i||a[10]!==u?(h=t.jsxs("div",{role:"status","aria-label":"Pending merge approval",className:i,"data-testid":"merge-pending-approval-banner",children:[l,u,x]}),a[9]=i,a[10]=u,a[11]=h):h=a[11],h}const X=[{value:"1-9",displayText:"1-9"},{value:"10-99",displayText:"10-99"},{value:"100-499",displayText:"100-499"},{value:"500+",displayText:"500+"}],Y=[{scope:"chat",label:"Chat memory",description:"Shared context for chats, attachment analysis, chat titles, and Daily Briefs.",placeholder:"For example: Use our product terminology when answering questions."},{scope:"projects",label:"Projects memory",description:"Shared context for autonomous AI project runs.",placeholder:"For example: External emails always come from the assigned account owner."},{scope:"summaries",label:"Summaries memory",description:"Shared context for meeting summaries, action items, live questions, and next-step emails, reports, and documents. Generated content may be shared with meeting participants.",placeholder:"For example: Keep customer summaries action-oriented and flag pricing discussions."}],Z=()=>{const o=r.c(124),{user:l}=p(),m=l?.workspace?.id,I=M(m),{data:F,isLoading:R,isError:$,error:D,refetch:P}=w();let L;o[0]===Symbol.for("react.memo_cache_sentinel")?(L={successToast:!1},o[0]=L):L=o[0];const B=j(L);let K,V;o[1]!==m?(K=A(m),o[1]=m,o[2]=K):K=o[2],o[3]!==K?(V={mutationKey:K},o[3]=K,o[4]=V):V=o[4];const G=a(V)>0,H=B.isPending||G,Z=e.useRef(!1);let re,ie;o[5]!==$?(re=()=>{$&&!Z.current&&(Z.current=!0,z.error("Failed to load workspace settings. Please try again.")),$||(Z.current=!1)},ie=[$],o[5]=$,o[6]=re,o[7]=ie):(re=o[6],ie=o[7]),e.useEffect(re,ie);const{data:le}=k();let ce;o[8]===Symbol.for("react.memo_cache_sentinel")?(ce={successToast:!1},o[8]=ce):ce=o[8];const de=_(ce),me=F?.name??"",pe=le?.company_size??"",ue=le?.primary_industry_id??"",[xe,he]=e.useState(null),[ge,fe]=e.useState(""),[ye,be]=e.useState(null),[ve,we]=e.useState(null),je=xe??me,ke=ye??pe,_e=ve??ue,[Ne,Se]=e.useState(null),Ce=Ne??(F?.remove_external_participants_from_meetings??!0);let Ae;if(o[9]!==l){const e=u(l);Ae=x("edit_workspace_settings",e),o[9]=l,o[10]=Ae}else Ae=o[10];const ze=Ae.hasPermission,Ee=N(),Ie=S();let Fe;o[11]!==ze?(Fe=e=>ze?e.trim().length<1?"Workspace name is required":e.trim().length>255?"Workspace name must be less than 255 characters":"":"",o[11]=ze,o[12]=Fe):Fe=o[12];const Re=Fe;let Te;o[13]!==ge||o[14]!==Re?(Te=e=>{he(e),ge&&fe(Re(e))},o[13]=ge,o[14]=Re,o[15]=Te):Te=o[15];const We=Te,$e=e.useRef(null);let De;o[16]!==H||o[17]!==xe||o[18]!==me||o[19]!==B||o[20]!==Re?(De=()=>{if(null===xe)return;if(H)return;const e=Re(xe);
1if(fe(e),e)return;const t=xe.trim();t!==me.trim()?($e.current=t,B.mutateAsync({name:t}).catch(ee).finally(()=>{$e.current=null,he(null)})):he(null)},o[16]=H,o[17]=xe,o[18]=me,o[19]=B,o[20]=Re,o[21]=De):De=o[21];const Pe=De,qe=e.useRef(te);let Me,Oe,Le,Be;o[22]!==ze||o[23]!==xe||o[24]!==me||o[25]!==B||o[26]!==Re?(Me=()=>{qe.current=()=>{if(null===xe||!ze)return;if(Re(xe))return;const e=xe.trim();e!==me.trim()&&e!==$e.current&&B.mutateAsync({name:e}).catch(ae)}},o[22]=ze,o[23]=xe,o[24]=me,o[25]=B,o[26]=Re,o[27]=Me):Me=o[27],e.useEffect(Me),o[28]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>()=>qe.current(),Le=[],o[28]=Oe,o[29]=Le):(Oe=o[28],Le=o[29]),e.useEffect(Oe,Le),o[30]!==pe||o[31]!==de?(Be=e=>{e!==pe&&(be(e),de.mutateAsync({companySize:e}).catch(se).finally(()=>be(null)))},o[30]=pe,o[31]=de,o[32]=Be):Be=o[32];const Ke=Be;let Ue;o[33]!==ue||o[34]!==de?(Ue=e=>{e&&e!==ue&&(we(e),de.mutateAsync({primaryIndustryId:e}).catch(oe).finally(()=>we(null)))},o[33]=ue,o[34]=de,o[35]=Ue):Ue=o[35];const Ve=Ue;let Ge;o[36]!==H||o[37]!==Ce||o[38]!==B?(Ge=async e=>{if(H)return;const t=Ce;Se(e);try{await B.mutateAsync({remove_external_participants_from_meetings:e}),Se(null)}catch(a){const e=a;n.error("Remove external participants update failed:",e),Se(t)}},o[36]=H,o[37]=Ce,o[38]=B,o[39]=Ge):Ge=o[39];const He=Ge,{mutateAsync:Je}=B;let Qe;o[40]!==Je?(Qe=(e,t)=>Je({external_send_mode:e,allowed_domains:t}),o[40]=Je,o[41]=Qe):Qe=o[41];const Xe=Qe,Ye=H||de.isPending;if(R){let e,a;return o[42]===Symbol.for("react.memo_cache_sentinel")?(e=t.jsx(g,{title:"Workspace Settings"}),o[42]=e):e=o[42],o[43]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{className:"flex h-full flex-col",children:[e,t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-gray-contio-50 p-4 pb-22",children:t.jsx(E,{testId:"workspace-settings-loading"})})]}),o[43]=a):a=o[43],a}if($){const e=D instanceof Error&&D.message?D.message:"Something went wrong loading your workspace settings.";let a,s,n,r;return o[44]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsx(g,{title:"Workspace Settings"}),o[44]=a):a=o[44],o[45]!==e?(s=t.jsx("p",{className:"text-sm text-destructive",children:e}),o[45]=e,o[46]=s):s=o[46],o[47]!==P?(n=t.jsx(i,{type:"button",color:"success",variant:"solid",onClick:()=>{P()},"data-testid":"workspace-settings-retry-button",children:"Try again"}),o[47]=P,o[48]=n):n=o[48],o[49]!==s||o[50]!==n?(r=t.jsxs("div",{className:"flex h-full flex-col",children:[a,t.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto bg-gray-contio-50 p-4 pb-22",children:t.jsxs("div",{className:"w-full max-w-2xl space-y-4",role:"alert","data-testid":"workspace-settings-error",children:[s,n]})})]}),o[49]=s,o[50]=n,o[51]=r):r=o[51],r}let Ze;o[52]===Symbol.for("react.memo_cache_sentinel")?(Ze=t.jsx(g,{title:"Workspace Settings"}),o[52]=Ze):Ze=o[52];const et=ze?"Enter workspace name":"";let tt;o[53]!==ze||o[54]!==We?(tt=ze?e=>We(e.target.value):void 0,o[53]=ze,o[54]=We,o[55]=tt):tt=o[55];const at=ze?Pe:void 0,st=ze?ne:void 0,ot=Ye||!ze,nt=ge?"border-destructive":"",rt=ze?"":"cursor-not-allowed bg-gray-50 text-gray-800";let it,lt,ct,dt;o[56]!==nt||o[57]!==rt?(it=d(nt,rt),o[56]=nt,o[57]=rt,o[58]=it):it=o[58],o[59]!==et||o[60]!==tt||o[61]!==at||o[62]!==st||o[63]!==ot||o[64]!==it||o[65]!==je?(lt=t.jsx(c,{id:"workspace-name",type:"text",placeholder:et,value:je,onChange:tt,onBlur:at,onKeyDown:st,disabled:ot,className:it}),o[59]=et,o[60]=tt,o[61]=at,o[62]=st,o[63]=ot,o[64]=it,o[65]=je,o[66]=lt):lt=o[66],o[67]!==ge?(ct=ge&&t.jsx("p",{id:"workspace-name-error",className:"text-sm text-destructive",role:"alert","data-testid":"workspace-name-error",children:ge}),o[67]=ge,o[68]=ct):ct=o[68],o[69]!==lt||o[70]!==ct?(dt=t.jsxs(v,{htmlFor:"workspace-name",label:"Workspace Name",children:[lt,ct]}),o[69]=lt,o[70]=ct,o[71]=dt):dt=o[71];const mt=Ye||!ze;let pt;o[72]!==ke||o[73]!==Ke||o[74]!==mt?(pt=t.jsx(v,{htmlFor:"workspace-org-size",label:"Organization Size",children:t.jsx(y,{id:"workspace-org-size",selectItems:X,value:ke,onChange:Ke,placeholder:"Select organization size",disabled:mt,"aria-label":"Organization Size",className:"h-[var(--height-button-lg)] w-full"})}),o[72]=ke,o[73]=Ke,o[74]=mt,o[75]=pt):pt=o[75];const ut=Ye||!ze;let xt,ht;o[76]!==Ve||o[77]!==_e||o[78]!==ut?(xt=t.jsx(v,{htmlFor:"workspace-industry",label:"Industry",children:t.jsx(b,{id:"workspace-industry",value:_e,onValueChange:Ve,placeholder:"Select an industry",disabled:ut})}),o[76]=Ve,o[77]=_e,o[78]=ut,o[79]=xt):xt=o[79],o[80]!==dt||o[81]!==pt||o[82]!==xt?(ht=t.jsxs("div",{className:"max-w-sm space-y-5",children:[dt,pt,xt]}),o[80]=dt,o[81]=pt,o[82]=xt,o[83]=ht):ht=o[83];const gt=Ce?"border-brand-contio-500":"border-gray-contio-200";let ft,yt;
1o[84]!==gt?(ft=d("flex max-w-sm items-center gap-4 rounded-lg border bg-white p-3 shadow-sm transition-colors",gt),o[84]=gt,o[85]=ft):ft=o[85],o[86]===Symbol.for("react.memo_cache_sentinel")?(yt=t.jsxs("div",{className:"flex-1 space-y-0",children:[t.jsx(s,{htmlFor:"remove-external-participants-switch",className:"text-md font-bold",children:"Remove external people after meetings"}),t.jsx("div",{className:"max-w-2xs text-sm text-gray-contio-600",children:"Enabling this allows external attendees to access the agenda, but not the meeting recap."})]}),o[86]=yt):yt=o[86];const bt=!ze||H;let vt,wt;o[87]!==He||o[88]!==Ce||o[89]!==bt?(vt=t.jsx(f,{id:"remove-external-participants-switch",checked:Ce,onCheckedChange:He,disabled:bt,"aria-label":"Remove external people after meetings","data-testid":"remove-external-participants-switch",className:"shrink-0 data-[state=checked]:!bg-[var(--color-brand-contio-600)]"}),o[87]=He,o[88]=Ce,o[89]=bt,o[90]=vt):vt=o[90],o[91]!==ft||o[92]!==vt?(wt=t.jsxs("div",{className:ft,children:[yt,vt]}),o[91]=ft,o[92]=vt,o[93]=wt):wt=o[93];const jt=F?.external_send_mode??"draft_only";let kt;o[94]!==F?.allowed_domains?(kt=F?.allowed_domains??[],o[94]=F?.allowed_domains,o[95]=kt):kt=o[95];const _t=!ze;let Nt,St,Ct,At,zt,Et,It;return o[96]!==Xe||o[97]!==H||o[98]!==jt||o[99]!==kt||o[100]!==_t?(Nt=t.jsx(T,{className:"max-w-sm p-4",children:t.jsx(J,{id:"workspace-external-send",mode:jt,allowedDomains:kt,isSaving:H,readOnly:_t,onSave:Xe})}),o[96]=Xe,o[97]=H,o[98]=jt,o[99]=kt,o[100]=_t,o[101]=Nt):Nt=o[101],o[102]!==Ee||o[103]!==ze||o[104]!==Ie||o[105]!==l?.workspace?.id?(St=Y.map(e=>{const{scope:a,label:s,description:o,placeholder:n}=e;return t.jsx(T,{className:"p-4",children:t.jsx(C,{id:`workspace-ai-memory-${a}`,label:s,description:o,value:Ee.data?.workspace?.[a]?.memory??"",placeholder:n,isLoading:Ee.isLoading,isUnavailable:Ee.isError,isSaving:Ie.isPending&&Ie.variables?.scope===a,readOnly:!ze,onSave:e=>Ie.mutateAsync({scope:a,memory:e})})},`${l?.workspace?.id}-${a}`)}),o[102]=Ee,o[103]=ze,o[104]=Ie,o[105]=l?.workspace?.id,o[106]=St):St=o[106],o[107]!==St?(Ct=t.jsx(W,{title:"AI Memory",collapsible:!0,children:t.jsx("div",{className:"max-w-sm space-y-4",children:St})}),o[107]=St,o[108]=Ct):Ct=o[108],o[109]!==ze?(At=t.jsx(U,{canEdit:ze}),o[109]=ze,o[110]=At):At=o[110],o[111]!==ze||o[112]!==I?(zt=ze&&t.jsxs(h,{requiredFlags:["workspace_merge"],children:[O(I.data)&&t.jsx(Q,{sourceWorkspaceName:I.data?.source_workspace_name}),t.jsxs("div",{className:"flex max-w-sm items-center gap-4 roun
1ded-lg border border-gray-contio-200 bg-white p-3 shadow-sm","data-testid":"merge-workspace-row",children:[t.jsxs("div",{className:"flex-1 space-y-0",children:[t.jsx("div",{className:"text-md font-bold",children:"Merge this workspace"}),t.jsx("div",{className:"max-w-2xs text-sm text-gray-contio-600",children:"Move this workspace's people and content into another workspace. This cannot be undone."})]}),t.jsx(q,{to:"/settings/workspace/merge",className:"shrink-0 rounded-[var(--radius-button-sm)] border border-gray-contio-600 px-[var(--spacing-button-md-padding-x)] py-[var(--spacing-button-md-padding-y)] text-[length:var(--button-font-size-md)] font-bold whitespace-nowrap text-gray-contio-600 transition-colors hover:bg-gray-contio-600 hover:text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-contio-700","data-testid":"merge-workspace-link",children:"Start a merge"})]})]}),o[111]=ze,o[112]=I,o[113]=zt):zt=o[113],o[114]!==ze?(Et=ze&&t.jsx(h,{requiredFlags:["workspace_archive"],children:t.jsxs("div",{className:"flex max-w-sm items-center gap-4 roun
1ded-lg border border-gray-contio-200 bg-white p-3 shadow-sm","data-testid":"archive-workspace-row",children:[t.jsxs("div",{className:"flex-1 space-y-0",children:[t.jsx("div",{className:"text-md font-bold",children:"Archive"}),t.jsx("div",{className:"max-w-2xs text-sm text-gray-contio-600",children:"Export this workspace as a portable archive, or import an archive into it."})]}),t.jsx(q,{to:"/settings/workspace/archive",className:"shrink-0 rounded-[var(--radius-button-sm)] border border-gray-contio-600 px-[var(--spacing-button-md-padding-x)] py-[var(--spacing-button-md-padding-y)] text-[length:var(--button-font-size-md)] font-bold whitespace-nowrap text-gray-contio-600 transition-colors hover:bg-gray-contio-600 hover:text-white focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-contio-700","data-testid":"archive-workspace-link",children:"Manage archives"})]})}),o[114]=ze,o[115]=Et):Et=o[115],o[116]!==ht||o[117]!==wt||o[118]!==Nt||o[119]!==Ct||o[120]!==At||o[121]!==zt||o[122]!==Et?(It=t.jsxs("div",{className:"flex h-full flex-col",children:[Ze,t.jsxs("div",{className:"min-h-0 flex-1 space-y-8 overflow-y-auto bg-gray-contio-50 p-4 pb-22",children:[ht,wt,Nt,Ct,At,zt,Et]})]}),o[116]=ht,o[117]=wt,o[118]=Nt,o[119]=Ct,o[120]=At,o[121]=zt,o[122]=Et,o[123]=It):It=o[123],It};function ee(e){n.error("Workspace name update failed:",e)}function te(){}function ae(e){n.error("Workspace name update failed:",e)}function se(e){n.error("Workspace organization size update failed:",e)}function oe(e){n.error("Workspace industry update failed:",e)}function ne(e){"Enter"===e.key&&e.currentTarget.blur()}export{Z 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.