PageSourceSearch

https://somaleaf-reviews-w6uf6ai.gamma.site/_next/static/chunks/pages/settings-6dce51fb70c412c8.js

js somaleaf-reviews-w6uf6ai.gamma.site collected 2026-10-03 04:10:54 UTC 206,074 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662,4792,2973],{24994:function(e,i,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/settings",function(){return n(90475)}])},29094:function(e,i){"use strict";i.Z={src:"/_next/static/media/Sal-Painting-2x.c8081548.png",height:5035,width:5077,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAVFBMVEVMaXEAAAAYGBjh4eEAAAAAAAAAAAABAQECAgIAAADf3983NzcBAQEDAwMAAAB/f38zMzPMzMwAAAA/Pz+ampoCAgK1tbWGhoYAAAAAAACVlZXr6+utrPL5AAAAGXRSTlMAOh6Fz9nD/YVc0yTjSbYErTL2iWWutGjs83dYZgAAAAlwSFlzAAAWJQAAFiUBSVIk8AAAAEFJREFUeJwVxkcSgCAQAMEh7xLEbKH//6dFnxojV/V+McQw0kgjYMux7jOcr4vJK2xfjlWAnp1VBbgfWpspIlbND1vVAkv9ao33AAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},57474:function(e,i){"use strict";i.Z={src:"/_next/static/media/Sal-Tether.5de34fdf.svg",height:1352,width:3061,blurWidth:0,blurHeight:0}},71537:function(e,i,n){"use strict";n.d(i,{z:function(){return ex}});var t=n(52322);n(98248),n(61219);var s=n(55671),r=n(62202),l=n(18200),a=n(81674),o=n(94523),c=n(97729),d=n.n(c),u=n(5632),x=n(2784),h=n(43997),p=n(14274),m=n(93202),g=n(2013);let j=e=>{let i=["malformed","encoded","illegal"];return e.includes("URIError")&&e.split(" ").some(e=>i.includes(e))};class v extends x.Component{componentDidMount(){window.addEventListener("error",this.handleError),window.addEventListener("unhandledrejection",this.handleUnhandledRejection)}componentWillUnmount(){window.removeEventListener("error",this.handleError),window.removeEventListener("unhandledrejection",this.handleUnhandledRejection)}componentDidCatch(e,i){if("dev"===p.v.APPLICATION_ENVIRONMENT)throw e}static getDerivedStateFromError(e){return{hasError:!0,errMessage:e.message,shouldMountChildren:!1}}handleError(e){if("dev"===p.v.APPLICATION_ENVIRONMENT)throw Error("[ErrorBoundary]: ".concat(e.message))}handleUnhandledRejection(e){let i=this.props.unhandledRejectionFilter(e);if(i){var n;let i=(null===(n=e.reason)||void 0===n?void 0:n.message)||"";this.setState({hasError:!0,errMessage:i})}}render(){let e=!0===j(this.state.errMessage)?{opacity:"0.65",starOverlay:!1}:{};return(0,t.jsxs)(t.Fragment,{children:[this.state.hasError&&(0,t.jsx)(g.q,{pos:"absolute",top:0,...e,errMessage:""===this.state.errMessage?void 0:this.state.errMessage,showDisclosure:!0}),this.state.shouldMountChildren&&this.props.children]})}constructor(e){super(e),this.state={hasError:!1,errMessage:"",shouldMountChildren:!0},this.handleError=this.handleError.bind(this),this.handleUnhandledRejection=this.handleUnhandledRejection.bind(this)}}v.defaultProps={unhandledRejectionFilter:e=>{var i;return!!j((null===(i=e.reason)||void 0===i?void 0:i.message)||"")||e.reason instanceof m.YBv&&!1===document.hidden||e.reason instanceof m.R5s}},n(61036),n(62376),n(6991),n(76298),n(4466),n(43839),n(40917);var C=n(11050),f=n(42005);let b=()=>{let e=(0,x.useRef)(!1),i=(0,x.useRef)(new Map);(0,x.useEffect)(()=>{if("production"!==p.v.APPLICATION_ENVIRONMENT)return;let n=()=>{if(e.current)return;let n=i.current.get("total"),t=i.current.get("notTrusted"),s=t/n>.5;s&&n>5&&(e.current=!0,f.c.track(C.xW.NOT_TRUSTED_EVENTS_DETECTED,{totalEvents:n,notTrustedEvents:t}))},t=e=>{e.isTrusted||i.current.set("notTrusted",(i.current.get("notTrusted")||0)+1),i.current.set("total",(i.current.get("total")||0)+1),n()};return document.addEventListener("paste",t,{capture:!0}),document.addEventListener("mousedown",t,{capture:!0}),document.addEventListener("keydown",t,{capture:!0}),()=>{document.removeEventListener("paste",t,{capture:!0}),document.removeEventListener("mousedown",t,{capture:!0}),document.removeEventListener("keydown",t,{capture:!0})}},[])};var y=n(79254),A=n(27354),_=n(42111),w=n(32019),k=n(99092),I=n(36651);let S=(e,i)=>{k.H.init(p.v.HIGHLIGHT_PROJECT_ID,{environment:p.v.APPLICATION_ENVIRONMENT,sessionShortcut:!!i&&"shift+command+0",enableStrictPrivacy:e,enableSegmentIntegration:!0,networkRecording:{enabled:!0,recordHeadersAndBody:!0}}),C.co.loadSdkPromise.then(e=>{e&&e.addSourceMiddleware(k.LZ)})},E=e=>{let{children:i}=e,{user:n,anonymousUser:s,isGammaOrgUser:r,isUserLoading:l}=(0,I.SE)(),{enabled:a,enableStrictPrivacy:o}=(0,_.ye)("highlight");return(0,x.useEffect)(()=>{a&&!l&&n&&S(o,r)},[o,a,r,l,n]),(0,x.useEffect)(()=>
1{if(!l){if(n){let{id:e,displayName:i,email:t,profileImageUrl:s}=n;k.H.identify(e,{highlightDisplayName:i,email:t,avatar:s})}else if(null==s?void 0:s.id){let{id:e,displayName:i}=s;k.H.identify("",{anonDisplayName:i||"",anonId:e})}}},[n,s,l]),(0,t.jsx)(t.Fragment,{children:i})};var N=n(34881),P=n(87254),T=n(5879),R=n(44754);let O=e=>{let{children:i}=e;return(0,R.b)(),(0,t.jsx)(T.bd,{i18n:P.ag,children:i})};var M=n(18875),D=n(17292),z=n(55478),L=n(76332),U=n(6912),G=n(27902),F=n(21733),W=n(78462),H=n(72354),B=n(1163),K=n(2953);let V="get-gamma-pro",q=e=>{var i,n;let{children:s}=e,{currentWorkspace:r,isUserLoading:l}=(0,F.SE)(),[a,o]=(0,x.useState)(!1),c=(0,G.z$)(),d=(0,_.ye)("upsellUXEnabled_Pro"),{data:u,refetch:h}=(0,L.FaU)({variables:{workspaceId:null==r?void 0:r.id,includeExpired:!0},skip:!(null==r?void 0:r.id)}),p=null==u?void 0:u.subscription;(0,U.ET)({subscription:p,workspace:r,autoLaunch:!0});let{data:m}=(0,L.kNl)({variables:{workspaceId:null==r?void 0:r.id},skip:!r}),g=null==m?void 0:null===(i=m.products)||void 0===i?void 0:i.find(e=>"pro"===e.key),j=null==g?void 0:null===(n=g.prices)||void 0===n?void 0:n.find(e=>e.frequencyUnit===L.C_B.Year),v=(0,B.K9)(r),{isOpen:C,onOpen:f,onClose:b}=(0,z.q)({id:"upsell-modal"}),y=(0,x.useRef)(null),A=(0,x.useCallback)(e=>{let{onOpenCallback:i,onCloseCallback:n,insufficientCreditsWarning:t,segmentEvent:s}=e;d&&(o(!!t),null==i||i(),f(),null==c||c.track(s),y.current=n||null)},[c,f,d]),w=(0,x.useCallback)(()=>{var e;null==y||null===(e=y.current)||void 0===e||e.call(y),b(),y.current=null,o(!1)},[b]),[k,I]=(0,x.useState)({openUpsellModal:A,product:v,subscription:p,proYearlyProductPrice:j});return(0,x.useEffect)(()=>{let e="true"===(0,W.SJ)()[V];e&&!l&&r&&(f(),(0,N.lO)({query:{...(0,W.SJ)(),[V]:void 0},emitChange:!1}))},[f,r,l]),(0,x.useEffect)(()=>{I({openUpsellModal:A,refetchSubscription:h,product:v,subscription:p,proYearlyProductPrice:j})},[A,v,p,j,h]),(0,t.jsxs)(K.P.Provider,{value:k,children:[s,(0,t.jsx)(H.b,{insufficientCreditsWarning:a,isUpsellModalOpen:C,closeUpsellModal:w}),(0,t.jsx)(U.S1,{})]})};var Y=n(99268),X=n(25944),Z=n(19902);let J="no_org_id",Q=e=>{let{children:i}=e;(0,X.iZ)();let{user:n,anonymousUser:s,currentWorkspace:r,isUserLoading:l}=(0,I.SE)();return(0,x.useEffect)(()=>{let e=(0,Z.K)();(0,Y.$n)(e.get()),e.fetch().then(Y.$n).catch(()=>{})},[]),(0,x.useEffect)(()=>{let e;if(!l){if(n){let{id:i,email:t}=n,s=!!t&&t.endsWith("@gamma.app"),l=(null==r?void 0:r.id)||J;e={userId:i,isGammaUser:s,userOrgId:l,anonymousUser:!1,gammaUserFirstName:s?n.firstName:""}}else e={userId:"anonymous_user",isGammaUser:!1,userOrgId:J,anonymousUser:!0,gammaUserFirstName:""};(0,Y.$n)(e)}},[l,n,s,r]),(0,t.jsx)(t.Fragment,{children:i})};var $=n(54839),ee=n(91994),ei=n(89311),en=n(95426),et=n(1198),es=n(90221),er=n(60742),el=n(13265),ea=n(90383);a.vc.autoAddCss=!1;let eo=(0,ee.bh)(),ec=(0,m.RqP)(),ed=(0,m.PGq)(),eu=(0,r.B1)(o.qZ,{styles:{global:{".ProseMirror":{outline:"0 none"}}}});((e,i)=>{let n=(0,$.I)({theme:i});e.globalToast=n})(window,eu),(0,er.Lq)(),D.F7.initialize(),(0,N.lt)(),C.co.init(),(0,M.S1)(),(0,A.u7)(),(0,en.a)("appMainBundleLoaded"),console.log("\uD83D\uDE80 GammaApp main wrapper imported"),_.VH.get("debugLogging")||(window.console.debug=()=>{});let ex=e=>function(i){return(0,t.jsx)(eh,{children:(0,t.jsx)(e,{...i})})},eh=e=>{let{children:i}=e;console.log("\uD83D\uDE80 GammaApp main wrapper rendered");let n=(0,u.useRouter)();(0,ei.l)(),(0,el.k)(),b(),(0,x.useEffect)(()=>{let e=(e,i)=>{let{shallow:n}=i;console.debug("[GammaApp - handleRouteChange] App is changing to ".concat(e," ").concat(n?"with":"without"," shallow routing"))};return n.events.on("routeChangeStart",e),()=>{n.events.off("routeChangeStart",e)}},[n]);let r=(0,et.aY)();return(0,t.jsx)(h.zt,{store:eo,children:(0,t.jsx)(O,{children:(0,t.jsx)(l.x,{theme:eu,resetCSS:!0,children:(0,t.jsx)(v,{children:(0,t.jsx)(s.e,{client:ec,children:(0,t.jsxs)(m.mdV,{client:ed,children:[(0,t.jsx)(em,{}),(0,t.jsx)(y.H6,{}),(0,t.jsx)(M.GQ,{}),(0,t.jsxs)(I.fS,{children:[(0,t.jsx)(G.qA,{children:(0,t.jsx)(_.dF,{children:(0,t.jsx)(q,{children:(0,t.jsx)(m.Imj,{children:(0,t.jsx)(Q,{children:(0,t.jsx)(E,{children:(0,t.jsx)(et.dv,{value:r,children:(0,t.jsx)(w.u,{children:i})})})})})})})}),(0,t.jsx)(_.MG,{})]})]})})})})})})},ep="A new medium for presenting ideas, powered by AI. Beautiful, engaging content with none of the formatting and design work.",em=()=>{let e=p.v.APPLICATION_ENVIRONMENT;return(0,t.jsxs)(d(),{children:[(0,t.jsx)("title",{children:"Gamma"}),(0,t.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0, viewport-fit=cover"}),(0,t.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,t.jsx)("link",{rel:"shortcut icon",href:"production"===e?"/fav
1icons/favicon-transparent-96x96.png":"staging"===e?"/favicons/favicon_staging.jpg":"/favicons/favicon_local.jpg"}),(0,t.jsx)("meta",{content:ep,name:"description"},"description"),(0,t.jsx)("meta",{content:"Gamma",property:"og:title"},"og:title"),(0,t.jsx)("meta",{content:ep,property:"og:description"},"og:description"),(0,t.jsx)("meta",{content:p.v.OG_IMAGE_URL,property:"og:image"},"og:image"),(0,t.jsx)("meta",{content:"Gamma",property:"twitter:title"},"twitter:title"),(0,t.jsx)("meta",{content:ep,property:"twitter:description"},"twitter:description"),(0,t.jsx)("meta",{content:p.v.OG_IMAGE_URL,property:"twitter:image"},"twitter:image"),(0,t.jsx)("meta",{property:"og:type",content:"website"},"og:type"),(0,t.jsx)("meta",{content:"summary_large_image",name:"twitter:card"},"twitter:card"),(0,t.jsx)("link",{href:"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900",rel:"stylesheet"}),(0,t.jsx)("link",{rel:"stylesheet",href:"https://use.typekit.net/tiw2cwq.css"}),!(0,es.l6)()&&!(0,ea.wg)()&&(0,t.jsx)("script",{async:!0,src:"https://cdn.optimizely.com/js/20579410255.js"}),(0,t.jsx)("script",{src:"//cdn.iframe.ly/embed.js",async:!0,charSet:"utf-8"})]})}},60510:function(e,i,n){"use strict";n.d(i,{r:function(){return M},h:function(){return D}});var t=n(52322),s=n(38035),r=n(17993),l=n(77533),a=n(62614),o=n(81672),c=n(42946),d=n(49929),u=n(2784),x=n(90221),h=n(90439),p=n(93441),m=n(89458),g=n(90383),j=n(18733),v=n(5879),C=n(42111),f=n(78462),b=n(94199),y=n(11082),A=n(64173),_=n(31807),w=n(6912),k=n(48832),I=n(11050),S=n(36651),E=n(81640),N=n(12265),P=n(11942),T=n(88640);let R=[{Component:()=>{let e=(0,C.ye)("outageButterbar");if(!e.enabled)return null;let{header:i,text:n,buttonLink:s,buttonText:r,key:l,pathnameRegexp:a}=e;return(0,t.jsx)(D,{definition:{key:l,header:i,text:n,buttonText:r,buttonLink:s,conditions:()=>!a||null!==window.location.pathname.match(new RegExp(a))}})},key:"outage-butterbar"},{Component:()=>{let e=(0,C.ye)("openAiStatus");return"NORMAL"===e?null:(0,t.jsx)(D,{definition:{key:"ai-service-status",header:(0,t.jsx)(v.cC,{id:"1Agl06"}),text:(0,t.jsx)(v.cC,{id:"cCl6WD"}),ttl:86400,conditions:()=>(0,f._r)(window.location.pathname)}})},key:"ai-service-status-butterbar"},{Component:()=>{var e,i,n;let{user:s,currentWorkspace:r}=(0,S.SE)(),{subscription:l,product:a}=(0,E.z)(),{launchFailedPaymentFlow:o,failedPaymentFlowEnabled:c}=(0,w.ET)({subscription:l,workspace:r,autoLaunch:!1});if(!l||!a)return null;let d=(0,N.K)(),{name:u,dontChurnMessage:x}=d[a],{status:h,expirationTime:p,id:m}=l,g=(0,k.p6)(p,"MMMM do, yyyy"),j=(null==l?void 0:null===(e=l.createdByUser)||void 0===e?void 0:e.id)===(null==s?void 0:s.id),C=(0,P._8)(),f=p>Date.now();if(!("unpaid"===h||"past_due"===h)&&!f)return null;let A=C&&(j||!(null==l?void 0:l.createdByUser))?(0,t.jsx)(v.cC,{id:"velw1T",values:{expirationFormatted:g,GAMMA_PROPER_NOUN:b.N6,productName:u},components:{0:(0,t.jsx)(y.r,{href:C,isExternal:!0,textDecoration:"underline"})}}):(0,t.jsx)(v.cC,{id:"9aBOfk",values:{expirationFormatted:g,GAMMA_PROPER_NOUN:b.N6,productName:u,0:null===(i=l.createdByUser)||void 0===i?void 0:i.displayName,1:null===(n=l.createdByUser)||void 0===n?void 0:n.email},components:{0:(0,t.jsx)("b",{}),1:(0,t.jsx)("b",{})}});return(0,t.jsx)(D,{definition:{key:"payment-overdue-".concat(m),header:(0,t.jsx)(v.cC,{id:"gosJne",values:{productName:u}}),text:(0,t.jsxs)(t.Fragment,{children:[x," ",A]}),buttonText:(0,t.jsx)(v.cC,{id:"WLvqZR"}),buttonLink:c?void 0:C,buttonOnClick:c?o:void 0}})},key:"payment-overdue-butterbar"},{Component:()=>{let{subscription:e,openUpsellModal:i}=(0,E.z)();if(!e)return null;let{status:n,expirationTime:s,id:r}=e,l=new Date>(0,_.Z)(s)&&new Date<(0,A.Z)((0,_.Z)(s),{days:10});if(!l)return null;let a=()=>i({segmentEvent:I.AA.GAMMA_PRO_UPSELL_SUBSCRIPTION_EXPIRED_BUTTERBAR}),o=(0,t.jsx)(y.r,{onClick:a,isExternal:!0,textDecoration:"underline",children:(0,t.jsx)(v.cC,{id:"mj68q/"})});return(0,t.jsx)(D,{definition:{key:"subscription-expired-".concat(r),header:(0,t.jsx)(v.cC,{id:"5nhH6A"}),text:(0,t.jsxs)(t.Fragment,{children:["unpaid"===n||"past_due"===n?(0,t.jsx)(v.cC,{id:"Qdg
1XJv"}):""," ",o]}),buttonText:(0,t.jsx)(v.cC,{id:"kwkhPe"}),buttonOnClick:a}})},key:"subscription-expired-butterbar"},{Component:()=>{var e,i,n;let{user:s}=(0,S.SE)(),{subscription:r,product:l}=(0,E.z)();if(!r||!l)return null;let{status:a,expirationTime:o,id:c,cancellationRequestedTime:d}=r,u="canceled"!=a&&d&&new Date<(0,_.Z)(o)&&new Date>(0,A.Z)((0,_.Z)(o),{days:-7});if(!u)return null;let x=(null==r?void 0:null===(e=r.createdByUser)||void 0===e?void 0:e.id)===(null==s?void 0:s.id),h=(0,P._8)(),p=(0,k.p6)(o,"MMMM do, yyyy"),m=(0,N.K)(),{name:g,dontChurnMessage:j}=m[l],C=!x&&(null==r?void 0:r.createdByUser)?(0,t.jsx)(v.cC,{id:"z4DeyC",values:{expirationFormatted:p,GAMMA_PROPER_NOUN:b.N6,productName:g,0:null===(i=r.createdByUser)||void 0===i?void 0:i.displayName,1:null===(n=r.createdByUser)||void 0===n?void 0:n.email},components:{0:(0,t.jsx)("b",{}),1:(0,t.jsx)("b",{})}}):(0,t.jsx)(v.cC,{id:"qP91+f",values:{expirationFormatted:p,GAMMA_PROPER_NOUN:b.N6,productName:g},components:{0:(0,t.jsx)(y.r,{href:h,isExternal:!0,textDecoration:"underline"})}});return(0,t.jsx)(D,{definition:{key:"subscription-ending-soon-".concat(c),header:(0,t.jsx)(v.cC,{id:"THJAvC",values:{productName:g}}),text:(0,t.jsxs)(t.Fragment,{children:[j," ",C]}),buttonText:(0,t.jsx)(v.cC,{id:"3jHA5d"}),buttonLink:h}})},key:"upcoming-cancellation-butterbar"},{key:"tablet-browser-warning",header:(0,t.jsx)(v.cC,{id:"JAtlMu",values:{GAMMA_PROPER_NOUN:b.N6}}),text:(0,t.jsx)(v.cC,{id:"9JlCFS",values:{GAMMA_PROPER_NOUN:b.N6}}),conditions:()=>(0,x.dA)(),dismissKey:T.H.lastDismissedPreferredBrowserMessage},{key:"desktop-browser-warning",header:(0,t.jsx)(v.cC,{id:"3S0+Wy",values:{GAMMA_PROPER_NOUN:b.N6}}),text:(0,t.jsx)(v.cC,{id:"Tf7VpJ"}),conditions:()=>O()&&(0,x.ds)(),dismissKey:T.H.lastDismissedPreferredBrowserMessage}],O=()=>(0,x.jP)()||!(0,x.i7)()&&!(0,x.G6)()&&!(0,x.NA)(),M=e=>{let{isViewOnly:i}=e,n=(0,p.gF)();if(i||!n||(0,x.l6)()||h.cx||(0,g.wg)())return null;let r=R.map(e=>"Component"in e?(0,t.jsx)(e.Component,{},e.key):(0,t.jsx)(D,{definition:e},e.key));return(0,t.jsx)(s.k,{"data-testid":"butterbar",direction:"column",top:0,pos:"relative",zIndex:"banner",sx:{"> *:not(:first-child)":{display:"none"}},children:r})},D=e=>{let{definition:i}=e,{key:n,dismissKey:x="butterbar-dismiss-".concat(n),header:h,text:p,buttonText:g,buttonLink:v,buttonOnClick:C=v?()=>window.open(v,"_blank"):void 0,conditions:f,ttl:b}=i,[y,A]=(0,m.I)(x,!1);return((0,u.useEffect)(()=>{if(!(b&&y))return;let e=new Date().getTime(),i=new Date(y).getTime(),n=e-i>1e3*b;n&&j.W.removeItem(x)},[x,y,b]),f&&!f()||y)?null:(0,t.jsxs)(s.k,{direction:"row",bg:"indigo.500",color:"white",py:3,px:4,align:"center",fontSize:"sm",children:[(0,t.jsxs)(r.g,{flex:"1",align:"start",spacing:0,children:[(0,t.jsx)(l.x,{fontWeight:"bold",children:h}),(0,t.jsx)(l.x,{opacity:"0.7",fontSize:"xs",children:p})]}),g&&C&&(0,t.jsx)(a.z,{variant:"plain",size:"sm",mr:4,rightIcon:v?(0,t.jsx)(d.G,{icon:c.wlW}):void 0,onClick:C,children:g}),(0,t.jsx)(o.P,{onClick:()=>{A(String(new Date))}})]})}},2013:function(e,i,n){"use strict";n.d(i,{q:function(){return y}});var t=n(52322),s=n(38035),r=n(77533),l=n(49259),a=n(87436),o=n(95897),c=n(28535),d=n(89511),u=n(11121),x=n(44438),h=n(42822),p=n(62614),m=n(75009),g=n(94523),j=n(5879),v=n(3543),C=n(92981);let f=(0,t.jsx)(j.cC,{id:"HiX9QN"}),b={bgImage:"radial-gradient(1px 1px at 20px 30px, #eee, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 40px 70px, #fff, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 50px 160px, #ddd, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 90px 40px, #fff, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 130px 80px, #fff, rgba(0,0,0,0)),\n    radial-gradient(1px 1px at 160px 120px, #ddd, rgba(0,0,0,0))",bgRepeat:"repeat",bgSize:"200px 200px",transform:"translate(-50%,-50%)",borderRadius:{base:0,lg:"100px"},pos:"relative",maxW:"8xl",maxH:"5xl",minH:{base:0,lg:"5xl"}},y=e=>{let{errMessage:i=f,showDisclosure:n=!1,opacity:y=1,starOverlay:A=!0,backgroundColor:_=g.qZ.colors.trueblue[900],...w}=e,k=A?b:{};return(0,t.jsx)(s.k,{"data-error-component":!0,w:"100vw",h:"100vh",overflow:"hidden",zIndex:99999,backgroundColor:(0,v.tT)(_,y),...w,children:(0,t.jsx)(s.k,{...k,justifyContent:"center",alignItems:"center",flex:1,p:[4,16],left
1:"50%",top:"50%",children:(0,t.jsxs)(C.qX,{lede:"",title:(0,t.jsx)(j.cC,{id:"HbR60U"}),stackProps:{shadow:"lg-dark",position:"relative"},children:[(0,t.jsx)(r.x,{children:(0,t.jsx)(j.cC,{id:"1gm+lP"})}),n&&(0,t.jsx)(l.U,{allowToggle:!0,pt:4,children:(0,t.jsxs)(a.Q,{children:[(0,t.jsxs)(o.K,{px:0,_hover:{bgColor:"none"},borderStyle:"none",children:[(0,t.jsx)(c.xu,{flex:"1",textAlign:"left",children:(0,t.jsx)(j.cC,{id:"qug3k/"})}),(0,t.jsx)(d.X,{})]}),(0,t.jsx)(u.H,{pb:4,children:(0,t.jsx)(x.E,{colorScheme:"red",children:i})})]})}),(0,t.jsx)(h.M,{children:(0,t.jsx)(p.z,{variant:"solid",size:"lg",m:6,onClick:()=>{window.location.reload()},children:(0,t.jsx)(j.cC,{id:"C6f2hU"})})}),(0,t.jsx)(m.E,{pos:"absolute",w:36,bottom:"calc(-100% + 120px)",right:-12,src:"/_next/static/media/Sal-Asteroid-Parachute.ad317576.png",pointerEvents:"none",opacity:{base:0,md:1}})]})})})}},79254:function(e,i,n){"use strict";n.d(i,{$C:function(){return x},H6:function(){return u},Uj:function(){return h}});var t=n(52322),s=n(5632),r=n(73534),l=n.n(r),a=n(14274),o=n(93441),c=n(34385);let d=["/signin","/signup","/invitations/workspaces/[workspaceId]"],u=()=>{let e=(0,s.useRouter)().pathname;return!(0,o.gF)()||d.includes(e)?null:(0,t.jsx)("style",{children:".grecaptcha-badge { visibility: hidden; }"})},x=()=>(0,t.jsx)(l(),{src:"https://www.google.com/recaptcha/enterprise.js?render=".concat(a.v.RECAPTCHA_SCORING_KEY),async:!0,defer:!0}),h=async e=>(await (0,c.X)(50,100)(()=>!!window.grecaptcha).catch(()=>{throw Error("Timed out waiting for grecaptcha")}),new Promise((i,n)=>{grecaptcha.enterprise.ready(async()=>{try{let n=await grecaptcha.enterprise.execute(a.v.RECAPTCHA_SCORING_KEY,{action:e});i(n)}catch(e){console.log(e),n(e)}})}))},24551:function(e,i,n){"use strict";n.d(i,{C:function(){return _},O:function(){return w}});var t=n(52322),s=n(38035),r=n(17993),l=n(62614),a=n(67109),o=n(42946),c=n(49929),d=n(5879),u=n(55388),x=n(2689),h=n.n(x),p=n(2784),m=n(91994),g=n(62040),j=n(90507),v=n(28858),C=n(46741),f=n(76282),b=n(74720),y=n(14874);let A={...v.I,...b.R,...C.dE},_="ai-card-editor",w=(0,p.memo)(e=>{let{...i}=e,n=(0,m.CG)(f.$X),a=(0,u.jE)({...i,extensions:y.XL});a&&(a.editorId=_);let x=(0,m.CG)(f.g8),v=(0,m.CG)(f.CC);(0,p.useEffect)(()=>{a&&a.setEditable(!n)},[n,a]);let C=(0,p.useCallback)(()=>{null==a||a.chain().insertContentAt(null==a?void 0:a.state.doc.content.size,{type:"card",content:[{type:"paragraph"}]}).selectInsertedNode().run()},[a]);return(0,g.n)(a),(0,t.jsxs)(s.k,{flex:"1",direction:"column",sx:A,p:{base:2,md:3},children:[(0,t.jsx)(j.kg,{editor:a,style:{wordBreak:"break-word",display:"flex",flexDirection:"column"}}),n&&(0,t.jsx)(r.g,{children:h()(x-v).map(e=>(0,t.jsx)(k,{},e))}
1),!n&&(0,t.jsx)(l.z,{boxShadow:"none",leftIcon:(0,t.jsx)(c.G,{icon:o.r8p,fixedWidth:!0}),onClick:C,children:(0,t.jsx)(d.cC,{id:"sFY+gw"})})]})});w.displayName="AICardEditor";let k=()=>(0,t.jsx)(a.O,{height:14,width:"100%",borderRadius:"md"})},74720:function(e,i,n){"use strict";n.d(i,{R:function(){return s}});var t=n(40212);let s={".ProseMirror":{flex:1,...t.U},".block":{my:"0.75rem",":first-child":{mt:"0px !important"},":last-child":{mb:"0px !important"}},".block-heading":{fontWeight:"bold",lineHeight:"1.25",_first:{mt:0}},h1:{fontSize:"1.5em"},h2:{fontSize:"1.25em"},h3:{fontSize:"1.125em"},"a[href]":{color:"var(--chakra-colors-trueblue-600)",textDecoration:"underline"}}},14874:function(e,i,n){"use strict";n.d(i,{XL:function(){return ev},uJ:function(){return ej},dW:function(){return eC}});var t=n(72338),s=n(86900),r=n(42626),l=n(74902),a=n(36518),o=n(71391),c=n(86509),d=n(9432),u=n(70675),x=n(38438),h=n(39615),p=n(39475),m=n(77381),g=n(6085),j=n(3402),v=n(17487),C=n(72762),f=n(73528),b=n(99173),y=n(41889),A=n(13653),_=n(59799),w=n(90507),k=n(47577),I=n(52322),S=n(28535);let E=e=>{let{selected:i}=e;return(0,I.jsx)(w.T5,{children:(0,I.jsx)(S.xu,{pos:"relative",draggable:"true","data-drag-handle":!0,cursor:"grab",contentEditable:"false",position:"relative",display:"flex",flexDirection:"column",justifyContent:"center",height:"1.25rem",color:i?"trueblue.400":"gray.400",lineHeight:"1rem",fontWeight:"800",children:"---"})})},N=/^(---|___|—-)/,P=t.NB.create({name:"sectionBreak",group:"block",atom:!0,selectable:!0,draggable:!0,parseHTML:()=>[{tag:"hr"}],renderHTML(e){let{HTMLAttributes:i}=e;return["hr",(0,t.P1)(i)]},addNodeView:()=>
1(0,w.fW)(E),addInputRules(){return[(0,k.ok)({find:N,type:this.type})]}});var T=n(60491),R=n(90062),O=n(91073),M=n(27191),D=n(52780);let z=new M.Sy({props:{decorations:e=>{let{doc:i}=e,n=[],t=1;return i.descendants((e,i)=>{"card"===e.type.name&&(n.push(D.p.node(i,i+e.nodeSize,{},{number:t,isSectionCardPluginDecoration:!0})),t++)}),0==n.length?D.EH.empty:D.EH.create(i,n)}}}),L=e=>{let i=e.find(e=>e.spec.isSectionCardPluginDecoration);return i?i.spec:{number:0,isSectionCardPluginDecoration:!0}};var U=n(29117),G=n(77533),F=n(38035),W=n(32899),H=n(10625),B=n(67046),K=n(332),V=n(99058),q=n(25481),Y=n(27599),X=n(42946),Z=n(49929),J=n(94523),Q=n(5879),$=n(87254),ee=n(2784),ei=n(5026),en=n(76282),et=n(91994),es=n(90221),er=n(3543);let el={r:235,g:248,b:255},ea={r:255,g:245,b:255},eo={r:107,g:70,b:193},ec={r:43,g:108,b:176},ed=(e,i,n,t)=>t?{bg:"gray.100",text:"gray.600"}:{bg:(0,er.Py)(el,ea,e/Math.min(n,i)),text:(0,er.Py)(ec,eo,e/Math.min(n,i))},eu=e=>{let{decorations:i,editor:n,getPos:t}=e,{number:s}=L(i),r=(0,et.CG)(en.CC),{maxCards:l,canUpgrade:a}=(0,ei.hw)(),o=s>l,c=s===r,d=ed(s,r,l,o),u=(0,ee.useCallback)(()=>{let e=t(),i=n.view.state.doc.nodeAt(e);if(!i){console.error("[SectionCardView] Cannot append card. Node unknown");return}let s=e+i.nodeSize;n.chain().insertContentAt(s,{type:"card",content:[{type:"paragraph"}]}).focus().selectInsertedNode().run()},[n,t]),x=(0,ee.useCallback)(()=>{n.commands.selectNodeAtPos(t())},[n,t]),h=(0,ee.useCallback)(()=>{let e=t(),i=n.view.state.doc.nodeAt(e);if(!i){console.error("[SectionCardView] Cannot delete card. Node unknown");return}n.chain().deleteRange({from:e,to:e+i.nodeSize}).selectInsideNodeAtPos(e).focus().run()},[n,t]),p=(0,ee.useCallback)(()=>{let e=t(),i=n.view.state.doc.nodeAt(e);if(!i){console.error("[SectionCardView] Cannot focus card. Node unknown");return}n.chain().selectInsideNodeAtPos(e).focus().run()},[n,t]),m=(0,A.Od)(i);return(0,I.jsxs)(w.T5,{role:"group",children:[(0,I.jsxs)(U.U,{className:"card",border:"1px solid",borderColor:m?"var(--chakra-ring-color)":"blackAlpha.100",shadow:"sm",_hover:{shadow:"md"},transitionProperty:"box-shadow",transitionDuration:"normal",bg:"white",borderRadius:"md",spacing:0,align:"stretch","data-selection-ring":!0,pos:"relative",my:3,mt:1===s?0:void 0,role:"group",children:[!(0,es.s2)()&&(0,I.jsx)(S.xu,{position:"absolute",color:d.text,zIndex:"1",top:"3.5",left:"0",pointerEvents:"none",opacity:"0",_groupHover:{opacity:.75},children:(0,I.jsx)(Z.G,{icon:X.Okg,fixedWidth:!0})}),o&&(0,I.jsx)(S.Cd,{size:"6px",position:"absolute",zIndex:"2",top:"1.5",left:"1.5",bg:"sunglow.400"}),(0,I.jsx)(J.kH,{label:o&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(G.x,{children:[(0,I.jsx)(Q.cC,{id:"rayOuP"})," "]}),(0,I.jsx)(G.x,{color:"gray.400",children:a?(0,I.jsx)(Q.cC,{id:"W8sobv",values:{MAX_CARDS_PRO:ei.Fv}}):(0,I.jsx)(Q.cC,{id:"yLG7qf"})})]}),placement:"top",children:(0,I.jsx)(F.k,{dir:"column",align:"start",justify:"center",pr:1,pl:2,py:{base:3.5,md:4},w:12,cursor:o?"help":"grab","data-drag-handle":!0,contentEditable:!1,onClick:x,fontSize:s>=100?"xs":"sm",fontFamily:"mono",fontWeight:"600",borderLeftRadius:"inherit",userSelect:"none",transitionProperty:"filter",transitionDuration:"normal",_hover:{filter:"brightness(0.95)"},bg:d.bg,color:d.text,children:s})}),(0,I.jsx)(S.xu,{p:{base:3,md:4},flex:1,color:o?"gray.600":void 0,position:"relative",children:(0,I.jsx)(w.ms,{})}),(0,I.jsx)(eh,{addCard:u,focusCard:p,deleteCard:h})]}
1),!(0,es.s2)()&&!c&&(0,I.jsx)(ex,{addCard:u})]})},ex=(0,ee.memo)(e=>{let{addCard:i}=e;return(0,I.jsxs)(F.k,{w:"100%",h:1,borderRadius:"md",bg:"trueblue.200",transitionProperty:"opacity",transitionDuration:"slow",opacity:0,_hover:{opacity:1},_focusWithin:{opacity:1},contentEditable:!1,my:1,dir:"column",align:"center",justify:"center",pos:"absolute",transform:"translateY(-0.75rem)",zIndex:1,children:[(0,I.jsx)(S.xu,{pos:"absolute",top:-2,bottom:-2,left:0,right:0}),(0,I.jsx)(J.kH,{placement:"top",label:$.ag._({id:"sFY+gw"}),shortcut:"---",children:(0,I.jsx)(W.h,{pos:"absolute",variant:"solid",icon:(0,I.jsx)(Z.G,{icon:X.r8p}),"aria-label":"Add card",isRound:!0,size:"xs",onClick:i,tabIndex:-1})})]})});ex.displayName="CardDivider";let eh=(0,ee.memo)(e=>{let{addCard:i,deleteCard:n,focusCard:t}=e;return(0,I.jsx)(U.U,{pr:{base:2,md:2.5},pt:{base:2,md:3},alignSelf:"start",children:(0,es.s2)()?(0,I.jsx)(H.v,{children:e=>{let{onClose:s}=e;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(B.j,{onClick:t,as:W.h,colorScheme:"gray",variant:"ghost",size:"sm",icon:(0,I.jsx)(Z.G,{icon:X.S6C,fixedWidth:!0})}),(0,I.jsx)(K.h,{children:(0,I.jsxs)(V.q,{zIndex:"tooltip",children:[(0,I.jsx)(q.s,{onClick:()=>{s(),i()},icon:(0,I.jsx)(Z.G,{icon:X.L26,fixedWidth:!0}),children:(0,I.jsx)(Q.cC,{id:"90n2YU"})}),(0,I.jsx)(Y.R,{}),(0,I.jsx)(q.s,{onClick:()=>{n(),s()},color:"red",icon:(0,I.jsx)(Z.G,{icon:X.Vui,fixedWidth:!0}),children:(0,I.jsx)(Q.cC,{id:"nabda1"})})]})})]})}}):(0,I.jsx)(J.kH,{label:(0,I.jsx)(Q.cC,{id:"nabda1"}),placement:"top",children:(0,I.jsx)(W.h,{colorScheme:"gray",variant:"ghost",opacity:"0",_groupHover:{opacity:1},_focus:{opacity:1},transitionProperty:"opacity",transitionDuration:"slow",size:"sm",onClick:n,"aria-label":$.ag._({id:"nabda1"}),icon:(0,I.jsx)(Z.G,{icon:X.Vui,fixedWidth:!0})})})})});eh.displayName="CardActions";let ep=/^(---|___|—-)$/,em=t.NB.create({name:"card",content:"block+",selectable:!0,draggable:!0,isolating:!0,parseHTML:()=>[{tag:"section"}],renderHTML(e){let{HTMLAttributes:i}=e;return["section",(0,t.P1)(i),0]},addNodeView:()=>(0,w.fW)(eu),addProseMirrorPlugins:()=>[z],addInputRules:()=>[new t.VK({find:ep,handler:e=>{let{state:i,range:n}=e,{tr:t}=i;(0,T.X)({tr:t.deleteRange(n.from,n.to),dispatch:!0})}})],addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.mergeCardsOnDelete(!1),Delete:()=>this.editor.commands.mergeCardsOnDelete(!0),Tab:()=>this.editor.commands.selectNextCard(!0),"Shift-Tab":()=>this.editor.commands.selectNextCard(!1)}},addCommands:()=>({selectNextCard:e=>i=>{let{state:n,dispatch:s,commands:r}=i;if(!s)return!0;let{selection:l}=n,a=(0,t.Kk)(O.KH)(l);if(!a||!l.empty)return!1;let o=n.doc.resolve(a.pos),c=o.index();if(e){if(c===o.parent.childCount-1)return!1;r.selectInsideNodeAtPos(a.pos+a.node.nodeSize)}else{if(0===c)return!1;let e=o.posAtIndex(c-1);r.selectInsideNodeAtPos(e)}return!0},mergeCardsOnDelete:e=>i=>{let{tr:n,state:s,dispatch:r}=i;if(!r)return!0;let{selection:l}=s,a=(0,t.Kk)(O.KH)(l);if(!a||!l.empty)return!1;try{let i=(0,R.pt)(l,e);if(!i)return!1;return e?(0,R.Yh)(a.pos,n,s):(0,R.Gq)(a.pos,n)}catch(e){return console.debug("[CardCommands] mergeCardsOnDelete failed",e),!1}}})}),eg=[c.A,m.l,y.d,x.n,h.x,v.Hy,o.X,s.d8,p.v,d.Tx,u.Z.configure({openOnClick:!1}),f.aV,C.g,b.k,_.U,g.m,a.f,l.m.configure({color:"var(--chakra-colors-trueblue-200)",width:3,class:"ProseMirror-dropcursor"}),A.Jn],ej=[...eg,P,r.B.extend({content:"block+"})],ev=[...eg,em,r.B.extend({content:"card+"})],eC=(e,i)=>{let n=(0,t.J1)("freeform"===i?ej:ev);return"structured"===i&&(e=e.split("<hr>").map(e=>"<section>".concat(e,"</section>")).join("\n")),(0,j.T)(e,n)}},39092:function(e,i,n){"use strict";n.d(i,{i:function(){return f},j:function(){return C}});var t=n(52322),s=n(87436),r=n(95897),l=n(29117),a=n(28535),o=n(43297),c=n(77533),d=n(36474),u=n(89511),x=n(11121),h=n(67109),p=n(49929),m=n(2784),g=n(76282),j=n(91994);let v={_groupHover:{color:"purple.600"}},C=(0,m.memo)(e=>{let{icon:i,colorScheme:n="gray",label:m,values:C=[],children:f}=e,b=(0,j.CG)(g.RB);return(0,t.jsx)(s.Q,{border:"none",children:e=>{let{isExpanded:s}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.K,{_focus:{boxShadow:"none",outline:"none"},py:2,p:3,outline:"none",transitionProperty:"common",transitionDuration:"normal",bg:"transparent",_hover:{bg:"".concat(n,".50")},children:(0,t.jsxs)(l.U,{width:"100%",spacing:"3",align:"start",children:[(0,t.jsx)(a.xu,{...v,display:"inline",fontSize:"sm",color:"".concat(n,".300"),children:(0,t.jsx)(p.G,{icon:i,fixedWidth:!0})}),(0,t.jsxs)(o.K,{spacing:0,align:"start",textAlign:"left",children:[(0,t.jsx)(c.x,{...v,fontWeight:"700",children:m}),!s&&(0,t.jsx)(c.x,{fontSize:"sm",fontWeight:"500",noOfLines:2,...v,children:C.filter(
1Boolean).join(" \xb7 ")})]}),(0,t.jsx)(d.L,{}),(0,t.jsx)(u.X,{...v})]})}),(0,t.jsxs)(x.H,{p:4,pt:3,pb:6,children:[b&&f,!b&&(0,t.jsxs)(o.K,{spacing:4,pt:2,align:"start",children:[(0,t.jsx)(h.O,{w:"100%",height:"30px"}),(0,t.jsx)(h.O,{w:"100%",height:"30px"}),(0,t.jsx)(h.O,{w:"100%",height:"30px"})]})]})]})}})});C.displayName="SettingsGroup";let f=e=>{let{children:i}=e;return(0,t.jsx)(c.x,{fontSize:"sm",color:"gray.500",children:i})}},45760:function(e,i,n){"use strict";n.d(i,{jX:function(){return a},vZ:function(){return l}});var t=n(52322),s=n(2784);let r=s.createContext({});function l(){let e=(0,s.useContext)(r);return e}let a=e=>{let{children:i}=e,n=s.useRef();return(0,t.jsx)(r.Provider,{value:{setEditorInstance:e=>{n.current=e},getEditorInstance:()=>n.current},children:i})}},74153:function(e,i,n){"use strict";n.d(i,{Ns:function(){return g},Q_:function(){return m},ex:function(){return h},ip:function(){return p},o7:function(){return x},vS:function(){return j}});var t=n(2784),s=n(45760),r=n(93202),l=n(91994),a=n(86581),o=n(33522),c=n(24551),d=n(14874),u=n(76282);let x=()=>{let e=(0,l.qr)(),i=(0,l.TL)(),[n]=(0,r.NCT)(),s=(0,t.useCallback)(async()=>{var t;let s=(0,u.d_)(e.getState()),r=s.id,l=await n({variables:{docGenerateInputId:r,input:{}}}),a=null===(t=l.data)||void 0===t?void 0:t.updateDocGenerationDraftInput;a&&a.draftInput&&r!==a.draftInput.id&&i((0,u.Gn)(a))},[i,e,n]);return s},h=e=>{var i;let n=(0,l.qr)(),s=(0,l.TL)(),[a]=(0,r.NCT)(),c=(0,t.useCallback)(async e=>{var i;let t=(0,u.RB)(n.getState()),r=(0,u.U6)(n.getState());if(!t||!r)return;let{format:l,...o}=e,c={format:l,...o},d=(0,u.br)(n.getState());c.settings&&(c.settings={...d,...c.settings});let x=(0,u.U6)(n.getState()),h=await a({variables:{docGenerateInputId:r,input:c}}),p=null===(i=h.data)||void 0===i?void 0:i.updateDocGenerationDraftInput;p&&p.draftInput&&x!==p.draftInput.id&&s((0,u.Gn)(p))},[s,n,a]),d=(0,o.Kt)(c,null!==(i=null==e?void 0:e.debounce)&&void 0!==i?i:0),x=(0,t.useCallback)(function(e){let i=!(arguments.length>1)||void 0===arguments[1]||arguments[1];s((0,u.Zx)(e)),i&&d(e)},[d,s]);return x},p=()=>{let e=h(),i=(0,t.useCallback)(function(i){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];e({format:i},n)},[e]),n=(0,l.CG)(u.Lh);return[n,i]},m=()=>{let e=h({debounce:500}),i=(0,t.useCallback)(function(i){let n=!(arguments.length>1)||void 0===arguments[1]||arguments[1];e({prompt:i},n)},[e]),n=(0,l.CG)(u.lb);return[n,i]},g=(e,i)=>{let n=h(i),s=(0,t.useCallback)(function(i){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];n({settings:{[e]:i}},t)},[e,n]),r=(0,l.CG)((0,u.Mn)(e));return[r,s]},j=e=>{let i=h(e),{getEditorInstance:n}=(0,s.vZ)(),r=(0,t.useCallback)(function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],s=n();if(s){let i=s.editorId===c.C,n=(0,a.c8)(e),t=(0,d.dW)(n,i?"structured":"freeform").content.toJSON();s.commands.setContent(t)}i({content:e},t)},[i,n]);return r}},39122:function(e,i,n){"use strict";n.d(i,{ET:function(){return t},LB:function(){return o},VN:function(){return a},VY:function(){return s},WJ:function(){return r},rj:function(){return l}});let t="/generate",s="ai-generate",r=2,l=2,a=400,o={DESIGNER__HELLO:0,USER__OUTPUT_FORMAT_INPUT:1,DESIGNER__TOPIC:2,USER__TOPIC_INPUT:3,DESIGNER__OUTLINE:4,USER__OUTLINE_INPUT:5}},49165:function(e,i,n){"use strict";n.d(i,{R:function(){return m},c:function(){return g}});var t=n(52322),s=n(70065),r=n(5879),l=n(5632),a=n(2784),o=n(93202),c=n(42111),d=n(84405),u=n(56356),x=n(41425),h=n(23147),p=n(36651);let m={example_deck_clone_toast:o.L17.DuplicateInspiration,import_google_doc:o.L17.ImportGoogleDoc,import_google_slides:o.L17.ImportGoogleSlides,import_docx:o.L17.ImportDocx,import_pptx:o.L17.ImportPptx,blank:o.L17.Blank,template_browser:o.L17.DuplicateTemplate,get_started_modal:o.L17.Blank,template_modal_griditem:o.L17.DuplicateTemplate,template_dashboard_griditem:o.L17.DuplicateTemplate,template_modal_preview:o.L17.DuplicateTemplate,template_modal_preview_create_theme:o.L17.DuplicateTemplate,"slash-new":o.L17.SlashNew,editor_toolbar_doc_menu_duplicate:o.L17.DuplicateDoc,dashboard_docs_view_duplicate:o.L17.DuplicateDoc,ai_generated:o.L17.AiGenerated,ai_generated_advanced:o.L17.AiGenerated,sites_add_page:o.L17.SitesAddPage,sites_copy_to_site:o.L17.SitesCopyToSite},g=()=>{let{user:e,currentWorkspace:i}=(0,p.SE)(),n=(0,c.ye)("cardLayoutsEnabled"),[g,{data:j,loading:v}]=(0,o.CsQ)(),{push:C,replace:f}=(0,l.useRouter)(),b=(0,s.p)(),y=(0,a.useCallback)(s=>
1{var l;let a=null==e?void 0:null===(l=e.settings)||void 0===l?void 0:l.needsEditorOnboarding,o=s.source,c=null==s?void 0:s.channelId,p=(null==s?void 0:s.historyFn)==="replace"?f:C,j=a?"quickstart":"empty";if(!(null==i?void 0:i.id)){console.error("[createDocAndNavigate] No currentWorkspace found");return}let v={cardLayoutsEnabled:n},y=(null==s?void 0:s.document)?s.document:"empty"===j?(0,u.bx)(e,{docFlags:v}):(0,u.VK)(e,{docFlags:v}),A=(0,h.qI)(y);return console.debug("[createDocAndNavigate] Creating doc",{document:y,encodedDocument:A}),g({variables:{workspaceId:null==i?void 0:i.id,title:(null==s?void 0:s.title)||"",source:m[s.source],initialContent:{ydoc:A,schemaVersion:x.bI,editors:[null==e?void 0:e.id]},...c?{channels:[{channelId:c}]}:{}}}).then(async e=>{let{data:i}=e;(0,d.Q)({doc_id:null==i?void 0:i.createDoc.id,source:o,channel:c||null}),console.debug("[createDocAndNavigate] Doc created. Navigating to Editor",null==i?void 0:i.createDoc.id),p("/docs/".concat(null==i?void 0:i.createDoc.id).concat(a?"?tour=true":""))}).catch(e=>{console.error("[createDocAndNavigate]",e),b({title:(0,t.jsx)(r.cC,{id:"0jT1fA"}),description:e.message,position:"top",status:"error",isClosable:!0,duration:null})})},[n,g,null==i?void 0:i.id,C,f,b,e]);return[y,{data:j,loading:v}]}},6912:function(e,i,n){"use strict";n.d(i,{S1:function(){return f},B_:function(){return A},ET:function(){return b}});var t=n(2784),s=n(14274),r=n(88232),l=n(42111),a=n(49152),o=n(44663),c=n(1163),d=n(11050),u=n(90221),x=n(23284),h=n(90383),p=n(87254),m=n(82108),g=n.n(m),j=n(94199);let v=(e,i)=>{let n=g()(i);return{[e]:{next:p.ag._({id:"hXzOVo"}),back:p.ag._({id:"iH8pgl"}),nevermind:p.ag._({id:"CKyk7Q"}),goToAccount:p.ag._({id:"C9yTHG",values:{GAMMA_PROPER_NOUN:j.N6}}),getHelp:p.ag._({id:"pWsyuL"}),declineOffer:p.ag._({id:"aIFikE"}),confirmAndCancel:p.ag._({id:"G9nPRC"}),pauseSubscription:p.ag._({id:"2RgEmU"}),cancelSubscription:p.ag._({id:"dEgA5A"}),discountSubscription:p.ag._({id:"qG4Wa/"}),claimOffer:p.ag._({id:"/Gl/RK"}),discountOff:p.ag._({id:"Bdtwnw"}),discountFor:p.ag._({id:"sQv06Y"}),discountForever:p.ag._({id:"FsOOWf"}),discountOneTime:p.ag._({id:"HpXCa4"}),day:p.ag._({id:"5YWExy"}),month:p.ag._({id:"obrMay"}),year:p.ag._({id:"/Tw548"}),error:p.ag._({id:"wTrpxV"}),genericErrorDescription:p.ag._({id:"PUjJ3A"}),cancelNow:p.ag._({id:"EiakwV"}),applyingDiscount:p.ag._({id:"8kSYjw"}),applyingCancel:p.ag._({id:"VpuvNv"}),applyingResume:p.ag._({id:"eIoGiX"}),applyingPause:p.ag._({id:"UD7gOq"}),discountApplied:p.ag._({id:"jdYyiz"}),discountAppliedMessage:p.ag._({id:"DhHX6G"}),pauseApplied:p.ag._({id:"eeITvj"}),pauseAppliedMessage:p.ag._({id:"nm0VaE"}),pauseAppliedResumeMessage:p.ag._({id:"qOe0SS"}),pauseScheduledMessage:p.ag._({id:"mqRc6d"}),until:p.ag._({id:"C51N+0"}),cancelApplied:p.ag._({id:"Wcg6zu"}),cancelAppliedMessage:p.ag._({id:"8vN97Y"}),cancelAppliedDateMessage:p.ag._({id:"BS/SGu"}),howLongToPausePrompt:p.ag._({id:"HLyJ9n"}),whatCouldWeHaveDone:p.ag._({id:"fcbm8H"}),weReadEveryAnswer:p.ag._({id:"nkuKRd"}),applyingCustomerAction:p.ag._({id:"PXwF+s"}),loading:p.ag._({id:"Z3FXyt"}),pauseWallCardPunch:p.ag._({id:"iL2TQ6"}),pauseWallCta:p.ag._({id:"TvXj47"}),pauseWallCardHeading:p.ag._({id:"kHm8Fg"}),scheduledToReactivate:p.ag._({id:"aH7vi8"}),resumeApplied:p.ag._({id:"diOgYK"}),resumeAppliedMessage:p.ag._({id:"YqFvUY"}),resumeNextChargeMessage:p.ag._({id:"VDqPUf"}),resumeNextChargeMessageWithoutAmount:p.ag._({id:"RrvVAn"}),resumeAccountDataInfo:p.ag._({id:"dJCJXA"}),subscriptionPauseNotice:p.ag._({id:"fpxliT"}),failedPaymentNotice:p.ag._({id:"Vxg5vO"}),chargedMultipleTimeNotice:p.ag._({id:"lAlv46"}),failedPaymentCardPunch:p.ag._({id:"KEZrHg",values:{GAMMA_PROPER_NOUN:j.N6,productName:n}}),resumeHey:p.ag._({id:"hdOctW"}),invoicePaidTitle:p.ag._({id:"aJGfDL"}),logout:p.ag._({id:"W+3RJN"}),note:p.ag._({id:"ycCSuD"}),discount:p.ag._({id:"HmpVeZ"}),discountNoticeHeadline:p.ag._({id:"5P1dmt"}),discountNoticePrepend:p.ag._({id:"yjadEY"}),discountOverride:p.ag._({id:"JfBDWL"}),discountValidUntil:p.ag._({id:"uXxNua"}),updateBilling:p.ag._({id:"tQilrI"}),extendTrialCTA:p.ag._({id:"m3l7VI"}),extendTrialPunch:p.ag._({id:"s5pINo"}),extendTrialOfferTitle:p.ag._({id:"SyzXYh"}),trialExtended:p.ag._({id:"fezME2"}),trialExtendedMessage:p.ag._({id:"QE4mUs"}),applyingTrialExtension:p.ag._({id:"vI2q9R"}),switchPlanCTA:p.ag._({id:"P2mx2L"}),changePlanHighlights:p.ag._({id:"qbgW+C"}),changePlanOfferPunch:p.ag._({id:"MRkiFP"}),planChanged:p.ag._({id:"ByFtyh"}),planChangedMessage:p.ag._({id:"Pf5z1G"}),applyingPlanChange:p.ag._({id:"9vKKLI"}),surveyStepTag:p.ag._({id:"cSUBI1"}),freeFormStepTag:p.ag._({id:"cSUBI1"}),finalConfirmation:p.ag._({id:"1/oP/N"}),offerDiscountTag:p.ag._({id:"LTgtxG"}),offerChangePlanTag:p.ag._({id:"ENMJv2"}),offerExtendTrialTag:p.ag._({id:"MWKntz"}),offerRedirectTag:p.ag._({id:"cvpAvL"}),offerContactTag:p.ag._({id:"cvpAvL"}),offerPauseTag:p.ag._({id:"+T6DGl"}),completeTag:p.ag._({id:"K5c1e7"}),errorTag:p.ag._({id:"EuvbIW"}),offerAccepted:p.ag._({id:"ZU0opP"})}}},C="\n!function(){  \n    if (!window.churnkey || !window.churnkey.created) {\n      window.churnkey = { created: true };\n      const a = document.createElement('script');\n      a.src = 'https://assets.churnkey.co/js/app.js?appId=".concat(s.v.CHURNKEY_APP_ID,"';\n      a.async = true;\n      const b = document.getElementsByTagName('script')[0];\n      b.parentNode.insertBefore(a, b);\n    }\n  }();\n"),f=()=>{let e=!(0,u.l6)()&&!(0,h.wg)();return(0,x.G)(e,C),null},b=e=>{let{subscription:i,workspace:n,autoLaunch:d=!0}=e,u=(0,l.ye)("churnkeyFailedPaymentWallEnabled"),x=(0,a.l)(),h=(0,c.K9)(n),p=(0,o.G)(),m=(0,t.useCallback)(async()=>
1{if(i&&h&&u)return(0,r.d6)("churnkey").then(e=>{var n,t;if(!e||!i.billingSubscriptionId||!(null===(n=i.createdByUser)||void 0===n?void 0:n.billingCustomerId)){console.error("[Churnkey] launchFailedPayment Missing hmac or subscription data",{hmac:e,subscription:i});return}console.debug("[Churnkey] launchFailedPayment - launching churnkey with:",{hmac:e,appId:s.v.CHURNKEY_APP_ID,subscriptionId:i.billingSubscriptionId,customerId:null===(t=i.createdByUser)||void 0===t?void 0:t.billingCustomerId}),y({authHash:e,subscription:i,localeKey:x,productKey:h,launchIntercomUI:p})})},[i,h,u,x,p]);return(0,t.useEffect)(()=>{d&&m()},[m,d]),{launchFailedPaymentFlow:m,failedPaymentFlowEnabled:u}},y=async e=>{var i,n;let{authHash:t,subscription:r,localeKey:l,productKey:a,launchIntercomUI:o}=e;null===(n=window.churnkey)||void 0===n||n.check("failed-payment",{subscriptionId:r.billingSubscriptionId,customerId:null===(i=r.createdByUser)||void 0===i?void 0:i.billingCustomerId,authHash:t,customerAttributes:{language:l},i18n:{lang:l,messages:v(l,a)},appId:s.v.CHURNKEY_APP_ID,mode:s.v.CHURNKEY_MODE,provider:"stripe",softWall:!0,forceCheck:!1,gracePeriodDays:3,ignoreInvoicesWithoutAttempt:!1,handleSupportRequest(){var e;o(),d.co.track(d.AA.CHURNKEY_HANDLE_SUPPORT_CLICK,{source:"failed-payment-wall",subscriptionId:r.billingSubscriptionId,customerId:null===(e=r.createdByUser)||void 0===e?void 0:e.billingCustomerId})},async handleCancel(e){var i,n;return d.co.track(d.AA.CANCEL_SUBSCRIPTION_CLICK,{source:"failed-payment-wall",subscriptionId:r.billingSubscriptionId,customerId:null===(i=r.createdByUser)||void 0===i?void 0:i.billingCustomerId}),console.debug("[launchChurnkeyFailedPayment.handleCancel]",{subscriptionId:r.billingSubscriptionId,customerId:null===(n=r.createdByUser)||void 0===n?void 0:n.billingCustomerId,customer:e}),_({authHash:t,subscription:r,localeKey:l,productKey:a,launchIntercomUI:o,customerAttributes:{viaFailedPayment:!0}}).catch(e=>y({authHash:t,subscription:r,localeKey:l,productKey:a,launchIntercomUI:o}))},onFailedPaymentWallActivated(){var e;d.co.track(d.AA.CHURNKEY_FAILED_PAYMENT_WALL_SHOWN,{subscriptionId:r.billingSubscriptionId,customerId:null===(e=r.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onUpdatePaymentInformation(){var e;d.co.track(d.AA.CHURNKEY_PAYMENT_METHOD_UPDATED,{source:"failed-payment-wall",subscriptionId:r.billingSubscriptionId,customerId:null===(e=r.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onFailedPaymentWallClose(){var e;d.co.track(d.AA.CHURNKEY_FAILED_PAYMENT_WALL_CLOSED,{subscriptionId:r.billingSubscriptionId,customerId:null===(e=r.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onCancel(){var e;d.co.track(d.AA.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE,{source:"failed-payment-wall",subscriptionId:r.billingSubscriptionId,customerId:null===(e=r.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onError(e,i){console.warn('Churnkey check("failed-payment", ...) error',e,i)}})},A=(e,i)=>{let n=(0,l.ye)("churnkeyCancelFlowEnabled"),s=(0,a.l)(),d=(0,c.K9)(i),u=(0,o.G)(),x=(0,t.useCallback)(()=>{if(e&&d&&n)return(0,r.d6)("churnkey").then(i=>{var n;if(!i||!e.billingSubscriptionId||!(null===(n=e.createdByUser)||void 0===n?void 0:n.billingCustomerId)){console.debug("[Churnkey] handleCancel - Missing hmac or subscription data",{hmac:i,subscription:e});return}return _({authHash:i,subscription:e,localeKey:s,productKey:d,launchIntercomUI:u})})},[n,s,d,e,u]);return{launchCancelFlow:x,cancelFlowEnabled:n}},_=async e=>{let{authHash:i,subscription:n,localeKey:t,productKey:r,customerAttributes:l={},launchIntercomUI:a}=e;return new Promise((e,o)=>{var u,x,h;null===(h=window.churnkey)||void 0===h||h.init("show",{subscriptionId:n.billingSubscriptionId,customerId:null===(u=n.createdByUser)||void 0===u?void 0:u.billingCustomerId,authHash:i,customerAttributes:{language:t,frequency:null===(x=(0,c.OJ)(n))||void 0===x?void 0:x.frequencyUnit,productKey:r,...l},i18n:{lang:t,messages:v(t,r)},appId:s.v.CHURNKEY_APP_ID,mode:s.v.CHURNKEY_MODE,provider:"stripe",record:!0,handleSupportRequest(){var e;a(),d.co.track(d.AA.CHURNKEY_HANDLE_SUPPORT_CLICK,{source:"cancel-flow",subscriptionId:n.billingSubscriptionId,customerId:null===(e=n.createdByUser)||void 0===e?void 0:e.b
1illingCustomerId})},onCancel(e,i,t){var s;d.co.track(d.AA.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE,{source:"cancel-flow",subscriptionId:n.billingSubscriptionId,customerId:null===(s=n.createdByUser)||void 0===s?void 0:s.billingCustomerId,surveyResponse:i,freeformFeedback:t}),console.debug("[launchChurnkeyCancelFlow.onCancel]",{surveyResponse:i,freeformFeedback:t})},onGoToAccount(i){console.debug("[launchChurnkeyCancelFlow.onGoToAccount]",{sessionResults:i}),e({sessionResults:i})},onClose(i){if(console.debug("[launchChurnkeyCancelFlow.onClose]",{sessionResults:i}),!i||i.aborted){o("Churnkey cancel flow aborted");return}e({sessionResults:i})},onError(e){console.warn("[launchChurnkeyCancelFlow.onError]",{message:e}),o({message:e})}})})}},34208:function(e,i,n){"use strict";n.d(i,{G:function(){return a}});var t=n(5632),s=n.n(t),r=n(2784),l=n(42111);let a=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",n=(0,l.ye)(e),{hasInitialized:t}=(0,l.yZ)(),a=t?!n:null;return(0,r.useEffect)(()=>{!0===a&&s().replace(i)},[a,i]),a}},48832:function(e,i,n){"use strict";n.d(i,{BK:function(){return y},Dw:function(){return b},Km:function(){return f},dN:function(){return v},p6:function(){return C}});var t=n(87254),s=n(82282),r=n(32361),l=n(96740),a=n(31807),o=n(73871),c=n(57907),d=n(21346),u=n(48053),x=n(1363),h=n(49738),p=n(90535),m=n(9283),g=n(75528);let j={en:c.Z,"pt-br":d.Z,ja:u.Z,"zh-cn":x.Z,"zh-tw":h.Z,es:p.Z,fr:m.Z,ko:g.Z},v=()=>j[t.ag.locale]||void 0,C=(e,i)=>e?(0,s.Z)((0,a.Z)(e),i,{locale:v()}):"",f=(e,i)=>e?(0,l.Z)((0,a.Z)(e),i?(0,a.Z)(i):new Date,{locale:v()}):"",b=e=>e?(0,r.Z)((0,a.Z)(e),{locale:v()}):"",y=e=>e?(0,o.Z)((0,a.Z)(e),new Date,{locale:v(),addSuffix:!0,roundingMethod:"floor"}):""},23312:function(e,i,n){"use strict";n.d(i,{C:function(){return m}});var t=n(52322),s=n(92850),r=n(26468),l=n(22226),a=n(54326),o=n(2338),c=n(97217),d=n(77533),u=n(50250),x=n(43297),h=n(62614),p=n(5879);let m=e=>{let{invitationCount:i,isOpen:n,onClose:m,onSendInvitationsClick:g,onDiscardClick:j}=e;return n?(0,t.jsxs)(s.u_,{returnFocusOnClose:!1,onClose:m,closeOnOverlayClick:!0,isOpen:!0,isCentered:!0,children:[(0,t.jsx)(r.Z,{}),(0,t.jsxs)(l.h,{children:[(0,t.jsx)(a.x,{children:(0,t.jsx)(p.cC,{id:"tW/kB6",values:{invitationCount:i}})}),(0,t.jsx)(o.o,{}),(0,t.jsx)(c.f,{children:(0,t.jsx)(d.x,{children:(0,t.jsx)(p.cC,{id:"qxNK2k",values:{invitationCount:i}})})}),(0,t.jsx)(u.m,{children:(0,t.jsxs)(x.K,{spacing:2,direction:"row",align:"center",children:[(0,t.jsx)(h.z,{onClick:j,children:(0,t.jsx)(p.cC,{id:"bzSI52"})}),(0,t.jsx)(h.z,{variant:"solid",onClick:g,children:(0,t.jsx)(p.cC,{id:"6dWGPZ",values:{invitationCount:i}})})]})})]})]}):null}},25944:function(e,i,n){"use strict";n.d(i,{bf:function(){return m},iZ:function(){return h},lh:function(){return x},wK:function(){return p}});var t=n(2784),s=n(42111),r=n(91994),l=n(47968),a=n(90604),o=n(56400),c=n(99268);let d=e=>Math.random()<=1/e;class u{setupProvider(){this.t1SetupProvider||(this.t1SetupProvider=performance.now())}downloadDoc(){this.t2DownloadDoc||(this.t2DownloadDoc=performance.now())}onCreate(){this.t3OnCreate||(this.t3OnCreate=performance.now())}report(){return null===this.t1SetupProvider||null===this.t2DownloadDoc||null===this.t3OnCreate?null:{downloadDoc:this.t2DownloadDoc-this.t1SetupProvider,onCreate:this.t3OnCreate-this.t2DownloadDoc}}constructor(){this.t1SetupProvider=null,this.t2DownloadDoc=null,this.t3OnCreate=null}}let x=(e,i)=>{let n=(0,r.CG)(l.Pw),s=(0,t.useRef)(n);(0,t.useEffect)(()=>{s.current=n},[n]),(0,t.useEffect)(()=>{if(e)return window.addEventListener("keydown",n,!0),()=>{window.removeEventListener("keydown",n,!0)};function n(e){let n=e.target.closest(".ProseMirror");if(!n||!s.current||!d(i))return;let t=performance.now();requestAnimationFrame(()=>{let i=e.key;" "===i&&(i="Space");let n=performance.now()-t;(0,c.EF)({...(0,o.H)(),key:i,duration:n})})}},[e,s,i])},h=()=>{let e=(0,s.ye)("rumSampleRate");(0,t.useEffect)(()=>{(0,c._k)(e)},[e])},p=e=>{let i=(0,t.useCallback)(i=>{let{isFullscreen:n=!1}=i;if(!e)return;let t=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=performance.now()-t;(0,c.gG)({...(0,o.H)(),toMode:a.q.SLIDE_VIEW,duration:e,isFullscreen:n})})})},[e]),n=(0,t.useCallback)(i=>{let{isFullscreen:n=!1}=i;if(!e)return;let t=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=performance.now()-t;(0,c.gG)({...(0,o.H)(),toMode:a.q.DOC_VIEW,duration:e,isFullscreen:n})})})},[e]);return{recordExitSlideModePerformance:n,recordEnterSlideModePerformance:i}},m=()=>{let[e]=(0,t.useState)(()=>new u),i=(0,t.useCallback)(()=>{e.setupProvider()},[e]),n=(0,t.useCallback)(()=>{e.downloadDoc()},[e]),s=(0,t.useCallback)(()=>{e.onCreate();let i=e.report();if(null===i){console.warn("[HoneycombDocLoadTimer] failed to generate doc timings");return}(0,c.Py)({...(0,o.H)(),duration:i.onCreate}),(0,c.aZ)({...(0,o.H)(),duration:i.downloadDoc})},[e]);return{timeOnCreate:s,timeOnSetupProvider:i,timeOnDownloadDoc:n}}},89311:function(e,i,n){"use strict";n.d(i,{l:function(){return a}});var t=n(5632),s=n(2784),r=n(7e4),l=n(88640);let a=()=>{let{pathname:e,isReady:i}=(0,t.useRouter)(),n=(0,s.useRef)(!1),[a,o]=(0,r.X)(l.H.lastHomeUrl,"/");(0,s.useEffect)(()=>
1{if(n.current||!i)return;let t="/inspiration"===e||"/templates"===e?e:"/";o(t),n.current=!0},[o,i,e])}},84405:function(e,i,n){"use strict";n.d(i,{J:function(){return l},Q:function(){return r}});var t=n(11050),s=n(25566);let r=e=>{let{doc_id:i,source:n,source_doc_id:r,channel:l,extra:a}=e;null===t.co||void 0===t.co||t.co.track(s.AA.DOC_CREATED,{doc_id:i,source_doc_id:r,source:n,channel:l,extra:a})},l=e=>{let{docId:i,type:n,source:r}=e;if(!i){console.debug("[trackDocShareLinkCopiedEvent]: doc_id is required");return}null===t.co||void 0===t.co||t.co.track(s.AA.DOC_SHARELINK_COPIED,{doc_id:i,source:r,type:n})}},60536:function(e,i,n){"use strict";n.d(i,{V:function(){return j}});var t=n(52322),s=n(50019),r=n(38035),l=n(74008),a=n(29117),o=n(77533),c=n(82554),d=n(36474),u=n(41098),x=n(5879),h=n(23405),p=n(94199),m=n(67964),g=n(81640);let j=e=>{let{onClose:i,onOpen:n,segmentEvent:j,doc:v,label:C}=e,f=(0,h.y)("upsellUXEnabled_Pro"),b=(0,m.dU)(null==v?void 0:v.organization),{openUpsellModal:y}=(0,g.z)(),A=(0,s.ff)("gray.200","gray.700");return!1===b&&f?(0,t.jsxs)(r.k,{direction:"column",w:"100%",children:[(0,t.jsx)(l.i,{borderColor:A}),(0,t.jsxs)(a.U,{mt:4,mb:2,children:[(0,t.jsxs)(a.U,{children:[(0,t.jsx)(o.x,{children:C||(0,t.jsx)(x.cC,{id:"kuLK2H",values:{GAMMA_PROPER_NOUN:p.N6}})}),(0,t.jsx)(c.C,{colorScheme:"trueblue",variant:"solid",children:p.k3})]}),(0,t.jsx)(d.L,{}),(0,t.jsx)(u.r,{onClickCapture:e=>{e.preventDefault(),y({onOpenCallback:i,onCloseCallback:n,segmentEvent:j})},isChecked:!0})]})]}):null}},4758:function(e,i,n){"use strict";n.d(i,{L:function(){return m}});var t=n(52322),s=n(38035),r=n(16556),l=n(29117),a=n(109),o=n(77533),c=n(28535),d=n(42946),u=n(49929),x=n(94523),h=n(5879),p=n(7985);n(30579);let m=e=>{let{selectedCollaborator:i,idx:n,handleRemoveClick:m}=e,g=i&&(0,p.G)((null==i?void 0:i.email)||""),j=0===n?170:300;return(0,t.jsx)(s.k,{width:0===n?"calc(100% - 100px)":"",className:"searchbartag","data-testid":"searchbartag-collaborator-".concat(i.email),children:(0,t.jsxs)(r.Vp,{size:"md",minW:110,...g?{}:{colorScheme:"red",bg:"red",color:"white"},children:["id"in i?(0,t.jsx)(x.kH,{label:i.email,"aria-label":i.email,children:(0,t.jsxs)(l.U,{children:[(0,t.jsx)(a.q,{size:"2xs",m:0,name:i.displayName,src:i.profileImageUrl}),(0,t.jsx)(o.x,{textTransform:"capitalize",wordBreak:"break-word",noOfLines:1,maxW:j,lineHeight:"1.5",children:i.displayName})]})}):(0,t.jsx)(x.kH,{label:g?i.email:(0,t.jsx)(h.cC,{id:"XILg0L"}),"aria-label":i.email,children:(0,t.jsxs)(l.U,{flex:1,children:[(0,t.jsx)(c.Cd,{bg:g?"trueblue.100":"none",size:6,children:(0,t.jsx)(u.G,{icon:g?d.FU$:d.WV2})}),(0,t.jsx)(o.x,{wordBreak:"break-all",display:"block",height:"100%",width:"100%",noOfLines:1,maxW:j,lineHeight:"1.5",children:i.email})]})}),(0,t.jsx)(r.SD,{onClick:m})]})},"id"in i?i.id:i.email)}},8347:function(e,i,n){"use strict";n.d(i,{XG:function(){return t},Nj:function(){return eS},t9:function(){return eE},o$:function(){return eM},aA:function(){return im},WQ:function(){return ig}});var t,s=n(52322),r=n(92850),l=n(26468),a=n(22226),o=n(54326),c=n(28535),d=n(2338),u=n(74008),x=n(97217),h=n(43297),p=n(67109),m=n(89099),g=n(62614),j=n(82554),v=n(36474),C=n(50250),f=n(38035),b=n(42946),y=n(49929),A=n(94523),_=n(5879),w=n(2784),k=n(93202),I=n(11550),S=n(67964),E=n(30579),N=n(16710),P=n(46759),T=n(15041),R=n(29318),O=n(36651),M=n(55274),D=n(70065),z=n(77533),L=n(87651),U=(n(81672),n(74409)),G=n(47443),F=n(52929),W=n(109),H=(n(82655),n(87254)),B=n(1842),K=n.n(B),V=n(94199),q=n(20336),Y=n(93441),X=n(89458),Z=n(88640),J=n(29117),Q=n(11082),$=n(8174),ee=n(78462);let ei=e=>{let{icon:i,showDisabled:n=!1}=e;return(0,s.jsx)(c.Cd,{color:"gray.800",textAlign:"center",bg:"gray.200",size:8,opacity:n?.5:1,children:n?(0,s.jsxs)("span",{className:"fa-stack",children:[(0,s.jsx)(y.G,{icon:b.u6k,className:"fa-stack-1x"}),(0,s.jsx)(y.G,{icon:i,className:"fa-stack-1x"})]}):(0,s.jsx)(y.G,{size:"1x",icon:i})})},en=e=>{let{channel:i,doc:n,isDisabled:t,showDisabledIcon:r=!1}=e,{removeDocChannel:l}=(0,$.Z)(),a=(0,w.useCallback)(()=>{n&&l(n,i.id)},[i.id,n,l]),o=(0,ee.j)({slug:i.slug,id:i.id});return(0,s.jsxs)(J.U,{py:2,w:"100%",justify:"space-between","data-testid":"workspace-row-".concat(i.id),children:[(0,s.jsx)(c.xu,{children:(0,s.jsxs)(f.k,{alignItems:"center",children:[(0,s.jsx)(ei,{icon:E.Ty,showDisabled:r}),(0,s.jsx)(c.xu,{ml:3,opacity:r?.5:1,children:(0,s.jsx)(Q.r,{href:o,target:"_blank",children:i.name})})]})}),(0,s.jsx)(g.z,{size:"sm",variant:"ghost",colorScheme:"red",onClick:a,isDisabled:t,children:(0,s.jsx)(_.cC,{id:"t/YqKh"})})]},i.id)};var et=n(46949),es=n(50019),er=n(75768),el=n(74105),ea=n(81540),eo=n(20816),ec=n(46028),ed=n(38421),eu=n.n(ed);let ex=e=>{let{workspaceId:i,docId:n,existingChannels:t,isDisabled:r}=e,l=(0,w.useRef)(null),[a,o]=(0,w.useState)(""),[d,u]=(0,w.useState)([]),[x,p]=(0,w.useState)(!1),{addDocChannel:m}=(0,$.Z)(),{data:g,loading:j}=(0,k.Kce)({variables:{query:a,workspaceId:i},skip:!a});(0,w.useEffect)(()=>
1{if(j||!g)return;let e=g.search.filter(Boolean);u(e),p(0===e.length)},[g,j]);let v=(0,w.useMemo)(()=>a?d.filter(e=>!t.find(i=>i.id===e.id)):[],[t,a,d]),C=(0,w.useCallback)(e=>{let i=v.find(i=>i.id===e);if(!i){console.error("[ChannelSearchBar.addSelectedChannel] No matching channel found");return}m({docId:n,channel:i,existingChannels:t})},[m,n,t,v]),b=(0,es.ff)("gray.100","gray.700"),I=(0,es.ff)("light","dark"),S=(0,es.ff)("trueblue.50","whiteAlpha.100");(0,es.ff)("trueblue.100","whiteAlpha.200");let N=(0,es.ff)("gray.200","gray.600");return(0,s.jsx)(er.h,{w:"100%",mb:2,alignItems:"flex-start","data-testid":"sharepanel-channel-search-bar",children:(0,s.jsx)(c.xu,{flex:1,children:(0,s.jsxs)(el.B,{w:"100%",justifyContent:"center",zIndex:1,children:[(0,s.jsx)(f.k,{display:"none",position:"absolute",h:"100%",w:"100%",alignItems:"center",justifyContent:"center",bg:b,zIndex:"overlay",opacity:.4,children:(0,s.jsx)(ea.$,{})}),(0,s.jsxs)(ec.Qc,{rollNavigation:!0,multiple:!0,emptyState:()=>!!x&&(0,s.jsxs)(f.k,{direction:"column",justify:"center",align:"center",w:"100%",my:6,children:[(0,s.jsx)(c.xu,{w:"80%",maxW:"200px",mb:6,alignContent:"center",children:(0,s.jsx)(eu(),{src:"/images/Sal-Fishing-2x.png",width:"640",height:"361",alt:"Sal, the Gamma mascot, fishing extraterrestrially"})}),(0,s.jsx)(U.X,{size:"xs",mb:2,textAlign:"center",children:(0,s.jsx)(_.cC,{id:"NmfOr+"})}),(0,s.jsx)(z.x,{fontSize:"sm",color:"gray.400",textAlign:"center",children:(0,s.jsx)(_.cC,{id:"kXnLEt"})})]}),suggestWhenEmpty:!1,openOnFocus:!0,filter:()=>!0,onSelectOption:e=>{let{item:i}=e;C(i.value),o("")},children:[(0,s.jsxs)(eo.Z,{pointerEvents:"none",color:(0,es.ff)("gray.300","gray.600"),h:"100%",flexDirection:"column",children:[(0,s.jsx)(f.k,{flex:1}),(0,s.jsx)(f.k,{h:10,py:4,alignItems:"center",children:(0,s.jsx)(et.W,{w:10})})]}),(0,s.jsx)(ec.Vp,{ref:l,"data-testid":"autocomplete-channels-input",cursor:r?"not-allowed":void 0,disabled:r,w:"100%",pl:5,wrapStyles:{px:2},fontSize:"md",placeholder:H.ag._({id:"KmCmUJ"}),transition:"width 1s ease-in-out",value:a,borderColor:N,onChange:e=>{let{target:i}=e,{value:n}=i;o(n),n||u([])}}),(0,s.jsx)(ec.Jm,{w:"100%",mt:0,display:a.length>0?"flex":"none","data-theme":I,children:v.length>0&&v.map(e=>{let{id:i,name:n,memberCount:t,isMember:r,members:l}=e;return(0,s.jsx)(ec.Gb,{"data-testid":"autocomplete-item-channel-".concat(i),value:{id:e.id},getValue:e=>e.id,align:"center",_focus:{bg:S},children:(0,s.jsxs)(J.U,{spacing:4,p:0,flex:1,children:[(0,s.jsx)(c.xu,{color:"gray.700",children:(0,s.jsx)(y.G,{icon:E.Ty})}),(0,s.jsxs)(h.K,{spacing:0,flex:"1",children:[(0,s.jsx)(z.x,{children:n}),(0,s.jsx)(z.x,{fontSize:"sm",color:"gray.400",children:r?(0,s.jsx)(_.cC,{id:"tWPlLK",values:{0:t||0}}):(0,s.jsx)(_.cC,{id:"pkIIls",values:{0:t||0}})})]}),(0,s.jsx)(A.NL,{size:"xs",overflowTooltipLabel:H.ag._({id:"25VyZX"}),avatars:l||[],max:3,onClick:e=>{e.preventDefault(),e.stopPropagation()}})]})},i)})})]})]})})})};var eh=n(55478),ep=n(78071),em=n(7985),eg=n(38045),ej=n(99016),ev=n(23312),eC=n(80498),ef=n(62549),eb=n(10625),ey=n(67046),eA=n(99058),e_=n(44035),ew=n(39237),ek=n(27599),eI=n(25481);(t||(t={})).NoAccess="no_access";let eS={[k.y3$.Manage]:{title:()=>H.ag._({id:"DZfDCl"}),description:()=>H.ag._({id:"r59J7Q"})},[k.y3$.Edit]:{title:()=>H.ag._({id:"ePK91l"}),description:()=>H.ag._({id:"kuZsYI"})},[k.y3$.Comment]:{title:()=>H.ag._({id:"NBdIgR"}),description:()=>H.ag._({id:"IwFh5+"})},[k.y3$.View]:{title:()=>H.ag._({id:"jpctdh"}),description:()=>H.ag._({id:"yzFEXd"})},[t.NoAccess]:{title:()=>H.ag._({id:"oPoLg+"}),description:()=>H.ag._({id:"Vcif8/"})}},eE=e=>{let{isDisabled:i,options:n,disabledOptions:r=[],selected:l,variant:a="ghost",onClick:o=()=>{},onRemove:d}=e;return(0,s.jsxs)(eb.v,{closeOnSelect:!0,children:[(0,s.jsx)(ey.j,{"data-testid":"permission-menu-value-".concat(l),as:g.z,display:"flex",size:"sm",isDisabled:i,variant:a,rightIcon:(0,s.jsx)(y.G,{icon:b.ptq}),children:eS[l||t.NoAccess].title()}),(0,s.jsx)(eA.q,{textAlign:"left",zIndex:"overlay",children:(0,s.jsxs)(e_._,{defaultValue:l,value:l,title:H.ag._({id:"9cDpsw"}),type:"radio",onChange:e=>{o(e)},children:[n.map(e=>{let i=r.find(i=>i.permission===e),n=i&&i.reason;return(0,s.jsx)(ew.i,{isDisabled:!!i,value:e,alignItems:"start",pt:3,children:(0,s.jsx)(A.kH,{label:n,"aria-label":n,isDisabled:!i,placement:"top",children:(0,s.jsxs)(c.xu,{children:[(0,s.jsx)(z.x,{mt:-1,children:eS[e].title()}),(0,s.jsx)(z.x,{fontSize:"sm",color:"gray.500",mt:1,children:eS[e].description()})]})},e)},e)}),d&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ek.R,{}),(0,s.jsx)(eI.s,{color:"red.500",onClick:d,icon:(0,s.jsx)(y.G,{icon:b.XAH,fixedWidth:!0}),children:(0,s.jsx)(_.cC,{id:"t/YqKh"})})]})]})})]})};var eN=n(4758);let eP=(0,eg.E)(c.xu),eT=(e,i,n)=>{if(!n)return e;let t=[...e],s=e.findIndex(e=>"email"in e&&e.email===n),r=i.find(e=>e.email===n);return -1!==s&&t.splice(s,1),[...t,r||{email:n}]},eR=(e,i)=>{let n=(0,ef.Hs)(i.map(e=>"displayName"in e?e.displayName:e.email),3);return e===k.y3$.Manage?H.ag._({id:"4bKxWq",values:{userNames:n,GAMMA_ARTIFACT_PROPER_NOUN:V.Yc,0:i.length}}):e===k.y3$.Edit?H.ag._({id:"3rbi6Y",values:{userNames:n,GAMMA_ARTIFACT_PROPER_NOUN:V.Yc,0:i.length}}):e===k.y3$.Comment?H.ag._({id:"uGWY40",values:{userNames:n,GAMMA_ARTIFACT_PROPER_NOUN:V.Yc,0:i.length}}):e===k.y3$.View?H.ag._({id:"p5IG6F",values:{userNames:n,GAMMA_ARTIFACT_PROPER_NOUN:V.Yc,0:i.length}}):H.ag._({id:"Ai1TAT",values:{userNames:n,GAMMA_ARTIFACT_PROPER_NOUN:V.Yc,0:i.length}})},eO=e=>{let{workspaceId:i,docId:n,user:t,existingDocCollaborators:r,existingInvitations:l,registerDoneFn:a,isDisabled:o}=e,d=(0,D.p)(),[u,x]=(0,w.useState)(!1),h=(0,w.useRef)(),p=(0,w.useRef)(null),[m,j]=(0,w.useState)(""),[v,C]=(0,w.useState)([]),[I,S]=(0,w.useState)(k.y3$.Manage),[E,N]=(0,w.useState)(new eC.B),[P,T]=(0,w.useState)([]),R=P.filter(e=>"email"in e),O=r.map(e=>e.user),{isOpen:M,onOpen:L,onClose:U}=(0,eh.q)({id:"unsentInvitationsModalDisclosure"}),[G,{loading:F,error:B}]=(0,k.qVw)();(0,Y.GJ)("Error inviting collaborators.",B);let K=(0,ej.j)(k.aAR),{data:V,loading:q}=(0,k.PGi)({variables:{query:m,workspaceId:i},skip:!m});(0,w.useEffect)(()=>
1{if(q||!V)return;let e=V.search.filter(Boolean);C(e)},[V,q]);let X=(0,w.useMemo)(()=>m?v.filter(e=>"User"===e.__typename&&e.id!==t.id&&!R.concat(O).find(i=>i.email===e.email)):[],[v,O,m,R,t.id]),Z=!!m&&!X.find(e=>e.email===m),Q=I===k.y3$.Manage&&R.some(e=>!("__typename"in e&&"User"===e.__typename)),$=P.concat({email:m}).filter(e=>!("email"in e)||(0,em.G)(e.email||"")),ee=!!P.length,ei=!!$.length;(0,w.useEffect)(()=>{a(()=>()=>(ei?L():E.resolve(),E.promise))},[a,E,ei,L]);let en=(0,w.useCallback)(async e=>{x(!0),T(i=>e.reduce((e,i)=>eT(e,X,i.trim()),i));let n=(await Promise.all(e.map(e=>K({workspaceId:i,query:e}).then(i=>{var n;return null===(n=i.data)||void 0===n?void 0:n.search.find(i=>"User"===i.__typename&&i.email===e)})))).filter(Boolean);T(i=>e.reduce((e,i)=>eT(e,n,i.trim()),i)),x(!1)},[X,K,i]),ed=(0,w.useCallback)(async()=>{if(0===R.length)return;let e=eT(R,X,m.trim()).filter(e=>"email"in e&&(0,em.G)(e.email||"")),i=[...r,...e.map(e=>{if("id"in e)return{docId:n,user:e,guest:!1,permission:I,__typename:"DocCollaborator"}})].filter(e=>!!e),s=[...l,...e.map(e=>{if("id"in e)return;let i={id:"temp",docTitle:"temp-title",invitedBy:t,docId:n,email:e.email,permission:I,__typename:"DocInvitation"};return i})].filter(e=>!!e);return G({variables:{docId:n,collaborators:e.map(e=>{let i="id"in e?{userId:e.id}:{email:e.email};return{...i,permission:I}})},update:(e,i)=>{let{data:t}=i;e.writeFragment({id:"Doc:".concat(n),fragment:k.yAO,data:null==t?void 0:t.addCollaborators})},optimisticResponse:{addCollaborators:{id:n,collaborators:i,invitations:s}}}).then(()=>{let i=H.ag._({id:"Ka86rB",values:{0:e.length}}),n=eR(I,e);d({title:i,description:n,status:"success",duration:5e3,isClosable:!0,position:"top"})})},[G,n,m,I,X,R,r,l,d,t]),eu=(0,w.useCallback)(async()=>Promise.all([ed()]).then(()=>{var e;T([]),j(""),null===(e=h.current)||void 0===e||e.resetItems(!0),E.resolve(),N(new eC.B)}).catch(e=>{console.warn(e)}),[ed,E]),ex=o||F||u,eg=(0,es.ff)("gray.100","gray.700"),ef=(0,es.ff)("light","dark"),eb=(0,es.ff)("trueblue.50","whiteAlpha.100"),ey=(0,es.ff)("trueblue.100","whiteAlpha.200"),eA=(0,es.ff)("gray.200","gray.600");return(0,s.jsxs)(er.h,{w:"100%",mb:2,alignItems:"flex-start","data-testid":"sharepanel-search-bar",children:[(0,s.jsx)(c.xu,{flex:1,children:(0,s.jsxs)(el.B,{w:"100%",justifyContent:"center",zIndex:2,children:[(0,s.jsx)(f.k,{display:u?"flex":"none",position:"absolute",h:"100%",w:"100%",alignItems:"center",justifyContent:"center",bg:eg,zIndex:"overlay",opacity:.4,children:(0,s.jsx)(ea.$,{})}),(0,s.jsxs)(ec.Qc,{ref:h,values:P,maxSelections:100,maxSuggestions:20,creatable:!0,multiple:!0,freeSolo:!0,suggestWhenEmpty:!1,openOnFocus:!0,filter:(e,i)=>!R.find(e=>e.email===i),onSelectOption:e=>{let{item:i}=e,{type:n}=i.originalValue;"collaborator"===n&&T(e=>eT(e,X,i.value)),j("")},onTagRemoved:e=>{T(i=>[...i].filter(i=>"email"in i?i.email!==e:!("id"in i)||i.id!==e))},children:[(0,s.jsxs)(eo.Z,{pointerEvents:"none",color:(0,es.ff)("gray.300","gray.600"),h:"100%",flexDirection:"column",children:[(0,s.jsx)(f.k,{flex:1}),(0,s.jsx)(f.k,{h:10,py:4,alignItems:"center",children:(0,s.jsx)(et.W,{w:10})})]}),(0,s.jsx)(ec.Vp,{ref:p,"data-testid":"autocomplete-collaborators-input",cursor:ex?"not-allowed":void 0,disabled:ex,w:"100%",pl:5,wrapStyles:{px:2},fontSize:"md",placeholder:H.ag._({id:"P8H57Z"}),transition:"width 1s ease-in-out",value:m,borderColor:eA,onKeyDown:e=>{let{key:i}=e;if("Backspace"===i&&0===m.length&&P.length>0){let e=P.slice(-1).pop();if(e){var n;null===(n=h.current)||void 0===n||n.removeItem("email"in e?e.email:e.id)}}},onPaste:e=>{e.preventDefault(),e.stopPropagation();let i=e.clipboardData.getData("Text"),n=i.trim().split(/[,|;\s]+/);en(n),j(""),C([])},onChange:e=>{let{target:i}=e,{value:n}=i;j(n),n||C([])},children:P.map((e,i)=>(0,s.jsx)(eN.L,{idx:i,selectedCollaborator:e,handleRemoveClick:()=>{var i;null===(i=h.current)||void 0===i||i.removeItem(e.email)}},"id"in e?e.id:e.email))}),(0,s.jsx)(ec.Jm,{w:"100%",mt:0,display:m.length>0?"flex":"none","data-theme":ef,children:X.map(e=>{let{id:i,email:n,displayName:t,profileImageUrl:r}=e;return(0,s.jsx)(ec.Gb,{fixed:!0,"data-testid":"autocomplete-item-user-".concat(i),value:{email:n,type:"collaborator"},getValue:e=>e.email,align:"center",_focus:{bg:eb},children:(0,s.jsxs)(J.U,{children:[(0,s.jsx)(W.q,{size:"sm",name:t,src:r}),(0,s.jsxs)(c.xu,{children:[(0,s.jsx)(z.x,{textTransform:"capitalize",children:t}),(0,s.jsx)(z.x,{fontSize:"xs",color:"gray.500",children:null==n?void 0:n.toLowerCase()})]})]})},i)}).concat((0,s.jsx)(ec.Gb,{value:{email:m,type:"collaborator"},align:"center",display:Z?"flex":"none",_focus:{bg:eb},children:(0,s.jsxs)(J.U,{children:[(0,s.jsx)(c.Cd,{bg:ey,size:8,children:(0,s.jsx)(y.G,{icon:b.FU$})}),(0,s.jsx)(z.x,{size:"md",children:m})]})},m))})]}),(0,s.jsx)(ep.p,{in:ee,unmountOnExit:!0,children:(0,s.jsx)(eo.x,{w:"auto",justifyContent:"flex-end",pr:1,children:(0,s.jsx)(eE,{isDisabled:F,options:[k.y3$.Manage,k.y3$.Edit,k.y3$.Comment,k.y3$.View],variant:"ghost",selected:I,onClick:e=>S(e)})})})]})}),(0,s.jsx)(eP,{overflowX:"hidden",mr:-2,transition:"slow",animate:{maxWidth:ee?"200px":"0px"},children:(0,s.jsx)(A.kH,{label:(0,s.jsx)(_.cC,{id:"Rxin92"}),"aria-label":H.ag._({id:"Rxin92"}),isDisabled:!Q,placement:"top",children:(0,s.jsx)(c.xu,{children:(0,s.jsx)(g.z,{variant:"solid",onClick:eu,isDisabled:!ei||Q,isLoading:F,"data-testid":"add-selected-items",children:(0,s.jsx)(_.cC,{id:"m16xKo"})})})})}),(0,s.jsx)(ev.C,{invitationCount:$.length,onDiscardClick:()=>{U(),E.resolve(),N(new eC.B)},onSendInvitationsClick:()=>{U(),eu()},onClose:()=>{U(),E.reject(),N(new eC.B)},isOpen:M})]})},eM=e=>{let{title:i,subtitle:n,img:t,isDisabled:r=!1,disabledText:l,tooltipText:a,testId:o,infoIcon:d,permissionsControl:u,workspaceGuestInvite:x}=e,h="string"==typeof n?(0,s.jsx)(z.x,{fontSize:"xs",color:"gray.500",children:n}):n,p=(0,s.jsx)(A.kH,{isDisabled:!a,label:a,placement:"top",children:(0,s.jsx)(c.xu,{children:u})});return(0,s.jsxs)(J.U,{w:"100%",justify:"space-between",py:2,"data-testid":"permission-settings-row".concat(o?"-"+o:""),children:[(0,s.jsx)(c.xu,{children:(0,s.jsxs)(f.k,{alignItems:"center",children:[t,(0,s.jsxs)(c.xu,{ml:3,children:[(0,s.jsx)(z.x,{children:i}),(0,s.jsxs)(f.k,{align:"center",children:[x&&x,h&&h]})]})]})}),(0,s.jsx)(c.xu,{children:(0,s.jsx)(A.kH,{isDisabled:!a,label:(0,s.jsx)(z.x,{children:a}),placement:"top",children:r?(0,s.jsx)(z.x,{size:"sm",color:"gray.500","data-testid":"permission-controls-disabled-".concat(o),children:l}):d?(0,s.jsxs)(J.U,{children:[d,p]}):p})})]})};var eD=n(17993);let ez=e=>{let{children:i,showDivider:n=!0,isDark:t=!1,...r}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eD.g,{spacing:1,align:"stretch",py:4,...r,children:i}),n&&(0,s.jsx)(u.i,{borderColor:t?"gray.700":"gray.200"})]})};var eL=n(43679),eU=n(34071),eG=n(39429),eF=n(46164),eW=n(47154),eH=n(48394);let eB=e=>{let{email:i,name:n,workspaceName:t,workspaceId:r}=e,[l]=(0,k.f4M)(),[a,o]=(0,w.useState)(!1),c=(0,D.p)();return(0,s.jsx)(eL.J,{closeOnBlur:!0,children:e=>{let{onClose:d}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eU.x,{children:(0,s.jsx)(g.z,{leftIcon:(0,s.jsx)(y.G,{icon:b.Gg}),size:"xs",colorScheme:"gray",mr:1,px:2,h:"auto",py:1,children:(0,s.jsx)(_.cC,{id:"O1wAlQ"})})}),(0,s.jsxs)(eG.y,{bg:"white",children:[(0,s.jsx)(eF.Q,{}),(0,s.jsx)(eW.Y,{fontWeight:"bold",children:(0,s.jsx)(_.cC,{id:"XYV7FR"})}),(0,s.jsxs)(eH.b,{children:[(0,s.jsx)(z.x,{fontSize:"sm",children:(0,s.jsx)(_.cC,{id:"hJZ5XP",values:{name:n,workspaceName:t,GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:V.aq}})}),(0,s.jsx)(g.z,{isDisabled:a,w:"100%",mt:2,onClick:()=>{r&&i&&(o(!0),l({variables:{workspaceId:r,invitees:[{email:i}]}}).then(()=>{c({title:H.ag._({id:"oNCcm2"}),status:"success",duration:5e3,isClosable:!0,position:"top"})}).catch(e=>{console.error(e),c({title:H.ag._({id:"h37zlR",values:{0:e.message}}),status:"error",isClosable:!0,position:"top"})}).finally(()=>{o(!1),d()}))},children:(0,s.jsx)(_.cC,{id:"qVqqmP"})})]})]})]})}})},eK=(e,i)=>{var n,t;let s="DocCollaborator"===e.__typename?null===(n=e.user.displayName)||void 0===n?void 0:n.toUpperCase():"DocInvitation"===e.__typename?e.email.toUpperCase():"",r="DocCollaborator"===i.__typename?null===(t=i.user.displayName)||void 0===t?void 0:t.toUpperCase():"DocInvitation"===i.__typename?i.email.toUpperCase():"";return!r||s&&s<r?-1:!s||r&&s>r?1:0},eV=(e,i)=>{if(e.permission!==i.permission){if("manage"===e.permission)return -1;if("manage"===i.permission)return 1}return eK(e,i)},eq=e=>{var i,n;let{workspaceId:r,isFromOtherOrg:l,doc:a,user:o,setVerifySearchDone:d,canManage:u,isDark:x=!1}=e,h=(0,D.p)(),[p,m]=(0,X.I)(Z.H.hasDismissedDocWorkspaceNotice,!1),{isConnected:g}=(0,k.$gs)(),[j,{error:v}]=(0,k.qVw)(),[C,{error:f}]=(0,k.mrc)();(0,Y.GJ)("Error updating collaborator.",v),(0,Y.GJ)("Error removing collaborator.",f);let[w]=(0,k.rIg)(),I=u&&g,S=!l,E=(S&&(p||!a||a.orgAccess),!!(!(null==a?void 0:a.orgAccess)&&(null==a?void 0:a.channels)&&(null==a?void 0:a.channels.length)>0&&(null==a?void 0:a.channels.every(e=>K()(e.permission))))),P=(null==a?void 0:a.orgAccess)==null&&(null==a?void 0:a.publicAccess)==k.y3$.View,T=(0,N.qw)(a),R=(null==a?void 0:a.collaborators)||[],O=(null==a?void 0:a.invitations)||[],M=R.filter(e=>e.permission===k.y3$.Manage).length,U=[...R,...O].sort(eV),B=e=>()=>{let i="updated"===e?H.ag._({id:"Xpw8aE"}):H.ag._({id:"jwO7L7"});h({title:i,status:"success",duration:5e3,isClosable:!0,position:"top"})},J=a.orgAccess?a.orgAccess:t.NoAccess,Q=J!==t.NoAccess;return(0,s.jsxs)(s.Fragment,{children:[I&&(0,s.jsx)(eO,{workspaceId:r,docId:a.id,user:o,existingDocCollaborators:R,existingInvitations:O,registerDoneFn:d,isDisabled:!u}),(0,s.jsx)(q.V,{label:(0,s.jsx)(_.cC,{id:"i5bpoc"}),isConnected:g,mb:4}),(0,s.jsx)(z.x,{fontSize:"sm",color:"gray.600",pt:2,children:T}),(0,s.jsxs)(ez,{isDark:x,children:[!1,(0,s.jsx)(eM,{testId:"workspace",title:(0,s.jsx)(_.cC,{id:"wtxjAY"}),subtitle:Q?H.ag._({id:"aC87LX",values:{0:null==a?void 0:null===(i=a.organization)||void 0===i?void 0:i.name}}):"",img:(0,s.jsx)(ei,{icon:b.P88,showDisabled:!Q}),isDisabled:!I,disabledText:eS[J].title(),infoIcon:P?(0,s.jsx)(A.kH,{label:(0,s.jsx)(_.cC,{id:"paaewf",values:{GAMMA_ARTIFACT_PROPER_NOUN:V.Yc}}
1),placement:"top",children:(0,s.jsx)(c.xu,{color:"yellow.500",children:(0,s.jsx)(y.G,{icon:b.DBf})})}):void 0,permissionsControl:(0,s.jsx)(eE,{isDisabled:!I,selected:J,options:[k.y3$.Manage,k.y3$.Edit,k.y3$.Comment,k.y3$.View,t.NoAccess],onClick:e=>{let i={id:a.id,orgAccess:e===t.NoAccess?null:e};w({variables:i,optimisticResponse:{updateDoc:{...i,__typename:"Doc"}},refetchQueries:["GetDocs"]}).then(B(e===t.NoAccess?"removed":"updated"))}})}),S&&(null===(n=a.channels)||void 0===n?void 0:n.map(e=>(0,s.jsx)(en,{channel:e,doc:a,isDisabled:!g,showDisabledIcon:E},e.id))),!!a.orgAccess&&S&&!a.site&&!E&&(0,s.jsx)(c.xu,{w:"100%",mt:2,children:(0,s.jsx)(ex,{existingChannels:a.channels,workspaceId:r,docId:a.id,isDisabled:!g})}),(0,s.jsx)(L.U,{in:S&&E,children:(0,s.jsxs)(G.b,{status:"warning",children:[(0,s.jsx)(F.z,{}),(0,s.jsx)(_.cC,{id:"RZRM4l",values:{GAMMA_ARTIFACT_PROPER_NOUN:V.Yc}})]})})]}),U&&(0,s.jsx)(ez,{showDivider:!1,isDark:x,children:U.map(e=>{let i=e.permission===k.y3$.Manage&&M<2,n=!I||i,t=i?H.ag._({id:"0q0LJR"}):void 0,l=eS[e.permission].title();if("DocCollaborator"===e.__typename){var d;let i=e.user;return(0,s.jsx)(eM,{testId:i.email,title:"".concat(i.displayName," ").concat(i.id===o.id?H.ag._({id:"dDUgzP"}):""),img:(0,s.jsx)(W.q,{name:i.displayName,src:i.profileImageUrl,size:"sm"}),subtitle:n?void 0:i.email,isDisabled:n,disabledText:l,tooltipText:t,workspaceGuestInvite:!n&&e.guest?(0,s.jsx)(eB,{name:i.displayName,workspaceName:null===(d=a.organization)||void 0===d?void 0:d.name,workspaceId:r,email:e.user.email}):void 0,permissionsControl:(0,s.jsx)(eE,{isDisabled:n,selected:e.permission,options:[k.y3$.Manage,k.y3$.Edit,k.y3$.Comment,k.y3$.View],disabledOptions:e.guest?[{permission:k.y3$.Manage,reason:H.ag._({id:"Rxin92"})}]:[],onClick:e=>{let n={docId:a.id,collaborators:[{userId:i.id,permission:e}]};j({variables:n,optimisticResponse:{addCollaborators:{id:n.docId,collaborators:R.map(n=>({...n,permission:n.user.id===i.id?e:n.permission})),invitations:O,__typename:"Doc"}}}).then(B("updated")).catch(()=>{})},onRemove:()=>{let e={docId:a.id,collaborators:[{userId:i.id}]};C({variables:e,optimisticResponse:{removeCollaborators:{id:e.docId,collaborators:R.filter(e=>e.user.id!==i.id),invitations:O,__typename:"Doc"}}}).then(B("removed"))}})},i.id)}return"DocInvitation"===e.__typename?(0,s.jsx)(eM,{testId:e.email,title:e.email,subtitle:H.ag._({id:"MActeE"}),img:(0,s.jsx)(c.Cd,{bg:"trueblue.50",size:8,children:(0,s.jsx)(y.G,{icon:b.FU$,size:"sm"})}),isDisabled:n,disabledText:l,permissionsControl:(0,s.jsx)(eE,{selected:e.permission,options:[k.y3$.Manage,k.y3$.Edit,k.y3$.Comment,k.y3$.View],disabledOptions:[{permission:k.y3$.Manage,reason:H.ag._({id:"Rxin92"})}],onClick:i=>{let n={docId:a.id,collaborators:[{email:e.email,permission:i}]};j({variables:n,optimisticResponse:{addCollaborators:{id:n.docId,invitations:O.map(n=>({...n,permission:n.email===e.email?i:n.permission})),collaborators:R,__typename:"Doc"}}}).then(B("updated")).catch(()=>{console.warn("Error updating permission")})},onRemove:()=>{let i={docId:a.id,collaborators:[{email:e.email}]};C({variables:i,optimisticResponse:{removeCollaborators:{id:i.docId,invitations:O.filter(i=>i.email!==e.email),collaborators:R,__typename:"Doc"}}}).then(B("removed"))}})},e.email):null})})]})};var eY=n(11050),eX=n(26284),eZ=n(29494),eJ=n(84405);let eQ="embed-copied-toast",e$=e=>{let{embedCode:i,isDisabled:n,docId:t}=e,r=(0,D.p)(),[l,a]=(0,w.useState)(!1),{hasCopied:o,onCopy:c}=(0,eX.V)(i),d=(0,w.useRef)(null);(0,w.useEffect)(()=>{d.current&&l&&(d.current.focus(),d.current.select())},[l]);let u=(0,w.useCallback)(()=>a(!0),[]),x=(0,w.useCallback)(()=>a(!1),[]),h=(0,w.useCallback)(()=>{c(),r.isActive(eQ)||r({id:eQ,title:(0,s.jsx)(_.cC,{id:"ETv+Uw"}),status:"success",duration:5e3}),(0,eJ.J)({docId:t,source:"sharePanel",type:"embed"})},[t,c,r]);return(0,s.jsxs)(eD.g,{spacing:4,align:"stretch",children:[(0,s.jsx)(eZ.g,{ref:d,rows:5,variant:"filled",fontFamily:"mono",colorScheme:"gray",disabled:n,onClick:u,onBlur:x,isReadOnly:!0,resize:"none",pointerEvents:n?"none":void 0,children:i}),(0,s.jsx)(g.z,{alignSelf:"flex-end",onClick:h,isDisabled:n,size:"sm",...n?{opacity:"1 !important",color:"gray.400",_hover:{opacity:"1"},_active:{boxShadow:"0 none"}}:{},children:o?(0,s.jsx)(_.cC,{id:"6V3Ea3"}):(0,s.jsx)(_.cC,{id:"Sx4kHi"})})]})};var e0=n(60536);let e1=e=>{let{doc:i,onSharePanelOpen:n,onSharePanelClose:t}=e,r=(0,w.useMemo)(()=>(0,ee.lT)({docId:i.id,docTitle:i.title}),[i.id,i.title]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(z.x,{fontSize:"sm",color:"gray.600",pt:2,pb:2,children:(0,s.jsx)(_.cC,{id:"2QJhbq",values:{GAMMA_ARTIFACT_PROPER_NOUN:V.Yc}})}),(0,s.jsx)(c.xu,{pb:4,children:(0,s.jsx)(e$,{embedCode:r,docId:i.id,isDisabled:!1})}),(0,s.jsx)(e0.V,{onClose:t,onOpen:n,segmentEvent:eY.AA.GAMMA_PRO_UPSELL_SHARE_SETTINGS_REMOVE_WATERMARK,doc:i})]})};var e2=n(91994),e3=n(25566),e5=n(75652),e4=n.n(e5),e7=n(14274),e6=n(47968);let e9=(e,i)=>"".concat(e7.v.API_HOST||"","/export/docs/").concat(e,"/").concat(i),e8=async(e,i,n)=>{let t=e9(e,n);return fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","share-token":e7.v.SHARE_TOKEN||""},body:JSON.stringify({docContent:i})})},ie=function(e,i,n){let t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"pdf",r=(0,D.p)(),l=(0,w.useRef)(null),a=(0,eY.z$)(),[o,c]=(0,w.useState)(!1),d=(0,w.useCallback)(()=>{l.current=r({id:"export-toast-".concat(e.id,"-").concat(t),isClosable:!1,position:"top",duration:null,status:"loading",variant:"light",title:(0,s.jsx)(_.cC,{id:"N/fNtX",values:{format:t}})})},[null==e?void 0:e.id,r,t]),u=(0,w.useCallback)(()=>{l.current&&r.update(l.current,{status:"loading",variant:"light",title:(0,s.jsx)(_.cC,{id:"eJOEBy"}),description:(0,s.jsx)(_.cC,{id:"vMANwD"}),isClosable:!0})},[r,t]),x=(0,w.useCallback)(()=>{l.current&&r.update(l.current,{title:(0,s.jsx)(_.cC,{id:"walT1X"}),status:"error",duration:null,isClosable:!0})},[r]),h=(0,w.useCallback)(e=>{l.current&&r.update(l.current,{status:"success",title:(0,s.jsx)(_.cC,{id:"pK8dQg"}),description:(0,s.jsx)(z.x,{children:(0,s.jsx)(_.cC,{id:"MTtTC2",components:{0:(0,s.jsx)(Q.r,{textDecoration:"underline",target:"_blank",href:e||void 0,onClick:()=>l.current&&r.close(l.current)})}})}),isClosable:!0})},[r,t]),p=(0,w.useCallback)(()=>{let s=null==n?void 0:n.getJSON();c(!0),d();let r=setTimeout(u,3e4);e8(e.id,s,t).then(async n=>{var s;let r=await n.blob();if(!n.ok)throw Error("Export failed.");let l="pdf"===t?eY.AA.PDF_EXPORTED:eY.AA.PPTX_EXPORTED;null==a||a.track(l,{doc_id:e.id,source:i}),h(decodeURIComponent(n.headers.get("x-gamma-download-url")||"")||void 0);let o=window.URL.createObjectURL(r),c=document.createElement("a"),d=decodeURIComponent((null===(s=(n.headers.get("Content-Disposition")||"").split(";").find(e=>e.includes("filename=")))||void 0===s?void 0:s.replace("filename=","").trim())||"".concat(e.id,".").concat(t));c.download=d,c.href=o,c.style.display="none",document.body.appendChild(c),c.click(),c.remove()}).catch(()=>{x()}).finally(()=>{c(!1),clearTimeout(r)})},[a,null==e?void 0:e.id,n,i,t,x,d,u,h]);return{handleExport:p,exportInProgress:o}},ii=e=>{let i=(0,e2.CG)(e6.Pu),n=e.theme||i,t=(0,w.useMemo)(()=>{let e=n.fonts?[...n.fonts]:[];return e.length<2&&e.push({id:"Inter",name:"Inter",url:"https://fonts.googleapis.com/css2?family=Inter"}),e4()(e).map(e=>{var i;return(null===(i=e.url)||void 0===i?void 0:i.includes("fonts.googleapis.com"))?{name:e.name,url:"https://fonts.google.com/specimen/".concat(e.name)}
1:{name:e.name}}).filter(e=>!!e)},[n]);return t};var it=n(69747),is=n(68727);let ir=e=>{let{doc:i,editor:n,onSharePanelOpen:t,onSharePanelClose:r,isMultipage:l=!1}=e,a=(0,e2.CG)(e6.Pu),o=a.config.headingGradient,c=(0,O.py)("edit",i);return(0,s.jsxs)(eD.g,{spacing:4,align:"start",pt:2,children:[(0,s.jsx)(z.x,{fontSize:"sm",color:"gray.600",children:l?(0,s.jsx)(_.cC,{id:"QI+Cf0",values:{0:i.title},components:{0:(0,s.jsx)("strong",{})}}):(0,s.jsx)(_.cC,{id:"qwhOQ/",values:{GAMMA_ARTIFACT_PROPER_NOUN:V.Yc}})}),(0,s.jsxs)(h.K,{spacing:2,width:"100%",children:[(0,s.jsx)(io,{format:"pdf",label:"PDF",icon:b.gSj,accentColor:"red",doc:i,editor:n}),(0,s.jsx)(io,{format:"pptx",label:"PowerPoint",icon:b.WOY,accentColor:"orange",doc:i,editor:n})]}),(0,s.jsxs)(h.K,{spacing:"2",w:"100%",children:[o&&(0,s.jsx)(il,{}),(0,s.jsx)(ia,{doc:i})]}),n&&c&&(0,s.jsx)(z.x,{fontSize:"sm",color:"gray.600",children:(0,s.jsx)(_.cC,{id:"8LhjM/",components:{0:(0,s.jsx)(g.z,{variant:"link",as:"span",size:"sm",cursor:"pointer",onClick:()=>{r(),it.pw.emit(it.TI.OPEN_PAGE_SETUP,"cards")}})}})}),(0,s.jsx)(e0.V,{onClose:r,onOpen:t,segmentEvent:e3.AA.GAMMA_PRO_UPSELL_EXPORT_SETTINGS_REMOVE_WATERMARK,doc:i})]})},il=()=>{let e=(0,es.ff)("gray.100","gray.800");return(0,s.jsxs)(G.b,{status:"info",bg:e,children:[(0,s.jsx)(F.z,{color:"gray.400",boxSize:"4",mt:"1",mr:"2.5"}),(0,s.jsx)(_.cC,{id:"lgULOV",values:{GAMMA_ARTIFACT_PROPER_NOUN:V.Yc}})]})},ia=e=>{let{doc:i}=e,n=ii(i),t=(0,es.ff)("gray.200","gray.700"),r=(0,es.ff)("gray.100","gray.800"),l=(0,es.ff)("white","gray.800"),a=(0,es.ff)("trueblue.400","trueblue.200"),o=(0,es.ff)("trueblue.300","trueblue.200");return n.length?(0,s.jsxs)(G.b,{status:"info",bg:r,children:[(0,s.jsx)(F.z,{color:"gray.400",boxSize:"4",mt:"1",mr:"2.5"}),(0,s.jsxs)(h.K,{children:[(0,s.jsx)(z.x,{fontSize:"sm",children:(0,s.jsx)(_.cC,{id:"5qYpE7"})}),(0,s.jsx)(J.U,{children:n.map(e=>{let{name:i,url:n}=e;return(0,s.jsx)(c.xu,{border:"1px",borderColor:t,borderRadius:"md",bg:l,h:"auto",_hover:n?{boxShadow:"var(--chakra-shadows-md)",borderColor:o,color:a}:{},transitionProperty:"common",transitionDuration:"normal",onClick:n?()=>window.open(n,"_blank"):void 0,cursor:n?"pointer":void 0,children:(0,s.jsxs)(J.U,{p:3,paddingRight:4,spacing:4,children:[(0,s.jsx)(z.x,{fontWeight:"medium",children:i}),n&&(0,s.jsx)(y.G,{icon:b.wlW,size:"1x"})]})},"name")})})]})]}):null},io=e=>{let{format:i,doc:n,editor:t,icon:r,accentColor:l,label:a,badge:o}=e,{handleExport:c,exportInProgress:d}=ie(n,"share_panel",t,i);return(0,s.jsx)(is.j,{onClick:c,icon:r,formatLabel:a,accentColor:l,exportInProgress:d,exportInProgressNote:(0,s.jsx)(_.cC,{id:"57bp6s"}),badge:o})};var ic=n(54933),id=n(21979),iu=n(16893);let ix=e=>{let{subtitle:i,tooltipLabel:n,ariaLabel:t,icon:r}=e;return(0,s.jsxs)(J.U,{spacing:1,align:"center",children:[(0,s.jsx)(z.x,{fontSize:"xs",color:"gray.500",children:i}),(0,s.jsx)(A.kH,{label:n,placement:"top","aria-label":t,children:(0,s.jsx)(c.xu,{color:"gray.500",lineHeight:"1",children:(0,s.jsx)(y.G,{size:"xs",icon:r})})})]})},ih=()=>({view:{subtitle:H.ag._({id:"ihPQra"}),tooltip:(0,E.tN)()},comment:{subtitle:H.ag._({id:"qPZYdC"}),tooltip:H.ag._({id:"oKPro/",values:{0:(0,E.tN)()}})},edit:{subtitle:H.ag._({id:"TVFcVE"}),tooltip:H.ag._({id:"2gPY9r",values:{0:(0,E.tN)()}})}}),ip=e=>{var i;let{doc:n,isConnected:r,onSharePanelOpen:l,onSharePanelClose:a,canManage:o}=e,d=(0,D.p)(),u=(0,iu.A)(ih),x=null==n?void 0:null===(i=n.accessLinks)||void 0===i?void 0:i[0],[h,p]=(0,w.useState)(!1),[m]=(0,k.kTH)(),g=(null==x?void 0:x.permission)?null==x?void 0:x.permission:t.NoAccess,j=g===t.NoAccess,v=(null==x?void 0:x.token)==="",C=x&&x.permission!==k.y3$.View,A=e=>()=>{let i="updated"===e?H.ag._({id:"Xpw8aE"}):H.ag._({id:"jwO7L7"});d({title:i,status:"success",duration:5e3,isClosable:!0,position:"top"})},I=(0,w.useMemo)(()=>(0,ee.Gn)({docTitle:null==n?void 0:n.title,docId:null==n?void 0:n.id,token:null==x?void 0:x.token,absolute:!0}),[n,null==x?void 0:x.token]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ez,{showDivider:!1,children:o&&(0,s.jsxs)(ez,{showDivider:!1,children:[(0,s.jsx)(eM,{title:(0,s.jsx)(_.cC,{id:"qZu20V"}),subtitle:j?H.ag._({id:"vMZPZT"}):(0,s.jsx)(ix,{subtitle:u[g].subtitle,tooltipLabel:u[g].tooltip,ariaLabel:u[g].subtitle,icon:b.DBf}),img:(0,s.jsx)(ei,{icon:b.nNP,showDisabled:j}),isDisabled:!(o&&r),disabledText:eS[t.NoAccess].title(),permissionsControl:(0,s.jsx)(eE,{selected:g,options:[k.y3$.Edit,k.y3$.Comment,k.y3$.View,t.NoAccess],onClick:e=>{let i=null==x?void 0:x.id,s={id:n.id,accessLinks:e===t.NoAccess?[{permission:null}]:[{permission:e}]};m({variables:s,optimisticResponse:{updateDoc:{...s,accessLinks:[{__typename:"Acce
1ssLink",id:i||"temp-id",permission:e===t.NoAccess?null:e}],__typename:"Doc"}}}).then(A(e===t.NoAccess?"removed":"updated"))}})}),(0,s.jsxs)(L.U,{animateOpacity:!0,in:!!(null==x?void 0:x.permission),children:[(0,s.jsx)(id.I,{url:I,customLabel:H.ag._({id:"y1eoq1"}),onClick:()=>{(0,eJ.J)({docId:n.id,source:"sharePanel",type:"tokenUrl"})}}),!v&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L.U,{in:h,unmountOnExit:!0,children:(0,s.jsxs)(eD.g,{mt:3,align:"stretch",spacing:4,bg:"gray.50",p:6,borderRadius:"md",children:[(0,s.jsxs)(J.U,{spacing:4,align:"center",children:[(0,s.jsx)(c.xu,{color:"purple.600",children:(0,s.jsx)(y.G,{fixedWidth:!0,icon:ic._1N})}),(0,s.jsx)(z.x,{fontSize:"sm",children:(0,s.jsx)(_.cC,{id:"asiJbp"})})]}),(0,s.jsxs)(J.U,{spacing:4,align:"center",children:[(0,s.jsx)(c.xu,{color:"purple.600",children:(0,s.jsx)(y.G,{fixedWidth:!0,icon:ic.Mdf})}),(0,s.jsx)(z.x,{fontSize:"sm",display:"inline-block",children:(0,s.jsx)(_.cC,{id:"+g8rkW",values:{GAMMA_ARTIFACT_PROPER_NOUN:V.Yc,GAMMA_PROPER_NOUN:V.N6}})})]}),C&&(0,s.jsxs)(J.U,{spacing:4,align:"center",children:[(0,s.jsx)(c.xu,{color:"purple.600",children:(0,s.jsx)(y.G,{fixedWidth:!0,icon:ic.FKd})}),(0,s.jsx)(z.x,{fontSize:"sm",children:(0,s.jsx)(_.cC,{id:"NSCwrX",values:{GAMMA_PROPER_NOUN:V.N6,selectedAccessLinkPermission:g},components:{0:(0,s.jsx)(z.x,{as:"span",fontWeight:"bold"})}})})]})]})}),(0,s.jsx)(f.k,{justify:"center",alignItems:"center",my:3,children:(0,s.jsxs)(J.U,{spacing:1,as:"button",onClick:()=>p(!h),children:[h?(0,s.jsx)(y.G,{fixedWidth:!0,size:"xs",icon:b.onQ}):(0,s.jsx)(y.G,{fixedWidth:!0,size:"xs",icon:b.r8p}),(0,s.jsx)(z.x,{lineHeight:"normal",marginLeft:"auto",marginRight:"auto",fontSize:"xs",fontWeight:"medium",children:h?(0,s.jsx)(_.cC,{id:"BRvU04"}):(0,s.jsx)(_.cC,{id:"l0Ck42"})})]})})]})]})]})}),(0,s.jsx)(e0.V,{onClose:a,onOpen:l,segmentEvent:eY.AA.GAMMA_PRO_UPSELL_SHARE_SETTINGS_REMOVE_WATERMARK,doc:n})]})},im=e=>{let{visibility:i,isFromOtherOrg:n}=e,t=(0,es.ff)("white","var(--chakra-colors-gray-900)");return(0,s.jsxs)(s.Fragment,{children:[n&&(0,s.jsx)(y.G,{icon:b.Gg}),(0,s.jsxs)(c.xu,{as:"span",className:"fa-layers fa-fw",children:[(0,s.jsx)(y.G,{icon:i.primaryIcon}),i.secondaryIcon&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(y.G,{icon:ic.diR,color:t,transform:"down-6 right-6"}),(0,s.jsx)(y.G,{icon:i.secondaryIcon,transform:"shrink-7 right-6 down-6"})]})]})]})},ig=e=>{var i;let{doc:n,editor:t,isSharePanelOpen:D,onSharePanelClose:z,onSharePanelOpen:L,onAnalyticsPanelOpen:U,view:G,setView:F,showAnalytics:W=!0,showSharePublic:H=!0,showEmbed:B=!0,showSiteSettings:K=!0}=e,V=(0,R.Yy)(),q=(0,S._O)(),{openSiteSettings:Y}=(0,M.AA)(),X=(0,w.useRef)(!1),{user:Z,currentWorkspace:J}=(0,O.SE)(),{isConnected:Q}=(0,k.$gs)(),$=(0,O.py)("manage",n),ee=(0,O.py)("comment",n),{isOpen:ei,onClose:en}=(0,I.M)({id:"create-site-modal"}),et=n&&n.site&&n.site.routes.length>1,es=n&&(0,T.Vr)(n.site),er=(0,E.ei)({showSharePublic:H&&$&&!es,showEmbed:B&&$&&!es}),el=$&&U&&n&&!es,[ea,eo]=(0,w.useState)(()=>()=>Promise.resolve()),ec=(0,w.useCallback)(()=>{z(),en()},[z,en]),ed=n?et?n.site.name:n.title:null,eu=(0,w.useCallback)(()=>{ea().then(()=>{F("invite"),z()},()=>{console.debug("[handleSharePanelClose] CollaboratorSearchBar rejected \uD83D\uDC4E\uD83C\uDFFC")})},[F,z,ea]),ex=(0,w.useCallback)(()=>{U&&(z(),U())},[U,z]),eh=(0,w.useCallback)(()=>{Y("domains"),z()},[z,Y]);if(!Z)return null;let ep=(0,N.h_)(n,Z),em=ep?(0,N.Xp)()[ep]:null,eg=(0,N.Gi)(n,J);if(n&&null===em)return console.error("[SharePanel] Unknown VisibilityValue for doc",n),null;let ej=null==n?void 0:null===(i=n.organization)||void 0===i?void 0:i.id;!n||ej||X.current||(console.error("[SharePanelModal] Doc unexpectedly doesnt have a workspaceId",{docId:n.id,organization:n.organization}),X.current=!0);let ev=V?"gray.400":"gray.600",eC=V?"whiteAlpha.200":"trueblue.50",ef=V?"trueblue.200":"trueblue.500";return(0,s.jsxs)(A.Wk,{isDark:V,children:[(0,s.jsxs)(r.u_,{onEsc:eu,isOpen:D,onClose:z,trapFocus:!1,size:"3xl",returnFocusOnClose:!1,children:[(0,s.jsx)(l.Z,{}),(0,s.jsxs)(a.h,{color:V?"white":"gray.800",bg:V?"gray.900":"white","data-share-panel-modal-content":!0,mx:2,borderColor:V?"gray.700":"gray.200",children:[(0,s.jsxs)(o.x,{children:[em&&(0,s.jsx)(c.xu,{as:"span",mr:3,children:(0,s.jsx)(im,{visibility:em,isFromOtherOrg:eg})}),ed?(0,s.jsx)(_.cC,{id:"sit2to",values:{displayName:ed}}):(0,s.jsx)(_.cC,{id:"Z8lGw6"})]}),(0,s.jsx)(d.o,{"data-share-panel-close-button":!0,onClick:e=>{e.preventDefault(),eu()}}),(0,s.jsx)(u.i,{}),n?(0,s.jsx)(x.f,{"data-testid":"share-panel-modal-body",children:n&&ej&&(0,s.jsxs)(s.Fragment,{children:[$&&(0,s.jsxs)(h.K,{direction:"row",children:[(0,s.jsx)(m.E,{my:4,children:er.map(e=>{let{viewKey:i,icon:n,ariaLabel:t,label:r,isBeta:l}=e,a=G===i;return(0,s.jsx)(m.U,{children:(0,s.jsx)(g.z,{leftIcon:(0,s.jsx)(y.G,{icon:n,"aria-label":t}),variant:"ghost",size:"sm",fontWeight:"600",bg:a?eC:"transparent",color:a?ef:ev,onClick:()=>F(i),rightIcon:l?(0,s.jsx)(j.C,{colorScheme:"green",children:(0,s.jsx)(_.cC,{id:"YBt9YP"})}):void 0,children:r})},i)})}),K&&!(null==n?void 0:n.site)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(v.L,{}),(0,s.jsx)(g.z,{onClick:eh,variant:"plain",size:"sm",my:4,children:(0,s.jsx)(_.cC,{id:"wzvDe1"})})]})]}),(!ee||"invite"==G)&&(0,s.jsx)(eq,{workspaceId:ej,doc:n,user:Z,setVerifySearchDone:eo,canManage:$,isFromOtherOrg:eg,isMultipage:et,isDark:V}),$&&"public"===G&&(0,s.jsx)(ip,{doc:n,isConnected:Q,onSharePanelOpen:L,onSharePanelClose:z,canManage:$}),$&&"embed"===G&&(0,s.jsx)(e1,{doc:n,onSharePanelOpen:L,onSharePanelClose:z}),ee&&"export"===G&&(0,s.jsx)(ir,{doc:n,editor:t,onSharePanelOpen:L,onSharePanelClose:z,isMultipage:et})]})}):(0,s.jsx)(x.f,{pb:6,"data-testid":"share-panel-modal-body",children:(0,s.jsxs)(h.K,{children:[(0,s.jsx)(p.O,{height:"55px"}),(0,s.jsx)(p.O,{height:"55px"}),(0,s.jsx)(p.O,{height:"55px"}),(0,s.jsx)(p.O,{height:"55px"})]})}),(0,s.jsx)(u.i,{}),(0,s.jsx)(C.m,{children:(0,s.jsxs)(f.k,{justifyContent:"space-between",flex:1,children:[W&&el&&(0,s.jsx)(g.z,{isDisabled:!Q,leftIcon:(0,s.jsx)(y.G,{icon:b.Ma4}),variant:"ghost",onClick:ex,children:(0,s.jsx)(_.cC,{id:"YaUqUV"})}),(0,s.jsx)(v.L,{}),(0,s.jsx)(g.z,{onClick:e=>{e.preventDefault(),eu()},variant:"solid",children:(0,s.jsx)(_.cC,{id:"DPfwMq"})})]})})]})]}),(null==n?void 0:n.id)&&q&&$&&(0,s.jsx)(P.M,{isOpen:ei,onClose:ec,existingDoc:n})]})}},91283:function(e,i,n){"use strict";n.d(i,{XG:function(){return t.XG},t9:function(){return t.t9},zx:function(){return N},bg:function(){return P}});var t=n(8347),s=n(52322),r=n(92850),l=n(26468),a=n(22226),o=n(54326),c=n(2338),d=n(97217),u=n(77533),x=n(28535),h=n(
150250),p=n(75768),m=n(62614),g=n(55478),j=n(70065),v=n(42946),C=n(49929),f=n(5879),b=n(87254),y=n(1842),A=n.n(y),_=n(2784),w=n(93202),k=n(94199),I=n(36651),S=n(8174),E=n(16710);let N=e=>{var i;let{onClose:n,onSubmit:g,doc:j}=e,y=(0,I.py)("manage",j||void 0),{isConnected:A}=(0,w.$gs)(),[k,S]=(0,_.useState)(w.y3$.Manage);return j?(0,s.jsxs)(r.u_,{closeOnOverlayClick:!1,isOpen:!0,onClose:n,size:"lg",children:[(0,s.jsx)(l.Z,{}),(0,s.jsxs)(a.h,{"data-testid":"workspace-permissions-prompt",children:[(0,s.jsx)(o.x,{children:(0,s.jsx)(f.cC,{id:"JzTAyU",values:{0:j.title}})}),(0,s.jsx)(c.o,{}),(0,s.jsxs)(d.f,{children:[(0,s.jsx)(u.x,{mb:6,children:(0,s.jsx)(f.cC,{id:"wKPcxh"})}),(0,s.jsx)(t.o$,{testId:"workspace",title:(0,s.jsx)(f.cC,{id:"wtxjAY"}),subtitle:b.ag._({id:"aC87LX",values:{0:null==j?void 0:null===(i=j.organization)||void 0===i?void 0:i.name}}),isDisabled:!y||!A,img:(0,s.jsx)(x.Cd,{color:"gray.800",textAlign:"center",bg:"gray.200",size:"32px",children:(0,s.jsx)(C.G,{size:"1x",icon:v.P88})}),disabledText:t.Nj[k].title(),permissionsControl:(0,s.jsx)(t.t9,{selected:k,options:[w.y3$.Manage,w.y3$.Edit,w.y3$.Comment,w.y3$.View],onClick:e=>{S(e)}})})]}),(0,s.jsx)(h.m,{children:(0,s.jsxs)(p.h,{children:[(0,s.jsx)(m.z,{variant:"ghost",onClick:n,children:(0,s.jsx)(f.cC,{id:"dEgA5A"})}),(0,s.jsx)(m.z,{variant:"solid","data-testid":"workspace-permissions-submit",onClick:()=>{g(k),n()},children:(0,s.jsx)(f.cC,{id:"DPfwMq"})})]})})]})]}):(0,s.jsx)(s.Fragment,{})},P=()=>{let{onOpen:e,isOpen:i,onClose:n}=(0,g.q)({id:"workspacePermissionPromptDisclosure"}),[t]=(0,w.rIg)(),{currentWorkspace:s}=(0,I.SE)(),r=(0,j.p)(),{addDocChannel:l}=(0,S.Z)(),[a,o]=(0,_.useState)(null),[c,d]=(0,_.useState)(null),u=(0,I.we)(),x=(0,_.useCallback)((e,i)=>{let n=(e.channels||[]).find(e=>e.id===i.id),t=(0,E.Gi)(e,s),l=u.cannot("manage",e)&&A()(e.orgAccess);return t?(r({description:b.ag._({id:"doMS3L",values:{GAMMA_ARTIFACT_PROPER_NOUN:k.Yc}}),status:"warning",duration:5e3,isClosable:!0,position:"top"}),!1):l?(r({description:b.ag._({id:"81ZRAa",values:{GAMMA_ARTIFACT_PROPER_NOUN:k.Yc}}),status:"warning",duration:5e3,isClosable:!0,position:"top"}),!1):!n||(r({description:b.ag._({id:"FRsVHP",values:{GAMMA_ARTIFACT_PROPER_NOUN:k.Yc}}),status:"warning",duration:5e3,isClosable:!0,position:"top"}),!1)},[u,r,s]),h=(0,_.useCallback)(e=>{if(!a||!c)return;let{id:i}=a;t({variables:{id:i,orgAccess:e},optimisticResponse:{updateDoc:{id:i,orgAccess:e,__typename:"Doc"}}}).then(()=>{l({doc:a,channel:c,existingChannels:null==a?void 0:a.channels})}).catch(e=>{console.error("[useAddDocToChannel.updatedocOrgAccess] Error setting doc orgAccess for doc id",i),r({title:b.ag._({id:"SlfejT"}),description:b.ag._({id:"x9Wysy",values:{0:e.message}}),status:"error"})})},[l,a,c,r,t]),p=(0,_.useCallback)((i,n)=>{let t=x(i,n);t&&(i.orgAccess?l({doc:i,channel:n,existingChannels:(null==i?void 0:i.channels)||[]}):(o(i),d(n),e()))},[l,e,x]),m=(0,_.useCallback)(()=>{d(null),o(null),n()},[n]);return{isOpen:i,onClose:m,doc:a,handleAddDocToChannel:p,updateWorkspacePermissionThenAddToChannel:h}}},8174:function(e,i,n){"use strict";n.d(i,{Z:function(){return c}});var t=n(52322),s=n(70065),r=n(5879),l=n(2784),a=n(93202),o=n(94199);let c=()=>{let e=(0,s.p)(),[i]=(0,a.yx3)({refetchQueries:["GetChannelDocActivity","GetChannels"]}),n=(0,l.useCallback)(n=>{let{docId:s,doc:l,channel:c,existingChannels:d=[]}=n,u=s||(null==l?void 0:l.id);if(!u){console.error("Invalid docid");return}let x={input:{docId:u,sharing:[{op:a.Bdm.Add,path:"/channels",value:[{channelId:c.id}]}]}},h=(null==l?void 0:l.title)||o.Yc,p=[...d,{id:c.id,slug:c.slug,name:c.name,permission:a.y3$.Comment}].sort((e,i)=>e.slug.localeCompare(i.slug,"en"));i({variables:x,update:(e,i)=>{let{data:n}=i;e.writeFragment({id:"Doc:".concat(u),fragment:a.IiT,data:null==n?void 0:n.updatePublicChannels})},optimisticResponse:{updatePublicChannels:{id:x.input.docId,channels:p}}}).then(()=>{e({title:(0,t.jsx)(r.cC,{id:"7hDHpt",values:{title:h}}),description:(0,t.jsx)(r.cC,{id:"A2xcFn",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc,0:c.name}}),status:"success",duration:5e3,isClosable:!0,position:"top"})},i=>{e({title:(0,t.jsx)(r.cC,{id:"bLdU0Q",values:{title:h,0:c.name}}),description:i.message,duration:null,status:"error",isClosable:!0,position:"top"})})},[i,e]),c=(0,l.useCallback)((n,s)=>{var l;if(!s)return;let c={input:{docId:n.id,sharing:[{op:a.Bdm.Remove,path:"/channels",value:[{channelId:s}]}]}};i({variables:c,update:(e,i)=>{let{data:t}=i;e.writeFragment({id:"Doc:".concat(n.id),fragment:a.P6u,data:null==t?void 0:t.updatePublicChannels})},optimisticResponse:{updatePublicChannels:{id:c.input.docId,channels:null===(l=n.channels)||void 0===l?void 0:l.filter(e=>e.id!==s)}}}).then(()=>{e({title:(0,t.jsx)(r.cC,{id:"qsnpV6",values:{GAMMA_ARTIFACT_PROPER_NOUN:o.Yc}}),status:"success",duration:1e4,position:"top"})}).catch(i=>{e({title:(0,t.jsx)(r.cC,{id:"+yMzgs"}),description:i.message,status:"error",duration:3e3,isClosable:!0,position:"top"}),console.error("[addRemoveDocChannel] Error removing channel:",i.message)})},[i,e]);return{addDocChannel:n,removeDocChannel:c}}},16710:function(e,i,n){"use strict";n.d(i,{Gi:function(){return d},Xp:function(){return h},h_:function(){return p},nZ:function(){return j},qw:function(){return m},uG:function(){return v}});var t=n(52322),s=n(42946),r=n(5879),l=n(87254),a=n(94199),o=n(30579),c=n(78462);let d=(e,i)=>{var n;return(null==e?void 0:null===(n=e.organization)||void 0===n?void 0:n.id)!==(null==i?void 0:i.id)},u={PRIVATE:"private",LINK_VIEW:"link-view",LINK_COMMENT:"link-comment",LINK_EDIT:"link-edit",INDIVIDUAL:"individual",ORG_VIEW:"org-view",ORG_COMMENT:"org-comment",ORG_EDIT:"org-edit",ORG_MANAGE:"org-manage",CHANNEL_PRIVATE:"channel-private",PUBLIC:"public"},x=[u.ORG_VIEW,u.ORG_COMMENT,u.ORG_EDIT,u.ORG_MANAGE],h=()=>({[u.PRIVATE]:{title:()=>
1l.ag._({id:"IZiYjM",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),subtitle:()=>l.ag._({id:"nHujJB",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),primaryIcon:s.byT},[u.LINK_VIEW]:{title:()=>l.ag._({id:"Pb5t/X",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),primaryIcon:s.nNP},[u.LINK_COMMENT]:{title:()=>l.ag._({id:"FUtIA5",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),primaryIcon:s.nNP},[u.LINK_EDIT]:{title:()=>l.ag._({id:"tNOSZi",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),primaryIcon:s.nNP},[u.INDIVIDUAL]:{title:()=>l.ag._({id:"IB6oAl",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),subtitle:e=>"".concat(e," can access this ").concat(a.Yc,"."),primaryIcon:s.ILF},[u.ORG_VIEW]:{title:e=>l.ag._({id:"S+losC",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc,org:e}}),primaryIcon:s.P88,secondaryIcon:s.Mdf},[u.ORG_COMMENT]:{title:e=>l.ag._({id:"acq2w5",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc,org:e}}),primaryIcon:s.P88,secondaryIcon:s.Mzg},[u.ORG_EDIT]:{title:e=>l.ag._({id:"FFdz7p",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc,org:e}}),primaryIcon:s.P88,secondaryIcon:s.TzT},[u.ORG_MANAGE]:{title:e=>l.ag._({id:"3yNlmN",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc,org:e}}),primaryIcon:s.P88},[u.CHANNEL_PRIVATE]:{title:()=>l.ag._({id:"Tw6Jzi"}),primaryIcon:o.Ty},[u.PUBLIC]:{title:()=>l.ag._({id:"NMHF69",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),primaryIcon:s.Xj}}),p=(e,i)=>{var n;if(!e)return null;let t=(null==e?void 0:e.publicAccess)?u.PUBLIC:(null==e?void 0:e.orgAccess)==="manage"?u.ORG_MANAGE:(null==e?void 0:e.orgAccess)==="edit"?u.ORG_EDIT:(null==e?void 0:e.orgAccess)==="comment"?u.ORG_COMMENT:(null==e?void 0:e.orgAccess)==="view"?u.ORG_VIEW:(null==e?void 0:e.channels)&&e.channels.some(e=>null!==e.permission)?u.CHANNEL_PRIVATE:(null==e?void 0:e.collaborators)&&(null==e?void 0:null===(n=e.collaborators)||void 0===n?void 0:n.length)>1?u.INDIVIDUAL:(null==e?void 0:e.accessLinks)&&e.accessLinks.some(e=>"view"===e.permission&&""===e.token)?u.LINK_VIEW:(null==e?void 0:e.accessLinks)&&e.accessLinks.some(e=>"comment"===e.permission&&""===e.token)?u.LINK_COMMENT:(null==e?void 0:e.accessLinks)&&e.accessLinks.some(e=>"edit"===e.permission&&""===e.token)?u.LINK_EDIT:v(e,i)?u.PRIVATE:u.INDIVIDUAL;return t},m=e=>(null==e?void 0:e.publicAccess)?l.ag._({id:"gJUdlS",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}):(null==e?void 0:e.orgAccess)?l.ag._({id:"5Ma3Lv",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}):l.ag._({id:"QbKKqw",values:{GAMMA_ARTIFACT_PROPER_NOUN:a.Yc}}),g=(e,i,n)=>{var l,a;if(!i)return[];let h=(null==e?void 0:null===(l=e.channels)||void 0===l?void 0:l.map(e=>{let{id:i,name:n,slug:t}=e;return{id:i,label:n,href:(0,c.j)({id:i,slug:t}),icon:o.Ty}}))||[],m=p(e,i),g=d(e,n),j=g?[{id:"shared-from-external-org",label:(null==e?void 0:null===(a=e.organization)||void 0===a?void 0:a.name)?(0,t.jsx)(r.cC,{id:"lFZJ+N",values:{0:e.organization.name}}):(0,t.jsx)(r.cC,{id:"qn35Ez"}),icon:s.Gg,color:"gray.500"}]:[];if(m===u.PUBLIC)return[{id:"public",label:(0,t.jsx)(r.cC,{id:"7d1a0d"}),icon:s.Xj,color:"gray.500"},...j,...h];if(m===u.PRIVATE)return[{id:"private",label:(0,t.jsx)(r.cC,{id:"zwBp5t"}),icon:s.byT,color:"gray.500"},...j];if(m===u.INDIVIDUAL){let n=(e.collaborators||[]).filter(e=>e.user.id!==i.id).length;return[{id:"collaborators",label:(0,t.jsx)(r.cC,{id:"o2NxSP",values:{numCollaborators:n}}),icon:s.ILF,color:"gray.500"},...j]}return g?j:m&&x.includes(m)?[{id:"workspace",label:(0,t.jsx)(r.cC,{id:"0Gd0NU"}),icon:s.P88,color:"gray.500"},...j,...h]:h},j=e=>{let{doc:i,user:n,currentWorkspace:t,channelToExclude:s}=e;return g(i,n,t).filter(e=>e.id!==s)},v=(e,i)=>{var n;return e&&i&&!e.orgAccess&&!e.publicAccess&&(null===(n=e.createdBy)||void 0===n?void 0:n.id)===i.id}},46759:function(e,i,n){"use strict";n.d(i,{M:function(){return S}});var t=n(52322),s=n(70065),r=n(92850),l=n(26468),a=n(22226),o=n(54326),c=n(2338),d=n(97217),u=n(43297),x=n(35183),h=n(97166),p=n(85573),m=n(50250),g=n(75768),j=n(62614),v=n(94523),C=n(5879),f=n(87254),b=n(5632),y=n(2784),A=n(93202),_=n(83669),w=n(15041),k=n(36651),I=n(78462);let S=e=>{var i;let{isOpen:n,onClose:S,existingDoc:E}=e,N=(0,s.p)(),P=(0,y.useRef)(null),[T,R]=(0,y.useState)(!1),{currentWorkspace:O}=(0,k.SE)(),[M,D]=(0,y.useState)(""),[z]=(0,A.V$$)(),[L]=(0,A.So6)(),U=(0,_.b)(),{push:G}=(0,b.useRouter)(),F=(0,y.useCallback)(async()=>
1{if(null==E?void 0:E.id){await (0,w.iL)(E.id),R(!0);try{var e,i;let{data:n}=await L({variables:{duplicateDocInput:{sourceDocId:E.id,source:A.L17.SitesCopyToSite,title:(null==E?void 0:E.title)||f.ag._({id:"wja8aL"}),orgId:null==O?void 0:O.id,orgAccess:A.y3$.Manage,themeId:null}}}),t=null==n?void 0:null===(e=n.duplicateDoc)||void 0===e?void 0:e.id;if(!t){console.error("[CreateSiteModal] Failed to duplicate doc with id",E.id);return}let{data:s}=await z({variables:{input:{workspaceId:null==O?void 0:O.id,name:M,routes:[{docId:t,path:"/"}],themeId:null==E?void 0:null===(i=E.theme)||void 0===i?void 0:i.id}}}),r=null==s?void 0:s.createSite;if(!r){console.error("[CreateSiteModal] Failed to create site, no site returned");return}let l=(0,I.yQ)({docId:t});G(l),S()}catch(e){N({status:"error",title:(0,t.jsx)(C.cC,{id:"Pdboh4"}),description:(0,t.jsx)(C.cC,{id:"c6YG3V"})}),console.error(e)}R(!1)}},[z,null==O?void 0:O.id,L,null==E?void 0:E.id,null==E?void 0:null===(i=E.theme)||void 0===i?void 0:i.id,null==E?void 0:E.title,M,G,N]),W=(0,y.useCallback)(async()=>{R(!0);let{data:e}=await z({variables:{input:{workspaceId:null==O?void 0:O.id,name:M,routes:[]}}}),i=null==e?void 0:e.createSite;if(!i){console.error("[CreateSiteModal] Failed to create site, no site returned");return}U({siteId:null==i?void 0:i.id,routes:null==i?void 0:i.routes,title:"Home",path:"/"})},[U,z,null==O?void 0:O.id,M]),H=(0,y.useCallback)(async()=>(null==E?void 0:E.id)?F():W(),[null==E?void 0:E.id,F,W]),B=M.length>0;return(0,t.jsx)(v.Wk,{isDark:!1,children:(0,t.jsxs)(r.u_,{isOpen:n,onClose:S,initialFocusRef:P,size:"2xl",children:[(0,t.jsx)(l.Z,{}),(0,t.jsxs)(a.h,{children:[(0,t.jsx)(o.x,{children:(0,t.jsx)(C.cC,{id:"JHMOcq"})}),(0,t.jsx)(c.o,{}),(0,t.jsx)(d.f,{children:(0,t.jsx)(u.K,{spacing:4,children:(0,t.jsxs)(x.NI,{children:[(0,t.jsx)(h.l,{children:(0,t.jsx)(C.cC,{id:"Lve3H6"})}),(0,t.jsx)(p.I,{ref:P,placeholder:f.ag._({id:"tlD7N3"}),onChange:e=>{D(e.target.value)},onKeyDown:e=>{B&&"Enter"===e.key&&H()}})]})})}),(0,t.jsx)(m.m,{children:(0,t.jsxs)(g.h,{children:[(0,t.jsx)(j.z,{variant:"ghost",onClick:S,children:(0,t.jsx)(C.cC,{id:"dEgA5A"})}),(0,t.jsx)(j.z,{variant:"solid",onClick:H,isDisabled:!B,isLoading:T,children:(0,t.jsx)(C.cC,{id:"JHMOcq"})})]})})]})]})})}},83669:function(e,i,n){"use strict";n.d(i,{b:function(){return x}});var t=n(5632),s=n(2784),r=n(93202),l=n(84405),a=n(56356),o=n(41425),c=n(23147),d=n(21733),u=n(78462);let x=()=>{let{user:e,currentWorkspace:i}=(0,d.SE)(),[n]=(0,r.CsQ)(),[x]=(0,r.qbt)(),{push:h}=(0,t.useRouter)(),p=(0,s.useCallback)(async t=>{let{title:s,path:d,siteId:p,routes:m}=t;if(!d.startsWith("/")){console.error("[AddNewPageToSite] Path must start with /. Aborting.",d);return}if(!(null==i?void 0:i.id)||!p||!m)return;let g=(0,a.R$)({settings:{defaultFullBleed:"full"},docFlags:{cardLayoutsEnabled:!0}}),j=(0,c.qI)(g),{data:v}=await n({variables:{workspaceId:null==i?void 0:i.id,title:s,source:r.L17.SitesAddPage,initialContent:{ydoc:j,schemaVersion:o.bI,editors:[null==e?void 0:e.id]},orgAccess:r.y3$.Manage,mainPage:"/"===d}}),C=null==v?void 0:v.createDoc.id;if((0,l.Q)({doc_id:C,source:r.L17.SitesAddPage,channel:null}),!p||!C){console.error("[AddPageModal] Site or doc id is undefined. Cannot add route.");return}await x({variables:{input:{siteId:p,docId:C,path:d,offline:!1}},refetchQueries:["GetSite"]});let f=(0,u.yQ)({docId:C});return console.debug("[AddPageModal] Doc created. Adding route then navigating to editor",C),await h(f),C},[null==i?void 0:i.id,e,n,x,h]);return p}},53596:function(e,i,n){"use strict";n.d(i,{n:function(){return f}});var t=n(52322),s=n(28535),r=n(82554),l=n(38035),a=n(77533),o=n(73200),c=n(5879),d=n(2784),u=n(50260),x=n(5200),h=n(95316),p=n(22569),m=n(87205),g=n(15151),j=n(27333),v=n(5995),C=n(89098);let f=(0,d.memo)(e=>{var i;let{theme:n,variant:d="outline",...f}=e,{contentStyles:y}=n.config,A=(0,p.R5)(n),_=(0,u.wj)(n),w=(0,v.l)(n),k=(0,g.J)(n,!1),I=(0,C.c)(n),S=(0,p.wh)(A,_,m.Iv),E=null===(i=n.config.accentBackgrounds)||void 0===i?void 0:i[0],N=E?(0,p.wh)(E,_,m.Iv):{},P=E?{display:"grid",gridTemplateRows:"minmax(2.5em, auto) auto",gridTemplateAreas:'"accent" "body"',gridTemplateColumns:"1fr",overflow:"hidden"}:{},T=b(n);return(0,t.jsxs)(s.xu,{css:w,sx:k,w:"100%",pos:"relative",children:[T&&null===n.workspaceId&&(0,t.jsx)(r.C,{pos:"absolute",right:-1,top:-1,zIndex:1,colorScheme:"green",children:(0,t.jsx)(c.cC,{id:"isRobC"})}),(0,t.jsxs)(l.k,{borderTopRadius:"ghost"===d?"none":"md",boxShadow:"sm",_focus:{boxShadow:"outline"},p:"1em",transitionProperty:"common",transitionDuration:"normal",...S,backgroundAttachment:"initial",direction:"row",align:"center",...f,children:[(0,t.jsx)(x.P,{theme:n}),(0,t.jsxs)(s.xu,{sx:{...I.cardSx,...y},...P,borderRadius:"base",className:"".concat(h.pL," ").concat(_?"is-dark":""),color:_?"white":"gray.900",flex:1,pointerEvents:"none",children:[E&&(0,t.jsx)(s.xu,{gridArea:'"accent"',...N}),(0,t.jsxs)(s.xu,{gridArea:E?'"body"':void 0,py:E?2:4,px:4,children:[(0,t.jsx)(a.x,{className:"block-title",mt:"0 !important",mb:"".concat(E?"0":"var(--chakra-space-1)"," !important"),children:(0,t.jsx)(a.x,{as:"span",className:(0,o.cx
1)("title",j.A8),fontSize:"1.6em !important",paddingBottom:"0 !important",children:(0,t.jsx)(c.cC,{id:"MHrjPM"})})}),(0,t.jsx)(a.x,{fontSize:"0.9em !important",noOfLines:3,className:"block block-paragraph",my:"0 !important",children:(0,t.jsx)(c.cC,{id:"U41VTK",components:{0:(0,t.jsx)(a.x,{as:"a",className:"link"})}})})]})]})]})]})});f.displayName="ThemePreviewThumbnail";let b=e=>{if(!e.createdTime)return!1;let i=new Date(e.createdTime),n=new Date;return n.setDate(n.getDate()-30),i>n}},6085:function(e,i,n){"use strict";n.d(i,{m:function(){return c}});var t=n(72338),s=n(27191),r=n(37160),l=n(86581),a=n(18455),o=n(87008);let c=t.hj.create({name:"clipboardLight",addCommands:()=>({insertMarkdownAt:(e,i)=>n=>{let{state:t,tr:s}=n;try{let n=(0,l.aT)(i,t.schema);return s.replaceRange(e.from,e.to,n),!0}catch(e){return console.warn("(caught) [Clipboard] insertMarkdownAt error",e),!1}}}),addProseMirrorPlugins(){let e=this.editor;return[new s.Sy({key:new s.H$("clipboardLight"),props:{clipboardSerializer:{serializeFragment:i=>(0,o.Xb)(i,e.schema)},handlePaste:(i,n,t)=>(0,l.iO)(e,n)||(0,r.g)(i,n,t),transformPastedHTML:e=>(0,a.B)(e,!0)}})]}})},17324:function(e,i,n){"use strict";n.d(i,{a:function(){return I}});var t=n(52322),s=n(28535),r=n(43297),l=n(35183),a=n(97166),o=n(7344),c=n(59905),d=n(73481),u=n(17993),x=n(85573),h=n(62614),p=n(94523),m=n(5879),g=n(87254),j=n(2784),v=n(93202),C=n(94199),f=n(36651);let b=[{id:"consulting",label:()=>g.ag._({id:"m5xed+"})},{id:"creator",label:()=>g.ag._({id:"UE2beD"})},{id:"customer_service",label:()=>g.ag._({id:"FfYIy2"})},{id:"data",label:()=>g.ag._({id:"HKH+W+"})},{id:"design",label:()=>g.ag._({id:"f8fH8W"})},{id:"education",label:()=>g.ag._({id:"aqxYLv"})},{id:"engineering",label:()=>g.ag._({id:"SUXBxp"})},{id:"finance",label:()=>g.ag._({id:"8V6XO3"})},{id:"human_resources",label:()=>g.ag._({id:"aDLrMs"})},{id:"leadership",label:()=>g.ag._({id:"HyFz7F"})},{id:"legal",label:()=>g.ag._({id:"vifyyw"})},{id:"marketing",label:()=>g.ag._({id:"vo2a+a"})},{id:"operations",label:()=>g.ag._({id:"B1MDds"})},{id:"product",label:()=>g.ag._({id:"K47k8R"})},{id:"recruiting",label:()=>g.ag._({id:"bn0SqF"})},{id:"sales",label:()=>g.ag._({id:"mUv9U4"})},{id:"other",label:()=>g.ag._({id:"/IX/7x"})}],y={"get-started":{saveButtonText:()=>g.ag._({id:"ZDIydz"}),formControlMaxW:["100%","80%","50%"],categoryQuestion:()=>g.ag._({id:"kJizcc"})},modal:{saveButtonText:()=>g.ag._({id:"hQRttt"}),formControlMaxW:["100%","60%"],categoryQuestion:()=>g.ag._({id:"06/kLN"})},setup:{saveButtonText:()=>g.ag._({id:"xGVfLh"}),formControlMaxW:["100%"],categoryQuestion:()=>g.ag._({id:"kJizcc"})}},A=[{id:"work",label:()=>g.ag._({id:"rgBHdd"})},{id:"education",label:()=>g.ag._({id:"RKJfzm"})},{id:"personal",label:()=>g.ag._({id:"jo0oU2"})}],_=[{id:"primary",label:()=>g.ag._({id:"LldObG"})},{id:"secondary",label:()=>g.ag._({id:"AtXGMV"})},{id:"university",label:()=>g.ag._({id:"DEb9mB"})},{id:"other",label:()=>g.ag._({id:"/IX/7x"})}],w=[{id:"student",label:()=>g.ag._({id:"a0qEkS"})},{id:"teacher",label:()=>g.ag._({id:"lypRAW"})},{id:"administrator",label:()=>g.ag._({id:"Faptqt"})},{id:"other",label:()=>g.ag._({id:"/IX/7x"})}],k=[{id:"friend",label:()=>g.ag._({id:"Gw0M4G"})},{id:"internet",label:()=>g.ag._({id:"mRh0Qq"})},{id:"search",label:()=>g.ag._({id:"z4/LHW"})},{id:"tiktok",label:()=>g.ag._({id:"zyUxcw"})},{id:"instagram",label:()=>g.ag._({id:"zzlbbf"})},{id:"youtube",label:()=>g.ag._({id:"9Q6UKX"})},{id:"linkedin",label:()=>g.ag._({id:"gggTBm"})},{id:"other",label:()=>g.ag._({id:"/IX/7x"})}],I=e=>{let{onSuccess:i,onError:n,context:I="get-started"}=e,{user:S,refetch:E}=(0,f.SE)(),[N,P]=(0,j.useState)(!1),[T,R]=(0,j.useState)(void 0),[O,M]=(0,j.useState)(void 0),[D,z]=(0,j.useState)(!1),[L,U]=(0,j.useState)(void 0),[G,{loading:F,error:W}]=(0,v.kDo)(),[H,B]=(0,j.useState)(void 0),[K,V]=(0,j.useState)("student"),q="education"===L||"education"===T?H&&K:L,Y=T&&!L,X=(0,j.useCallback)(()=>{let e="education"===L||"education"===T?"".concat(L,"_").concat(K,"_").concat(H):L;G({variables:{input:{id:null==S?void 0:S.id,referrer:O,jobFunction:e}}}).then(()=>(P(!0),null==E?void 0:E())).then(()=>{i&&i()}).catch(e=>{console.error('[GetStarted.UserInfo] Error updating user info "'.concat(null==S?void 0:S.id,'"'),e.message),P(!1),n&&n()})}
1,[L,H,K,n,i,O,E,G,null==S?void 0:S.id,T]),{formControlMaxW:Z,saveButtonText:J,categoryQuestion:Q}=y[I];return(0,t.jsx)(s.xu,{w:"100%",children:(0,t.jsxs)(r.K,{pt:6,alignItems:"center",spacing:6,alignSelf:"center",mb:10,children:[(0,t.jsxs)(l.NI,{maxW:Z,as:"fieldset",isRequired:!0,children:[(0,t.jsx)(a.l,{children:Q()}),(0,t.jsx)(o.E,{onChange:e=>{R(e),"education"===e?U("education"):U(void 0)},value:T,children:(0,t.jsx)(r.K,{direction:"column",spacing:2,children:A.map(e=>{let{id:i,label:n}=e;return(0,t.jsx)(c.Y,{value:i,children:n()},i)})})})]}),T&&(0,t.jsxs)(t.Fragment,{children:["education"!==T&&(0,t.jsxs)(l.NI,{maxW:Z,isRequired:!0,children:[(0,t.jsx)(a.l,{children:(0,t.jsx)(m.cC,{id:"SYYw/x"})}),(0,t.jsx)(d.P,{placeholder:g.ag._({id:"rjLlrw"}),isRequired:!0,onChange:e=>{let i=e.target.value;"work"===T&&"education"===i&&V("teacher"),U(i)},children:b.map((e,i)=>{let{label:n,id:s}=e;return(0,t.jsx)("option",{value:s,children:n()},"".concat(s,"-").concat(i))})})]}),("education"===T||"education"===L)&&(0,t.jsxs)(l.NI,{maxW:Z,isRequired:!0,children:[(0,t.jsx)(a.l,{children:(0,t.jsx)(m.cC,{id:"B+ClFT"})}),(0,t.jsxs)(u.g,{spacing:2,children:[(0,t.jsx)(d.P,{placeholder:g.ag._({id:"rjLlrw"}),isRequired:!0,value:K,onChange:e=>{V(()=>e.target.value)},children:w.map((e,i)=>{let{label:n,id:s}=e;return(0,t.jsx)("option",{value:s,children:n()},"".concat(s,"-").concat(i))})}),(0,t.jsx)(d.P,{placeholder:g.ag._({id:"rNbKca"}),isRequired:!0,onChange:e=>{B(()=>e.target.value)},children:_.map((e,i)=>{let{label:n,id:s}=e;return(0,t.jsx)("option",{value:s,children:n()},"".concat(s,"-").concat(i))})})]}),(0,t.jsx)(l.Q6,{fontSize:"xs",children:(0,t.jsx)(m.cC,{id:"9sEdx4"})})]}),(0,t.jsxs)(l.NI,{maxW:Z,children:[(0,t.jsx)(a.l,{children:(0,t.jsx)(m.cC,{id:"bxuHg8"})}),(0,t.jsxs)(u.g,{spacing:2,children:[(0,t.jsx)(d.P,{placeholder:g.ag._({id:"rjLlrw"}),value:D?"other":O,onChange:e=>{"other"===e.target.value?(z(!0),M("")):(z(!1),M(e.target.value))},children:k.map((e,i)=>{let{label:n,id:s}=e;return(0,t.jsx)("option",{value:s,children:n()},"".concat(s,"-").concat(i))})}),D&&(0,t.jsx)(x.I,{type:"text",value:O,onChange:e=>{M(e.target.value)}})]}),(0,t.jsx)(l.Q6,{fontSize:"xs",children:O&&(null==O?void 0:O.length)>4?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.cC,{id:"RNrV8M",values:{GRANT_PROPER_NOUN:C.XI}})," ",(0,t.jsx)("span",{role:"img","aria-label":g.ag._({id:"8K1shM"}),children:"\uD83D\uDE4F"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(m.cC,{id:"Bhgibl",values:{GRANT_PROPER_NOUN:C.XI}})," ",(0,t.jsx)("span",{role:"img","aria-label":g.ag._({id:"bh5RqM"}),children:"\uD83D\uDE0A"})]})})]})]}),(0,t.jsx)(r.K,{alignItems:"center",spacing:4,pt:4,children:(0,t.jsx)(p.kH,{label:(0,t.jsx)(m.cC,{id:"5G+MQW"}),isDisabled:!Y,placement:"top",children:(0,t.jsx)(s.xu,{children:(0,t.jsx)(h.z,{variant:"solid",size:"lg",isDisabled:N||!!W||!q,isLoading:F||N,onClick:X,children:J()})})})})]})})}},7603:function(e,i,n){"use strict";n.d(i,{o:function(){return l}});var t=n(89220),s=n(2784),r=n(36651);let l=()=>{let{push:e}=(0,t.useRouter)(),{userStatus:i}=(0,r.SE)();(0,s.useEffect)(()=>{"loggedOut"===i&&e("/signin?redirect_to=".concat(encodeURIComponent(window.location.href)))},[i,e])}},52610:function(e,i,n){"use strict";n.d(i,{My:function(){return a},rK:function(){return d},r_:function(){return o},up:function(){return c}});var t=n(52322),s=n(5879),r=n(87254),l=n(93202);let a=1,o=()=>
1r.ag._({id:"cyLJM2"}),c=()=>r.ag._({id:"6h5uMS"}),d={[l.r3E.Admin]:{title:(0,t.jsx)(s.cC,{id:"U3pytU"}),description:(0,t.jsx)(s.cC,{id:"U4MLdj"})},[l.r3E.Member]:{title:(0,t.jsx)(s.cC,{id:"OvoEq7"}),description:(0,t.jsx)(s.cC,{id:"nslZjr"})}}},90475:function(e,i,n){"use strict";n.r(i),n.d(i,{default:function(){return $}});var t=n(52322),s=n(5632),r=n(2784),l=n(71537),a=n(34208),o=n(7603),c=n(28535),d=n(77533),u=n(17993),x=n(5879),h=n(29117),p=n(62614),m=n(38035),g=n(49929),j=n(54933),v=n(87254);let C={SETTINGS_OVERVIEW:"settings",SETTINGS_MEMBERS:"settings/members",SETTINGS_DEFAULTS:"settings/defaults"},f={[C.SETTINGS_OVERVIEW]:{displayName:(0,t.jsx)(x.cC,{id:"6/dCYd"}),ariaLabel:v.ag._({id:"6/dCYd"}),icon:j.Kb6,showCreateButton:!1},[C.SETTINGS_MEMBERS]:{displayName:(0,t.jsx)(x.cC,{id:"wlQNTg"}),ariaLabel:v.ag._({id:"wlQNTg"}),icon:j.iOm,showCreateButton:!1},[C.SETTINGS_DEFAULTS]:{displayName:(0,t.jsx)(x.cC,{id:"8aiTeQ"}),ariaLabel:v.ag._({id:"8aiTeQ"}),icon:j.cRF,showCreateButton:!1}},b=()=>{let e=(0,s.useRouter)(),i=e.asPath.substring(1);return(0,t.jsx)(h.U,{spacing:"2",marginBottom:"8",children:Object.entries(f).map(n=>{let[s,{displayName:r,icon:l}]=n;return(0,t.jsx)(p.z,{variant:"ghost",onClick:()=>e.push("/".concat(s),void 0,{shallow:!0}),isActive:i===s,children:(0,t.jsxs)(m.k,{alignItems:"center",gap:"2",children:[(0,t.jsx)(g.G,{icon:l}),r]})},s)})})};var y=n(74409);let A=e=>{let{children:i,...n}=e;return(0,t.jsx)(y.X,{fontFamily:"p22-mackinac-pro",fontWeight:"700",...n,children:i})},_=e=>{let{children:i}=e;return(0,t.jsx)(y.X,{fontSize:"lg",fontWeight:"600",color:"gray.800",mt:"8",mb:"4",children:(0,t.jsx)(d.x,{children:i})})},w=e=>{let{title:i,description:n,children:s}=e;return(0,t.jsxs)(h.U,{justifyContent:"space-between",w:"100%",children:[(0,t.jsxs)(m.k,{flexDir:"column",children:[(0,t.jsx)(_,{children:i}),(0,t.jsx)(d.x,{fontSize:"sm",mt:"2",mb:"6",color:"gray.600",children:n})]}),(0,t.jsx)(m.k,{children:(0,t.jsx)(d.x,{children:s})})]})},k=e=>{let{children:i}=e;return(0,t.jsx)(u.g,{display:"flex",gap:"6",mt:"4",w:"100%",alignItems:"center",children:i})},I=()=>(0,t.jsxs)(c.xu,{children:[(0,t.jsx)(A,{children:(0,t.jsx)(x.cC,{id:"o+K7xz"})}),(0,t.jsxs)(k,{children:[(0,t.jsx)(w,{title:(0,t.jsx)(x.cC,{id:"Y0Fj4S"}),description:(0,t.jsx)(x.cC,{id:"V4OZDJ"}),children:(0,t.jsx)(d.x,{children:"Placeholder"})}),(0,t.jsx)(w,{title:(0,t.jsx)(x.cC,{id:"CozWO1"}),description:(0,t.jsx)(x.cC,{id:"Z2mL5G"}),children:(0,t.jsx)(d.x,{children:"Placeholder"})})]})]}),S=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A,{children:(0,t.jsx)(x.cC,{id:"EJlVlP"})}),(0,t.jsxs)(k,{children:[(0,t.jsx)(w,{title:(0,t.jsx)(x.cC,{id:"qX22NW"}),description:(0,t.jsxs)(d.x,{children:["Your workspace is currently subscribed to the"," ",(0,t.jsx)("strong",{children:"Pro Annual"})," plan, set to renew on November 20, 2024"]}),children:(0,t.jsx)(d.x,{children:"Placeholder"})}),(0,t.jsx)(w,{title:(0,t.jsx)(x.cC,{id:"3jHA5d"}),description:(0,t.jsx)(x.cC,{id:"Hqloak"}),children:(0,t.jsx)(d.x,{children:"Placeholder"})})]})]}),E=()=>(0,t.jsxs)(u.g,{alignItems:"start",spacing:"10",children:[(0,t.jsx)(b,{}),(0,t.jsx)(I,{}),(0,t.jsx)(S,{})]});var N=n(43297);let P=()=>(0,t.jsxs)(u.g,{alignItems:"start",spacing:"10",children:[(0,t.jsx)(b,{}),(0,t.jsx)(A,{children:(0,t.jsx)(x.cC,{id:"J+c0BR"})}),(0,t.jsx)(k,{children:(0,t.jsx)(w,{title:(0,t.jsx)(x.cC,{id:"KKJitJ"}),description:(0,t.jsxs)(N.K,{children:[(0,t.jsx)(d.x,{children:(0,t.jsx)(x.cC,{id:"CJWQom"})}),(0,t.jsx)("br",{}),(0,t.jsx)(d.x,{children:(0,t.jsx)(x.cC,{id:"fJM4Z7",components:{0:(0,t.jsx)("strong",{})}})})]}),children:(0,t.jsx)(d.x,{children:"Placeholder"})})}),(0,t.jsx)(_,{children:(0,t.jsx)(x.cC,{id:"1DWkjK"})})]});var T=n(70065),R=n(10625),O=n(67046),M=n(332),D=n(99058),z=n(69024),L=n(25481),U=n(93202),G=n(50260),F=n(53596),W=n(14027),H=n(36651),B=n(74153);n(39092);let K=e=>{let{selectedThemeId:i,onSelectTheme:n}=e,[s,r]=(0,B.Ns)("themeId"),{globalThemes:l,workspaceThemes:a,allThemes:o}=q(),c=o.find(e=>e.id===s),u=i?o.find(e=>e.id===i)||c||W.g:c||W.g,x=e=>{r(e),null==n||n(e)};return(0,t.jsxs)(R.v,{matchWidth:!0,isLazy:!0,children:[(0,t.jsx)(O.j,{as:p.z,w:"100%",variant:"plain",h:"auto",py:2,rightIcon:(0,t.jsx)(d.x,{fontSize:"xs",children:(0,t.jsx)(g.G,{icon:j.ptq})}
1),boxShadow:"sm",bg:"white",border:"none",children:(0,t.jsx)(V,{theme:u||W.g,fontSize:"0.4em"})}),(0,t.jsx)(M.h,{children:(0,t.jsxs)(D.q,{maxH:"50vh",overflow:"auto",children:[a.length>0&&(0,t.jsx)(z.k,{title:v.ag._({id:"B+0JwP"}),children:a.map(e=>(0,t.jsx)(L.s,{onClick:()=>x(e.id),children:(0,t.jsx)(V,{theme:e,fontSize:"0.6em"})},e.id))}),(0,t.jsx)(z.k,{title:v.ag._({id:"VjG5AF"}),children:l.map(e=>(0,t.jsx)(L.s,{onClick:()=>x(e.id),children:(0,t.jsx)(V,{theme:e,fontSize:"0.6em"})},e.id))})]})})]})},V=e=>{let{theme:i,...n}=e;return(0,t.jsxs)(h.U,{w:"100%",spacing:4,textAlign:"start",children:[(0,t.jsx)(c.xu,{w:"16em",...n,children:(0,t.jsx)(F.n,{theme:i,borderRadius:"md"})}),(0,t.jsx)(c.xu,{flex:"1",noOfLines:2,maxW:"100%",whiteSpace:"normal",wordBreak:"break-word",children:i.name})]})},q=()=>{let{currentWorkspace:e}=(0,H.SE)(),{data:i,loading:n}=(0,U.BCl)({variables:{workspaceId:null,archived:!1},fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),{data:t,loading:s}=(0,U.BCl)({variables:{workspaceId:null==e?void 0:e.id,archived:!1},skip:!e,fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),l=(null==i?void 0:i.themes)||[],a=(null==t?void 0:t.themes)||[],o=(0,r.useMemo)(()=>[...l||[],...a||[]].sort(G.qb),[l,a]);return{globalThemes:l,workspaceThemes:a,allThemes:o,loading:n||s}};var Y=n(91283);let X=e=>{let{workspaceId:i,selected:n,fieldName:s,options:r}=e,[l]=(0,U.Mqp)(),a=(0,T.p)(),o=e=>()=>
1{let i="updated"===e?v.ag._({id:"Xpw8aE"}):v.ag._({id:"jwO7L7"});a({title:i,status:"success",duration:5e3,isClosable:!0,position:"top"})};return(0,t.jsx)(Y.t9,{selected:n,options:r,onClick:e=>{let n=e===Y.XG.NoAccess?null:e,t={id:i,[s]:n};l({variables:{input:t},optimisticResponse:{updateWorkspace:{id:t.id,[s]:n}}}).then(o("updated")).catch(()=>{console.warn("Error updating permission")})}})},Z=()=>{let{currentWorkspace:e}=(0,H.SE)(),{data:i}=(0,U.WaV)({variables:{id:null==e?void 0:e.id},skip:!(null==e?void 0:e.id)}),{workspace:n}=i||{},[s]=(0,U.Mqp)(),r=(null==n?void 0:n.workspaceMemberPermission)||Y.XG.NoAccess,l=(null==n?void 0:n.accessLinkPermission)||Y.XG.NoAccess,a=(0,T.p)(),o=e=>()=>{let i="updated"===e?v.ag._({id:"Xpw8aE"}):v.ag._({id:"jwO7L7"});a({title:i,status:"success",duration:5e3,isClosable:!0,position:"top"})};return(0,t.jsxs)(u.g,{alignItems:"start",spacing:"10",children:[(0,t.jsx)(b,{}),(0,t.jsx)(A,{children:(0,t.jsx)(x.cC,{id:"XtZ1cx"})}),(0,t.jsxs)(k,{children:[(0,t.jsx)(w,{title:(0,t.jsx)(x.cC,{id:"wtxjAY"}),description:(0,t.jsx)(x.cC,{id:"7bmyCk"}),children:(0,t.jsx)(X,{workspaceId:null==n?void 0:n.id,selected:r,fieldName:"workspaceMemberPermission",options:[U.y3$.Manage,U.y3$.Edit,U.y3$.Comment,U.y3$.View,Y.XG.NoAccess]})}),(0,t.jsx)(w,{title:(0,t.jsx)(x.cC,{id:"aOKIxo"}),description:(0,t.jsx)(x.cC,{id:"HOSok9"}),children:(0,t.jsx)(X,{workspaceId:null==n?void 0:n.id,selected:l,fieldName:"accessLinkPermission",options:[U.y3$.Edit,U.y3$.Comment,U.y3$.View,Y.XG.NoAccess]})})]}),(0,t.jsx)(A,{children:(0,t.jsx)(x.cC,{id:"fvaOtb"})}),(0,t.jsx)(k,{children:(0,t.jsx)(w,{title:(0,t.jsx)(x.cC,{id:"x5htAS"}),description:(0,t.jsx)(x.cC,{id:"zspFiO"}),children:(0,t.jsx)(K,{selectedThemeId:null==n?void 0:n.defaultThemeId,onSelectTheme:e=>{let i={id:null==n?void 0:n.id,defaultThemeId:e};s({variables:{input:i},optimisticResponse:{updateWorkspace:{id:i.id,defaultThemeId:e}}}).then(o("updated")).catch(()=>{console.warn("Error updating theme")})}})})})]})};var J=n(33360),Q=n(93441),$=(0,l.z)((0,J.w)(()=>{(0,a.G)("workspaceSettings");let e=(0,Q.gF)(),i=(0,s.useRouter)(),n=(0,r.useCallback)(()=>{let{asPath:e}=i;if(!e)return null;let[n,t,s]=e.split("/");return s||null},[i]);if((0,o.o)(),!e)return null;let l=n();switch(l){case"members":return(0,t.jsx)(P,{});case"defaults":return(0,t.jsx)(Z,{});default:return(0,t.jsx)(E,{})}}))},18412:function(e,i,n){"use strict";n.d(i,{T:function(){return s}});var t=n(76919);let s=new t.v},55274:function(e,i,n){"use strict";n.d(i,{AA:function(){return u},DN:function(){return c},mb:function(){return d}});var t=n(5632),s=n(2784),r=n(91994),l=n(47968),a=n(78462),o=n(18412);let c=(0,s.createContext)({openPageSetup:(e,i)=>{},openSiteSettings:e=>{},openSharePanel:(e,i)=>{}}),d=(e,i)=>{let{push:n}=(0,t.useRouter)(),c=(0,r.qr)();return(0,s.useMemo)(()=>({openPageSetup:async(t,s)=>{if(!i)return;let r=()=>o.T.emit("openPageSetup",s);if(t!==e){let e=(0,a.yQ)({docId:t});await n(e);let i=c.subscribe(()=>{(0,l.ke)(c.getState())===t&&(r(),i())})}else r()},openSiteSettings:e=>{o.T.emit("openSiteSettings",e)},openSharePanel:async(i,t)=>{let s=()=>o.T.emit("openSharePanel",t);if(i!==e){let e=(0,a.yQ)({docId:i});await n(e);let t=c.subscribe(()=>{(0,l.ke)(c.getState())===i&&(s(),t())})}else s()}}),[e,n,i,c])},u=()=>(0,s.useContext)(c)},37639:function(e,i,n){"use strict";n.d(i,{Ad:function(){return d},ve:function(){return c}});var t=n(52322),s=n(2784),r=n(64663);let l={activeTab:r.oc.ALL},a=(0,s.createContext)({state:l,dispatch:()=>{throw Error("dispatch function must be overridden")}}),o=(e,i)=>"SET_ACTIVE_TAB"===i.type?{...e,activeTab:i.payload}:e,c=()=>{let e=(0,s.useContext)(a);if(void 0===e)throw Error("useActiveTabContext must be used within a ActiveTabProvider");return e},d=e=>{let{children:i}=e,[n,r]=(0,s.useReducer)(o,l);return(0,t.jsx)(a.Provider,{value:{state:n,dispatch:r},children:i})}},64663:function(e,i,n){"use strict";n.d(i,{A5:function(){return u},f8:function(){return c},oc:function(){return d}});var t=n(52322),s=n(42946),r=n(5879),l=n(87254),a=n(94199),o=n(30579);let c={SHARED_WITH_ME:"shared-with-me",ALL:"all",CHANNEL:"channel",TRASH:"trash",TEMPLATES:"templates",INSPIRATION:"inspiration",THEMES:"themes",FONTS:"fonts",SITES:"sites",SETTINGS:"settings"},d={...c},u={[c.SHARED_WITH_ME]:{displayName:(0,t.jsx)(r.cC,{id:"lIbchQ"}
1),ariaLabel:l.ag._({id:"rt/fuz"}),icon:s.XCy,showCreateButton:!1},[c.ALL]:{displayName:(0,t.jsx)(r.cC,{id:"W10xDz",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:a.aq}}),ariaLabel:l.ag._({id:"W10xDz",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:a.aq}}),icon:s.s2,showCreateButton:!0},[c.SITES]:{displayName:(0,t.jsx)(r.cC,{id:"QHZRmq"}),ariaLabel:l.ag._({id:"QHZRmq"}),icon:s.g4A,showCreateButton:!0},[c.CHANNEL]:{displayName:(0,t.jsx)(r.cC,{id:"HSh8u/"}),ariaLabel:l.ag._({id:"HSh8u/"}),icon:o.Ty,showCreateButton:!0},[c.TRASH]:{displayName:(0,t.jsx)(r.cC,{id:"GQ3O42"}),ariaLabel:l.ag._({id:"GQ3O42"}),icon:s.XAH,showCreateButton:!1},[c.TEMPLATES]:{displayName:(0,t.jsx)(r.cC,{id:"iTylMl"}),ariaLabel:l.ag._({id:"iTylMl"}),icon:s.BDt,showCreateButton:!1},[c.INSPIRATION]:{displayName:(0,t.jsx)(r.cC,{id:"K2fjhl"}),ariaLabel:l.ag._({id:"K2fjhl"}),icon:s.cnt,showCreateButton:!1},[c.THEMES]:{displayName:(0,t.jsx)(r.cC,{id:"fJ3EbT"}),ariaLabel:l.ag._({id:"fJ3EbT"}),icon:s.q2v,showCreateButton:!1,description:(0,t.jsx)(r.cC,{id:"1kjnn4",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:a.aq},components:{0:(0,t.jsx)("b",{}),1:(0,t.jsx)("b",{})}})},[c.FONTS]:{displayName:(0,t.jsx)(r.cC,{id:"E3KfxC"}),ariaLabel:l.ag._({id:"E3KfxC"}),icon:s.gu6,showCreateButton:!1,description:(0,t.jsx)(r.cC,{id:"sWZ6Li",components:{0:(0,t.jsx)("b",{})}})},[c.SETTINGS]:{displayName:(0,t.jsx)(r.cC,{id:"0dbeO4"}),ariaLabel:l.ag._({id:"0dbeO4"}),icon:s.Kb6,showCreateButton:!1}}},46929:function(e,i,n){"use strict";n.d(i,{J:function(){return R}});var t=n(5632),s=n.n(t),r=n(2784),l=n(42111),a=n(67964),o=n(91994),c=n(11050),d=n(36651),u=n(37639),x=n(64663),h=n(76644),p=n(52322),m=n(70065),g=n(93202),j=n(82642),v=n(38035),C=n(77533),f=n(75768),b=n(62614),y=n(32899),A=n(5879),_=n(87254);let w=e=>{let{currentChannelId:i,channelPreview:n,workspaceId:t,joinChannel:r,toastId:l}=e,a=(0,m.p)();return l?(0,p.jsxs)(v.k,{bg:"white",p:3,px:6,m:4,justify:"center",align:"center",borderRadius:"md",shadow:"md",children:[(0,p.jsx)(C.x,{fontSize:"sm",mr:4,children:(0,p.jsx)(A.cC,{id:"HPr8I3",values:{0:n.name},components:{0:(0,p.jsx)("strong",{})}})}),(0,p.jsxs)(f.h,{size:"sm",alignItems:"center",children:[(0,p.jsx)(b.z,{maxW:"xs",display:"block",noOfLines:1,onClick:()=>{if(!i||!n){console.error("No active channel id");return}r({channel:{...n},workspaceId:t}).then(()=>{a.close(l)})},variant:"solid",children:(0,p.jsx)(A.cC,{id:"0wdd7X"})}),(0,p.jsx)(y.h,{isRound:!0,variant:"ghost",size:"xs","aria-label":_.ag._({id:"1QfxQT"}),icon:(0,p.jsx)(j.T,{}),onClick:()=>{a.close(l),s().replace("/#".concat(h.pX))}})]})]}):null};var k=n(77405);let I=e=>{let{currentChannelId:i,activeChannel:n,workspaceId:t}=e,l=(0,r.useRef)(),a=(0,m.p)(),{joinChannel:o}=(0,k.A)(),{data:c,called:d,error:u,loading:x}=(0,g.aw6)({variables:{id:i,workspaceId:t},skip:n||!i||!t}),j=i&&!n&&(null==c?void 0:c.channel)?c.channel:null;return(0,r.useEffect)(()=>{u&&console.error("[useChannelsData] Error fetching channelPreview",u),(u||d&&j&&j.archived)&&s().replace("/#".concat(h.pX))},[u,j,d,x]),(0,r.useEffect)(()=>{let e=i&&j;return!e&&l.current&&(a.close(l.current),l.current=void 0),e&&(l.current?l.current&&a.update(l.current,{duration:null,render:()=>(0,p.jsx)(w,{workspaceId:t,currentChannelId:i,channelPreview:j,joinChannel:o,toastId:l.current})}):l.current=a({duration:null,render:()=>(0,p.jsx)(w,{workspaceId:t,currentChannelId:i,channelPreview:j,joinChannel:o,toastId:l.current})})),()=>{l.current&&a.close(null==l?void 0:l.current)}},[i,j,o,a,t]),{channelPreview:j}},S=e=>{let{workspaceId:i,user:n}=e,{query:s}=(0,t.useRouter)(),l=Array.isArray(s.channelSlug)?s.channelSlug[0]:s.channelSlug,a=l?l.slice(-15):null,{data:o,loading:c,subscribeToMore:d}=(0,g.uCJ)({variables:{workspaceId:i},skip:!n||!n.workspaceMemberships||!i,returnPartialData:!0});(0,r.useEffect)(()=>{if(d&&i)return d({document:g.olB,variables:{workspaceId:i}})},[d,i]);let u=((null==o?void 0:o.channels)||[]).filter(e=>e.isMember&&!e.archived).sort((e,i)=>e.slug.localeCompare(i.slug,"en")),x=u.find(e=>e.id===a),{channelPreview:h}=I({currentChannelId:a,activeChannel:x,workspaceId:i});return{channelPreview:h,currentChannelId:a,channels:u,isChannelsLoading:c,activeChannel:x}},E=e=>
1{let{currentChannel:i,currentWorkspaceId:n}=e,{replace:s}=(0,t.useRouter)();(0,r.useEffect)(()=>{n&&i&&i.workspaceId!==n&&s("/")},[i,n,s])};var N=n(16263),P=n(78462);let T=e=>Object.values(x.oc).find(i=>i===e),R=()=>{let{user:e,currentWorkspace:i}=(0,d.SE)(),{isReady:n,route:p}=(0,t.useRouter)(),m=(0,a._O)(),g=(0,l.ye)("workspaceSettings"),j=!!(e&&0===e.workspaceMemberships.length),v=T((0,P.AE)()),{channelPreview:C,channels:f,activeChannel:b,currentChannelId:y,isChannelsLoading:A}=S({workspaceId:null==i?void 0:i.id,user:e});E({currentChannel:C||b,currentWorkspaceId:null==i?void 0:i.id});let{state:_,dispatch:w}=(0,u.ve)(),k=_.activeTab,I=(0,o.TL)(),R=(0,o.CG)(N.NV),O=(0,r.useCallback)(e=>{I((0,N.II)({isSidebarVisible:e}))},[I]);return(0,r.useEffect)(()=>{let e="/settings"===p?"settings":void 0,i=y?x.oc.CHANNEL:v||e||h.pX;i!==k&&w({type:"SET_ACTIVE_TAB",payload:i})},[k,y,w,p,v]),(0,r.useEffect)(()=>{m||"sites"!==k||s().replace("/")},[m,k]),(0,r.useEffect)(()=>{O(!1)},[]),(0,r.useEffect)(()=>{n&&(j?s().replace("/#".concat(x.oc.SHARED_WITH_ME)):setTimeout(()=>{I((0,N.II)({isSidebarVisible:!1}))},150))},[I,v,y,j,n]),(0,c.If)(e=>{e.track(c.AA.HOME_TAB_VIEWED,{tab:k})},[k]),{channelPreview:C,channels:f,activeChannel:b,currentChannelId:y,isChannelsLoading:A,activeTab:k,isWorkspaceSettingsEnabled:g,isSidebarVisible:R,setIsSidebarVisible:O,sitesEnabled:m,userHasNoWorkspaces:j,user:e,currentWorkspace:i}}},62207:function(e,i,n){"use strict";n.d(i,{k:function(){return ea},l:function(){return K}});var t=n(52322),s=n(46949),r=n(43297),l=n(38035),a=n(28535),o=n(75009),c=n(74409),d=n(77533),u=n(29117),x=n(36474),h=n(62614),p=n(92850),m=n(26468),g=n(22226),j=n(54326),v=n(2338),C=n(97217),f=n(35183),b=n(74105),y=n(20816),A=n(85573),_=n(81540),w=n(99793),k=n(67109),I=n(42822),S=n(50250),E=n(42946),N=n(49929),P=n(94523),T=n(5879),R=n(87254),O=n(2784),M=n(93202),D=n(94199),z=n(30579),L=n(29094),U=n(77405),G=n(11082),F=n(38421),W=n.n(F);let H=e=>{let{channelName:i,onCreateClick:n}=e;return(0,t.jsx)(I.M,{minH:"sm",children:(0,t.jsxs)(l.k,{direction:"column",justify:"center",align:"center",w:["100%","80%"],children:[(0,t.jsx)(a.xu,{w:"80%",maxW:"250px",mb:6,alignContent:"center",children:(0,t.jsx)(W(),{src:"/images/Sal-Fishing-2x.png",width:"640",height:"361",alt:"Sal, the Gamma mascot, fishing extraterrestrially"})}),(0,t.jsx)(c.X,{size:"md",mb:2,textAlign:"center",children:(0,t.jsx)(T.cC,{id:"NmfOr+"})}),(0,t.jsx)(d.x,{fontSize:"lg",color:"gray.400",textAlign:"center",children:(0,t.jsx)(T.cC,{id:"cZOpR0",values:{channelName:i},components:{0:(0,t.jsx)(G.r,{onClick:n,color:"trueblue.500"})}})})]})})},B=e=>{let{channels:i,workspaceId:n}=e,{leaveChannel:s,joinChannel:p}=(0,U.A)(),m=(0,O.useCallback)((e,i)=>{e?p({channel:i,workspaceId:n}):s({channel:i})},[p,s,n]);return(0,t.jsxs)(r.K,{spacing:0,children:[0===i.length&&(0,t.jsxs)(l.k,{direction:"column",justify:"center",align:"center",w:"100%",my:6,children:[(0,t.jsx)(a.xu,{w:"80%",maxW:"200px",mb:6,alignContent:"center",children:(0,t.jsx)(o.E,{src:L.Z.src,width:"725px",alt:"Sal, the Gamma mascot, painting in space"})}),(0,t.jsx)(c.X,{size:"md",mb:2,textAlign:"center",children:(0,t.jsx)(T.cC,{id:"PN1FMY"})}),(0,t.jsx)(d.x,{fontSize:"lg",color:"gray.400",textAlign:"center",children:(0,t.jsx)(T.cC,{id:"gdEwT8",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:D.aq},components:{0:(0,t.jsx)("br",{})}})})]}),i.length>0&&i.map(e=>{let{members:i,isMember:n,memberCount:s,name:l}=e;return(0,t.jsxs)(u.U,{spacing:4,px:4,py:2,_hover:{bg:"gray.100"},borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",children:[(0,t.jsx)(a.xu,{p:2,color:n?"":"gray.400",children:(0,t.jsx)(N.G,{icon:n?E.fV7:z.Ty})}),(0,t.jsxs)(u.U,{flex:1,children:[(0,t.jsxs)(r.K,{spacing:0,children:[(0,t.jsx)(d.x,{children:l}),(0,t.jsx)(d.x,{fontSize:"sm",color:"gray.400",children:e.isMember?(0,t.jsx)(T.cC,{id:"tWPlLK",values:{0:s||0}}):(0,t.jsx)(T.cC,{id:"pkIIls",values:{0:s||0}})})]}),(0,t.jsx)(x.L,{}),(0,t.jsx)(P.NL,{size:"xs",overflowTooltipLabel:R.ag._({id:"25VyZX"}),avatars:i||[],max:3})]}),(0,t.jsx)(h.z,{w:20,variant:n?"ghost":"plain",color:n?"gray.600":"plain",size:"sm",onClick:()=>{m(!n,e)},children:n?(0,t.jsx)(T.cC,{id:"Mv8CyJ"}):(0,t.jsx)(T.cC,{id:"0wdd7X"})})]},e.id)})]})},K=e=>{var i;let{isOpen:n,onClose:l,workspaceId:a}=e,[o,c]=(0,O.useState)(""),[x,E]=(0,O.useState)(!1),[N,D]=(0,O.useState)(!1),z=(0,O.useRef)(null),{createChannel:L,createChannelLoading:G,createChannelError:F}=(0,U.A)(),[W,K]=(0,O.useState)(null),[V,q]=(0,O.useState)(!1),{data:Y,loading:X,called:Z,fetchMore:J}=(0,M.Un3)({variables:{workspaceId:a,first:20,sortBy:{field:M.Bhs.MemberCount,direction:M.SrV.Desc},query:o},skip:!a,nextFetchPolicy:"cache-only"}),Q=(0,O.useCallback)(e=>{let{value:i}=e.target;K(null),i?c(i):c("")},[]),$=!!(o&&(null==Y?void 0:Y.workspaceChannels.edges.length)===0),ee=()=>{a&&L({input:{name:o,workspaceId:a}}).then(()=>{l()}).catch(e=>{K(e.message)})};(0,O.useEffect)(()=>{X||E($)},[X,$]),(0,O.useEffect)(()=>{!Z||X||N||D(!0)},[Z,X,N]);let ei=x&&$,en=(null==Y?void 0:Y.workspaceChannels.edges.map(e=>e.node))||[],et=!o,es=null==Y?void 0:null===(i=Y.workspaceChannels)||void 0===i?void 0:i.pageInfo,er=N&&(null==es?void 0:es.hasNextPage)&&(null==es?void 0:es.endCursor);return(0,t.jsxs)(p.u_,{isOpen:n,onClose:l,lockFocusAcrossFrames:!1,returnFocusOnClose
1:!1,size:"2xl",initialFocusRef:z,children:[(0,t.jsx)(m.Z,{}),(0,t.jsxs)(g.h,{children:[(0,t.jsx)(j.x,{pb:0,children:(0,t.jsx)(T.cC,{id:"Mxy55o"})}),(0,t.jsxs)(d.x,{px:6,color:"gray.500",mb:2,children:[(0,t.jsx)(T.cC,{id:"/eBcp2"}),"."]}),(0,t.jsx)(v.o,{}),(0,t.jsx)(C.f,{children:(0,t.jsxs)(r.K,{spacing:5,children:[(0,t.jsxs)(u.U,{align:"flex-start",children:[(0,t.jsxs)(f.NI,{isInvalid:!!F&&o.length>0,children:[(0,t.jsxs)(b.B,{size:"md",children:[(0,t.jsx)(y.Z,{pointerEvents:"none",color:"gray.300",children:(0,t.jsx)(s.W,{})}),(0,t.jsx)(A.I,{value:o,onChange:Q,placeholder:R.ag._({id:"iwm5Y3"}),_placeholder:{opacity:1},ref:z}),X&&(0,t.jsx)(y.x,{pointerEvents:"none",color:"gray.500",transitionProperty:"common",transitionDuration:"normal",children:(0,t.jsx)(_.$,{size:"sm"})})]}),W&&(0,t.jsx)(w.J1,{children:W})]}),(0,t.jsx)(h.z,{w:"300px",variant:"plain",onClick:ee,isDisabled:0===o.length,isLoading:G,children:(0,t.jsx)(T.cC,{id:"Oo7YVo"})})]}),(0,t.jsxs)(P.NZ,{children:[et&&(0,t.jsx)(T.cC,{id:"LOzhoI"}),o&&(0,t.jsx)(T.cC,{id:"mjEyky",values:{0:en.length}})]}),ei&&(0,t.jsx)(H,{channelName:o,onCreateClick:ee}),!N&&(0,t.jsxs)(r.K,{children:[(0,t.jsx)(k.O,{height:"55px"}),(0,t.jsx)(k.O,{height:"55px"}),(0,t.jsx)(k.O,{height:"55px"}),(0,t.jsx)(k.O,{height:"55px"}),(0,t.jsx)(k.O,{height:"55px"})]}),N&&a&&!ei&&(0,t.jsx)(B,{channels:en,workspaceId:a}),er&&(0,t.jsx)(I.M,{p:6,children:(0,t.jsx)(h.z,{isLoading:V,onClick:()=>{q(!0),J({variables:{...0===o.length?{first:50}:{},after:null==es?void 0:es.endCursor}}).finally(()=>{q(!1)})},size:"sm",children:(0,t.jsx)(T.cC,{id:"yQ2kGp"})})})]})}),(0,t.jsx)(S.m,{children:(0,t.jsx)(h.z,{variant:"solid",onClick:l,children:(0,t.jsx)(T.cC,{id:"DPfwMq"})})})]})]})};var V=n(55478),q=n(70065),Y=n(26284),X=n(10625),Z=n(67046),J=n(32899),Q=n(99058),$=n(25481),ee=n(27599),ei=n(5632),en=n.n(ei),et=n(78462),es=n(75768);let er=e=>{let{channel:i,workspaceId:n,onClose:s}=e,[r]=(0,M.HOP)(),l=(0,q.p)(),a=(0,O.useCallback)(()=>{if(!n||!(null==i?void 0:i.id)){console.error('[onDeleteChannelClick] Cannot delete channel. OrgId: "'.concat(n,'" channelId: "').concat(null==i?void 0:i.id,'"'));return}r({variables:{channelId:i.id,workspaceId:n}}).then(()=>{l({title:(0,t.jsx)(T.cC,{id:"j4JrT0"}),status:"success",duration:3e3,position:"top"})})},[i,l,r,n]);return(0,t.jsxs)(p.u_,{closeOnOverlayClick:!1,isOpen:!0,onClose:s,size:"lg",children:[(0,t.jsx)(m.Z,{}),(0,t.jsxs)(g.h,{children:[(0,t.jsxs)(j.x,{children:["Delete ",i.name,"?"]}),(0,t.jsx)(v.o,{}),(0,t.jsxs)(C.f,{children:[(0,t.jsx)(d.x,{mb:2,children:(0,t.jsx)(T.cC,{id:"IkJ0gO"})}),(0,t.jsx)(d.x,{mb:2,children:(0,t.jsx)(T.cC,{id:"r5GL8F",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:D.aq}})}),(0,t.jsx)(d.x,{color:"red.500",children:(0,t.jsx)(T.cC,{id:"2xOCJW"})})]}),(0,t.jsx)(S.m,{children:(0,t.jsxs)(es.h,{children:[(0,t.jsx)(h.z,{variant:"ghost",onClick:s,children:(0,t.jsx)(T.cC,{id:"dEgA5A"})}),(0,t.jsx)(h.z,{variant:"ghost",colorScheme:"red",onClick:()=>{a(),s()},children:(0,t.jsx)(T.cC,{id:"NbFtQm"})})]})})]})]})},el=e=>{let{channel:i,workspaceId:n,onClose:s}=e,r=(0,q.p)(),[a,o]=(0,O.useState)(()=>null==i?void 0:i.name),[c,{loading:d}]=(0,M.tWW)(),[u,x]=(0,O.useState)(null),b=(0,O.useCallback)(e=>{o(e.target.value)},[]),y=(0,O.useRef)(null),_=!!u,k=(0,O.useCallback)(()=>{if(!n||!(null==i?void 0:i.id)){console.error('[onRenameChannel] Cannot rename channel. OrgId: "'.concat(n,'" channelId: "').concat(null==i?void 0:i.id,'"'));return}c({variables:{input:{id:null==i?void 0:i.id,workspaceId:n,name:a}}}).then(e=>{var n;let{data:l}=e;en().replace((0,et.j)({id:null==i?void 0:i.id,slug:null==l?void 0:l.updateChannel.slug})),r({title:(0,t.jsx)(T.cC,{id:"QJd4OZ",values:{0:null==l?void 0:null===(n=l.updateChannel)||void 0===n?void 0:n.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}),s()}).catch(e=>{x(e.message)})},[n,null==i?void 0:i.id,c,a,r,s]);return(0,t.jsxs)(p.u_,{closeOnOverlayClick:!1,isOpen:!0,initialFocusRef:y,onClose:s,children:[(0,t.jsx)(m.Z,{}),(0,t.jsxs)(g.h,{children:[(0,t.jsx)(j.x,{children:(0,t.jsx)(T.cC,{id:"NZgZhv"})}),(0,t.jsx)(v.o,{}),(0,t.jsx)(C.f,{children:(0,t.jsx)(l.k,{mt:4,w:"100%",direction:"column",children:(0,t.jsxs)(f.NI,{isInvalid:_,children:[(0,t.jsx)(A.I,{value:a,ref:y,onChange:b,onKeyDown:e=>{"Enter"===e.key&&k()}}),_&&(0,t.jsx)(w.J1,{children:u})]})})}),(0,t.jsx)(S.m,{children:(0,t.jsxs)(es.h,{children:[(0,t.jsx)(h.z,{variant:"ghost",onClick:s,children:(0,t.jsx)(T.cC,{id:"dEgA5A"})}),(0,t.jsx)(h.z,{isLoading:d,variant:"solid",onClick:k,children:(0,t.jsx)(T.cC,{id:"2wxgft"})})]})})]})]})},ea=e=>{let{channel:i,workspaceId:n}=e,{isOpen:s,onOpen:r,onClose:l}=(0,V.q)({id:"deleteChannelModalDisclosure"}),{isOpen:a,onOpen:o,onClose:c}=(0,V.q)({id:"renameChannelModalDisclosure"}),{push:d}=(0,ei.useRouter)(),{leaveChannel:u}=(0,U.A)(),x=(0,q.p)(),{onCopy:h}=(0,Y.V)((0,et.j)({id:null==i?void 0:i.id,slug:null==i?void 0:i.slug},!1));return(0,t.jsxs)(X.v,{closeOnSelect:!1,isLazy:!0,children:[(0,t.jsx)(Z.j,{as:J.h,variant:"ghost",fontWeight:"600",color:"gray.700",icon:(0,t.jsx)(N.G,{icon:E.S6C})}),(0,t.jsxs)(Q.q,{zIndex:"popover",children:[(0,t.jsx)($.s,{icon:(0,t.jsx)(N.G,{fixedWidth:!0,icon:E.aJJ}),onClick:o,children:(0,t.jsx)(T.cC,{id:"NZgZhv"})}),(0,t.jsx)(ee.R,{}),(0,t.jsx)($.s,{onClick:()=>{h(),x({title:(0,t.jsx)(T.cC,{id:"h5GS+N"}),status:"success",duration:3e3,position:"top"})},icon:(0,t.jsx)(N.G,{fixedWidth:!0,icon:E.DrL}),children:(0,t.jsx)(T.cC,{id:"alYpud"})}),(0,t.jsx)($.s,{icon:(0,t.jsx)(N.G,{fixedWidth:!0,icon:E.WQc}),onClick:()=>{u({channel:i}).then(()=>{d("/")})},children:(0,t.jsx)(T.cC,{id:"jC8TAY"})}),(0,t.jsx)(ee.R,{}),(0,t.jsx)($.s,{color:"red.500",onClick:r,icon:(0,t.jsx)(N.G,{fixedWidth:!0,icon:E.XAH}),children:(0,t.jsx)(T.cC,{id:"NbFtQm"})})]}),a&&(0,t.jsx)(el,{channel:i,workspaceId:n,onClose:c}),s&&(0,t.jsx)(er,{channel:i,workspaceId:n,onClose:l})]})}},76644:function(e,i,n){"use strict";n.d(i,{Kk:function(){return o},LS:function(){return d},en:function(){return a},j7:function(){return u},pX:function(){return c}});var t=n(52322),s=n(5879),r=n(93202),l=n(64663);let a=[{key:r.IX5.EditedTime,label:(0,t.jsx)(s.cC,{id:"acZeX2"})},{key:r.IX5.CreatedTime,label:(0,t.jsx)(s.cC,{id:"u46WEi"})}],o=[{key:r.IX5.LastViewed,label:(0,t.jsx)(s.cC,{id:"UOgIR2"})},{key:r.IX5.LastEdited,label:(0,t.jsx)(s.cC,{id:"acZeX2"})},{key:r.IX5.Favorited,label:(0,t.jsx)(s.cC,{id:"2TANrw"})}],c=l.oc.ALL,d=r.IX5.EditedTime,u=[r.IX5.LastViewed,r.IX5.LastEdited,r.IX5.Favorited]},77405:function(e,i,n){"use strict";n.d(i,{A:function(){return u}});var t=n(52322),s=n(70065),r=n(5879),l=n(5632),a=n.n(l),o=n(2784),c=n(93202),d=n(78462);let u=()=>{let e=(0,s.p)(),[i]=(0,c.ozD)(),[n]=(0,c.Oau)(),[l,{loading:u,error:x}]=(0,c.dbz)(),h=(0,o.useCallback)(n=>{let{channel:s}=n;return i({variables:{channelId:s.id}}).then(()=>{e({title:(0,t.jsx)(r.cC,{id:"GCUxja",values:{0:null==s?void 0:s.name}}),description:(0,t.jsx)(r.cC,{id:"SQY08b",values:{0:null==s?void 0:s.name}}),status:"success",duration:3e3,isClosable:!0,position:"top"})})},[i,e]),p=(0,o.useCallback)(i=>{let{channel:s,workspaceId:l}=i,{name:a}=s;return n({variables:{channelId:s.id},update:(e,i)=>{let{data:n}=i;(null==n?void 0:n.joinChannel)&&e.writeQuery({query:c.kTw,variables:{workspaceId:l},data:{channels:[n.joinChannel]}})},optimisticResponse:{joinChannel:{...s}}}).then(()=>{e({title:(0,t.jsx)(r.cC,{id:"WpOdvg",values:{name:a}}),description:(0,t.jsx)(r.cC,{id:"/IOSvX",values:{name:a}}),status:"success",duration:3e3,isClosable:!0,position:"top"})}).catch(i=>{e({title:(0,t.jsx)(r.cC,{id:"bLRa0l",values:{name:a}}),description:i.message,status:"error",duration:3e3,isClosable:!0,position:"top"})})},[n,e]),m=(0,o.useCallback)(i=>
1{let{input:n}=i;return l({variables:{input:n},update:(e,i)=>{let{data:t}=i;(null==t?void 0:t.createChannel)&&e.writeQuery({query:c.kTw,variables:{workspaceId:n.workspaceId},data:{channels:[t.createChannel]}})},optimisticResponse:{createChannel:{id:"temp-id",slug:"temp-slug",...n,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString(),__typename:"Channel"}}}).then(i=>{var n;let s=null==i?void 0:null===(n=i.data)||void 0===n?void 0:n.createChannel;(null==s?void 0:s.name)&&e({title:(0,t.jsx)(r.cC,{id:"EbT81q",values:{0:s.name}}),status:"success",duration:3e3,isClosable:!0,position:"top"}),(null==s?void 0:s.id)&&(null==s?void 0:s.slug)?a().push((0,d.j)({id:s.id,slug:s.slug})):console.error('[CreateChannelModal] Error generating channel URL. ID: "'.concat(null==s?void 0:s.id,'". Slug: "').concat(null==s?void 0:s.slug,'"'))}).catch(i=>{e({title:(0,t.jsx)(r.cC,{id:"YeikaQ"}),description:i.message,status:"error",duration:3e3,isClosable:!0,position:"top"})})},[l,e]);return{joinChannel:p,leaveChannel:h,createChannel:m,createChannelLoading:u,createChannelError:x}}},33360:function(e,i,n){"use strict";n.d(i,{w:function(){return nE}});var t=n(52322),s=n(38035),r=n(28165),l=n(60510),a=n(37639),o=n(17190),c=n(97729),d=n.n(c),u=n(2784),x=n(28846),h=n(52797),p=n(16690),m=n(94199),g=n(31341),j=n(92850),v=n(26468),C=n(22226),f=n(54326),b=n(2338),y=n(28535),A=n(29117),_=n(17993),w=n(77533),k=n(74008),I=n(97217),S=n(20437),E=n(50250),N=n(42946),P=n(49929),T=n(5879),R=n(5632),O=n.n(R),M=n(39122),D=n(93202),z=n(49165),L=n(42111),U=n(34881),G=n(11050),F=n(36651),W=n(96933),H=n(90221),B=n(89458),K=n(88640),V=n(30523),q=n(11082),Y=n(43297),X=n(82554),Z=n(39097),J=n.n(Z);let Q=e=>{let{title:i,body:n,accentColor:r,href:l,icon:a,isNew:o,onClick:c}=e;return(0,t.jsx)(J(),{href:l,passHref:!0,legacyBehavior:!0,children:(0,t.jsx)(V.P,{as:q.r,position:"relative",padding:"6",border:"2px solid",borderColor:"gray.100",borderRadius:"8",cursor:"pointer",boxSizing:"border-box",background:"white",shadow:"sm",transitionProperty:"common",transitionDuration:"normal",_hover:{borderColor:"".concat(r,".400"),boxShadow:"xl",textDecoration:"none"},role:"group",onClick:c,children:(0,t.jsxs)(Y.K,{children:[(0,t.jsx)(s.k,{height:"40",mb:"2",justify:"center",alignItems:"center",borderRadius:"md",top:0,left:0,bottom:0,right:0,background:"".concat(r,".100"),fontSize:"3rem",color:"".concat(r,".300"),transitionProperty:"all",transitionDuration:"normal",_groupHover:{color:"".concat(r,".400"),fontSize:"3.125rem"},children:(0,t.jsx)(y.xu,{children:(0,t.jsx)(P.G,{icon:a,className:"fa-xl"})})}),(0,t.jsxs)(w.x,{mt:2,fontSize:"xl",fontWeight:"bold",lineHeight:"short",children:[i,o&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)(X.C,{fontSize:"0.75em",colorScheme:"green",children:(0,t.jsx)(T.cC,{id:"YBt9YP"})})]})]}),(0,t.jsx)(w.x,{fontSize:"sm",children:n})]})})})};var $=n(54933);let ee={createFromAI:{title:(0,t.jsx)(T.cC,{id:"ks31i0"}),body:(0,t.jsx)(T.cC,{id:"y3x+dr"}),colorScheme:"pink",icon:$.ddb,action:"createFromAI",isNew:!0},createDeck:{title:(0,t.jsx)(T.cC,{id:"17dkjV"}),body:(0,t.jsx)(T.cC,{id:"EHsEUm"}),colorScheme:"purple",icon:$.RLl,action:"blankDeck",isNew:!1},viewTemplates:{title:(0,t.jsx)(T.cC,{id:"M4C2N9"}),body:(0,t.jsx)(T.cC,{id:"hO9+rY"}),colorScheme:"salmon",icon:$.BDt,action:"templates",isNew:!1},tipsAndTricks:{title:(0,t.jsx)(T.cC,{id:"ZOGX27"}),body:(0,t.jsx)(T.cC,{id:"mgn8Bj"}),colorScheme:"teal",icon:$.s2,action:"welcomeDoc",isNew:!1},inspiration:{title:(0,t.jsx)(T.cC,{id:"IR0bRg"}),body:(0,t.jsx)(T.cC,{id:"QbmT2X"}),colorScheme:"orchid",icon:$.cnt,action:"inspiration",isNew:!1}},ei="getStarted",en=()=>{let{push:e,query:i,pathname:n}=(0,R.useRouter)(),[s]=(0,z.c)(),r=!!i[ei],l=(0,u.useCallback)(i=>{let{searchParams:t}=new URL(window.location.href);t.delete(ei),i?i.startsWith("/#")?O().replace(i):((0,U.lO)({query:Object.fromEntries(t.entries())}),e(i)):O().replace({pathname:n,query:t.toString()},void 0,{shallow:!0})},[n,e]),a=(0,u.useCallback)(()=>{let{searchParams:e}=new URL(window.location.href);e.delete(ei),(0,U.lO)({query:Object.fromEntries(e.entries())}),s({source:"get_started_modal"})},[s]);return r?(0,t.jsx)(er,{onClose:l,onCreateDoc:a}):null},et=e=>{let{isMobile:i,aiWizardEnabled:n,openAiStatus:t}=e,s="DOWN"==t;return i?[...n&&!s?[ee.createFromAI]:[],ee.tipsAndTricks,ee.inspiration]:[...n&&!s?[ee.createFromAI]:[],ee.createDeck,ee.viewTemplates,ee.tipsAndTricks].slice(0,3)},es={createFromAI:"create_from_ai",welcomeDoc:"welcome_doc",templates:"templates",inspiration:"inspiration",blankDeck:"create_doc"},er=e=>{var i,n;let{onClose:s,onCreateDoc:r}=e,l=(0,L.ye)("createGenerateV2"),a=(0,G.z$)(),[o]=(0,B.I)(K.H.welcomeDocId,null),c=(0,L.ye)("aiWizard"),d=(0,L.ye)("openAiStatus"),x=(0,W.i)(["full","full","3xl","4xl"]),{user:h,currentWorkspace:p,setSettings:m}=(0,F.SE)(),g=null==h?void 0:h.id,R=et({isMobile:(0,H.s2)(),aiWizardEnabled:c,openAiStatus:d}),O=l?"/create/generate?ref=dashboard":M.ET;(0,u.useEffect)(()=>{null==m||m({remove:["showGetStarted"]})},[m]);let{data:z,loading:U,called:V}=(0,D.HHH)({variables:{workspaceId:null==p?void 0:p.id,first:1,createdBy:g,sortBy:{field:D.IX5.CreatedTime,direction:D.SrV.Asc}},skip:!!(!g||o)}),q=o||(null==h?void 0:null===(i=h.settings)||void 0===i?void 0:i.welcomeDocId)||(null==z?void 0:null===(n=z.docs.edges[0])||void 0===n?void 0:n.node.id),Y=(0,u.useCallback)(e=>{switch(e){case"welcomeDoc":q?s("/docs/".concat(q)):console.warn("[StartingModal] No welcomeDoc");break;case"templates":s("/#templates");break;case"inspiration":s("/#inspiration");break;case"blankDeck":r();break;case"createFromAI":s(O);break;default:console.warn("[StartingModal] Unknown action",e)}},[O,s,r,q]);return(0,t.jsxs)(j.u_,{isOpen:!0,size:x,trapFocus:!1,onClose:()=>{null==a||a.track(G.AA.GET_STARTED_CLICKED,{target:"dismiss",variation:"new"}),s()},children:[(0,t.jsx)(v.Z,{}),(0,t.jsxs)(C.h,{children:[(0,t.jsx)(f.x,{children:(0,t.jsx)(T.cC,{id:"h0sjMM"})}),(0,t.jsx)(b.o,{}),(0,H.s2)()?(0,t.jsx)(y.xu,{padding:"4",background:"salmon.100",mb:"4",children:(0,t.jsxs)(A.U,{spacing:"5",paddingLeft:"2",children:[(0,t.jsx)(y.xu,{color:"salmon.600",children:(0,t.jsx)(P.G,{icon:N.tc$,className:"fa-xl"})}),(0,t.jsxs)(_.g,{align:"flex-start",spacing:"0",children:[(0,t.jsx)(w.x,{fontWeight:"600",fontSize:"lg",children:(0,t.jsx)(T.cC,{id:"2aP3e7"})}),(0,t.jsx)(w.x,{fontSize:"sm",children:(0,t.jsx)(T.cC,{id:"WsGA8K"})})]})]})}):(0,t.jsx)(k.i,{mb:"4"}),(0,t.jsx)(I.f,{children:(0,t.jsx)(S.M,{columns:[1,1,3],spacing:5,children:R.map((e,i)=>{let{icon:n,colorScheme:s,title:r,body:l,action:c,isNew:d}=e;if("welcomeDoc"===c&&!o&&V&&!U&&!z)return console.error("[GetStartedModalContent] Unexpectedly cant find a welcomeDocId"),null;let u="blankDeck"===c?"/new":"templates"===c?"/#templates":"inspiration"===c?"/#inspiration":"welcomeDoc"===c?"/docs/".concat(q):"createFromAI"===c?O:"/";return(0,t.jsx)(Q,{accentColor:s||"trueblue",title:r,body:l,href:u,icon:n,isNew:d,onClick:e=>{null==a||a.track(G.AA.GET_STARTED_CLICKED,{target:es[c],variation:"new"}),e.metaKey||(e.preventDefault(),Y(c))}},i)})})}),(0,t.jsx)(E.m,{})]})]})};var el=n(82642),ea=n(55478),eo=n(32899),ec=n(81540),ed=n(36474),eu=n(87254),ex=n(71113),eh=n(40651),ep=n(17749),em=n(1196),eg=n(44663),ej=n(11881),ev=n(2953),eC=n(62131);let ef=e=>{let{onOpenCallback:i,onCloseCallback:n}=e,s=(0,L.ye)("upsellUXEnabled_Pro"),{openUpsellModal:r}=(0,ev.z)();return s?(0,t.jsx)(ej.f,{bottom:0,bg:"white",borderRadius:"md",boxShadow:"base",border:"1px solid",borderColor:"trueblue.100",p:3,children:(0,t.jsxs)(Y.K,{children:[(0,t.jsxs)(A.U,{children:[(0,t.jsx)(eC.ER,{variant:"solid"}),(0,t.jsx)(w.x,{fontSize:"sm",fontWeight:"600",children:(0,t.jsx)(T.cC,{id:"mpbrVv",values:{GAMMA_PRO_PROPER_NOUN:m.x8}})})]}),(0,t.jsx)(w.x,{fontSize:"xs",color:"gray.600",children:(0,t.jsx)(T.cC,{id:"gGlaFH",values:{GAMMA_PROPER_NOUN:m.N6}})}),(0,t.jsx)(w.x,{fontSize:"sm",fontWeight:"bold",children:(0,t.jsx)(ej.A,{color:"trueblue.600",href:"#",onClick:()=>{r({onOpenCallback:i,onCloseCallback:n,segmentEvent:G.AA.GAMMA_PRO_UPSELL_CALLOUT_SIDEBAR})},children:(0,t.jsx)(w.x,{children:(0,t.jsx)(T.cC,{id:"y7e9aS"})})})})]})}):null};var eb=n(57124),ey=n(91994),eA=n(67109),e_=({size:e="2rem",...i})=>(0,t.jsx)(eA.O,{borderRadius:"full",boxSize:e,...i});e_.displayName="SkeletonCircle";var ew=n(109),ek=n(10625),eI=n(67046),eS=n(62614),eE=n(99058),eN=n(25481),eP=n(27599),eT=n(44035),eR=n(39237),eO=n(94523),eM=n(1842),eD=n.n(eM),ez=n(14274),eL=(0,n(67012).I)({displayName:"WarningTwoIcon",d:"M23.119,20,13.772,2.15h0a2,2,0,0,0-3.543,0L.881,20a2,2,0,0,0,1.772,2.928H21.347A2,2,0,0,0,23.119,20ZM11,8.423a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Zm1.05,11.51h-.028a1.528,1.528,0,0,1-1.522-1.47,1.476,1.476,0,0,1,1.448-1.53h.028A1.527,1.527,0,0,1,13.5,18.4,1.475,1.475,0,0,1,12.05,19.933Z"}),eU=n(47443),eG=n(70065),eF=n(82713),eW=n(75768);let eH=()=>
1(0,t.jsxs)(A.U,{px:2,py:2,border:"2px solid var(--chakra-colors-red-500)",borderRadius:"md",children:[(0,t.jsx)(eL,{w:4,h:4,color:"red.500"}),(0,t.jsx)(w.x,{fontSize:"sm",color:"red.500",children:(0,t.jsx)(T.cC,{id:"Ofm9ns"})})]}),eB=e=>{let{user:i,workspace:n,canDeleteAccount:r}=e;return(0,t.jsxs)(eU.b,{status:i||(null==n?void 0:n.memberCount)&&n.memberCount<=1?"error":"warning",display:"flex",flexDirection:"column",alignItems:"normal",mt:2,children:[(0,t.jsxs)(s.k,{pb:3,flexDirection:["column","column","row","row"],align:"flex-start",gap:2,children:[(0,t.jsxs)(s.k,{flex:1,children:[(0,t.jsx)(ew.q,{src:null==i?void 0:i.profileImageUrl,size:"sm",name:(null==i?void 0:i.displayName)||(null==n?void 0:n.name)}),(0,t.jsxs)(Y.K,{spacing:0,ml:2,flex:"1",children:[(0,t.jsx)(w.x,{fontSize:"sm",flex:"1",wordBreak:"break-word",children:(null==i?void 0:i.displayName)||(null==n?void 0:n.name)}),i&&(0,t.jsx)(w.x,{fontSize:"xs",color:"gray.600",flex:"1",wordBreak:"break-word",children:i.email}),n&&(0,t.jsx)(w.x,{fontSize:"xs",color:"gray.600",children:(0,t.jsx)(T.cC,{id:"LaQ44M",values:{0:n.memberCount||0}})})]})]}),(0,t.jsx)(s.k,{flexShrink:1,children:(i||n&&(null==n?void 0:n.memberCount)===1)&&(0,t.jsx)(eH,{})})]}),(0,t.jsx)(k.i,{borderColor:"blackAlpha.200"}),(0,t.jsxs)(w.x,{pt:2,fontSize:"sm",color:i||(null==n?void 0:n.memberCount)&&n.memberCount<=1?"red.500":"yellow.700",children:[r&&i&&(0,t.jsxs)(t.Fragment,{children:["⚠️"," ",(0,t.jsx)(T.cC,{id:"j95nHI",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq}})]}),r&&(null==n?void 0:n.memberCount)&&(n.memberCount>1?(0,t.jsxs)(t.Fragment,{children:["⚠️ ",(0,t.jsx)(T.cC,{id:"QnF/9z"})]}):(0,t.jsxs)(t.Fragment,{children:["⚠️"," ",(0,t.jsx)(T.cC,{id:"PU+L+E",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq}})]})),!r&&(0,t.jsxs)(t.Fragment,{children:["⚠️"," ",(0,t.jsx)(T.cC,{id:"eFx5qm"})]})]})]})},eK=e=>{var i,n;let{isOpen:s,onClose:r,user:l}=e,[a,o]=(0,u.useState)(!1),[c,d]=(0,u.useState)(!1),{data:x}=(0,D.NUx)(),h=(0,eG.p)(),[p]=(0,D.I1z)(),g=(null==x?void 0:null===(n=x.user)||void 0===n?void 0:null===(i=n.workspaceMemberships)||void 0===i?void 0:i.filter(e=>!1===e.disabled))||[],_=g.filter(e=>{var i,n;return"admin"===e.role&&(null===(i=e.workspace)||void 0===i?void 0:i.adminCount)===1&&(null===(n=e.workspace)||void 0===n?void 0:n.memberCount)&&e.workspace.memberCount>1}),k=g.map(e=>e.workspace),S=0===_.length,N=(0,u.useCallback)(()=>{d(!0),p().then(e=>{let{data:i}=e;i&&(window.location.href="".concat(ez.v.API_HOST,"/logout?redirectTo=/user-deleted"))}).catch(()=>{d(!1),h({title:"Delete account failed. Try again or reach out to Gamma support.",status:"error",duration:3e3,position:"top",isClosable:!0})})},[h,p]);return(0,t.jsxs)(j.u_,{isOpen:s,onClose:r,size:"lg",closeOnOverlayClick:!1,children:[(0,t.jsx)(v.Z,{}),(0,t.jsxs)(C.h,{p:2,children:[(0,t.jsx)(f.x,{children:(0,t.jsx)(T.cC,{id:"pj33Dr",values:{GAMMA_PROPER_NOUN:m.N6}})}),(0,t.jsx)(b.o,{}),(0,t.jsxs)(I.f,{children:[S&&(0,t.jsxs)(Y.K,{spacing:3,children:[(0,t.jsx)(w.x,{children:(0,t.jsx)(T.cC,{id:"gICMDu"})}),(0,t.jsxs)(y.xu,{children:[(0,t.jsx)(w.x,{colorScheme:"gray",fontSize:"sm",children:(0,t.jsx)(T.cC,{id:"sG4820"})}),(0,t.jsx)(eB,{user:l,canDeleteAccount:S})]}),k&&k.length>0&&(0,t.jsxs)(y.xu,{children:[(0,t.jsx)(w.x,{colorScheme:"gray",fontSize:"sm",children:(0,t.jsx)(T.cC,{id:"dFEw4P"})}),null==k?void 0:k.map(e=>(0,t.jsx)(eB,{workspace:e,canDeleteAccount:S},null==e?void 0:e.id))]}),(0,t.jsxs)(y.xu,{children:[(0,t.jsx)(w.x,{colorScheme:"gray",fontSize:"sm",children:(0,t.jsx)(T.cC,{id:"R3XcoA"})}),(0,t.jsxs)(A.U,{bg:"gray.100",mt:2,p:3,pl:2,spacing:2,borderRadius:"sm",children:[(0,t.jsx)(eF.X,{size:"lg",spacing:"1rem",p:3,defaultChecked:a,onChange:e=>o(e.target.checked)}),(0,t.jsx)(w.x,{fontSize:"sm",children:(0,t.jsx)(T.cC,{id:"4YT8Pd"})})]})]})]}),!S&&(0,t.jsx)(Y.K,{children:(0,t.jsxs)(y.xu,{children:[(0,t.jsx)(w.x,{colorScheme:"gray",fontSize:"sm",children:(0,t.jsx)(T.cC,{id:"nhUDfL"})}),null==k?void 0:k.map(e=>(0,t.jsx)(eB,{workspace:e,canDeleteAccount:S},null==e?void 0:e.id))]})})]}),S&&(0,t.jsx)(E.m,{children:(0,t.jsxs)(eW.h,{children:[(0,t.jsx)(eS.z,{variant:"ghost",colorScheme:"gray",onClick:r,children:(0,t.jsx)(T.cC,{id:"dEgA5A"})}),(0,t.jsx)(eS.z,{isDisabled:!a,variant:"ghost",colorScheme:"red",onClick:N,isLoading:c,loadingText:eu.ag._({i
1d:"O71YIC"}),children:(0,t.jsx)(T.cC,{id:"dfBVKc"})})]})})]})]})};var eV=n(75009),eq=n(87651),eY=n(99793),eX=n(35183),eZ=n(97166),eJ=n(85573),eQ=n(89606),e$=n(10649),e0=n(49152),e1=n(43102),e2=n(99787);let e3={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},e5=e=>{let{uppy:i,multiple:n=!1,accept:s=e2.pK.join(",")}=e,r=(0,u.useRef)(null),l=(0,u.useMemo)(()=>(0,t.jsx)("input",{ref:r,className:"gamma-uppy-FileInput-input",style:e3,type:"file",name:"gamma-file-input",multiple:n,accept:s,onChange:e=>{let n=e.target;if(!n||!n.files)return;let t=Array.from(n.files);t.forEach(e=>{try{i.addFile({source:"file input",name:e.name,type:e.type,data:e})}catch(e){e.isRestriction?console.warn("[useFileInput] Restriction error:",e):console.error(e)}}),n.value=null}}),[]),a=(0,u.useCallback)(()=>{var e;null===(e=r.current)||void 0===e||e.click()},[]);return(0,u.useEffect)(()=>{let e=r.current;e&&(i.on("file-removed",()=>{e.value=null}),i.on("complete",()=>{e.value=null}),i.on("transloadit:complete",()=>{e.value=null}))},[]),{inputElement:l,onClick:a}};var e4=n(87205);let e7={cropped:"",original:""},e6=e=>{let{isOpen:i,onClose:n,onAccountDeleteModalOpen:r,user:l,orgId:a,refetchUser:o}=e,c=(0,eG.p)(),[d,{loading:x,error:h}]=(0,D.kDo)(),{setSettings:p}=(0,F.SE)(),m=(0,e0.l)(),g=(0,u.useMemo)(()=>m,[]),[_,S]=(0,u.useState)(g);(0,e1.m)(_);let[R,O]=(0,u.useState)(l.firstName||""),[M,z]=(0,u.useState)(l.lastName||""),[L,U]=(0,u.useState)(l.profileImageUrl||""),[G,W]=(0,u.useState)(e7),[H,B]=(0,u.useState)("original"),K=G.cropped&&"cropped"===H?G.cropped:G.original&&"original"===H?G.original:L,[V,q]=(0,u.useState)("idle"),X=(0,u.useMemo)(()=>e2.ND.createUppyInstance(a,{onUploadStart:e=>{W(e7),q("uploading"),B("original"),(0,e4.Ns)(e.file.type||"")||U(e.tempUrl)},onOriginalFileUpload:e=>{console.debug("[AccountSettingsModal] onOriginalFileUpload",e),U(e.src),W(i=>({...i,original:e.src}))},onUploadComplete:e=>{console.debug("[AccountSettingsModal] onUploadComplete",e),U(i=>i||e.src),W(()=>({original:e.src,cropped:e.croppedFace||""})),q("idle"),X.cancelAll()},onUploadFailed:()=>{q("error"),X.cancelAll()}},"profile"),[]),{onClick:Z,inputElement:J}=e5({uppy:X}),Q=(0,u.useCallback)(()=>{r&&(r(),n())},[r,n]),ee=(0,u.useCallback)(()=>{X.cancelAll(),q("idle"),O(l.firstName||""),z(l.lastName||""),U(l.profileImageUrl||""),B("original"),W(e7),S(g)},[l,g,X]),ei=_!==g,en=R!==l.firstName||M!==l.lastName||L!==l.profileImageUrl,et=(0,u.useMemo)(()=>en||ei,[ei,en]),es=(0,u.useCallback)(()=>{if(!et){n();return}let e=[];ei&&p&&e$.p_.includes(_)&&e.push(p({set:{locale:_}})),en&&e.push(d({variables:{input:{id:l.id,firstName:R,lastName:M,profileImageUrl:L}}})),Promise.all(e).then(()=>{null==o||o(),n(),c({title:(0,t.jsx)(T.cC,{id:"wAvGr+"}),position:"top",status:"success",isClosable:!0,duration:3e3})}).catch(e=>{console.error('[AccountSettingsModal.onSaveClick] Error updating user info "'.concat(null==l?void 0:l.id,'"'),e.message)})},[R,et,ei,en,M,_,n,L,o,p,c,d,null==l?void 0:l.id]),er=R.length<1&&M.length<1||!!(null==h?void 0:h.message)||"error"===V;return(0,t.jsxs)(j.u_,{isOpen:i,onClose:n,size:"lg",closeOnOverlayClick:!1,children:[J,(0,t.jsxs)(y.xu,{w:0,h:0,children:[(0,t.jsx)(eV.E,{src:G.original}),(0,t.jsx)(eV.E,{src:G.cropped})]}),(0,t.jsx)(v.Z,{}),(0,t.jsxs)(C.h,{children:[(0,t.jsx)(f.x,{children:(0,t.jsx)(T.cC,{id:"T3FM0r"})}),(0,t.jsx)(b.o,{}),(0,t.jsx)(k.i,{mb:4}),(0,t.jsxs)(I.f,{display:"flex",flexDirection:"column",alignItems:"center",children:[(0,t.jsxs)(Y.K,{direction:"column",alignItems:"center",children:[(0,t.jsxs)(ek.v,{placement:"bottom-start",offset:[100,0],children:[(0,t.jsx)(eO.kH,{label:(0,t.jsx)(T.cC,{id:"etzA4s"}),openDelay:750,placement:"top",children:(0,t.jsx)(eI.j,{position:"relative",disabled:"uploading"===V,userSelect:"none",cursor:"pointer",role:"group",_hover:{opacity:.9},children:(0,t.jsxs)(ew.q,{src:K,name:"".concat(R," ").concat(M).trim(),size:"2xl",_groupHover:{shadow:"lg"},ignoreFallback:!0,children:["uploading"===V&&(0,t.jsx)(y.Cd,{position:"absolute",size:"full",justifyContent:"center",alignItems:"center",bg:"gray.300",opacity:.5,children:(0,t.jsx)(ec.$,{size:"xl",thickness:"2px"})}),(0,t.jsx)(y.Cd,{position:"absolute",bottom:0,right:0,borderRadius:"full",color:"gray.800",textAlign:"center",bg:"gray.200",size:9,_groupHover:{shadow:"lg",transform:"scale(1.02)"},children:(0,t.jsx)(P.G,{icon:L?N._jT:N.TzT,width:16,height:16,size:"xs"})})]})})}),(0,t.jsxs)(eE.q,{fontSize:"sm",children:[(0,t.jsx)(eN.s,{onClick:()=>{"uploading"!==V&&Z()},children:(0,t.jsxs)(A.U,{children:[(0,t.jsx)(P.G,{icon:$.A$k}),(0,t.jsx)(w.x,{children:(0,t.jsx)(T.cC,{id:"wPTug2"})})]})}),L&&(0,t.jsx)(eP.R,{}),L&&(0,t.jsx)(eN.s,{onClick:()=>{U(""),W(e7)},children:(0,t.jsxs)(A.U,{color:"var(--chakra-colors-red-500)",children:[(0,t.jsx)(P.G,{icon:N.Vui,color:"var(--chakra-colors-red-500)"}),(0,t.jsx)(w.x,{children:(0,t.jsx)(T.cC,{id:"k8od7T"})})]})})]})]}),(0,t.jsx)(eq.U,{in:!!L&&!!G.cropped&&L!==l.profileImageUrl&&"idle"===V,animateOpacity:!0,children:(0,t.jsx)(eF.X,{size:"sm",fontSize:"12px",color:"gray.500",isChecked:"cropped"===H,onChange:e=>{B(e.target.checked?"cropped":"original"),U(e.target.checked?G.cropped:G.original)},mb:3,children:(0,t.jsx)(T.cC,{id:"+J8/VC"})})}),(0,t.jsx)(eY.J1,{children:"error"===V&&"Error uploading profile image."}),(0,t.jsxs)(Y.K,{spacing:0,alignItems:"center",children:[(0,t.jsx)(w.x,{fontSize:"xl",fontWeight:"bold",children:l.displayName}),(0,t.jsx)(w.x,{color:"gray.500",children:l.email})]})]}),(0,t.jsxs)(Y.K,{direction:"column",width:"100%",my:6,px:4,spacing:6,children:[(0,t.jsxs)(eX.NI,{isInvalid:er,children:[(0,t.jsx)(eZ.l,{children:(0,t.jsx)(T.cC,{id:"V1EGGU"})}),(0,t.jsx)(eJ.I,{w:"100%",value:R,onChange:e=>O(e.target.value.slice(0,60))})]}),(0,t.jsxs)(eX.NI,{isInvalid:er,children:[(0,t.jsx)(eZ.l,{children:(0,t.jsx)(T.cC,{id:"1ZaQUH"})}),(0,t.jsx)(eJ.I,{w:"100%",value:M,onChange:e=>z(e.target.value.slice(0,60))}),(0,t.jsx)(eY.J1,{children:(null==h?void 0:h.message)?null==h?void 0:h.message:(0,t.jsx)(T.cC,{id:"yQeiGC"})})]}),(0,t.jsxs)(eX.NI,{children:[(0,t.jsx)(eZ.l,{children:(0,t.jsx)(T.cC,{id:"vXIe7J"})}),(0,t.jsx)(eQ.p,{selectedLocale:e$.w$[_],onLocaleSelect:S})]})]})]}),(0,t.jsx)(E.m,{children:(0,t.jsxs)(s.k,{justifyContent:"space-between",flex:1,alignItems:"flex-end",children:[(0,t.jsx)(s.k,{
1children:(0,t.jsx)(eS.z,{variant:"ghost",color:"gray.400",colorScheme:"gray",size:"sm",onClick:Q,children:(0,t.jsx)(T.cC,{id:"ktknoE"})})}),(0,t.jsxs)(s.k,{flexWrap:"wrap",justifyContent:"flex-end",gap:2,children:[et&&(0,t.jsx)(eS.z,{variant:"ghost",colorScheme:"gray",onClick:ee,children:(0,t.jsx)(T.cC,{id:"dEgA5A"})}),(0,t.jsx)(eS.z,{variant:et?"solid":"plain",onClick:es,isDisabled:er||"uploading"===V,isLoading:x,children:et?(0,t.jsx)(T.cC,{id:"y3aU20"}):(0,t.jsx)(T.cC,{id:"DPfwMq"})})]})]})})]})]})},e9=()=>(0,t.jsxs)(A.U,{w:"100%",px:2,pb:1,children:[(0,t.jsx)(e_,{size:"32px"}),(0,t.jsx)(eA.O,{width:"60%",height:"20px"})]}),e8=e=>{var i;let{workspace:n,memberCount:s,isMultiline:r=!0}=e;return(0,t.jsxs)(A.U,{mr:4,children:[(0,t.jsx)(ew.q,{name:null===(i=n.name)||void 0===i?void 0:i.replace(/\s/g,""),size:"sm",bgColor:"orchid.300",color:"white"}),(0,t.jsxs)(Y.K,{textAlign:"left",align:"flex-start",justify:"flex-start",spacing:0,...r?{}:{noOfLines:1},children:[(0,t.jsx)(w.x,{fontSize:"sm",fontWeight:"600",wordBreak:"break-word",m:0,p:0,...r?{}:{overflow:"hidden",textOverflow:"ellipsis"},minWidth:"0px",children:n.name}),(0,t.jsx)(eC.Y7,{workspace:n}),!eD()(s)&&(0,t.jsx)(w.x,{fontSize:"xs",color:"gray.500",textAlign:"left",children:(0,t.jsx)(T.cC,{id:"F6GBat",values:{memberCount:s}})})]})]})},ie=e=>{let{onOpen:i}=e,{user:n,currentWorkspace:r,refetch:l,setCurrentWorkspaceId:a}=(0,F.SE)(),{isConnected:o}=(0,D.$gs)(),{isOpen:c,onOpen:d,onClose:u}=(0,ea.q)({id:"user-settings-modal"}),{isOpen:x,onOpen:h,onClose:p}=(0,ea.q)({id:"account-delete-modal"}),m=(0,W.i)({md:"400px"});if(!n)return(0,t.jsx)(t.Fragment,{});let g=null==n?void 0:n.organizations;return g&&r?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ek.v,{autoSelect:!1,children:[(0,t.jsx)(eO.kH,{label:o?"":"You're offline","aria-label":o?"Workspace options":"You're offline",children:(0,t.jsx)(y.xu,{children:(0,t.jsx)(eI.j,{as:eS.z,isDisabled:!o,variant:"ghost",rightIcon:o?(0,t.jsx)(P.G,{icon:N.gc2,"aria-label":"Caret icon"}):(0,t.jsx)(P.G,{icon:N.bKP}),w:"100%",colorScheme:"blackAlpha",color:"gray.800",cursor:"pointer",_hover:{color:"trueblue.600"},p:2,pr:4,children:(0,t.jsx)(y.xu,{width:"100%",children:r&&(0,t.jsx)(e8,{workspace:r,memberCount:null,isMultiline:!1})})})})}),(0,t.jsxs)(eE.q,{minW:m,zIndex:"overlay",shadow:"lg",maxW:"min(500px, 100vw)",children:[(0,t.jsxs)(eN.s,{px:2,cursor:"pointer",onClick:d,children:[(0,t.jsx)(ew.q,{src:n.profileImageUrl,size:"sm",name:n.displayName}),(0,t.jsxs)(Y.K,{spacing:0,ml:2,children:[(0,t.jsx)(w.x,{fontSize:"sm",children:n.displayName}),(0,t.jsx)(w.x,{fontSize:"xs",color:"gray.500",children:n.email})]}),(0,t.jsx)(ed.L,{}),(0,t.jsx)(P.G,{size:"sm",icon:$.gr5,color:"var(--chakra-colors-gray-500)"})]}),(0,t.jsx)(eP.R,{}),g&&g.length>0&&(0,t.jsx)(eT._,{title:eu.ag._({id:"pmt7u4"}),type:"radio",defaultValue:null==r?void 0:r.id,onChange:e=>{a(e)},children:g.filter(e=>!eD()(e)&&!eD()(e.id)&&!eD()(e.name)).map(e=>(0,t.jsx)(eR.i,{value:e.id,icon:1===g.length?null:void 0,isFocusable:1!==g.length,children:(0,t.jsxs)(A.U,{children:[(0,t.jsx)(s.k,{flex:1,w:"100%",children:(0,t.jsx)(e8,{workspace:e,memberCount:null,isMultiline:!0})}
1),e.id===(null==r?void 0:r.id)&&(0,t.jsx)(s.k,{children:(0,t.jsx)(eS.z,{size:"sm",variant:"outline",onClick:i,children:(0,t.jsx)(T.cC,{id:"0dbeO4"})})})]})},e.id))}),(0,t.jsx)(eP.R,{}),(0,t.jsx)(eN.s,{color:"red.500",icon:(0,t.jsx)(P.G,{icon:N.jLD,fixedWidth:!0}),onClick:()=>{window.location.href="".concat(ez.v.API_HOST,"/logout")},children:(0,t.jsx)(T.cC,{id:"fcWrnU"})})]})]}),c&&(0,t.jsx)(e6,{orgId:r.id,user:n,refetchUser:l,isOpen:c,onClose:u,onAccountDeleteModalOpen:h}),x&&(0,t.jsx)(eK,{user:n,isOpen:x,onClose:p})]}):(0,t.jsx)(t.Fragment,{})};var ii=n(74409),it=n(36371),is=n(73582),ir=n(2969),il=n(3181),ia=n(13272),io=n(87342),ic=n(29705),id=n(82282),iu=n(31807),ix=n(6912),ih=n(11942),ip=n(81640),im=n(42005),ig=n(25566);let ij=e=>{var i,n,s,r;let{memberCount:l}=e,{user:a,currentWorkspace:o}=(0,F.SE)(),{subscription:c,product:d,refetchSubscription:x}=(0,ip.z)(),{launchCancelFlow:h,cancelFlowEnabled:p}=(0,ix.B_)(c,o),[m,g]=(0,u.useState)(!1),j=(0,u.useCallback)(async()=>{if(h){im.c.track(ig.AA.CANCEL_SUBSCRIPTION_CLICK,{source:"cancel-flow"}),g(!0);try{var e;let i=await h();(null==i?void 0:null===(e=i.sessionResults)||void 0===e?void 0:e.canceled)===!0&&await (null==x?void 0:x())}catch(e){console.warn("Failed to cancel subscription",e)}g(!1)}},[h,x]),v=null==c?void 0:null===(i=c.products)||void 0===i?void 0:i[0];if(!v||!d)return null;let C=!!(null==c?void 0:c.cancellationRequestedTime),f=!!(null==c?void 0:c.expirationTime)&&new Date>new Date(c.expirationTime),b=(null==c?void 0:null===(n=c.createdByUser)||void 0===n?void 0:n.id)===(null==a?void 0:a.id),A=b?(0,ih._8)():null,_=(null==v?void 0:v.units)&&l?l-v.units:void 0,w="".concat(null==c?void 0:null===(s=c.createdByUser)||void 0===s?void 0:s.displayName," (").concat(null==c?void 0:null===(r=c.createdByUser)||void 0===r?void 0:r.email,")");return(0,t.jsxs)(Y.K,{direction:"row",spacing:2,alignItems:"baseline",children:[(0,t.jsx)(eC.Y7,{workspace:o}),_&&_>0&&b&&(0,t.jsx)(eO.kH,{label:(0,t.jsx)(T.cC,{id:"J8+D9M",values:{addedSeats:_}}),placement:"top",children:(0,t.jsx)(y.xu,{color:"yellow.500",children:(0,t.jsx)(P.G,{icon:N.Vm4})})}),(0,t.jsxs)(eW.h,{px:2,spacing:4,children:[(0,t.jsx)(eO.kH,{placement:"top",shouldWrapChildren:!0,label:b?f?(0,t.jsx)(T.cC,{id:"uxwzHm",values:{0:(0,id.Z)((0,iu.Z)(c.expirationTime),"PPP")}}):C?(0,t.jsx)(T.cC,{id:"SoEbnk",values:{0:(0,id.Z)((0,iu.Z)(c.expirationTime),"PPP")}}):(0,t.jsx)(T.cC,{id:"HrQ7yf"}):(0,t.jsx)(T.cC,{id:"H49TQ5",values:{creatorNameAndEmail:w}}),children:(0,t.jsx)(eS.z,{target:"_blank",href:b&&A?A:void 0,as:q.r,colorScheme:b?"trueblue":"gray",variant:"link",size:"sm",rightIcon:(0,t.jsx)(ic.h,{ml:-1}),isDisabled:!b,children:(0,t.jsx)(T.cC,{id:"J/hVSQ",values:{0:C||f?"Re-activate subscription":"Manage subscription"}})})}),p&&!C&&b&&(0,t.jsx)(eO.kH,{placement:"top",shouldWrapChildren:!0,label:(0,t.jsx)(T.cC,{id:"o/WrRZ"}),children:(0,t.jsx)(eS.z,{colorScheme:"gray",color:"gray.600",variant:"link",size:"sm",onClick:j,isLoading:m,isDisabled:m,children:(0,t.jsx)(T.cC,{id:"fHXMPy"})})})]}),f?(0,t.jsx)(y.xu,{fontSize:"sm",color:"gray.400",children:(0,t.jsx)(T.cC,{id:"mrIVJ+",values:{0:(0,id.Z)((0,iu.Z)(c.expirationTime),"PPP")}})}):C?(0,t.jsx)(y.xu,{fontSize:"sm",color:"gray.400",children:(0,t.jsx)(T.cC,{id:"uBqaX6",values:{0:(0,id.Z)((0,iu.Z)(c.expirationTime),"PPP")}})}):(0,t.jsx)(y.xu,{fontSize:"sm",color:"gray.400",children:(0,t.jsx)(T.cC,{id:"TwZCUl",values:{0:(0,id.Z)((0,iu.Z)(c.nextBillingTime),"PPP")}})})]})};var iv=n(46640),iC=n(37733),ib=n(52610);let iy=e=>{let{workspace:i,canManageWorkspace:n}=e,s=(0,eG.p)(),{refetch:r}=(0,F.SE)(),[l,a]=(0,u.useState)((null==i?void 0:i.name)||""),[o,c]=(0,u.useState)(!1),[d,{loading:x,called:h,error:p,reset:m}]=(0,D.Mqp)(),g=(0,u.useCallback)(()=>{c(!1),a((null==i?void 0:i.name)||"")},[null==i?void 0:i.name]),j=(0,u.useCallback)(()=>{d({variables:{input:{name:l,id:null==i?void 0:i.id}},fetchPolicy:"no-cache"}).then(()=>{null==r||r(),s({status:"success",title:"Success!",description:"Workspace updated successfully.",position:"top",duration:5e3}),setTimeout(()=>{c(!1),m()},1e3)}).catch(e=>{console.error('[WorkspaceSettingsModal] Error updating workspace "'.concat(null==i?void 0:i.id,'"'),e.message)})},[l,null==i?void 0:i.id,r,m,s,d]),v=""===l||l.length<ib.My||l.length>50||!!(null==p?void 0:p.message);(0,u.useEffect)(()=>{l!==i.name&&c(!0)},[l,i.name]);let C=(0,ib.up)();return i?(0,t.jsx)(y.xu,{children:(0,t.jsxs)(eX.NI,{isInvalid:v,children:[(0,t.jsx)(eZ.l,{children:(0,t.jsx)(T.cC,{id:"CozWO1"})}),(0,t.jsxs)(Y.K,{w:"100%",direction:["column","row"],children:[(0,t.jsx)(eO.kH,{placement:"top-start",label:(0,t.jsx)(T.cC,{id:"M1LZmX",values:{WORKSPACE_ADMIN_DISPLAY_NAME_PLURAL:C}}),isDisabled:n,children:(0,t.jsx)(y.xu,{flex:1,children:(0,t.jsx)(eJ.I,{w:["100%","50%"],placeholder:eu.ag._({i
1d:"CozWO1"}),value:l,disabled:!n,onChange:e=>a(e.target.value.slice(0,50))})})}),(0,t.jsx)(iC.R,{in:o,unmountOnExit:!0,children:(0,t.jsx)(y.xu,{children:(0,t.jsxs)(eW.h,{w:"100%",children:[(0,t.jsx)(eS.z,{variant:"solid",isLoading:x,isDisabled:v||h,onClick:j,children:(0,t.jsx)(T.cC,{id:"EkH9pt"})}),(0,t.jsx)(eS.z,{onClick:g,children:(0,t.jsx)(T.cC,{id:"dEgA5A"})})]})})})]}),(0,t.jsx)(eX.Q6,{children:(0,t.jsx)(T.cC,{id:"ODB/Vo"})}),(0,t.jsx)(eY.J1,{children:(null==p?void 0:p.message)?null==p?void 0:p.message:(0,t.jsx)(T.cC,{id:"soNtuq",values:{WORKSPACE_NAME_MIN_LENGTH:ib.My}})})]})}):null};var iA=n(46949),i_=n(74105),iw=n(20816),ik=n(46028),iI=n(7985),iS=n(38045),iE=n(84636),iN=n.n(iE),iP=n(23312),iT=n(4758),iR=n(80498),iO=n(16893),iM=n(1163);let iD=()=>{let[e,i]=(0,u.useState)(!1),{product:n}=(0,ip.z)(),t=!!n,[s,r]=(0,u.useState)(new iR.B),{isOpen:l,onOpen:a,onClose:o}=(0,ea.q)({id:"confirm-add-paid-user"}),c=(0,u.useCallback)(()=>i(e=>!e),[]),d=(0,u.useCallback)(()=>{s.reject(),i(!1),o()},[o,s]),x=(0,u.useCallback)(()=>{s.resolve(!0),i(!1),o()},[o,s]),h=(0,u.useCallback)(()=>{if(!t)return Promise.resolve();let e=new iR.B;return r(e),a(),e.promise},[t,a]);return{isConfirmAddPaidMemberModalOpen:l,isConfirmAddPaidMemberModalChecked:e,onConfirmAddPaidMemberClose:d,onConfirmAddPaidMemberClick:x,showConfirmPaidUserModal:h,onConfirmAddPaidMemberClickCheckbox:c}},iz=e=>{let{isOpen:i,newMemberCount:n,isChecked:r,onClose:l,onConfirmClick:a,onCancelClick:o,onCheckboxConfirm:c}=e,{subscription:d}=(0,ip.z)(),x=(0,u.useCallback)(()=>(0,iM.$F)(d,n),[d,n]),{totalPrice:h,productPrice:p}=(0,iO.A)(x,[n,d]);if(!i||!d)return null;let m=(null==p?void 0:p.frequencyUnit)===D.C_B.Month?(0,t.jsx)(T.cC,{id:"JKIwMd",values:{newMemberCount:n,totalPrice:h},components:{0:(0,t.jsx)("strong",{}),1:(0,t.jsx)("strong",{})}}):(0,t.jsx)(T.cC,{id:"Pltlc3",values:{newMemberCount:n,totalPrice:h},components:{0:(0,t.jsx)("strong",{}),1:(0,t.jsx)("strong",{})}});return(0,t.jsxs)(j.u_,{isOpen:i,onClose:l,trapFocus:!1,size:"xl",children:[(0,t.jsx)(v.Z,{}),(0,t.jsxs)(C.h,{children:[(0,t.jsx)(f.x,{children:(0,t.jsx)(T.cC,{id:"B9zUUN",values:{newMemberCount:n}})}),(0,t.jsx)(b.o,{}),(0,t.jsx)(I.f,{children:(0,t.jsxs)(Y.K,{spacing:4,children:[(0,t.jsx)(w.x,{as:"span",children:(0,t.jsx)(T.cC,{id:"c6yFkJ"})}),(0,t.jsxs)(s.k,{gap:3,alignItems:"start",children:[(0,t.jsx)(eF.X,{mt:1,isChecked:r,onChange:c}),(0,t.jsx)(w.x,{children:m})]}),(0,t.jsx)(y.xu,{fontSize:"sm",bgColor:"gray.200",p:4,borderRadius:"md",children:(0,t.jsx)(w.x,{children:(0,t.jsx)(T.cC,{id:"mjZQpA"})})})]})}),(0,t.jsx)(E.m,{children:(0,t.jsxs)(eW.h,{children:[(0,t.jsx)(eS.z,{variant:"ghost",colorScheme:"gray",onClick:o,children:(0,t.jsx)(T.cC,{id:"dEgA5A"})}),(0,t.jsx)(eS.z,{variant:"solid",onClick:a,isDisabled:!r,children:(0,t.jsx)(T.cC,{id:"WMsmjg",values:{newMemberCount:n}})})]})})]})]})},iL=(0,iS.E)(y.xu),iU=e=>{let{workspace:i,canManageWorkspace:n,setDoneFn:r}=e,l=(0,eG.p)(),a=(0,u.useRef)(),o=(0,u.useRef)(null),[c,d]=(0,u.useState)([]),[x,h]=(0,u.useState)(new iR.B),[p,m]=(0,u.useState)(""),[g,{loading:j}]=(0,D.f4M)(),{isOpen:v,onOpen:C,onClose:f}=(0,ea.q)({id:"confirm-unsent-invitations"}),{isConfirmAddPaidMemberModalOpen:b,isConfirmAddPaidMemberModalChecked:A,onConfirmAddPaidMemberClick:_,onConfirmAddPaidMemberClose:k,showConfirmPaidUserModal:I,onConfirmAddPaidMemberClickCheckbox:S}=iD(),E=(0,u.useMemo)(()=>c.concat({email:p.trim()}).filter(e=>!("email"in e)||(0,iI.G)(e.email||"")),[p,c]),N=!!(p.length||c.length),P=!!E.length;(0,u.useEffect)(()=>{r(()=>()=>(P?C():x.resolve(),x.promise))},[P,x,C,r]);let R=j||!n,O=(0,u.useCallback)(async()=>{if(0!==E.length)return g({variables:{workspaceId:i.id,invitees:E},refetchQueries:["GetWorkspace"]}).then(()=>{let e=(0,t.jsx)(T.cC,{id:"Ka86rB",values:{0:E.length}});l({title:e,description:(0,t.jsx)(w.x,{children:E.map(e=>(0,t.jsx)(w.x,{children:e.email},e.email))}),status:"success",position:"top",isClosable:!0,duration:9e3})})},[E,g,i.id,l]),M=(0,u.useCallback)(async()=>I().then(O).then(()=>{var e;d([]),m(""),null===(e=a.current)||void 0===e||e.resetItems(!0),x.resolve(),h(new iR.B)}).catch(e=>{console.warn(e)}),[I,O,x]),z=(0,u.useCallback)(e=>{d(i=>i.filter(i=>i.email!==e))},[]),L=(0,u.useCallback)(e=>{d(i=>iN()([...i,...e],"email"))},[]),U=(0,ib.up)(),G=(0,ib.r_)();return(0,t.jsxs)(y.xu,{my:4,mb:6,children:[(0,t.jsx)(w.x,{mb:2,fontSize:"sm",color:"gray.500",children:(0,t.jsx)(T.cC,{id:"/Yxzaj"})}),(0,t.jsxs)(s.k,{direction:"row",w:"100%",alignItems:"flex-start",children:[(0,t.jsx)(i_.B,{w:"100%",justifyContent:"center",flex:1,children:(0,t.jsxs)(ik.Qc,{ref:a,values:c,maxSelections:100,maxSuggestions:20,creatable:!0,multiple:!0,freeSolo:!0,suggestWhenEmpty:!1,openOnFocus:!0,filter:(e,i)=>!c.find(e=>e.email===i),onSelectOption:e=>{let{item:i}=e;L([{email:i.value}]),m("")},onTagRemoved:e=>{d(i=>[...i].filter(i=>i.email!==e))},children:[(0,t.jsxs)(iw.Z,{pointerEvents:"none",color:"gray.300",h:"100%",flexDirection:"column",children:[(0,t.jsx)(s.k,{flex:1}),(0,t.jsx)(s.k,{h:10,py:4,alignItems:"center",children:(0,t.jsx)(iA.W,{w:10})})]}),(0,t.jsx)(eO.kH,{placement:"top-start",label:(0,t.jsx)(T.cC,{id:"8LvjQl",values:{WORKSPACE_ADMIN_DISPLAY_NAME_PLURAL:U,WORKSPACE_ADMIN_DISPLAY_NAME:G}}),isDisabled:n,children:(0,t.jsx)(y.xu,{children:(0,t.jsx)(ik.Vp,{ref:o,"data-testid":"autocomplete-collaborators-input",cursor:R?"not-allowed":void 0,disabled:R,w:"100%",pl:5,wrapStyles:{px:2}
1,fontSize:"md",placeholder:eu.ag._({id:"+1O5zr"}),transition:"width 1s ease-in-out",value:p,onKeyDown:e=>{let{key:i}=e;if("Enter"===i&&0===p.length){e.preventDefault();return}if("Backspace"===i&&0===p.length&&c.length>0){let e=c.slice(-1).pop();if(e){var n;null===(n=a.current)||void 0===n||n.removeItem(e.email)}}},onPaste:e=>{e.preventDefault(),e.stopPropagation();let i=e.clipboardData.getData("Text"),n=i.trim().split(/[,|;\s]+/);L([...n.map(e=>({email:e}))]),m("")},onChange:e=>{let{target:i}=e,{value:n}=i;m(n)},children:c.map((e,i)=>(0,t.jsx)(iT.L,{idx:i,selectedCollaborator:e,handleRemoveClick:()=>{z(e.email)}},e.email))})})})]})}),(0,t.jsx)(iL,{overflowX:"hidden",transition:"slow",animate:{maxWidth:N?"240px":"0px"},children:(0,t.jsx)(y.xu,{ml:2,children:(0,t.jsx)(eS.z,{variant:"solid",onClick:M,isDisabled:!P,isLoading:!1,"data-testid":"add-selected-items",children:(0,t.jsx)(T.cC,{id:"MFKlMB"})})})})]}),(0,t.jsx)(iP.C,{invitationCount:E.length,isOpen:v,onClose:()=>{f(),x.reject(),h(new iR.B)},onDiscardClick:()=>{f(),x.resolve(),h(new iR.B)},onSendInvitationsClick:()=>{f(),M()}}),(0,t.jsx)(iz,{isOpen:b,newMemberCount:E.length,isChecked:A,onConfirmClick:_,onClose:k,onCancelClick:k,onCheckboxConfirm:S})]})};var iG=n(52929),iF=n(21979);let iW=()=>{let{subscription:e}=(0,ip.z)(),i=(0,iM.OJ)(e),n=null==i?void 0:i.frequencyUnit;return(0,t.jsxs)(w.x,{children:[(0,t.jsx)(w.x,{as:"span",fontWeight:"600",children:n===D.C_B.Month?(0,t.jsx)(T.cC,{id:"cs6BKJ",values:{0:(0,iM.Hk)(i)},components:{0:(0,t.jsx)(w.x,{as:"span",textDecoration:"underline"})}}):n===D.C_B.Year?(0,t.jsx)(T.cC,{id:"xArlW8",values:{0:(0,iM.Hk)(i)},components:{0:(0,t.jsx)(w.x,{as:"span",textDecoration:"underline"})}}):"---"}),(0,t.jsx)(w.x,{children:(0,t.jsx)(T.cC,{id:"gfz9Jx"})})]})};var iH=n(78462);let iB=e=>{let{workspace:i}=e,n=(0,iH.Dg)(i),{product:r}=(0,ip.z)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(w.x,{my:2,fontSize:"sm",color:"gray.500",children:[(0,t.jsx)(T.cC,{id:"eR6rch"})," ",(0,t.jsx)(T.cC,{id:"X4Z7y1"})]}),(0,t.jsx)(s.k,{mb:4,children:(0,t.jsx)(iF.I,{url:n})}),(0,t.jsxs)(eU.b,{mt:2,status:"warning",fontSize:"sm",borderRadius:4,children:[(0,t.jsx)(iG.z,{}),(0,t.jsxs)(Y.K,{children:[(0,t.jsxs)(w.x,{children:[(0,t.jsx)("strong",{children:(0,t.jsx)(T.cC,{id:"XeiZmu"})})," ",(0,t.jsx)(T.cC,{id:"PF+S+V",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq}})]}),r&&(0,t.jsx)(iW,{})]})]})]})};var iK=n(14093),iV=n(70189),iq=n(78534),iY=n(80774),iX=n(5832),iZ=n(66983),iJ=n(79443);let iQ=(e,i)=>"".concat(null!=e?e:""," ").concat(i?"(".concat(i,")"):"");var i$=n(97010);let i0=(e,i,n)=>{let s=iQ(i.displayName,i.email),r=(0,ib.r_)();return"remove"===e?{title:(0,t.jsx)(T.cC,{id:"HlXuQk",values:{0:i.displayName||""}}),description:(0,t.jsx)(T.cC,{id:"MYcnTw",values:{nameWithEmail:s}}),confirmButtonLabel:(0,t.jsx)(T.cC,{id:"gNjH/6"})}:"leave"===e?{title:(0,t.jsx)(T.cC,{id:"6iUevl"}),description:(0,t.jsx)(T.cC,{id:"nM44Cu",values:{0:n.name}}),confirmButtonLabel:(0,t.jsx)(T.cC,{id:"hGWoeF"})}:{title:(0,t.jsx)(T.cC,{id:"kxbLa+",values:{WORKSPACE_ADMIN_DISPLAY_NAME:r}}),description:(0,t.jsx)(T.cC,{id:"gJfQ74",values:{WORKSPACE_ADMIN_DISPLAY_NAME:r}}),confirmButtonLabel:(0,t.jsx)(T.cC,{id:"m4YerB"})}},i1=e=>{let{isOpen:i,onClose:n,onConfirmClick:s,onCancelClick:r,userToConfirm:l,workspace:a,action:o}=e;if(!i)return null;let{title:c,description:d,confirmButtonLabel:u}=i0(o,l,a);return(0,t.jsxs)(j.u_,{returnFocusOnClose:!1,onClose:n,isOpen:!0,isCentered:!0,size:"lg",children:[(0,t.jsx)(v.Z,{}),(0,t.jsxs)(C.h,{children:[(0,t.jsx)(f.x,{children:c}),(0,t.jsx)(b.o,{}),(0,t.jsxs)(I.f,{children:[(0,t.jsx)(w.x,{children:d}),"remove"===o&&(0,t.jsx)(i2,{user:l,mt:3})]}),(0,t.jsx)(E.m,{children:(0,t.jsxs)(eW.h,{variant:"ghost",children:[(0,t.jsx)(eS.z,{onClick:r,colorScheme:"gray",children:(0,t.jsx)(T.cC,{id:"dEgA5A"})}),(0,t.jsx)(eS.z,{colorScheme:"red",onClick:s,children:u})]})})]})]})},i2=e=>{let{user:i,...n}=e;return(0,t.jsxs)(_.g,{spacing:3,...n,children:[(0,t.jsx)(eU.b,{status:"warning",children:(0,t.jsxs)(A.U,{children:[(0,t.jsx)(ew.q,{src:null==i?void 0:i.profileImageUrl,size:"sm",name:null==i?void 0:i.displayName}),(0,t.jsxs)(Y.K,{spacing:0,ml:2,flex:"1",children:[(0,t.jsx)(w.x,{fontSize:"sm",flex:"1",wordBreak:"break-word",children:null==i?void 0:i.displayName}),i.email&&(0,t.jsx)(w.x,{fontSize:"xs",color:"gray.600",flex:"1",wordBreak:"break-word",children:i.email})]})]})}),(0,t.jsxs)(eU.b,{children:[(0,t.jsx)(iG.z,{}),(0,t.jsxs)(i$.GS,{spacing:3,children:[(0,t.jsx)(i$.HC,{children:(0,t.jsx)(T.cC,{id:"J1E9I7",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq,0:i.displayName||""}})}),(0,t.jsx)(i$.HC,{children:(0,t.jsx)(T.cC,{id:"1i/P7t",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq,0:i.displayName||""}})})]})]})]})};var i3=n(19783);let i5=e=>{let{selected:i,options:n,onSelect:s,isMenuDisabled:r,disabledOptions:l=[],deleteLabel:a=(0,t.jsx)(T.cC,{id:"HBvein"}),onDeleteClick:o,disabledDeleteReason:c}=e,d=i===D.r3E.Admin?(0,t.jsx)(T.cC,{id:"U3pytU"}):(0,t.jsx)(T.cC,{id:"OvoEq7"});return(0,t.jsxs)(ek.v,{closeOnSelect:!0,children:[(0,t.jsx)(eI.j,{as:eS.z,isDisabled:r,variant:"ghost",size:"sm",rightIcon:(0,t.jsx)(P.G,{icon:N.ptq}),children:d}),(0,t.jsx)(eE.q,{maxW:"320px",zIndex:"dropdown",children:(0,t.jsxs)(eT._,{defaultValue:i,value:i,type:"radio",onChange:e=>{Array.isArray(e)||s(e)},children:[n.map(e=>{let i=l.find(i=>i.disabledOption===e);return(0,t.jsx)(eR.i,{value:e,isDisabled:!!i,pt:3,children:(0,t.jsx)(i3.u,{"aria-label":null==i?void 0:i.reason,label:null==i?void 0:i.reason,isDisabled:!i,placement:"right",shouldWrapChildren:!0,children:(0,t.jsxs)(y.xu,{lineHeight:"base",children:[(0,t.jsx)(w.x,{fontSize:"md",children:ib.rK[e].title}),(0,t.jsx)(w.x,{fontSize:"sm",color:"gray.500",children:ib.rK[e].description})]})})},e)}),(0,t.jsx)(eP.R,{}),(0,t.jsx)(i3.u,{"aria-label":c,label:c,isDisabled:!c,placement:"right",shouldWrapChildren:!0,children:(0,t.jsx)(eN.s,{onClick:o,color:"red.500",fontSize:"md",lineHeight:"base",isDisabled:!!c,children:a})})]})})]})},i4=(e,i)=>(i||[]).find(i=>{var n;return(null===(n=i.workspace)||void 0===n?void 0:n.id)===e}),i7=e=>{var i;
1let{workspace:n,dateFormatterFn:r,canManageWorkspace:l,workspaceAdminCount:a}=e,[o,c]=(0,u.useState)(D.tvj.DisplayName),[d,x]=(0,u.useState)(D.SrV.Asc),[h,p]=(0,u.useState)(!1),m={id:null==n?void 0:n.id,first:50,sortBy:{field:o,direction:d}},{data:g,loading:j,fetchMore:v}=(0,D.iR3)({variables:m,skip:!(null==n?void 0:n.id)}),[C,{loading:f}]=(0,D.Eiz)(),[b,{loading:A}]=(0,D.ert)(),[_,w]=(0,u.useState)(null),k=null==g?void 0:null===(i=g.workspaceMembers)||void 0===i?void 0:i.pageInfo,I=!j&&(null==k?void 0:k.hasNextPage)&&(null==k?void 0:k.endCursor),S=null==g?void 0:g.workspaceMembers.edges.map(e=>e.node),{user:E,refetch:N}=(0,F.SE)(),R=n.id,O=(0,eG.p)(),[M,z]=(0,u.useState)(null),[L,U]=(0,u.useState)(null),[G,W]=(0,u.useState)(new iR.B),{isOpen:H,onOpen:B,onClose:K}=(0,ea.q)(),V=(0,u.useMemo)(()=>null!=a?a:(null==S?void 0:S.reduce((e,i)=>{let n=i4(R,i.workspaceMemberships);return n&&n.role===D.r3E.Admin&&e++,e},0))||0,[S,R,a]),q=(0,u.useCallback)(async()=>(B(),G.promise),[G,B]),X=(0,u.useCallback)(()=>{z(null),U(null)},[]),Z=(0,u.useCallback)((e,i)=>{w(e.id),C({variables:{workspaceId:n.id,userId:e.id,role:i},refetchQueries:["GetWorkspace"]}).then(()=>{null==N||N();let n=i===D.r3E.Admin?(0,t.jsx)(T.cC,{id:"IFCQlQ",values:{0:e.displayName,1:e.email}}):(0,t.jsx)(T.cC,{id:"gWgob7",values:{0:e.displayName,1:e.email}});O({description:n,status:"success",position:"top",duration:5e3,isClosable:!0})}).catch(()=>{O({description:(0,t.jsx)(T.cC,{id:"CF7q4i",values:{0:e.displayName,1:e.email}}),status:"error",position:"top",duration:5e3,isClosable:!0})}).finally(()=>{w(null)})},[N,O,C,n.id]),J=(0,u.useCallback)(e=>async i=>{e&&l&&((null==E?void 0:E.id)===e.id&&i===D.r3E.Member?!(V<=1)&&(z(e),U("giveUpAdminAccess"),q().then(()=>{Z(e,i)}).catch(()=>{console.debug("[handleMemberRoleChange] User cancelled action")}).finally(()=>X())):Z(e,i))},[V,l,Z,q,X,null==E?void 0:E.id]),Q=(0,u.useCallback)(e=>()=>{if(e.id===(null==E?void 0:E.id))return;let i=iQ(e.displayName,e.email);z(e),U("remove"),q().then(()=>{w(e.id),b({variables:{workspaceId:R,userId:e.id},refetchQueries:["GetWorkspace","GetWorkspaceMembers"]}).then(()=>{null==N||N(),O({description:(0,t.jsx)(T.cC,{id:"jkCRxy",values:{emailWithName:i}}),status:"success",position:"top",duration:5e3,isClosable:!0})}).catch(()=>{O({description:(0,t.jsx)(T.cC,{id:"eETcUn",values:{emailWithName:i}}),status:"error",position:"top",duration:5e3,isClosable:!0})})}).finally(()=>{w(null),X()})},[b,q,R,null==E?void 0:E.id,N,X,O]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(iK.x,{children:(0,t.jsxs)(iV.i,{variant:"simple",colorScheme:"blackAlpha",size:"sm",whiteSpace:"normal",children:[(0,t.jsx)(iq.h,{children:(0,t.jsxs)(iY.Tr,{children:[(0,t.jsx)(iX.Th,{children:(0,t.jsx)(eS.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{c(D.tvj.DisplayName),x(e=>e===D.SrV.Asc?D.SrV.Desc:D.SrV.Asc)},rightIcon:(0,t.jsx)(y.xu,{color:o===D.tvj.DisplayName?"gray.700":"gray.300",children:(0,t.jsx)(P.G,{icon:o===D.tvj.DisplayName?"asc"===d?$.eW2:$.l1h:$.CmM})}),children:(0,t.jsx)(T.cC,{id:"6YtxFj"})})}),(0,t.jsx)(iX.Th,{children:(0,t.jsx)(eS.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{c(D.tvj.CreatedTime),x(e=>e===D.SrV.Asc?D.SrV.Desc:D.SrV.Asc)},rightIcon:(0,t.jsx)(y.xu,{color:o===D.tvj.CreatedTime?"gray.700":"gray.300",children:(0,t.jsx)(P.G,{icon:o===D.tvj.CreatedTime?"asc"===d?$.eW2:$.l1h:$.CmM})}),children:(0,t.jsx)(T.cC,{id:"SnjWqV"})})}),(0,t.jsx)(iX.Th,{children:(0,t.jsx)(T.cC,{id:"GDvlUT"})})]})}),(0,t.jsxs)(iZ.p,{children:[j&&(0,t.jsx)(iY.Tr,{p:0,children:(0,t.jsx)(iJ.Td,{colSpan:2,p:0,children:(0,t.jsxs)(Y.K,{spacing:2,children:[(0,t.jsx)(eA.O,{h:8}),(0,t.jsx)(eA.O,{h:8}),(0,t.jsx)(eA.O,{h:8})]})})}),S&&S.map((e,i)=>{let s=i===S.length-1,a=i4(n.id,e.workspaceMemberships),o=null==a?void 0:a.createdTime,c=r(o),d=null==a?void 0:a.role,u=d===D.r3E.Admin,x=d?ib.rK[d].title:"",h=_===e.id,p=e.id===(null==E?void 0:E.id);return(0,t.jsxs)(iY.Tr,{children:[(0,t.jsx)(iJ.Td,{borderBottom:s?"0 none":void 0,children:(0,t.jsx)(i6,{user:e,isSelf:p})}
1),(0,t.jsx)(iJ.Td,{borderBottom:s?"0 none":void 0,whiteSpace:"nowrap",children:c}),(0,t.jsx)(iJ.Td,{borderBottom:s?"0 none":void 0,w:32,children:h?(0,t.jsx)(y.xu,{textAlign:"center",children:(0,t.jsx)(ec.$,{size:"xs"})}):l&&d?(0,t.jsx)(i5,{selected:d,isMenuDisabled:f||A,options:[D.r3E.Admin,D.r3E.Member],onSelect:J(e),disabledOptions:u&&V<=1?[{disabledOption:D.r3E.Member,reason:"A workspace must have at least one admin"}]:[],disabledDeleteReason:p?"You cannot remove yourself":void 0,onDeleteClick:Q(e)}):x})]},e.id)})]})]})}),I&&(0,t.jsx)(s.k,{w:"100%",justify:"center",align:"center",mt:3,children:(0,t.jsx)(eS.z,{isLoading:h,size:"sm",onClick:()=>{p(!0),v({variables:{after:null==k?void 0:k.endCursor}}).finally(()=>{p(!1)})},children:(0,t.jsx)(T.cC,{id:"yQ2kGp"})})}),M&&L&&(0,t.jsx)(i1,{isOpen:H,onClose:()=>{K(),G.reject(),W(new iR.B)},onCancelClick:()=>{K(),G.reject(),W(new iR.B)},onConfirmClick:async()=>{K(),G.resolve(),W(new iR.B)},userToConfirm:M,action:L,workspace:n})]})},i6=e=>{let{user:i,isSelf:n}=e,{displayName:s,profileImageUrl:r,email:l}=i;return(0,t.jsxs)(A.U,{children:[(0,t.jsx)(ew.q,{size:"sm",name:s,src:r}),(0,t.jsxs)(Y.K,{spacing:0,children:[(0,t.jsxs)(w.x,{children:[s,n?(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)(T.cC,{id:"4Q6lF1"})]}):""]}),(0,t.jsx)(A.U,{mt:1,children:(0,t.jsx)(w.x,{fontSize:"xs",color:"gray.500",children:l})})]})]})};var i9=n(829),i8=n.n(i9);let ne=e=>{let{invitations:i,dateFormatterFn:n,canManageWorkspace:s}=e,[r,l]=(0,u.useState)("email"),[a,o]=(0,u.useState)("asc"),[c]=(0,D.PZh)(),d=(0,eG.p)(),x=(0,ib.up)(),h=(0,u.useCallback)(e=>{c({variables:{id:e}}).then(()=>{d({title:eu.ag._({id:"DGxAzK"}),status:"success",duration:3e3,isClosable:!0,position:"bottom"})}).catch(e=>{console.error(e),d({title:eu.ag._({id:"s51CLN",values:{0:e.message}}),status:"error",isClosable:!0,position:"bottom"})})},[c,d]),p="asc"===a?i8()(i,r):i8()(i,r).reverse();return 0===p.length?(0,t.jsx)(y.xu,{p:4,background:"gray.50",children:(0,t.jsx)(w.x,{my:8,textAlign:"center",children:(0,t.jsx)(T.cC,{id:"blyObO"})})}):(0,t.jsx)(iK.x,{children:(0,t.jsxs)(iV.i,{variant:"simple",colorScheme:"blackAlpha",size:"sm",whiteSpace:"normal",children:[(0,t.jsx)(iq.h,{children:(0,t.jsxs)(iY.Tr,{children:[(0,t.jsx)(iX.Th,{children:(0,t.jsx)(eS.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{l("email"),o(e=>"asc"===e?"desc":"asc")},rightIcon:(0,t.jsx)(y.xu,{color:"email"===r?"gray.700":"gray.300",children:(0,t.jsx)(P.G,{icon:"email"===r?"asc"===a?$.eW2:$.l1h:$.CmM})}),children:(0,t.jsx)(T.cC,{id:"O3oNi5"})})}),(0,t.jsxs)(iX.Th,{children:[" ",(0,t.jsx)(eS.z,{ml:-3,size:"sm",color:"gray.500",variant:"ghost",colorScheme:"blackAlpha","aria-label":"sort",onClick:()=>{l("createdTime"),o(e=>"asc"===e?"desc":"asc")},rightIcon:(0,t.jsx)(y.xu,{color:"email"===r?"gray.700":"gray.300",children:(0,t.jsx)(P.G,{icon:"createdTime"===r?"asc"===a?$.eW2:$.l1h:$.CmM})}),children:(0,t.jsx)(T.cC,{id:"B82OLR"})})]}),(0,t.jsx)(iX.Th,{children:(0,t.jsx)(T.cC,{id:"GXsAby"})})]})}),(0,t.jsx)(iZ.p,{children:p&&(null==p?void 0:p.length)>0&&p.map((e,i)=>(0,t.jsxs)(iY.Tr,{children:[(0,t.jsx)(iJ.Td,{children:e.email}),(0,t.jsx)(iJ.Td,{children:n(e.createdTime)}),(0,t.jsx)(iJ.Td,{children:(0,t.jsx)(eO.kH,{placement:"top",label:(0,t.jsx)(T.cC,{id:"wcx9n8",values:{WORKSPACE_ADMIN_DISPLAY_NAME_PLURAL:x}}),shouldWrapChildren:!0,isDisabled:s,children:(0,t.jsx)(eS.z,{w:20,variant:"plain",color:"plain",size:"sm",isDisabled:!s,onClick:()=>{h(e.id)},children:(0,t.jsx)(T.cC,{id:"GXsAby"})})})})]},e.id))})]})})},ni=e=>{var i,n,s;let{isOpen:r,onClose:l}=e,{currentWorkspace:a}=(0,F.SE)(),o=(0,F.d3)(),{data:c}=(0,D.WaV)({variables:{id:null==a?void 0:a.id},skip:!(null==a?void 0:a.id)}),[d,x]=(0,u.useState)(()=>()=>Promise.resolve()),h=(null==c?void 0:null===(i=c.workspace)||void 0===i?void 0:i.invitations)||[],p=(0,u.useCallback)(()=>{d().then(l).catch(()=>{console.warn("[workspaceSettingsModal] InviteByEmail rejected to close modal")})},[d,l]);if(!a)return null;let m=null==c?void 0:null===(n=c.workspace)||void 0===n?void 0:n.memberCount;return(0,t.jsxs)(j.u_,{isOpen:r,onClose:p,size:"3xl",trapFocus:!1,children:[(0,t.jsx)(v.Z,{}),(0,t.jsxs)(C.h,{children:[(0,t.jsx)(f.x,{children:(0,t.jsx)(T.cC,{id:"Knd6gz"})}),(0,t.jsx)(b.o,{}),(0,t.jsx)(k.i,{mb:4}),(0,t.jsxs)(I.f,{children:[(0,t.jsx)(io.m,{segmentEvent:G.AA.GAMMA_PRO_UPSELL_CALLOUT_WORKSPACE_SETTINGS,onOpenCallback:p}
1),(0,t.jsx)(iy,{workspace:a,canManageWorkspace:o}),(0,t.jsx)(y.xu,{mt:12,children:(0,t.jsxs)(Y.K,{spacing:8,children:[(0,t.jsxs)(y.xu,{children:[(0,t.jsx)(ii.X,{size:"md",fontWeight:"600",mb:4,children:(0,t.jsx)(T.cC,{id:"KKJitJ"})}),(0,t.jsx)(iU,{workspace:a,canManageWorkspace:o,setDoneFn:x}),o&&(0,t.jsx)(iB,{workspace:a})]}),(0,t.jsx)(y.xu,{children:(0,t.jsxs)(it.m,{variant:"soft-rounded",size:"sm",children:[(0,t.jsxs)(is.t,{mb:4,children:[(0,t.jsxs)(ir.O,{children:[(0,t.jsx)(y.xu,{mr:2,children:(0,t.jsx)(P.G,{icon:$.iOm})}),(0,t.jsx)(T.cC,{id:"VJ7g+s",values:{memberCount:m}})]}),(0,t.jsxs)(ir.O,{children:[(0,t.jsx)(y.xu,{mr:2,children:(0,t.jsx)(P.G,{icon:N.FU$})}),(0,t.jsx)(T.cC,{id:"KxTWx3",values:{0:h.length}})]})]}),(0,t.jsxs)(il.n,{children:[(0,t.jsx)(ia.x,{p:0,mt:0,children:(0,t.jsx)(i7,{workspace:a,dateFormatterFn:iv.P9,canManageWorkspace:o,workspaceAdminCount:null==c?void 0:null===(s=c.workspace)||void 0===s?void 0:s.adminCount})}),(0,t.jsx)(ia.x,{p:0,mt:0,children:(0,t.jsx)(ne,{invitations:h,dateFormatterFn:iv.P9,canManageWorkspace:o})})]})]})})]})})]}),(0,t.jsx)(k.i,{mt:6}),(0,t.jsx)(E.m,{children:(0,t.jsxs)(Y.K,{w:"100%",direction:"row",align:"center",justifyContent:"space-between",children:[(0,t.jsx)(ij,{memberCount:m}),(0,t.jsx)(ed.L,{}),(0,t.jsx)(eW.h,{children:(0,t.jsx)(eS.z,{variant:"solid",onClick:p,children:(0,t.jsx)(T.cC,{id:"DPfwMq"})})})]})})]})]})};var nn=n(82089);let nt=e=>{let{openModal:i}=e,{currentWorkspace:n}=(0,F.SE)(),s=(0,eG.p)();(0,u.useEffect)(()=>{let e=(0,iH.SJ)()[F.f2],r=null==n?void 0:n.id;e&&r&&(e===r?i():s({title:(0,t.jsx)(T.cC,{id:"EhVOPs"}),position:"top",id:"workspace-not-found",status:"error",isClosable:!0,duration:3e3}),(0,nn.lO)({query:{...(0,iH.SJ)(),[F.f2]:void 0},emitChange:!1}))},[s,i,n])},ns=u.forwardRef((e,i)=>{let{children:n,dataTestId:s,isSelected:r,isDropActive:l,href:a,target:o,...c}=e;return(0,t.jsx)(eS.z,{ref:i,textDecoration:"none",variant:"ghost",w:"100%",size:"sm",colorScheme:"gray",as:q.r,borderRadius:"md",justifyContent:"flex-start","data-testid":s,_hover:{bgColor:r?"trueblue.50":"gray.100",textDecoration:"none"},color:r||l?"trueblue.500":"gray.600",bgColor:r||l?"trueblue.50":void 0,_active:{color:"trueblue.500",bgColor:"trueblue.200",textDecoration:"none"},py:1.5,mb:1,paddingInlineStart:2,fontWeight:r?"bold":"regular",href:a,target:o,...c,children:n})});ns.displayName="SidebarButton";var nr=n(20103),nl=n(91283),na=n(30579),no=n(99368),nc=n(35138),nd=n(62207);let nu=u.forwardRef((e,i)=>{let{tabKey:n,isSelected:s,isDropActive:r=!1,href:l,target:a,children:o,...c}=e;return(0,t.jsx)(J(),{href:l,passHref:!0,legacyBehavior:!0,children:(0,t.jsx)(ns,{ref:i,isSelected:s,isDropActive:r,dataTestId:"sidebar-".concat(n,"-tab").concat(s?"--selected":""),target:a,...c,children:o})})});nu.displayName="SidebarItem";let nx=e=>{let{icon:i,title:n,faClassName:s,w:r,badge:l}=e;return(0,t.jsxs)(A.U,{justify:"flex-start",w:"100%",pr:l?3:void 0,children:[i&&(0,t.jsx)(P.G,{icon:i,fixedWidth:!0,className:s||void 0,size:"1x"}),(0,t.jsx)(w.x,{textOverflow:"ellipsis",overflowX:"hidden",ml:2,w:r,children:n}),l&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ed.L,{}),l]})]})};var nh=n(64663);let np=e=>{let{isSelected:i,hasActivity:n}=e;return n&&N.V1P,i?na.l7:na.Ty},nm=e=>{let{activity:i,user:n}=e;if(!(null==i?void 0:i.activeUsers))return(0,t.jsx)(t.Fragment,{});let s=iN()(i.activeUsers,"id"),r=(0,no.Yc)(s,null==n?void 0:n.id);return(0,t.jsx)(eO.NL,{overflowTooltipLabel:eu.ag._({id:"25VyZX"}),position:"absolute",right:2,size:"xs",max:3,avatars:r.map(e=>{let{displayName:i,profileImageUrl:n,id:t}=e;return{name:i||"",id:t,profileImageUrl:n,color:"white",badge:{color:"green.500",size:"1em"}}}),onClick:e=>{e.preventDefault(),e.stopPropagation()}})},ng=e=>{var i,n;let{isPreview:s,channel:r,activeTab:l,currentChannelId:a,addDocToChannel:o,user:c}=e,d=(0,L.ye)("channelActivity"),[{canDrop:u,isOver:x},h]=(0,nr.L)(()=>({accept:nc.c,drop:e=>{o(e,r)},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})})),p=l===nh.f8.CHANNEL&&r.id===a,m=d&&!!((null==r?void 0:null===(i=r.activity)||void 0===i?void 0:i.activeUsers)&&(null==r?void 0:null===(n=r.activity)||void 0===n?void 0:n.activeUsers.length)>0),g=np({isSelected:p,hasActivity:m});return(0,t.jsxs)(nu,{ref:h,"data-testid":"sidebar-item",tabKey:"".concat(nh.f8.CHANNEL,"-").concat(r.id),isDropActive:x&&u,isSelected:p,href:(0,iH.j)({id:r.id,slug:r.slug}),opacity:s?"0.5":void 0,justifyContent:"space-between",w:"100%",children:[(0,t.jsx)(nx,{icon:g,title:r.name,faClassName:p&&m?"fa-beat-fade":void 0,w:"18ch"}),m&&(0,t.jsx)(nm,{activity:null==r?void 0:r.activity,user:c})]},r.id)},nj=e=>{let{channelPreview:i,channels:n,activeTab:s,currentChannelId:r,isChannelsLoading:l}=e,{user:a,currentWorkspace:o}=(0,F.SE)(),{isOpen:c,onClose:d,doc:u,handleAddDocToChannel:x,updateWorksp
1acePermissionThenAddToChannel:h}=(0,nl.bg)(),{isOpen:p,onOpen:g,onClose:j}=(0,ea.q)({id:"manageChannelsModalDisclosure"});return l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eA.O,{h:"30px",w:"100%"}),(0,t.jsx)(eA.O,{h:"30px",w:"100%"}),(0,t.jsx)(eA.O,{h:"30px",w:"100%"})]}):(0,t.jsxs)(y.xu,{"data-testid":"sidebar-channels",w:"100%",children:[(0,t.jsxs)(A.U,{justify:"space-between",children:[(0,t.jsx)(eO.NZ,{textAlign:"left",mt:4,mb:3,paddingInlineStart:1,children:(0,t.jsx)(T.cC,{id:"HSh8u/"})}),(0,t.jsx)(eO.kH,{label:(0,t.jsx)(T.cC,{id:"Mxy55o"}),children:(0,t.jsx)(eo.h,{"aria-label":eu.ag._({id:"Mxy55o"}),size:"xs",isRound:!0,variant:"plain",icon:(0,t.jsx)(P.G,{icon:N.r8p}),onClick:g})})]}),i&&(0,t.jsx)(ng,{isPreview:!0,channel:i,activeTab:s,currentChannelId:r,addDocToChannel:x,user:a},i.id),n.map(e=>(0,t.jsx)(ng,{channel:e,activeTab:s,currentChannelId:r,addDocToChannel:x,user:a},e.id)),0===n.length&&(0,t.jsxs)(y.xu,{bgColor:"gray.50",textAlign:"center",p:4,mb:2,children:[(0,t.jsx)(w.x,{fontSize:"sm",children:(0,t.jsx)(T.cC,{id:"4G3U4C",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.aq}})}),(0,t.jsx)(w.x,{fontSize:"sm",mt:2,fontWeight:"bold",children:(0,t.jsx)(q.r,{color:"trueblue.600",href:"#",onClick:g,children:(0,t.jsx)(T.cC,{id:"Mxy55o"})})})]}),(0,t.jsx)(nd.l,{isOpen:p,onClose:j,workspaceId:null==o?void 0:o.id}),c&&(0,t.jsx)(nl.zx,{doc:u,onSubmit:h,onClose:d})]})},nv=e=>{let{setIsSidebarVisible:i}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Y.K,{pt:2,children:[(0,t.jsx)(e9,{}),(0,t.jsx)(y.xu,{display:{sm:"lg",md:"none"},children:(0,t.jsx)(eo.h,{"aria-label":"Close Sidebar",size:"sm",variant:"ghost",icon:(0,t.jsx)(P.G,{icon:N.NBC}),onClick:()=>i(!1)})}),(0,t.jsx)(eA.O,{w:"100%",height:"36px"})]}),(0,t.jsx)(eA.O,{w:"100%",height:"30px",mt:4}),(0,t.jsx)(eA.O,{w:"100%",height:"20px",mt:8}),(0,t.jsx)(eA.O,{w:"100%",height:"30px",mt:4}),(0,t.jsx)(eA.O,{w:"100%",height:"30px",mt:2}),(0,t.jsx)(eA.O,{w:"100%",height:"30px",mt:2}),(0,t.jsx)(ed.L,{}),(0,t.jsx)(s.k,{justify:"center",align:"flex-end",children:(0,t.jsx)(y.xu,{w:"30px",children:ex.TR})})]})},nC=e=>{let{channelPreview:i,isSidebarVisible:n,setIsSidebarVisible:r,isReady:l,activeTab:a,currentChannelId:o,channels:c,isChannelsLoading:d}=e,u=(0,L.ye)("intercom"),x=(0,L.ye)("shareFeedback"),h=(0,eb.fg)(),{product:p}=(0,ev.z)(),m=(0,ey.CG)(ep.Lj),j=(0,eg.G)(),v=(0,F.d3)(),{isOpen:C,onOpen:f,onClose:b}=(0,ea.q)({id:"workspace-settings-modal"}),{isOpen:A,onOpen:_,onClose:w}=(0,ea.q)({id:"ai-credits-modal"});nt({openModal:f});let I=(0,L.ye)("workspaceSettings");return(0,t.jsxs)(s.k,{direction:"column",zIndex:"overlay",h:"100vh",position:{base:"fixed",md:"sticky"},top:0,w:"300px",minW:"300px",bg:"white",shadow:{base:n?"xl":"none",md:"none"},transform:n?{base:"translate(0,0px)",md:"translate(0,0)"}:{base:"translate(-100%,0px)",md:"translate(0,0)"},transition:"transform .2s ease",children:[(0,t.jsx)(s.k,{overflowY:"auto",h:"100vh",p:6,pt:2,pb:4,direction:"column",alignContent:"space-between",children:l?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Y.K,{children:[(0,t.jsx)(s.k,{alignItems:"flex-start",justify:"flex-end",children:(0,t.jsx)(y.xu,{display:{base:"block",md:"none"},children:(0,t.jsx)(eo.h,{size:"sm","aria-label":eu.ag._({id:"62Ciis"}),variant:"ghost",icon:(0,t.jsx)(el.T,{w:3}),onClick:()=>r(!1),isRound:!0})})}),(0,t.jsx)(ie,{onOpen:f}),(0,t.jsx)(g.Pu,{})]}),(0,t.jsx)(nf,{channelPreview:i,activeTab:a,currentChannelId:o,channels:c,isChannelsLoading:d}),(0,t.jsx)(y.xu,{w:"100%",pt:1,pb:3,children:(0,t.jsx)(k.i,{})}),v&&(0,t.jsx)(ns,{dataTestId:"invite-to-workspace",onClick:()=>{f()},children:(0,t.jsx)(nx,{icon:N.FKd,title:(0,t.jsx)(T.cC,{id:"qVqqmP"})})}),!1===h&&(0,t.jsx)(ns,{dataTestId:"ai-user-credits",onClick:_,children:(0,t.jsx)(nx,{icon:N.owJ,title:null===m?(0,t.jsx)(ec.$,{size:"xs"}):(0,t.jsx)(T.cC,{id:"IniQ/K",values:{availableCredits:m}})})}),I&&(0,t.jsx)(nu,{tabKey:nh.oc.SETTINGS,isSelected:a===nh.oc.SETTINGS,href:"/".concat(nh.oc.SETTINGS),children:(0,t.jsx)(nx,{icon:nh.A5[nh.oc.SETTINGS].icon,title:nh.A5[nh.oc.SETTINGS].displayName})}),u&&(0,t.jsx)(ns,{dataTestId:"contact-button",onClick:j,children:(0,t.jsx)(nx,{icon:N.sNQ,title:(0,t.jsx)(T.cC,{id:"mpby9d"})})}),!u&&(0,t.jsx)(ns,{dataTestId:"contact-button",href:"mailto:".concat(em.p),children:(0,t.jsx)(nx,{icon:N.FU$,title:(0,t.jsx)(T.cC,{id:"A0C9La"})})}),x&&(0,t.jsx)(ns,{dataTestId:"feedback-button",href:"https://ideas.gamma.app/ideas",target:"_blank",children:(0,t.jsx)(nx,{icon:N.OH3,title:(0,t.jsx)(T.cC,{id:"u5hSeG"})})}),(0,t.jsx)(ed.L,{}),null===p?(0,t.jsx)(ef,{}):(0,t.jsx)(s.k,{justify:"center",align:"flex-end",width:"100%",my:6,children:(0,t.jsx)(y.xu,{fontSize:"12px",width:"30px",children:ex.TR})})]}):(0,t.jsx)(nv,{setIsSidebarVisible:r})}),(0,t.jsx)(ni,{isOpen:C,onClose:b}),(0,t.jsx)(eh.H,{isOpen:A,onClose:w,credits:m,onOpen:_})]})},nf=e=>{let{channelPreview:i,activeTab:n,currentChannelId:s,channels:r,isChannelsLoading:l}=e,a=(0,L.ye)("customFonts"),o=(0,eb._O)();return(0,t.jsxs)(_.g,{"data-testid":"sidebar-tablist",mt:4,mb:2,w:"100%",spacing:1,children:[(0,t.jsxs)(Y.K,{spacing:0,w:"100%",children:[(0,t.jsx)(nu,{tabKey:nh.oc.ALL,isSelected:n===nh.oc.ALL,href:"/#".concat(nh.oc.ALL),children:(0,t.jsx)(nx,{icon:nh.A5[nh.oc.ALL].icon,title:nh.A5[nh.oc.ALL].displayName})}),o&&(0,t.jsx)(nu,{pr:-1,tabKey:nh.oc.SITES,isSelected:n===nh.oc.SITES,href:"/#".concat(nh.oc.SITES),children:(0,t.jsx)(nx,{icon:nh.A5[nh.oc.SITES].icon,title:nh.A5[nh.oc.SITES].displayName,badge:(0,t.jsx)(X.C,{colorScheme:"green",lineHeight:"normal",fontSize:"xxs",children:(0,t.jsx)(T.cC,{id:"YBt9YP"})})})})]}),(0,t.jsx)(nj,{channelPreview:i,isChannelsLoading:l,channels:r,currentChannelId:s,activeTab:n}),(0,t.jsx)(y.xu,{w:"100%",pt:1,pb:2,children:(0,t.jsx)(k.i,{})}),!(0,H.s2)()&&(0,t.jsx)(nu,{tabKey:nh.oc.TEMPLATES,isSelected:n===nh.oc.TEMPLATES,href:"/#".concat(nh.oc.TEMPLATES),children:(0,t.jsx)(nx,{icon:nh.A5[nh.oc.TEMPLATES].icon,title:nh.A5[nh.oc.TEMPLATES].displayName})}),(0,t.jsx)(nu,{tabKey:nh.oc.INSPIRATION,isSelected:n===nh.oc.INSPIRATION,href:"/#".concat(nh.oc.INSPIRATION),children:(0,t.jsx)(nx,{icon:nh.A5[nh.oc.INSPIRATION].icon,title:nh.A5[nh.oc.INSPIRATION].displayName})}),!(0,H.s2)()&&(0,t.jsx)(nu,{tabKey:nh.oc.THEMES,isSelected:n===nh.oc.THEMES,href:"/#".concat(nh.oc.THEMES),children:(0,t.jsx)(nx,{icon:nh.A5[nh.oc.THEMES].icon,title:nh.A5[nh.oc.THEMES].displayName})}),a&&!(0,H.s2)()&&(0,t.jsx)(nu,{tabKey:nh.oc.FONTS,isSelected:n===nh.oc.FONTS,href:"/#".concat(nh.oc.FONTS),children:(0,t.jsx)(nx,{icon:nh.A5[nh.oc.FONTS].icon,title:nh.A5[nh.oc.FONTS].displayName})}),(0,t.jsx)(nu,{tabKey:nh.oc.TRASH,isSelected:n===nh.oc.TRASH,href:"/#".concat(nh.oc.TRASH),children:(0,t.jsx)(nx,{icon:nh.A5[nh.oc.TRASH].icon,title:nh.A5[nh.oc.TRASH].displayName})})]})};var nb=n(17324),ny=n(57474);let nA=()=>{let{onClose:e,onOpen:i,isOpen:n}=(0,ea.q)(),{user:r,isUserLoading:l}=(0,F.SE)(),a=!!(r&&!l&&!r.jobFunction);return((0,u.useEffect)(()=>{a&&setTimeout(i,1e3)},[a,i]),n)?(0,t.jsxs)(j.u_,{isOpen:n,onClose:e,closeOnEsc:!1,closeOnOverlayClick:!1,size:"lg",children:[(0,t.jsx)(v.Z,{}),(0,t.jsxs)(C.h,{children:[(0,t.jsx)(f.x,{children:(0,t.jsx)(T.cC,{id:"H8aFPr"})}),(0,t.jsx)(I.f,{children:(0,t.jsxs)(Y.K,{children:[(0,t.jsx)(s.k,{height:32,justifyContent:"center",background:"radial-gradient(circle at center, var(--chakra-colors-pink-200) 0, var(--chakra-colors-salmon-200) 110%)",borderRadius:"md",pt:4,px:4,children:(0,t.jsx)(eV.E,{src:ny.Z.src,alt:"Sal floating on a pink gradient"})}),(0,t.jsx)(w.x,{fontSize:"lg",pb:0,pt:4,children:(0,t.jsx)(T.cC,{id:"arCM97"})}),(0,t.jsxs)(w.x,{fontSize:"sm",color:"gray.500",textAlign:"center",children:["(",(0,t.jsx)(T.cC,{id:"H50C1I"})," ",(0,t.jsx)("span",{role:"img","aria-label":"stopwatch",children:"⏱"}),")"]}),(0,t.jsx)(nb.a,{context:"modal",onSuccess:e})]})})]})]}):(0,t.jsx)(t.Fragment,{})},n_={fontWeight:"bold",backgroundImage:"linear-gradient(50deg, #F658A8, #ff5b8a 49%, #ff5b8a 53%, #ff5b8a 55%, #fba64b 77%, #f99b52)",backgroundClip:"text",color:"transparent"},nw=()=>(0,t.jsx)(s.k,{bg:"#1A013F",direction:"column",mb:4,children:(0,t.jsxs)(s.k,{py:4,px:8,direction:["column","row"],children:[(0,t.jsxs)(Y.K,{mr:[0,4],children:[(0,t.jsx)(w.x,{fontSize:"xl",sx:n_,children:"Meet Gamma, the fast alternative to slides"}),(0,t.jsx)(w.x,{color:"gray.200",children:"Write like a doc, present like a deck."})]}),(0,t.jsx)(ed.L,{}),(0,t.jsxs)(A.U,{mt:[2,0],children:[(0,t.jsx)(eS.z,{as:"a",href:"/signup",children:"Make your own"}),(0,t.jsx)(eS.z,{as:"a",cursor:"pointer",variant:"ghost",colorScheme:"whiteAlpha",onClick:()=>{window.location.href="".concat(ez.v.API_HOST,"/logout")},children:"Sign out"})]})]})});var nk=n(46929);let nI=e=>{let{children:i}=e,{user:n,activeTab:r,userHasNoWorkspaces:l,currentChannelId:a,channelPreview:c,channels:u,isChannelsLoading:j,isSidebarVisible:v,setIsSidebarVisible:C}=(0,nk.J)();return(0,t.jsxs)(x.W,{backend:h.PD,children:[(0,t.jsxs)(s.k,{"data-testid":"home",width:"100%",height:"100%",position:"relative",children:[(0,t.jsx)(d(),{children:(0,t.jsx)("title",{children:r?"".concat(nh.A5[r].ariaLabel," - ").concat(m.N6):"".concat(m.N6)})}),(0,t.jsx)(g.H9,{}),(0,t.jsx)(en,{}),l?null:(0,t.jsx)(nC,{channelPreview:c,isSidebarVisible:v,setIsSidebarVisible:C,user:n,isReady:!!n,activeTab:r,currentChannelId:a,channels:u,isChannelsLoading:j}),(0,t.jsxs)(s.k,{"data-testid":"doc-root-main",flex:"1",px:l?0:(0,H.s2)()?2:6,py:l?0:(0,H.s2)()?2:6,w:"calc(100vw - 300px - var(--chakra-sizes-4))",bg:"gray.100",borderTopLeftRadius:"15p
1x",borderBottomLeftRadius:"15px",direction:"column",marginLeft:{base:"0"},minH:"var(--100vh)",pb:"10em",transition:"margin .2s ease",children:[l&&(0,t.jsx)(nw,{}),(0,t.jsx)(o.W,{maxW:"80em",p:(0,H.s2)()?2:void 0,h:"100%",children:i})]})]}),(0,t.jsx)(p.C,{showShortcuts:!1}),(0,t.jsx)(nA,{})]})},nS=e=>{let{children:i}=e;return(0,t.jsxs)(s.k,{width:"100%",height:"100%",direction:"column",minHeight:"var(--100vh)",bgColor:"gray.100",color:"gray.800",p:0,children:[(0,t.jsx)(r.xB,{styles:{body:{overflowY:"scroll"}}}),(0,t.jsx)(l.r,{}),(0,t.jsx)(a.Ad,{children:(0,t.jsx)(nI,{children:i})})]})};function nE(e){let i=i=>(0,t.jsx)(nS,{children:(0,t.jsx)(e,{...i})});return"getInitialProps"in e&&(i.getInitialProps=e.getInitialProps),i}},35138:function(e,i,n){"use strict";n.d(i,{c:function(){return t}});let t="ChannelDocDragItemType"},90439:function(e,i,n){"use strict";n.d(i,{Oj:function(){return a},Pv:function(){return l},QX:function(){return r},cx:function(){return s}});var t=n(14274);let s=t.v.GAMMA_PUPPETEER_SERVICE,r=s&&"pptx"===window.format,l=s&&"pdf"===window.format,a=s&&"screenshot"===window.format},7e4:function(e,i,n){"use strict";n.d(i,{X:function(){return r}});var t=n(2784),s=n(18733);function r(e,i){let[n,r]=(0,t.useState)(()=>{try{let n=s.Q.getItem(e);if(null===n)return i;return JSON.parse(n)}catch(e){return console.error("[useSessionStorage.getItem] Error getting sessionStorage item",e),i}}),l=(0,t.useCallback)(i=>{try{s.Q.setItem(e,JSON.stringify(i)),r(i)}catch(e){console.error("[useSessionStorage.setItem] Error setting sessionStorage item",e)}},[e]);return[n,l]}},62376:function(){},6991:function(){},76298:function(){},4466:function(){},43839:function(){},73481:function(e,i,n){"use strict";n.d(i,{P:function(){return x}});var t=n(31053),s=n(68023),r=n(76801),l=n(52322),a=(0,s.G)(function(e,i){let{children:n,placeholder:s,className:a,...o}=e;return(0,l.jsxs)(r.m.select,{...o,ref:i,className:(0,t.cx)("chakra-select",a),children:[s&&(0,l.jsx)("option",{value:"",children:s}),n]})});a.displayName="SelectField";var o=n(76874),c=n(91982),d=n(84586),u=n(2784),x=(0,s.G)((e,i)=>{var n;let s=(0,c.jC)("Select",e),{rootProps:u,placeholder:x,icon:h,color:p,height:g,h:j,minH:v,minHeight:C,iconColor:f,iconSize:b,...y}=(0,d.Lr)(e),[A,_]=function(e,i){let n={},t={};for(let[s,r]of Object.entries(e))i.includes(s)?n[s]=r:t[s]=r;return[n,t]}(y,d.oE),w=(0,o.Y)(_),k={paddingEnd:"2rem",...s.field,_focus:{zIndex:"unset",...null==(n=s.field)?void 0:n._focus}};return(0,l.jsxs)(r.m.div,{className:"chakra-select__wrapper",__css:{width:"100%",height:"fit-content",position:"relative",color:p},...A,...u,children:[(0,l.jsx)(a,{ref:i,height:null!=j?j:g,minH:null!=v?v:C,placeholder:x,...w,__css:k,children:e.children}),(0,l.jsx)(m,{"data-disabled":(0,t.PB)(w.disabled),...(f||p)&&{color:f||p},__css:s.icon,...b&&{fontSize:b},children:h})]})});x.displayName="Select";var h=e=>(0,l.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,l.jsx)("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),p=(0,r.m)("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),m=e=>{let{children:i=(0,l.jsx)(h,{}),...n}=e,t=(0,u.cloneElement)(i,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return(0,l.jsx)(p,{...n,className:"chakra-select__icon-wrapper",children:(0,u.isValidElement)(i)?t:null})};m.displayName="SelectIcon"},74902:function(e,i,n){"use strict";n.d(i,{m:function(){return r}});var t=n(72338),s=n(80722);let r=t.hj.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[(0,s.q)(this.options)]}})}},function(e){e.O(0,[9774,7662,8433,2182,2812,8774,6694,4078,3273,9025,5333,4424,8707,146,3661,3016,2545,9808,5112,3693,931,2808,4328,205,8271,2252,1537,6656,2681,8794,9718,4001,2888,179],function(){return e(e.s=24994)}),_N_E=e.O()}]);
2//# sourceMappingURL=settings-6dce51fb70c412c8.js.map

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.