https://truvarin-ipcgxyw.gamma.site/_next/static/chunks/pages/sandbox/[pageName]-05eacc4e290b3cd0.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2288,4792,4661],{64173:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var i=n(63761),r=n(42765),a=n(66700),o=n(19785);function l(e,t){if((0,o.Z)(2,arguments),!t||"object"!=typeof t)return new Date(NaN);var n="years"in t?(0,r.Z)(t.years):0,l="months"in t?(0,r.Z)(t.months):0,s="weeks"in t?(0,r.Z)(t.weeks):0,d="days"in t?(0,r.Z)(t.days):0,c="hours"in t?(0,r.Z)(t.hours):0,u="minutes"in t?(0,r.Z)(t.minutes):0,h="seconds"in t?(0,r.Z)(t.seconds):0,m=(0,a.Z)(e),p=l||n?function(e,t){(0,o.Z)(2,arguments);var n=(0,a.Z)(e),i=(0,r.Z)(t);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),s=new Date(n.getTime());return(s.setMonth(n.getMonth()+i+1,0),l>=s.getDate())?s:(n.setFullYear(s.getFullYear(),s.getMonth(),l),n)}(m,l+12*n):m,g=d||s?(0,i.Z)(p,d+7*s):p;return new Date(g.getTime()+1e3*(h+60*(u+60*c)))}},88807:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/sandbox/[pageName]",function(){return n(96475)}])},38095:function(e,t){"use strict";t.Z={src:"/_next/static/media/Sal-Spray.5abcbf19.svg",height:1657,width:2161,blurWidth:0,blurHeight:0}},99309:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{noSSR:function(){return o},default:function(){return l}});let i=n(43219),r=(n(2784),i._(n(70220)));function a(e){return{default:(null==e?void 0:e.default)||e}}function o(e,t){return delete t.webpack,delete t.modules,e(t)}function l(e,t){let n=r.default,i={loading:e=>{let{error:t,isLoading:n,pastDelay:i}=e;return null}};e instanceof Promise?i.loader=()=>e:"function"==typeof e?i.loader=e:"object"==typeof e&&(i={...i,...e}),i={...i,...t};let l=i.loader;return(i.loadableGenerated&&(i={...i,...i.loadableGenerated},delete i.loadableGenerated),"boolean"!=typeof i.ssr||i.ssr)?n({...i,loader:()=>null!=l?l().then(a):Promise.resolve(a(()=>null))}):(delete i.webpack,delete i.modules,o(n,i))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},38437:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return a}});let i=n(43219),r=i._(n(2784)),a=r.default.createContext(null)},70220:function(e,t,n){"use strict";/** 2@copyright (c) 2017-present James Kyle <[email protected]> 3 MIT License 4 Permission is hereby granted, free of charge, to any person obtaining 5a copy of this software and associated documentation files (the 6"Software"), to deal in the Software without restriction, including 7without limitation the rights to use, copy, modify, merge, publish, 8distribute, sublicense, and/or sell copies of the Software, and to 9permit persons to whom the Software is furnished to do so, subject to 10the following conditions: 11 The above copyright notice and this permission notice shall be 12included in all copies or substantial portions of the Software. 13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 14EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 15MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 16NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 17LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 18OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 19WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE 20*/Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return m}});let i=n(43219),r=i._(n(2784)),a=n(38437),o=[],l=[],s=!1;function d(e){let t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then(e=>(n.loading=!1,n.loaded=e,e)).catch(e=>{throw n.loading=!1,n.error=e,e}),n}class c{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e}
20,this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function u(e){return function(e,t){let n=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),i=null;function o(){if(!i){let t=new c(e,n);i={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return i.promise()}if(!s){let e=n.webpack?n.webpack():n.modules;e&&l.push(t=>{for(let n of e)if(t.includes(n))return o()})}function d(e,t){!function(){o();let e=r.default.useContext(a.LoadableContext);e&&Array.isArray(n.modules)&&n.modules.forEach(t=>{e(t)})}();let l=r.default.useSyncExternalStore(i.subscribe,i.getCurrentValue,i.getCurrentValue);return r.default.useImperativeHandle(t,()=>({retry:i.retry}),[]),r.default.useMemo(()=>{var t;return l.loading||l.error?r.default.createElement(n.loading,{isLoading:l.loading,pastDelay:l.pastDelay,timedOut:l.timedOut,error:l.error,retry:i.retry}):l.loaded?r.default.createElement((t=l.loaded)&&t.default?t.default:t,e):null},[e,l])}return d.preload=()=>o(),d.displayName="LoadableComponent",r.default.forwardRef(d)}(d,e)}function h(e,t){let n=[];for(;e.length;){let i=e.pop();n.push(i(t))}return Promise.all(n).then(()=>{if(e.length)return h(e,t)})}u.preloadAll=()=>new Promise((e,t)=>{h(o).then(e,t)}),u.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let n=()=>(s=!0,t());h(l,e).then(n,n)})),window.__NEXT_PRELOADREADY=u.preloadReady;let m=u},71537:function(e,t,n){"use strict";n.d(t,{z:function(){return eh}});var i=n(52322);n(98248),n(61219);var r=n(55671),a=n(62202),o=n(18200),l=n(81674),s=n(94523),d=n(97729),c=n.n(d),u=n(5632),h=n(2784),m=n(43997),p=n(14274),g=n(93202),x=n(2013);let f=e=>{let t=["malformed","encoded","illegal"];return e.includes("URIError")&&e.split(" ").some(e=>t.includes(e))};class v extends h.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,t){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 t=this.props.unhandledRejectionFilter(e);if(t){var n;let t=(null===(n=e.reason)||void 0===n?void 0:n.message)||"";this.setState({hasError:!0,errMessage:t})}}render(){let e=!0===f(this.state.errMessage)?{opacity:"0.65",starOverlay:!1}:{};return(0,i.jsxs)(i.Fragment,{children:[this.state.hasError&&(0,i.jsx)(x.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 t;return!!f((null===(t=e.reason)||void 0===t?void 0:t.message)||"")||e.reason instanceof g.YBv&&!1===document.hidden||e.reason instanceof g.R5s}},n(61036),n(62376),n(6991),n(76298),n(4466),n(43839),n(40917);var b=n(11050),j=n(42005);let y=()=>{let e=(0,h.useRef)(!1),t=(0,h.useRef)(new Map);(0,h.useEffect)(()=>{if("production"!==p.v.APPLICATION_ENVIRONMENT)return;let n=()=>{if(e.current)return;let n=t.current.get("total"),i=t.current.get("notTrusted"),r=i/n>.5;r&&n>5&&(e.current=!0,j.c.track(b.xW.NOT_TRUSTED_EVENTS_DETECTED,{totalEvents:n,notTrustedEvents:i}))},i=e=>{e.isTrusted||t.current.set("notTrusted",(t.current.get("notTrusted")||0)+1),t.current.set("total",(t.current.get("total")||0)+1),n()};return document.addEventListener("paste",i,{capture:!0}),document.addEventListener("mousedown",i,{capture:!0}),document.addEventListener("keydown",i,{capture:!0}),()=>{document.removeEventListener("paste",i,{capture:!0}),document.removeEventListener("mousedown",i,{capture:!0}),document.removeEventListener("keydown",i,{capture:!0})}},[])};var C=n(79254),_=n(27354),E=n(42111),k=n(32019),w=n(99092),I=n(36651);let S=(e,t)=>{w.H.init(p.v.HIGHLIGHT_PROJECT_ID,{environment:p.v.APPLICATION_ENVIRONMENT,sessionShortcut:!!t&&"shift+command+0",enableStrictPrivacy:e,enableSegmentIntegration:!0,networkRecording:{enabled:!0,recordHeadersAndBody:!0}}),b.co.loadSdkPromise.then(e=>{e&&e.addSourceMiddleware(w.LZ)})},T=e=>{let{children:t}=e,{user:n,anonymousUser:r,isGammaOrgUser:a,isUserLoading:o}=(0,I.SE)(),{enabled:l,enableStrictPrivacy:s}=(0,E.ye)("highlight");return(0,h.useEffect)(()=>{l&&!o&&n&&S(s,a)},[s,l,a,o,n]),(0,h.useEffect)(()=>
20{if(!o){if(n){let{id:e,displayName:t,email:i,profileImageUrl:r}=n;w.H.identify(e,{highlightDisplayName:t,email:i,avatar:r})}else if(null==r?void 0:r.id){let{id:e,displayName:t}=r;w.H.identify("",{anonDisplayName:t||"",anonId:e})}}},[n,r,o]),(0,i.jsx)(i.Fragment,{children:t})};var A=n(34881),N=n(87254),P=n(5879),M=n(44754);let O=e=>{let{children:t}=e;return(0,M.b)(),(0,i.jsx)(P.bd,{i18n:N.ag,children:t})};var R=n(18875),D=n(17292),F=n(55478),U=n(76332),L=n(6912),H=n(27902),z=n(21733),G=n(78462),B=n(72354),W=n(1163),V=n(2953);let K="get-gamma-pro",q=e=>{var t,n;let{children:r}=e,{currentWorkspace:a,isUserLoading:o}=(0,z.SE)(),[l,s]=(0,h.useState)(!1),d=(0,H.z$)(),c=(0,E.ye)("upsellUXEnabled_Pro"),{data:u,refetch:m}=(0,U.FaU)({variables:{workspaceId:null==a?void 0:a.id,includeExpired:!0},skip:!(null==a?void 0:a.id)}),p=null==u?void 0:u.subscription;(0,L.ET)({subscription:p,workspace:a,autoLaunch:!0});let{data:g}=(0,U.kNl)({variables:{workspaceId:null==a?void 0:a.id},skip:!a}),x=null==g?void 0:null===(t=g.products)||void 0===t?void 0:t.find(e=>"pro"===e.key),f=null==x?void 0:null===(n=x.prices)||void 0===n?void 0:n.find(e=>e.frequencyUnit===U.C_B.Year),v=(0,W.K9)(a),{isOpen:b,onOpen:j,onClose:y}=(0,F.q)({id:"upsell-modal"}),C=(0,h.useRef)(null),_=(0,h.useCallback)(e=>{let{onOpenCallback:t,onCloseCallback:n,insufficientCreditsWarning:i,segmentEvent:r}=e;c&&(s(!!i),null==t||t(),j(),null==d||d.track(r),C.current=n||null)},[d,j,c]),k=(0,h.useCallback)(()=>{var e;null==C||null===(e=C.current)||void 0===e||e.call(C),y(),C.current=null,s(!1)},[y]),[w,I]=(0,h.useState)({openUpsellModal:_,product:v,subscription:p,proYearlyProductPrice:f});return(0,h.useEffect)(()=>{let e="true"===(0,G.SJ)()[K];e&&!o&&a&&(j(),(0,A.lO)({query:{...(0,G.SJ)(),[K]:void 0},emitChange:!1}))},[j,a,o]),(0,h.useEffect)(()=>{I({openUpsellModal:_,refetchSubscription:m,product:v,subscription:p,proYearlyProductPrice:f})},[_,v,p,f,m]),(0,i.jsxs)(V.P.Provider,{value:w,children:[r,(0,i.jsx)(B.b,{insufficientCreditsWarning:l,isUpsellModalOpen:b,closeUpsellModal:k}),(0,i.jsx)(L.S1,{})]})};var Y=n(99268),Z=n(25944),X=n(19902);let Q="no_org_id",J=e=>{let{children:t}=e;(0,Z.iZ)();let{user:n,anonymousUser:r,currentWorkspace:a,isUserLoading:o}=(0,I.SE)();return(0,h.useEffect)(()=>{let e=(0,X.K)();(0,Y.$n)(e.get()),e.fetch().then(Y.$n).catch(()=>{})},[]),(0,h.useEffect)(()=>{let e;if(!o){if(n){let{id:t,email:i}=n,r=!!i&&i.endsWith("@gamma.app"),o=(null==a?void 0:a.id)||Q;e={userId:t,isGammaUser:r,userOrgId:o,anonymousUser:!1,gammaUserFirstName:r?n.firstName:""}}else e={userId:"anonymous_user",isGammaUser:!1,userOrgId:Q,anonymousUser:!0,gammaUserFirstName:""};(0,Y.$n)(e)}},[o,n,r,a]),(0,i.jsx)(i.Fragment,{children:t})};var $=n(54839),ee=n(91994),et=n(89311),en=n(95426),ei=n(1198),er=n(90221),ea=n(60742),eo=n(13265),el=n(90383);l.vc.autoAddCss=!1;let es=(0,ee.bh)(),ed=(0,g.RqP)(),ec=(0,g.PGq)(),eu=(0,a.B1)(s.qZ,{styles:{global:{".ProseMirror":{outline:"0 none"}}}});((e,t)=>{let n=(0,$.I)({theme:t});e.globalToast=n})(window,eu),(0,ea.Lq)(),D.F7.initialize(),(0,A.lt)(),b.co.init(),(0,R.S1)(),(0,_.u7)(),(0,en.a)("appMainBundleLoaded"),console.log("\uD83D\uDE80 GammaApp main wrapper imported"),E.VH.get("debugLogging")||(window.console.debug=()=>{});let eh=e=>function(t){return(0,i.jsx)(em,{children:(0,i.jsx)(e,{...t})})},em=e=>{let{children:t}=e;console.log("\uD83D\uDE80 GammaApp main wrapper rendered");let n=(0,u.useRouter)();(0,et.l)(),(0,eo.k)(),y(),(0,h.useEffect)(()=>{let e=(e,t)=>{let{shallow:n}=t;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 a=(0,ei.aY)();return(0,i.jsx)(m.zt,{store:es,children:(0,i.jsx)(O,{children:(0,i.jsx)(o.x,{theme:eu,resetCSS:!0,children:(0,i.jsx)(v,{children:(0,i.jsx)(r.e,{client:ed,children:(0,i.jsxs)(g.mdV,{client:ec,children:[(0,i.jsx)(eg,{}),(0,i.jsx)(C.H6,{}),(0,i.jsx)(R.GQ,{}),(0,i.jsxs)(I.fS,{children:[(0,i.jsx)(H.qA,{children:(0,i.jsx)(E.dF,{children:(0,i.jsx)(q,{children:(0,i.jsx)(g.Imj,{children:(0,i.jsx)(J,{children:(0,i.jsx)(T,{children:(0,i.jsx)(ei.dv,{value:a,children:(0,i.jsx)(k.u,{children:t})})})})})})})}),(0,i.jsx)(E.MG,{})]})]})})})})})})},ep="A new medium for presenting ideas, powered by AI. Beautiful, engaging content with none of the formatting and design work.",eg=()=>{let e=p.v.APPLICATION_ENVIRONMENT;return(0,i.jsxs)(c(),{children:[(0,i.jsx)("title",{children:"Gamma"}),(0,i.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0, viewport-fit=cover"}),(0,i.jsx)("link",{rel:"manifest",href:"/manifest.json"}),(0,i.jsx)("link",{rel:"shortcut icon",href:"production"===e?"/fav
20icons/favicon-transparent-96x96.png":"staging"===e?"/favicons/favicon_staging.jpg":"/favicons/favicon_local.jpg"}),(0,i.jsx)("meta",{content:ep,name:"description"},"description"),(0,i.jsx)("meta",{content:"Gamma",property:"og:title"},"og:title"),(0,i.jsx)("meta",{content:ep,property:"og:description"},"og:description"),(0,i.jsx)("meta",{content:p.v.OG_IMAGE_URL,property:"og:image"},"og:image"),(0,i.jsx)("meta",{content:"Gamma",property:"twitter:title"},"twitter:title"),(0,i.jsx)("meta",{content:ep,property:"twitter:description"},"twitter:description"),(0,i.jsx)("meta",{content:p.v.OG_IMAGE_URL,property:"twitter:image"},"twitter:image"),(0,i.jsx)("meta",{property:"og:type",content:"website"},"og:type"),(0,i.jsx)("meta",{content:"summary_large_image",name:"twitter:card"},"twitter:card"),(0,i.jsx)("link",{href:"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900",rel:"stylesheet"}),(0,i.jsx)("link",{rel:"stylesheet",href:"https://use.typekit.net/tiw2cwq.css"}),!(0,er.l6)()&&!(0,el.wg)()&&(0,i.jsx)("script",{async:!0,src:"https://cdn.optimizely.com/js/20579410255.js"}),(0,i.jsx)("script",{src:"//cdn.iframe.ly/embed.js",async:!0,charSet:"utf-8"})]})}},60510:function(e,t,n){"use strict";n.d(t,{r:function(){return R},h:function(){return D}});var i=n(52322),r=n(38035),a=n(17993),o=n(77533),l=n(62614),s=n(81672),d=n(42946),c=n(49929),u=n(2784),h=n(90221),m=n(90439),p=n(93441),g=n(89458),x=n(90383),f=n(18733),v=n(5879),b=n(42111),j=n(78462),y=n(94199),C=n(11082),_=n(64173),E=n(31807),k=n(6912),w=n(48832),I=n(11050),S=n(36651),T=n(81640),A=n(12265),N=n(11942),P=n(88640);let M=[{Component:()=>{let e=(0,b.ye)("outageButterbar");if(!e.enabled)return null;let{header:t,text:n,buttonLink:r,buttonText:a,key:o,pathnameRegexp:l}=e;return(0,i.jsx)(D,{definition:{key:o,header:t,text:n,buttonText:a,buttonLink:r,conditions:()=>!l||null!==window.location.pathname.match(new RegExp(l))}})},key:"outage-butterbar"},{Component:()=>{let e=(0,b.ye)("openAiStatus");return"NORMAL"===e?null:(0,i.jsx)(D,{definition:{key:"ai-service-status",header:(0,i.jsx)(v.cC,{id:"1Agl06"}),text:(0,i.jsx)(v.cC,{id:"cCl6WD"}),ttl:86400,conditions:()=>(0,j._r)(window.location.pathname)}})},key:"ai-service-status-butterbar"},{Component:()=>{var e,t,n;let{user:r,currentWorkspace:a}=(0,S.SE)(),{subscription:o,product:l}=(0,T.z)(),{launchFailedPaymentFlow:s,failedPaymentFlowEnabled:d}=(0,k.ET)({subscription:o,workspace:a,autoLaunch:!1});if(!o||!l)return null;let c=(0,A.K)(),{name:u,dontChurnMessage:h}=c[l],{status:m,expirationTime:p,id:g}=o,x=(0,w.p6)(p,"MMMM do, yyyy"),f=(null==o?void 0:null===(e=o.createdByUser)||void 0===e?void 0:e.id)===(null==r?void 0:r.id),b=(0,N._8)(),j=p>Date.now();if(!("unpaid"===m||"past_due"===m)&&!j)return null;let _=b&&(f||!(null==o?void 0:o.createdByUser))?(0,i.jsx)(v.cC,{id:"velw1T",values:{expirationFormatted:x,GAMMA_PROPER_NOUN:y.N6,productName:u},components:{0:(0,i.jsx)(C.r,{href:b,isExternal:!0,textDecoration:"underline"})}}):(0,i.jsx)(v.cC,{id:"9aBOfk",values:{expirationFormatted:x,GAMMA_PROPER_NOUN:y.N6,productName:u,0:null===(t=o.createdByUser)||void 0===t?void 0:t.displayName,1:null===(n=o.createdByUser)||void 0===n?void 0:n.email},components:{0:(0,i.jsx)("b",{}),1:(0,i.jsx)("b",{})}});return(0,i.jsx)(D,{definition:{key:"payment-overdue-".concat(g),header:(0,i.jsx)(v.cC,{id:"gosJne",values:{productName:u}}),text:(0,i.jsxs)(i.Fragment,{children:[h," ",_]}),buttonText:(0,i.jsx)(v.cC,{id:"WLvqZR"}),buttonLink:d?void 0:b,buttonOnClick:d?s:void 0}})},key:"payment-overdue-butterbar"},{Component:()=>{let{subscription:e,openUpsellModal:t}=(0,T.z)();if(!e)return null;let{status:n,expirationTime:r,id:a}=e,o=new Date>(0,E.Z)(r)&&new Date<(0,_.Z)((0,E.Z)(r),{days:10});if(!o)return null;let l=()=>t({segmentEvent:I.AA.GAMMA_PRO_UPSELL_SUBSCRIPTION_EXPIRED_BUTTERBAR}),s=(0,i.jsx)(C.r,{onClick:l,isExternal:!0,textDecoration:"underline",children:(0,i.jsx)(v.cC,{id:"mj68q/"})});return(0,i.jsx)(D,{definition:{key:"subscription-expired-".concat(a),header:(0,i.jsx)(v.cC,{id:"5nhH6A"}),text:(0,i.jsxs)(i.Fragment,{children:["unpaid"===n||"past_due"===n?(0,i.jsx)(v.cC,{id:"Qdg
20XJv"}):""," ",s]}),buttonText:(0,i.jsx)(v.cC,{id:"kwkhPe"}),buttonOnClick:l}})},key:"subscription-expired-butterbar"},{Component:()=>{var e,t,n;let{user:r}=(0,S.SE)(),{subscription:a,product:o}=(0,T.z)();if(!a||!o)return null;let{status:l,expirationTime:s,id:d,cancellationRequestedTime:c}=a,u="canceled"!=l&&c&&new Date<(0,E.Z)(s)&&new Date>(0,_.Z)((0,E.Z)(s),{days:-7});if(!u)return null;let h=(null==a?void 0:null===(e=a.createdByUser)||void 0===e?void 0:e.id)===(null==r?void 0:r.id),m=(0,N._8)(),p=(0,w.p6)(s,"MMMM do, yyyy"),g=(0,A.K)(),{name:x,dontChurnMessage:f}=g[o],b=!h&&(null==a?void 0:a.createdByUser)?(0,i.jsx)(v.cC,{id:"z4DeyC",values:{expirationFormatted:p,GAMMA_PROPER_NOUN:y.N6,productName:x,0:null===(t=a.createdByUser)||void 0===t?void 0:t.displayName,1:null===(n=a.createdByUser)||void 0===n?void 0:n.email},components:{0:(0,i.jsx)("b",{}),1:(0,i.jsx)("b",{})}}):(0,i.jsx)(v.cC,{id:"qP91+f",values:{expirationFormatted:p,GAMMA_PROPER_NOUN:y.N6,productName:x},components:{0:(0,i.jsx)(C.r,{href:m,isExternal:!0,textDecoration:"underline"})}});return(0,i.jsx)(D,{definition:{key:"subscription-ending-soon-".concat(d),header:(0,i.jsx)(v.cC,{id:"THJAvC",values:{productName:x}}),text:(0,i.jsxs)(i.Fragment,{children:[f," ",b]}),buttonText:(0,i.jsx)(v.cC,{id:"3jHA5d"}),buttonLink:m}})},key:"upcoming-cancellation-butterbar"},{key:"tablet-browser-warning",header:(0,i.jsx)(v.cC,{id:"JAtlMu",values:{GAMMA_PROPER_NOUN:y.N6}}),text:(0,i.jsx)(v.cC,{id:"9JlCFS",values:{GAMMA_PROPER_NOUN:y.N6}}),conditions:()=>(0,h.dA)(),dismissKey:P.H.lastDismissedPreferredBrowserMessage},{key:"desktop-browser-warning",header:(0,i.jsx)(v.cC,{id:"3S0+Wy",values:{GAMMA_PROPER_NOUN:y.N6}}),text:(0,i.jsx)(v.cC,{id:"Tf7VpJ"}),conditions:()=>O()&&(0,h.ds)(),dismissKey:P.H.lastDismissedPreferredBrowserMessage}],O=()=>(0,h.jP)()||!(0,h.i7)()&&!(0,h.G6)()&&!(0,h.NA)(),R=e=>{let{isViewOnly:t}=e,n=(0,p.gF)();if(t||!n||(0,h.l6)()||m.cx||(0,x.wg)())return null;let a=M.map(e=>"Component"in e?(0,i.jsx)(e.Component,{},e.key):(0,i.jsx)(D,{definition:e},e.key));return(0,i.jsx)(r.k,{"data-testid":"butterbar",direction:"column",top:0,pos:"relative",zIndex:"banner",sx:{"> *:not(:first-child)":{display:"none"}},children:a})},D=e=>{let{definition:t}=e,{key:n,dismissKey:h="butterbar-dismiss-".concat(n),header:m,text:p,buttonText:x,buttonLink:v,buttonOnClick:b=v?()=>window.open(v,"_blank"):void 0,conditions:j,ttl:y}=t,[C,_]=(0,g.I)(h,!1);return((0,u.useEffect)(()=>{if(!(y&&C))return;let e=new Date().getTime(),t=new Date(C).getTime(),n=e-t>1e3*y;n&&f.W.removeItem(h)},[h,C,y]),j&&!j()||C)?null:(0,i.jsxs)(r.k,{direction:"row",bg:"indigo.500",color:"white",py:3,px:4,align:"center",fontSize:"sm",children:[(0,i.jsxs)(a.g,{flex:"1",align:"start",spacing:0,children:[(0,i.jsx)(o.x,{fontWeight:"bold",children:m}),(0,i.jsx)(o.x,{opacity:"0.7",fontSize:"xs",children:p})]}),x&&b&&(0,i.jsx)(l.z,{variant:"plain",size:"sm",mr:4,rightIcon:v?(0,i.jsx)(c.G,{icon:d.wlW}):void 0,onClick:b,children:x}),(0,i.jsx)(s.P,{onClick:()=>{_(String(new Date))}})]})}},2013:function(e,t,n){"use strict";n.d(t,{q:function(){return C}});var i=n(52322),r=n(38035),a=n(77533),o=n(49259),l=n(87436),s=n(95897),d=n(28535),c=n(89511),u=n(11121),h=n(44438),m=n(42822),p=n(62614),g=n(75009),x=n(94523),f=n(5879),v=n(3543),b=n(92981);let j=(0,i.jsx)(f.cC,{id:"HiX9QN"}),y={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"}},C=e=>{let{errMessage:t=j,showDisclosure:n=!1,opacity:C=1,starOverlay:_=!0,backgroundColor:E=x.qZ.colors.trueblue[900],...k}=e,w=_?y:{};return(0,i.jsx)(r.k,{"data-error-component":!0,w:"100vw",h:"100vh",overflow:"hidden",zIndex:99999,backgroundColor:(0,v.tT)(E,C),...k,children:(0,i.jsx)(r.k,{...w,justifyContent:"center",alignItems:"center",flex:1,p:[4,16],left
20:"50%",top:"50%",children:(0,i.jsxs)(b.qX,{lede:"",title:(0,i.jsx)(f.cC,{id:"HbR60U"}),stackProps:{shadow:"lg-dark",position:"relative"},children:[(0,i.jsx)(a.x,{children:(0,i.jsx)(f.cC,{id:"1gm+lP"})}),n&&(0,i.jsx)(o.U,{allowToggle:!0,pt:4,children:(0,i.jsxs)(l.Q,{children:[(0,i.jsxs)(s.K,{px:0,_hover:{bgColor:"none"},borderStyle:"none",children:[(0,i.jsx)(d.xu,{flex:"1",textAlign:"left",children:(0,i.jsx)(f.cC,{id:"qug3k/"})}),(0,i.jsx)(c.X,{})]}),(0,i.jsx)(u.H,{pb:4,children:(0,i.jsx)(h.E,{colorScheme:"red",children:t})})]})}),(0,i.jsx)(m.M,{children:(0,i.jsx)(p.z,{variant:"solid",size:"lg",m:6,onClick:()=>{window.location.reload()},children:(0,i.jsx)(f.cC,{id:"C6f2hU"})})}),(0,i.jsx)(g.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}})]})})})}},4661:function(e,t,n){"use strict";n.d(t,{o:function(){return l}});var i=n(52322),r=n(38035),a=n(60510);let o=e=>{let{children:t,withFooter:n,isViewOnly:o}=e;return(0,i.jsxs)(r.k,{direction:"column",width:"100%",height:"100%",minHeight:"var(--100vh)",bgColor:"gray.100",color:"gray.800",children:[(0,i.jsx)(a.r,{isViewOnly:o}),(0,i.jsx)(r.k,{zIndex:"1",id:"main",flex:"1",justifyContent:"center",alignItems:"center",direction:"column",position:"relative",children:t}),n&&(0,i.jsxs)(r.k,{fontSize:"12px",color:"gray.400",pb:8,id:"footer",justifyContent:"center",children:["\xa9 ",new Date().getFullYear()," Gamma Tech, Inc."]})]})};function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{withFooter:!1,isViewOnly:!1},{withFooter:n,isViewOnly:r}=t,a=t=>(0,i.jsx)(o,{withFooter:n,isViewOnly:r,children:(0,i.jsx)(e,{...t})});return"getInitialProps"in e&&(a.getInitialProps=e.getInitialProps),a}},79254:function(e,t,n){"use strict";n.d(t,{$C:function(){return h},H6:function(){return u},Uj:function(){return m}});var i=n(52322),r=n(5632),a=n(45847),o=n.n(a),l=n(14274),s=n(93441),d=n(34385);let c=["/signin","/signup","/invitations/workspaces/[workspaceId]"],u=()=>{let e=(0,r.useRouter)().pathname;return!(0,s.gF)()||c.includes(e)?null:(0,i.jsx)("style",{children:".grecaptcha-badge { visibility: hidden; }"})},h=()=>(0,i.jsx)(o(),{src:"https://www.google.com/recaptcha/enterprise.js?render=".concat(l.v.RECAPTCHA_SCORING_KEY),async:!0,defer:!0}),m=async e=>(await (0,d.X)(50,100)(()=>!!window.grecaptcha).catch(()=>{throw Error("Timed out waiting for grecaptcha")}),new Promise((t,n)=>{grecaptcha.enterprise.ready(async()=>{try{let n=await grecaptcha.enterprise.execute(l.v.RECAPTCHA_SCORING_KEY,{action:e});t(n)}catch(e){console.log(e),n(e)}})}))},6912:function(e,t,n){"use strict";n.d(t,{S1:function(){return j},B_:function(){return _},ET:function(){return y}});var i=n(2784),r=n(14274),a=n(88232),o=n(42111),l=n(49152),s=n(44663),d=n(1163),c=n(11050),u=n(90221),h=n(23284),m=n(90383),p=n(87254),g=n(82108),x=n.n(g),f=n(94199);let v=(e,t)=>{let n=x()(t);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:f.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:f.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"})}}},b="\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(r.v.CHURNKEY_APP_ID,"';\n a.async = true;\n const b = document.getElementsByTagName('script')[0];\n b.parentNode.insertBefore(a, b);\n }\n }();\n"),j=()=>{let e=!(0,u.l6)()&&!(0,m.wg)();return(0,h.G)(e,b),null},y=e=>{let{subscription:t,workspace:n,autoLaunch:c=!0}
20=e,u=(0,o.ye)("churnkeyFailedPaymentWallEnabled"),h=(0,l.l)(),m=(0,d.K9)(n),p=(0,s.G)(),g=(0,i.useCallback)(async()=>{if(t&&m&&u)return(0,a.d6)("churnkey").then(e=>{var n,i;if(!e||!t.billingSubscriptionId||!(null===(n=t.createdByUser)||void 0===n?void 0:n.billingCustomerId)){console.error("[Churnkey] launchFailedPayment Missing hmac or subscription data",{hmac:e,subscription:t});return}console.debug("[Churnkey] launchFailedPayment - launching churnkey with:",{hmac:e,appId:r.v.CHURNKEY_APP_ID,subscriptionId:t.billingSubscriptionId,customerId:null===(i=t.createdByUser)||void 0===i?void 0:i.billingCustomerId}),C({authHash:e,subscription:t,localeKey:h,productKey:m,launchIntercomUI:p})})},[t,m,u,h,p]);return(0,i.useEffect)(()=>{c&&g()},[g,c]),{launchFailedPaymentFlow:g,failedPaymentFlowEnabled:u}},C=async e=>{var t,n;let{authHash:i,subscription:a,localeKey:o,productKey:l,launchIntercomUI:s}=e;null===(n=window.churnkey)||void 0===n||n.check("failed-payment",{subscriptionId:a.billingSubscriptionId,customerId:null===(t=a.createdByUser)||void 0===t?void 0:t.billingCustomerId,authHash:i,customerAttributes:{language:o},i18n:{lang:o,messages:v(o,l)},appId:r.v.CHURNKEY_APP_ID,mode:r.v.CHURNKEY_MODE,provider:"stripe",softWall:!0,forceCheck:!1,gracePeriodDays:3,ignoreInvoicesWithoutAttempt:!1,handleSupportRequest(){var e;s(),c.co.track(c.AA.CHURNKEY_HANDLE_SUPPORT_CLICK,{source:"failed-payment-wall",subscriptionId:a.billingSubscriptionId,customerId:null===(e=a.createdByUser)||void 0===e?void 0:e.billingCustomerId})},async handleCancel(e){var t,n;return c.co.track(c.AA.CANCEL_SUBSCRIPTION_CLICK,{source:"failed-payment-wall",subscriptionId:a.billingSubscriptionId,customerId:null===(t=a.createdByUser)||void 0===t?void 0:t.billingCustomerId}),console.debug("[launchChurnkeyFailedPayment.handleCancel]",{subscriptionId:a.billingSubscriptionId,customerId:null===(n=a.createdByUser)||void 0===n?void 0:n.billingCustomerId,customer:e}),E({authHash:i,subscription:a,localeKey:o,productKey:l,launchIntercomUI:s,customerAttributes:{viaFailedPayment:!0}}).catch(e=>C({authHash:i,subscription:a,localeKey:o,productKey:l,launchIntercomUI:s}))},onFailedPaymentWallActivated(){var e;c.co.track(c.AA.CHURNKEY_FAILED_PAYMENT_WALL_SHOWN,{subscriptionId:a.billingSubscriptionId,customerId:null===(e=a.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onUpdatePaymentInformation(){var e;c.co.track(c.AA.CHURNKEY_PAYMENT_METHOD_UPDATED,{source:"failed-payment-wall",subscriptionId:a.billingSubscriptionId,customerId:null===(e=a.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onFailedPaymentWallClose(){var e;c.co.track(c.AA.CHURNKEY_FAILED_PAYMENT_WALL_CLOSED,{subscriptionId:a.billingSubscriptionId,customerId:null===(e=a.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onCancel(){var e;c.co.track(c.AA.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE,{source:"failed-payment-wall",subscriptionId:a.billingSubscriptionId,customerId:null===(e=a.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onError(e,t){console.warn('Churnkey check("failed-payment", ...) error',e,t)}})},_=(e,t)=>{let n=(0,o.ye)("churnkeyCancelFlowEnabled"),r=(0,l.l)(),c=(0,d.K9)(t),u=(0,s.G)(),h=(0,i.useCallback)(()=>{if(e&&c&&n)return(0,a.d6)("churnkey").then(t=>{var n;if(!t||!e.billingSubscriptionId||!(null===(n=e.createdByUser)||void 0===n?void 0:n.billingCustomerId)){console.debug("[Churnkey] handleCancel - Missing hmac or subscription data",{hmac:t,subscription:e});return}return E({authHash:t,subscription:e,localeKey:r,productKey:c,launchIntercomUI:u})})},[n,r,c,e,u]);return{launchCancelFlow:h,cancelFlowEnabled:n}},E=async e=>{let{authHash:t,subscription:n,localeKey:i,productKey:a,customerAttributes:o={},launchIntercomUI:l}=e;return new Promise((e,s)=>{var u,h,m;null===(m=window.churnkey)||void 0===m||m.init("show",{subscriptionId:n.billingSubscriptionId,customerId:null===(u=n.createdByUser)||void 0===u?void 0:u.billingCustomerId,authHash:t,customerAttributes:{language:i,frequency:null===(h=(0,d.OJ)(n))||void 0===h?void 0:h.frequencyUnit,productKey:a,...o},i18n:{lang:i,messages:v(i,a)},appId:r.v.CHURNKEY_APP_ID,mode:r.v.CHURNKEY_MODE,provider:"stripe",record:!0,handleSupportRequest
20(){var e;l(),c.co.track(c.AA.CHURNKEY_HANDLE_SUPPORT_CLICK,{source:"cancel-flow",subscriptionId:n.billingSubscriptionId,customerId:null===(e=n.createdByUser)||void 0===e?void 0:e.billingCustomerId})},onCancel(e,t,i){var r;c.co.track(c.AA.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE,{source:"cancel-flow",subscriptionId:n.billingSubscriptionId,customerId:null===(r=n.createdByUser)||void 0===r?void 0:r.billingCustomerId,surveyResponse:t,freeformFeedback:i}),console.debug("[launchChurnkeyCancelFlow.onCancel]",{surveyResponse:t,freeformFeedback:i})},onGoToAccount(t){console.debug("[launchChurnkeyCancelFlow.onGoToAccount]",{sessionResults:t}),e({sessionResults:t})},onClose(t){if(console.debug("[launchChurnkeyCancelFlow.onClose]",{sessionResults:t}),!t||t.aborted){s("Churnkey cancel flow aborted");return}e({sessionResults:t})},onError(e){console.warn("[launchChurnkeyCancelFlow.onError]",{message:e}),s({message:e})}})})}},12985:function(e,t,n){"use strict";n.d(t,{B:function(){return r}});var i=n(2784);let r=i.lazy(()=>Promise.all([n.e(8917),n.e(7120),n.e(4100),n.e(3421)]).then(n.bind(n,23421)).then(e=>({default:e.default})))},26495:function(e,t,n){"use strict";n.d(t,{m:function(){return d}});var i=n(65616),r=n(48484),a=n(14274),o=n(99787),l=n(2090);let s=e=>{let t="",n=!1;if("transloadit"in e){let{failed:i,transloadit:r}=e;n=!!i.length,t=r[0].results[":original"][0].url}else{if(!("results"in e))return{sourceUrl:t,success:!1};t=e.results[":original"][0].url}return n?{sourceUrl:t,success:!1}:{sourceUrl:t,success:!0}},d=(e,t)=>{let n=new i.ZP({...o.N$,restrictions:{...o.N$.restrictions,allowedFileTypes:o.Ge}});return n.use(r.ZP,{assemblyOptions:async()=>{let t=a.v.TRANSLOADIT_FILE_TEMPLATE_ID,{signature:n,expires:i}=await (0,l.xQ)(t);return{params:{auth:{key:a.v.TRANSLOADIT_AUTH_KEY,expires:i},template_id:t},fields:{orgId:e},signature:n}},waitForEncoding:!0}),new Promise((e,i)=>{n.on("complete",t=>{let{success:n,sourceUrl:r}=s(t);n?e(r):i("Could not get sourceUrl from upload result")}),n.on("transloadit:complete",t=>{let{success:n,sourceUrl:r}=s(t);n?e(r):i("Could not get sourceUrl from result")}),n.on("error",e=>{i(e)}),n.on("restriction-failed",(e,t)=>{console.error("[uploadFontFile] restriction failed on file",e,"error",t),i(t)}),n.addFile({name:t.name,type:t.type,data:t}),o.N$.autoProceed||n.upload()})}},85747:function(e,t,n){"use strict";n.d(t,{E:function(){return l}});var i=n(52322),r=n(2784),a=n(99787);let o={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},l=e=>{let{handleFilesCallback:t,multiple:n=!1,accept:l=a.pK.join(",")}=e,s=(0,r.useRef)(null),d=(0,r.useMemo)(()=>(0,i.jsx)("input",{ref:s,className:"gamma-FileInput-input",style:o,type:"file",name:"gamma-file-input",multiple:n,accept:l,onChange:e=>{let n=e.target;if(!n||!n.files)return;let i=Array.from(n.files);t(i),n.value=null}}),[l,t,n]),c=(0,r.useCallback)(()=>{var e;null===(e=s.current)||void 0===e||e.click()},[]);return{inputElement:d,onClick:c}}},62700:function(e,t,n){"use strict";n.d(t,{d:function(){return a}});var i=n(52322),r=n(5879);let a=()=>({100:(0,i.jsx)(r.cC,{id:"RGjFMI"}),200:(0,i.jsx)(r.cC,{id:"GMGHcE"}),300:(0,i.jsx)(r.cC,{id:"1njn7W"}),400:(0,i.jsx)(r.cC,{id:"xfqlmg"}),500:(0,i.jsx)(r.cC,{id:"agPptk"}),600:(0,i.jsx)(r.cC,{id:"KVGfPY"}),700:(0,i.jsx)(r.cC,{id:"KmydK6"}),800:(0,i.jsx)(r.cC,{id:"NV46Ki"}),900:(0,i.jsx)(r.cC,{id:"THokF3"})})},30423:function(e,t,n){"use strict";n.d(t,{Av:function(){return x},B_:function(){return v},CZ:function(){return h},QP:function(){return b},Sd:function(){return j},UK:function(){return m},ZN:function(){return f},cC:function(){return g},x_:function(){return p},zn:function(){return c}});var i=n(18149),r=n.n(i),a=n(53553),o=n(93202);let l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=["italic","oblique"];for(let n of e)for(let e of t)if(-1!==n.toLowerCase().indexOf(e))return!0;return!1},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let t of e){if(d(t,["thin"]))return 100;if(d(t,["light","lite"],["extra","ultra","x"]))return 200;if(d(t,["light"]))return 300;if(d(t,["medium"]))return 500;if(d(t,["bold"],["demi","semi"]))return 600;if(d(t,["bold"],["extra","x"]))return 800;if(d(t,["bold"]))return 700;if(d(t,["black","heavy","ultra"]))return 900}return 400},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(let i of t)if(0===n.length){if(-1!==e.toLowerCase().indexOf(i.toLowerCase()))return!0}else for(let t of n)if(-1!==e.toLowerCase().indexOf(i.toLowerCase())&&-1!==e.toLowerCase().indexOf(t.toLowerCase()))return!0;return!1},c=async e=>new Promise((t,n)=>{let i=new FileReader;i.onload=e=>{var i,r,o,d,c,u,h,m,p,g,x,f,v,b,j,y,C,_,E;let k=null===(i=e.target)||void 0===i?void 0:i.result;try{let e=a.ZP.parse(k),n=null!==(y=null===(r=Object.values(null!==(j=null===(d=e.tables)||void 0===d?void 0:null===(o=d.name)||void 0===o?void 0:o.preferredSubfamily)&&void 0!==j?j:null===(u=e.tables)||void 0===u?void 0:null===(c=u.name)||void 0===c?void 0:c.fontSubfam
20ily))||void 0===r?void 0:r[0])&&void 0!==y?y:"",i=null!==(C=null===(h=Object.values(null===(p=e.tables)||void 0===p?void 0:null===(m=p.name)||void 0===m?void 0:m.fullName))||void 0===h?void 0:h[0])&&void 0!==C?C:"",w=null!==(E=null===(g=Object.values(null!==(_=null===(f=e.tables)||void 0===f?void 0:null===(x=f.name)||void 0===x?void 0:x.preferredFamily)&&void 0!==_?_:null===(b=e.tables)||void 0===b?void 0:null===(v=b.name)||void 0===v?void 0:v.fontFamily))||void 0===g?void 0:g[0])&&void 0!==E?E:"";t({familyName:w,isItalic:l([n,i]),weight:s([n,i])})}catch(e){n(e)}},i.onerror=e=>{console.error("[parseFontFile] unable to read the font file, providing defaults",e),t({familyName:"",isItalic:!1,weight:400})},i.readAsArrayBuffer(e)}),u=e=>{let t=e.lastIndexOf(".");return -1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}},h=e=>{let{extension:t}=u(e);return t===o.sA6.Otf||t===o.sA6.Ttf?t:o.sA6.Ttf},m=e=>{let{existingFont:t}=e;if(!t)return!0;let n={fontName:t.name,fontId:t.id,fontFiles:t.fontFiles.map(e=>({id:e.id,name:e.name,weight:e.weight,isItalic:e.isItalic,fileType:e.fileType,sourceUrl:e.sourceUrl}))},i={fontName:e.fontName,fontId:e.fontId,fontFiles:e.uploadFontFiles.map(e=>({id:e.fontFile.id,name:e.fontFile.name,weight:e.fontFile.weight,isItalic:e.fontFile.isItalic,fileType:e.fontFile.fileType,sourceUrl:e.fontFile.sourceUrl}))};return!r()(n,i)},p=e=>{let t=e.reduce((e,t)=>{let n=[t.weight,t.isItalic].join("__");return{...e,[n]:!0}},{});return Object.keys(t).length},g=e=>{let t=Object.values(e.reduce((e,t)=>{let n=t.fontFile,i=[n.weight,n.isItalic,n.fileType].join("__");return e[i]=e[i]||[],e[i].push(t),e},{})).reduce((e,t)=>{if(t.length>1)for(let n of t)e[n.uploadId]=!0;return e},{});return t},x=e=>e.reduce((e,t)=>{let n=t.fontFile.weight;return{...e,[n]:[...e[n]||[],t]}},{}),f=function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return e.sort((e,n)=>t?Number(e)-Number(n):Number(n)-Number(e))},v=e=>f(Array.from(new Set(e.map(e=>e.weight)))),b=(e,t)=>{if(void 0===t)return;if(t>e[e.length-1])return e[e.length-1];let n=1/0,i=-1;for(let r=0;r<e.length;r++){let a=Math.abs(t-e[r]);if(a<n)n=a,i=r;else break}return e[i]},j=e=>!!e&&0!==e.length&&-1===e.findIndex(e=>!e.isItalic)},48832:function(e,t,n){"use strict";n.d(t,{BK:function(){return C},Dw:function(){return y},Km:function(){return j},dN:function(){return v},p6:function(){return b}});var i=n(87254),r=n(82282),a=n(32361),o=n(96740),l=n(31807),s=n(73871),d=n(57907),c=n(21346),u=n(48053),h=n(1363),m=n(49738),p=n(90535),g=n(9283),x=n(75528);let f={en:d.Z,"pt-br":c.Z,ja:u.Z,"zh-cn":h.Z,"zh-tw":m.Z,es:p.Z,fr:g.Z,ko:x.Z},v=()=>f[i.ag.locale]||void 0,b=(e,t)=>e?(0,r.Z)((0,l.Z)(e),t,{locale:v()}):"",j=(e,t)=>e?(0,o.Z)((0,l.Z)(e),t?(0,l.Z)(t):new Date,{locale:v()}):"",y=e=>e?(0,a.Z)((0,l.Z)(e),{locale:v()}):"",C=e=>e?(0,s.Z)((0,l.Z)(e),new Date,{locale:v(),addSuffix:!0,roundingMethod:"floor"}):""},25944:function(e,t,n){"use strict";n.d(t,{bf:function(){return g},iZ:function(){return m},lh:function(){return h},wK:function(){return p}});var i=n(2784),r=n(42111),a=n(91994),o=n(47968),l=n(90604),s=n(56400),d=n(99268);let c=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 h=(e,t)=>{let n=(0,a.CG)(o.Pw),r=(0,i.useRef)(n);(0,i.useEffect)(()=>{r.current=n},[n]),(0,i.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||!r.current||!c(t))return;let i=performance.now();requestAnimationFrame(()=>{let t=e.key;" "===t&&(t="Space");let n=performance.now()-i;(0,d.EF)({...(0,s.H)(),key:t,duration:n})})}},[e,r,t])},m=()=>{let e=(0,r.ye)("rumSampleRate");(0,i.useEffect)(()=>{(0,d._k)(e)},[e])}
20,p=e=>{let t=(0,i.useCallback)(t=>{let{isFullscreen:n=!1}=t;if(!e)return;let i=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=performance.now()-i;(0,d.gG)({...(0,s.H)(),toMode:l.q.SLIDE_VIEW,duration:e,isFullscreen:n})})})},[e]),n=(0,i.useCallback)(t=>{let{isFullscreen:n=!1}=t;if(!e)return;let i=performance.now();requestAnimationFrame(()=>{requestAnimationFrame(()=>{let e=performance.now()-i;(0,d.gG)({...(0,s.H)(),toMode:l.q.DOC_VIEW,duration:e,isFullscreen:n})})})},[e]);return{recordExitSlideModePerformance:n,recordEnterSlideModePerformance:t}},g=()=>{let[e]=(0,i.useState)(()=>new u),t=(0,i.useCallback)(()=>{e.setupProvider()},[e]),n=(0,i.useCallback)(()=>{e.downloadDoc()},[e]),r=(0,i.useCallback)(()=>{e.onCreate();let t=e.report();if(null===t){console.warn("[HoneycombDocLoadTimer] failed to generate doc timings");return}(0,d.Py)({...(0,s.H)(),duration:t.onCreate}),(0,d.aZ)({...(0,s.H)(),duration:t.downloadDoc})},[e]);return{timeOnCreate:r,timeOnSetupProvider:t,timeOnDownloadDoc:n}}},89311:function(e,t,n){"use strict";n.d(t,{l:function(){return l}});var i=n(5632),r=n(2784),a=n(7e4),o=n(88640);let l=()=>{let{pathname:e,isReady:t}=(0,i.useRouter)(),n=(0,r.useRef)(!1),[l,s]=(0,a.X)(o.H.lastHomeUrl,"/");(0,r.useEffect)(()=>{if(n.current||!t)return;let i="/inspiration"===e||"/templates"===e?e:"/";s(i),n.current=!0},[s,t,e])}},56745:function(e,t,n){"use strict";n.d(t,{z:function(){return tS}});var i=n(52322),r=n(70065),a=n(32981),o=n(26468),l=n(73751),s=n(54326),d=n(38035),c=n(77533),u=n(28535),h=n(75768),m=n(62614),p=n(97217),g=n(2338),x=n(42822),f=n(81540),v=n(94523),b=n(5879),j=n(87254),y=n(18149),C=n.n(y),_=n(2784),E=n(43997),k=n(93202),w=n(11050),I=n(47968),S=n(36651),T=n(93441),A=n(47749),N=n(36371),P=n(73582),M=n(2969),O=n(29117),R=n(3181),D=n(13272),F=n(84010),U=n(42946),L=n(54933),H=n(49929),z=n(66625),G=n(94199),B=n(91994),W=n(87978),V=n(46409),K=n(49354),q=n(96933),Y=n(20678),Z=n(29318),X=n(887),Q=n(66479),J=n(20437),$=n(30233),ee=n(26838);let et=(0,_.memo)(e=>{let{theme:t,onThemeClick:n,onSelectClick:r}=e,{data:a,loading:o}=(0,k.BCl)({variables:{workspaceId:null,archived:!1},fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),l=(null==a?void 0:a.themes)||[];return(0,i.jsxs)(i.Fragment,{children:[o?(0,i.jsx)($.S,{size:4}):(0,i.jsx)(u.xu,{flex:1,p:6,children:(0,i.jsx)(J.M,{columns:{base:1,lg:2},spacing:1,children:[...l].sort(Q.qb).map(e=>(0,i.jsx)(ee.o,{type:"standard",theme:e,isChecked:e.id===t.id,onThemeClicked:n,variant:"ghost"},e.id))})}),(0,i.jsx)(d.k,{pos:"sticky",bottom:0,px:6,py:4,alignItems:"center",bg:"white",children:(0,i.jsx)(m.z,{"data-testid":"select-this-theme",flex:1,variant:"solid",leftIcon:(0,i.jsx)(H.G,{icon:U.JyM}),onClick:r,children:(0,i.jsx)(b.cC,{id:"UJfhAS"})})})]})});var en=n(5200),ei=n(41004),er=n(25925),ea=n(50521);let eo=(0,ei.E)(u.xu),el={enter:e=>({position:"absolute",width:"100%",x:"push"===e?"100%":"-100%",opacity:0}
20),center:{width:"100%",position:"static",x:0,opacity:1},exit:e=>({width:"100%",position:"absolute",x:"push"===e?"-100%":"100%",opacity:0})},es=e=>{let{containerProps:t,motionProps:n,InitialComponent:r}=e,[a,o]=(0,_.useState)(r?[r]:[]),l=(0,_.useRef)("push"),s=(0,_.useCallback)(()=>{l.current="pop",o([...a.slice(0,-1)])},[a]),d=(0,_.useCallback)(e=>{l.current="push",o([...a,e])},[a]),c=a[a.length-1];return((0,_.useEffect)(()=>{0===a.length&&r&&d(r)},[r,d,a]),c)?(0,i.jsx)(ea.m.Provider,{value:{push:d,pop:s},children:(0,i.jsx)(u.xu,{...t||{},position:"relative",children:(0,i.jsx)(er.M,{initial:!1,custom:l.current,children:(0,i.jsx)(eo,{variants:el,custom:l.current,initial:"enter",animate:"center",exit:"exit",transition:{default:{duration:.2}},...n||{},children:(0,i.jsx)(c,{})},a.length)})})}):null};var ed=n(25585),ec=n(97010),eu=n(82655),eh=n(42111),em=n(43297),ep=n(35183),eg=n(97166),ex=n(82713),ef=n(24213),ev=n(71272);let eb=e=>e.replace(/^\d+\.\s*/,"").replaceAll(/\s/g,"-").toLowerCase(),ej={width:"100%",variant:"unstyled",borderRadius:"revert",height:"revert",justifyContent:"flex-start"},ey=(0,_.memo)(e=>{let{icon:t,label:n,onClick:r,...a}=e;return(0,i.jsxs)(d.k,{"data-testid":"theme-config-menu-button-".concat(eb(n)),as:m.z,...ej,onClick:r,p:4,borderBottomWidth:"1px",_hover:{bg:"trueblue.50"},...a,children:[(0,i.jsx)(u.xu,{color:"trueblue.500",children:(0,i.jsx)(H.G,{icon:t,fixedWidth:!0})}),(0,i.jsx)(u.xu,{fontWeight:"600",ml:2,mr:"auto",children:n}),(0,i.jsx)(u.xu,{color:"gray.600",children:(0,i.jsx)(H.G,{icon:U._tD})})]})});ey.displayName="ThemeConfigNavigationMenuButton";let eC=e=>{let{label:t,onBackClick:n,children:r}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.k,{"data-testid":"theme-config-back-button",as:m.z,...ej,p:4,borderBottomWidth:"1px",bg:"gray.50",_hover:{bg:"gray.200"},onClick:n,children:[(0,i.jsx)(u.xu,{color:"gray.600",mr:2,children:(0,i.jsx)(H.G,{icon:U.A35})}),(0,i.jsx)(u.xu,{fontWeight:"600",children:t})]}),(0,i.jsx)(u.xu,{children:r})]})};var e_=n(47443),eE=n(52929),ek=n(37164),ew=n(99787),eI=n(16494),eS=n(29596),eT=n(40520),eA=n(64743);let eN=e=>(0,eA.bH)(e)&&(0,eA.Rr)(e),eP=e=>{let{setBackground:t,background:n,defaultMessage:r,isDark:a,isValidSource:o}=e,[l,s]=(0,_.useState)(ew.hq.key),d=eS.ah[l],c=(0,_.useCallback)(e=>o?o(e)&&eN(e):eN(e),[o]),u=(0,_.useCallback)(e=>{t({...n,...e})},[n,t]);return(0,i.jsx)(eT.O,{isDark:a,isValidSource:c,defaultMessage:r,currentBackground:n,currentSource:d,updateCurrentBackground:u,setCurrentSourceKey:s,currentSourceKey:l,editType:"themeBackgroun
20d"})};var eM=n(13793);n(38095);var eO=n(17993),eR=n(75009),eD=n(32899),eF=n(91710),eU=n(97253),eL=n(87205);n(65331),n(41779);let eH=e=>{let{uploadedImages:t,setUploadedImages:n,setIsLoading:a}=e,o=(0,B.CG)(I.KV),{currentWorkspace:l}=(0,S.SE)(),{orgId:s,templateId:d}=(0,Z.Ds)(o||(null==l?void 0:l.id),"themeBackground"),u=(0,r.p)(),[h,m]=(0,_.useState)(0),[p,g]=(0,_.useState)(!1),x=(0,_.useCallback)(e=>{let{file:t,tempUrl:i}=e;a(!0);let r=i;if(t.type&&(0,eL.Ns)(t.type)){let e="HEIC_tempId_".concat((0,ek.x0)());r=e}n(e=>[...e,{tempUrl:r,name:t.name,src:null,showPlaceholder:!0,uploadStatus:eI.D.Uploading}])},[a,n]),f=(0,_.useCallback)(e=>{n(t=>{let n=t.map(t=>t.name===e.name?{...t,...(0,eU.gM)({result:e,isError:!1})}:t);return n}),m(e=>e+1)},[n]);(0,_.useEffect)(()=>{a(!t.every(e=>"optimized"===e.uploadResultStep))},[a,t]);let y=(0,_.useCallback)(()=>{u({title:"Error uploading images, please try again",status:"error",duration:3e3,isClosable:!0}),m(e=>e+1)},[u]),C=(0,_.useMemo)(()=>{if(!s)throw Error("Tried uploading an image with no orgId");return ew.ND.createUppyInstance(s,{onUploadStart:x,onUploadComplete:f,onUploadFailed:y}
20,"themeBackground",50,"image",d)},[h,s,x,f,y,d]),E=()=>(0,i.jsx)(i.Fragment,{children:s&&(0,i.jsx)(eF.v0,{width:"100%",height:"100%",note:j.ag._({id:"x4Ts51"}),uppy:C,locale:{strings:{browse:j.ag._({id:"wZ9s+A"})}}})});return t.length>0?(0,i.jsxs)(eO.g,{align:"flex-start",spacing:4,onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),g(!0)},children:[p&&(0,i.jsx)(E,{}),(0,i.jsx)(J.M,{gap:2,columns:{base:2,"2xl":3},children:t.map(e=>{let{src:t,meta:r,name:a,tempUrl:o}=e||{},l=t?(0,eL.aN)(t,{width:500}):void 0;return(0,i.jsxs)(em.K,{spacing:1,position:"relative",role:"group",children:[(0,i.jsx)(eR.E,{src:l||o||"",alt:"",ignoreFallback:!0,borderRadius:"md"}),(0,i.jsx)(v.kH,{label:(0,i.jsx)(b.cC,{id:"ZTnXof"}),placement:"top",children:(0,i.jsx)(eD.h,{"aria-label":j.ag._({id:"Rz0Yis"}),icon:(0,i.jsx)(H.G,{icon:U.XAH}),onClick:()=>{n(t=>{let n=t.filter(t=>t.name!==e.name);return n})},isRound:!0,position:"absolute",top:1,right:1,size:"sm",color:"red.600",opacity:0,_hover:{color:"red.600"},_groupHover:{opacity:1}})}),r&&r.width&&r.height&&(0,i.jsxs)(c.x,{fontSize:"xs",children:[r.width,"\xd7",r.height,"px"]}),a&&(0,i.jsx)(c.x,{fontSize:"xs",lineHeight:4,children:a})]},e.tempUrl)})})]}):(0,i.jsx)(E,{})};var ez=n(53701);let eG=e=>e.backgroundType!==eM.E.NONE,eB={...K.Gx,accentId:void 0},eW=e=>{let{theme:t,updateTheme:n}=e,[r,a]=(0,_.useState)(!1),[o,l]=(0,_.useState)(null),[s,d]=(0,_.useState)(null),u=o&&!!o.accentId,p=t.config.accentBackgrounds,g=(0,eh.ye)("bulkUploadAccentImages"),x=(0,_.useCallback)(()=>{d(eB),l(eB)},[]),f=(0,_.useCallback)(()=>{l(null),d(null)},[]),v=(0,_.useCallback)(e=>{let t=e||o;if(!t)return;let i={...t,source:A.cx,originalSource:t.source,accentId:(0,ek.x0)()},r=p||[];if(u){let e=r.findIndex(e=>e.accentId===o.accentId);if(-1===e){console.warn("[AccentImagePicker] Could not find accent image to edit");return}n({accentBackgrounds:[...r.slice(0,e),i,...r.slice(e+1)]})}else n({accentBackgrounds:[...r,i]});f()},[p,o,u,f,n]),y=(0,_.useCallback)(e=>{let t=(p||[]).filter(t=>t.accentId!==e.accentId);n({accentBackgrounds:t})},[p,n]),E=(0,_.useCallback)(e=>{let t={...e,source:e.originalSource};d(t),l({...e,source:e.originalSource})},[]),k=(0,_.useCallback)(e=>{if(e.source===ew.hq.key||e.source===ew.$5.key){v(e);return}if(e.source===ew.in.key){var t,n,i,r;(null===(t=e.image)||void 0===t?void 0:t.uploadStatus)===eI.D.Uploading?a(!0):(null===(n=e.image)||void 0===n?void 0:n.uploadStatus)===eI.D.Done&&(null===(i=e.image)||void 0===i?void 0:i.uploadResultStep)==="optimized"?a(!1):(null===(r=e.image)||void 0===r?void 0:r.uploadStatus)===eI.D.Error&&a(!1)}l(e)},[v]),w=(0,_.useMemo)(()=>!C()(o,s),[o,s]),I=(0,Q.wj)(t),[S,T]=(0,_.useState)([]),[N,P]=(0,_.useState)(!1),M=(0,_.useCallback)(()=>{T([]),P(!1)},[]),O=(0,_.useCallback)(()=>{let e=S.map(e=>({type:eM.E.IMAGE,source:A.cx,originalSource:"image.custom",image:e,accentId:(0,ek.x0)()})),t=p||[];n({accentBackgrounds:[...e,...t]}),M()},[S,p,n,M]);return o?(0,i.jsxs)(em.K,{p:6,children:[(0,i.jsx)(eP,{setBackground:k,background:o,isValidSource:eG,defaultMessage:(0,i.jsxs)(e_.b,{children:[(0,i.jsx)(eE.z,{}),(0,i.jsx)(b.cC,{id:"VPwqDS"})]}),isDark:I}),(0,i.jsxs)(h.h,{pt:6,display:"flex",children:[(0,i.jsx)(m.z,{variant:"ghost",onClick:f,children:(0,i.jsx)(b.cC,{id:"dEgA5A"})}),(0,i.jsx)(m.z,{variant:"solid",onClick:()=>v(),isLoading:r,isDisabled:!w,flex:1,children:u?(0,i.jsx)(b.cC,{id:"tfDRzk"}):(0,i.jsx)(b.cC,{id:"B6vyEa"})})]})]}):(0,i.jsxs)(em.K,{spacing:6,children:[(0,i.jsxs)(em.K,{spacing:3,p:6,children:[(0,i.jsx)(m.z,{leftIcon:(0,i.jsx)(H.G,{icon:U.r8p}),alignSelf:"flex-start",onClick:x,children:(0,i.jsx)(b.cC,{id:"5phU36"})}),(0,i.jsxs)(e_.b,{fontSize:"xs",children:[(0,i.jsx)(eE.z,{}),(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"M6esHH"})})]}),g&&(0,i.jsx)(eH,{uploadedImages:S,setUploadedImages:T,setIsLoading:P}),p&&0!=p.length&&(0,i.jsx)(ez.U,{accentImages:p,isDark:I,handleDelete:y,handleItemClick:E})]}),S.length>0&&(0,i.jsxs)(h.h,{display:"flex",w:"100%",position:"sticky",bottom:0,left:0,bg:"white",py:3,px:6,borderTop:"1px",borderColor:"gray.300",children:[(0,i.jsx)(m.z,{variant:"ghost",onClick:M,children:(0,i.jsx)(b.cC,{id:"dEgA5A"})}),(0,i.jsx)(m.z,{variant:"solid",onClick:O,isLoading:N,flex:1,children:(0,i.jsx)(b.cC,{id:"1rLekk",values:{0:S.length,1:j.ag._({id:"BZPFHo",values:{0:S.length}})}})})]})]})};var eV=n(85573),eK=n(29494),eq=n(63176),eY=n(99793),eZ=n(12985);let eX=async(e,t,i)=>{try{let i=(await Promise.all([n.e(5489),n.e(4751)]).then(n.bind(n,89089))).default,r=(await Promise.all([n.e(5489),n.e(9224)]).then(n.bind(n,30058))).default,a=i.parse(e),o=r.objectify(a);t(o)}catch(e){i(e.message)}},eQ=async(e,t,i)=>{try{let i=(await Promise.all([n.e(5489),n.e(4751)]).then(n.bind(n,89089))).default,r=(await Promise.all([n.e(5489),n.e(9224)]).then(n.bind(n,30058))).default;i().process(e,{parser:r}).then(e=>{let{css:n}=e;t(n)})}catch(e){i(e.message)}},eJ=e=>{let{label:t,initialValue:r,updateValue:a,helperText:o}=e,[l,s]=(0,_.useState)(""),[d,c]=(0,_.useState)(null),[h,m]=(0,_.useState)(),p=(0,T.Kt)(eX,100);return((0,_.useEffect)(()=>{Promise.all([n.e(8917),n.e(7120),n.e(6214)]).then(n.bind(n,96214)).then(e=>{m(e.css())})},[]),(0,T.vm)(()=>{c(null),r&&eQ(r,s,c)},[r],[]),(0,T.vm)(()=>{c(null),p(l,a,c)},[l,a,p],[l]),h)?(0,i.jsxs)(ep.NI,{isInvalid:!!d,children:[(0,i.jsx)(eg.l,{children:t}),d&&(0,i.jsx)(eY.J1,{children:d}),o&&(0,i.jsx)(ep.Q6,{children:o}),(0,i.jsx)(u.xu,{border:"1px solid",borderColor:"gray.200",fontSize:"md",children:(0,i.jsx)(_.Suspense,{fallback:(0,i.jsx)("span",{}),children:(0,i.jsx)(eZ.B,{value:l,height:"300px",extensions:[h],onChange:s})})})]}):null};var e$=n(8624),e0=n(10625),e1=n(67046),e2=n(99058),e4=n(39237),e5=n(89098);let e3=e=>{let{theme:t,dispatch:n}=e,r=(0,e5.c)(t);return(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"x5htAS"})}),(0,i.jsxs)(e0.v,{matchWidth:!0,children:[(0,i.jsx)(e1.j,{size:"lg",as:m.z,borderRadius:"md",rightIcon:(0,i.jsx)(H.G,{icon:U.ptq,transform:"shrink-6"}),variant:"toolbar",px:4,h:10,w:"100%",border:"1px solid",borderColor:"gray.200",children:(0,i.jsx)(c.x,{textAlign:"left",fontWeight:"400",children:r.name()})}),(0,i.jsx)(e2.q,{maxH:"320px",maxW:"100%",overflow:"auto",children:e5.N.map(e=>(0,i.jsx)(e4.i,{isChecked:r.key===e.key,value:e.key,onClick:()=>n({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{themeBase:e.key}}}),children:(0,i.jsxs)(O.U,{maxW:"100%",children:[(0,i.jsx)(e9,{base:e}),(0,i.jsxs)(u.xu,{flex:"1",minW:"0",children:[e.name(),e.description&&(0,i.jsx)(c.x,{color:"gray.400",fontSize:"sm",children:e.description()})]})]})},e.key))})]})]})},e9=e=>{let{base:t}=e,n={"--card-color":"#FFF",...t.getCSSVars({cardColor:"#FFF",accentColor:"#F00",accentPalette:["#F00"]})};return(0,i.jsx)(u.xu,{backgroundColor:"gray.200",p:4,css:n,children:(0,i.jsx)(u.xu,{sx:t.cardSx,h:"3em",w:"5em"})})},e6=(0,_.memo)(()=>{var e;let{state:t,pop:n,dispatch:r,label:a}=(0,ed.n)(),{theme:o}
20=t,l=(null===(e=o.config.cardBackground)||void 0===e?void 0:e.type)===eM.E.COLOR?o.config.cardBackground.color:null;return(0,i.jsx)(eC,{onBackClick:n,label:a,children:(0,i.jsxs)(em.K,{p:6,children:[(0,i.jsxs)(ep.NI,{"data-testid":"custom-theme-card-color-picker",children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"9d2iLQ"})}),(0,i.jsx)(ep.Q6,{mb:4,children:(0,i.jsx)(b.cC,{id:"7wiFpy"})}),(0,i.jsx)(e$.T,{value:(null==l?void 0:l.hex)||null,updateValue:e=>r({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{cardBackground:e?{type:eM.E.COLOR,color:{hex:e}}:void 0}}}),defaultValue:"#FFFFFF"})]}),(0,i.jsx)(e3,{theme:o,dispatch:r})]})})});e6.displayName="ThemeConfigCardStylesPanel";var e7=n(30423),e8=n(52099),te=n(78462),tt=n(44035),tn=n(27599);let ti=e=>{let{label:t,description:n,labelColor:r="black",fontFamily:a,fontStyle:o="normal",fontWeight:l=400}=e,s=(0,i.jsxs)(O.U,{alignItems:"baseline",children:[(0,i.jsx)(u.xu,{color:"yellow.400",children:(0,i.jsx)(H.G,{icon:L.e7M})}),(0,i.jsx)(c.x,{textAlign:"left",color:r,fontWeight:l,fontSize:"lg",fontFamily:a,fontStyle:o,children:t})]});return n?(0,i.jsxs)(u.xu,{children:[s,(0,i.jsx)(c.x,{fontSize:"xs",color:"gray.500",children:n})]}):s},tr=e=>{let{value:t,updateValue:n,onFontUploadClick:r,weight:a="regular",defaultFont:o,fonts:l,customFontsEnabled:s,...d}=e,{workspaceFonts:u,globalFonts:h}=l,[p,g,x]=(0,_.useMemo)(()=>{let e=[...u,...h],n=e.find(e=>e.id===t),i=(0,e8.Yw)(e,t),r=(0,e8.Yw)(e,t,!1);return[n,i,r]},[h,u,t]),f=s&&u.filter(e=>!e.archived||e.id===(null==p?void 0:p.id)).length>0,j=!1,y="normal",C="bold"===a?700:400;if(p&&null!==p.workspaceId){j=!0===p.archived;let e=[...p.fontFiles||[]];y=(0,e7.Sd)(e)?"italic":"normal";let t=(0,e7.B_)(e);C=(0,e7.QP)(t,"bold"===a?700:400)||400}return(0,i.jsxs)(e0.v,{matchWidth:!0,isLazy:!0,children:[(0,i.jsx)(e1.j,{size:"lg",as:m.z,borderRadius:"md",rightIcon:(0,i.jsx)(H.G,{icon:U.ptq,transform:"shrink-6"}),variant:"toolbar",px:4,h:10,w:"100%",border:"1px solid",borderColor:"gray.200",...d,children:s&&j?(0,i.jsx)(ti,{label:x||"",fontFamily:'"'.concat(g,'"'),labelColor:t?"gray.800":"gray.400",fontStyle:y,fontWeight:C}):(0,i.jsx)(c.x,{textAlign:"left",fontFamily:'"'.concat(g||o,'"'),fontWeight:C,color:t?"gray.800":"gray.400",fontStyle:y,children:x||(0,i.jsx)(b.cC,{id:"Ff/YaY",values:{defaultFont:o,GAMMA_PROPER_NOUN:G.N6}})})}),(0,i.jsxs)(e2.q,{maxH:"320px",overflow:"auto",zIndex:"dropdown",children:[(0,i.jsxs)(tt._,{type:"radio",value:t||"",onChange:e=>n(e||void 0),children:[f&&(0,i.jsx)(v.NZ,{m:2,children:(0,i.jsx)(b.cC,{id:"syCKVA"})}),f&&u.map(e=>{var n;let r=e.id!==t,o=e.archived&&r,l=(null===(n=e.fontFiles)||void 0===n?void 0:n.length)===0&&r;if(!e.fontFiles||l||o)return null;let s=(0,e7.Sd)(e.fontFiles)?"italic":"normal";return j&&e.id===t?(0,i.jsx)(e4.i,{value:e.id,disabled:!0,children:(0,i.jsx)(ti,{fontFamily:e.name,label:e.name,fontStyle:s,description:(0,i.jsx)(b.cC,{id:"FZBl16"})})},e.id):(0,i.jsx)(e4.i,{value:e.id,children:(0,i.jsx)(c.x,{fontFamily:'"'.concat(e.name,'"'),fontSize:"lg",fontWeight:a,fontStyle:s,children:e.name})},e.id)}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tn.R,{}),(0,i.jsx)(v.NZ,{m:2,children:(0,i.jsx)(b.cC,{id:"Z/0bkt"})})]}),(0,i.jsx)(e4.i,{value:"",children:(0,i.jsx)(c.x,{fontFamily:o,fontSize:"lg",fontWeight:a,color:"gray.400",children:(0,i.jsx)(b.cC,{id:"fuNYg+"})})}),h&&h.map(e=>(0,i.jsx)(e4.i,{value:e.id,children:(0,i.jsx)(c.x,{fontFamily:(0,e8.eu)(e.id)?'"'.concat(e.id,'"'):'"'.concat(e.name,'"'),fontSize:"lg",fontWeight:a,children:e.name})},e.id))]}),s&&(0,i.jsx)(m.z,{width:"calc(100% + var(--chakra-space-4))",variant:"plain",position:"sticky",bottom:-2,m:-2,mt:2,p:2,borderX:"none",borderBottom:"none",fontSize:"sm",borderRadius:"none",onClick:r,leftIcon:(0,i.jsx)(H.G,{icon:U.A$k}),children:(0,i.jsx)(b.cC,{id:"vNYIdl"})})]})]})};var ta=n(29705),to=n(11082),tl=n(62700);let ts=e=>{var t,n,r;let{font:a,value:o,defaultWeight:l,updateValue:s,...d}=e,u=(0,_.useCallback)(e=>{let t=Number(e);Number.isNaN(t)||s(t)},[s]),h=(null==o?void 0:o.toString())||"",p=(0,tl.d)()[l],{weightOptions:g,isDeletedFontWeight:x}=(0,_.useMemo)(()=>{let e=(0,e8.W9)(a),t=void 0!==o&&!e.includes(o);if(!t||!o)return{isDeletedFontWeight:t,weightOptions:e};let n=[...e,o].sort((e,t)=>
20e-t);return{isDeletedFontWeight:t,weightOptions:n}},[a,o]),f=a&&(null==a?void 0:a.workspaceId)!==null,v=f&&(null===(t=a.fontFiles)||void 0===t?void 0:t.length)===0,j=x&&f,y=(0,te.p6)();return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e0.v,{matchWidth:!0,isLazy:!0,children:[(0,i.jsx)(e1.j,{size:"lg",as:m.z,borderRadius:"md",rightIcon:(0,i.jsx)(H.G,{icon:U.ptq,transform:"shrink-6"}),variant:"toolbar",px:4,h:10,w:"100%",border:"1px solid",borderColor:"gray.200",isDisabled:g.length<=1,...d,children:x?(0,i.jsx)(ti,{label:v?(0,i.jsx)(b.cC,{id:"EqUVJs"}):null!==(n=(0,tl.d)()[h])&&void 0!==n?n:p,labelColor:o?"gray.800":"gray.400"}):(0,i.jsx)(c.x,{textAlign:"left",color:o?"gray.800":"gray.400",fontWeight:400,children:null!==(r=(0,tl.d)()[h])&&void 0!==r?r:p})}),(0,i.jsx)(e2.q,{maxH:"320px",overflow:"auto",zIndex:"dropdown",children:(0,i.jsx)(tt._,{type:"radio",value:h,onChange:u,children:g.map(e=>{var t,n;return x&&o===e?(0,i.jsx)(e4.i,{value:e.toString(),disabled:!0,children:(0,i.jsx)(ti,{label:null!==(t=(0,tl.d)()[e])&&void 0!==t?t:p,description:j?(0,i.jsx)(b.cC,{id:"KFmni+"}):(0,i.jsx)(b.cC,{id:"mGTUJj"})})},e):(0,i.jsx)(e4.i,{value:e.toString(),children:(0,i.jsx)(c.x,{fontSize:"lg",children:null!==(n=(0,tl.d)()[e])&&void 0!==n?n:p})},e)})})})]}),j&&(0,i.jsx)(c.x,{fontSize:"xs",mt:1.5,children:(0,i.jsxs)(to.r,{href:y,textDecoration:"underline",isExternal:!0,children:[(0,i.jsx)(b.cC,{id:"RUO69p"}),(0,i.jsx)(ta.h,{ml:1})]})})]})},td=e=>{let{label:t,helperText:n,value:r,defaultValue:a,updateValue:o,...l}=e;return(0,i.jsxs)(ep.NI,{...l,children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(c.x,{children:t})}),(0,i.jsx)(e$.T,{value:r,updateValue:o,defaultValue:a}),n&&(0,i.jsx)(ep.Q6,{children:n})]})};var tc=n(84286),tu=n(66028);let th=e=>{let{value:t,updateValue:n,onLogoUploadStart:r,onLogoUploadFail:a}=e,[o,l]=(0,_.useState)(null),[s,d]=(0,_.useState)(null),c=(0,B.CG)(I.KV),{currentWorkspace:h}=(0,S.SE)(),p=c||(null==h?void 0:h.id);return p?t||s?(0,i.jsxs)(eO.g,{align:"flex-start",spacing:4,children:[(0,i.jsxs)(u.xu,{position:"relative",w:"100%",background:"gray.50",children:["placeholder"==s?(0,i.jsx)(tc.k3,{w:"100%"}):(0,i.jsx)(eR.E,{w:"100%",src:t||s||void 0,alt:"",onMouseDown:tu.br}),o==eI.D.Uploading&&(0,i.jsx)(tc.HI,{}),o==eI.D.Error&&(0,i.jsx)(tc.s7,{})]}),(0,i.jsx)(m.z,{onClick:()=>{n(null),l(null)},mt:2,w:"100%",children:(0,i.jsx)(b.cC,{id:"VlT9ID"})})]}):(0,i.jsx)(ew.un,{orgId:p,uploadType:"image",editType:"icon",dropHereText:j.ag._({id:"cmRkd1",values:{0:"%{browse}"}}),customHeight:"250px",customFontSize:"sm",showTip:!1,onUploadStart:e=>{let{file:t,tempUrl:n}=e;l(eI.D.Uploading),r&&r(),t.type&&(0,eL.Ns)(t.type)?d("placeholder"):d(n)},onUploadSuccess:e=>{let{src:t}=e;l(eI.D.Done),n(t),d(null)},onUploadFailed:e=>{l(eI.D.Error),a&&a()}}):null},tm=[{label:()=>j.ag._({id:"uIeorD"}),icon:eu.AVo,Component:()=>{let{dispatch:e,state:t,pop:n,label:r}=(0,ed.n)(),a=(0,Q.E7)(t.theme),o=(0,Q.wj)(t.theme),l=(0,_.useCallback)(t=>{var n,i;(null==t?void 0:t.type)===eM.E.IMAGE&&(null===(n=t.image)||void 0===n?void 0:n.uploadStatus)===eI.D.Uploading?e({type:"THEME_BACKGROUND_IMAGE_UPLOAD_STARTED",data:{background:t}}):(null==t?void 0:t.type)===eM.E.IMAGE&&(null===(i=t.image)||void 0===i?void 0:i.uploadStatus)===eI.D.Error?e({type:"THEME_BACKGROUND_IMAGE_UPLOAD_FAIL"}):e({type:"THEME_BACKGROUND_UPDATE_SUCCESS",data:{background:t}})},[e]);return(0,i.jsx)(eC,{onBackClick:n,label:r,children:(0,i.jsx)(em.K,{p:6,children:(0,i.jsx)(eP,{setBackground:l,background:a,defaultMessage:(0,i.jsxs)(e_.b,{fontSize:"xs",children:[(0,i.jsx)(eE.z,{}),(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"j+PsQe"})})]}),isDark:o})})})}},{label:()=>j.ag._({id:"Roi1AL"}),icon:eu.lCX,Component:e6},{label:()=>j.ag._({id:"TzJ8ZI"}),icon:eu.Zkk,Component:()=>{var e,t;let{label:n,state:r,dispatch:a,pop:o}=(0,ed.n)(),{theme:l}=r,s=(0,_.useCallback)(e=>a({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{accentColor:null!=e?e:void 0}}}),[a]);return(0,i.jsx)(eC,{onBackClick:o,label:n,children:(0,i.jsxs)(em.K,{spacing:2,p:6,children:[(0,i.jsxs)(ep.NI,{"data-testid":"custom-theme-accent-color-picker",children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"Udsgl4"})}),(0,i.jsx)(ep.Q6,{mb:4,children:(0,i.jsx)(b.cC,{id:"7ldaTf"})}),(0,i.jsx)(ef.U,{color:l.accentColor,defaultColor:A.uP,updateColor:s,gradient:l.config.accentGradient,updateGradient:e=>a({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{accentGradient:e}}})})]}),(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"NEXUdn"})}),(0,i.jsx)(ep.Q6,{mb:2,children:(0,i.jsx)(b.cC,{id:"+50OB4"})}),(0,i.jsx)(ev.Y,{value:(null===(e=l.config)||void 0===e?void 0:e.secondaryAccentColors)||[],updateV
20alue:e=>a({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{secondaryAccentColors:e}}}),maxColors:4})]}),(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{mt:4,children:(0,i.jsx)(b.cC,{id:"g/cMXH"})}),(0,i.jsx)(ex.X,{isChecked:!(null===(t=l.config)||void 0===t?void 0:t.disableReadabilityAdjustment),onChange:()=>{var e;return a({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{disableReadabilityAdjustment:!(null===(e=l.config)||void 0===e?void 0:e.disableReadabilityAdjustment)}}})},children:(0,i.jsx)(b.cC,{id:"fflXAI"})}),(0,i.jsx)(ep.Q6,{mb:2,children:(0,i.jsx)(b.cC,{id:"QjwqJE"})})]})]})})}},{label:()=>j.ag._({id:"COXEr5"}),icon:eu.l9f,Component:()=>{let{pop:e,state:t,dispatch:n,label:r}=(0,ed.n)(),{theme:a}=t;return(0,i.jsx)(eC,{onBackClick:e,label:r,children:(0,i.jsx)(eW,{theme:a,updateTheme:e=>n({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{...e}}})})})}},{label:()=>j.ag._({id:"I0oBSl"}),icon:eu.yGG,Component:()=>{var e;let t=(0,eh.ye)("customFonts"),{label:n,dispatch:r,state:a,pop:o}=(0,ed.n)(),{theme:l,fontState:s}=a,{fonts:d,fontsMap:u}=s,h=(0,_.useCallback)(e=>{let t=u[e],n=(0,e8.W9)(t),i=(0,e7.QP)(n,l.headingFontWeight||A.ZT.heading)||A.ZT.heading,a=(0,e8.s8)({fontsMap:u,headingFontId:e,bodyFontId:l.bodyFont});r({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{headingFont:e,headingFontWeight:i,fonts:a}}})},[r,u,l.bodyFont,l.headingFontWeight]),m=(0,_.useCallback)(e=>{let t=u[e],n=(0,e8.W9)(t),i=(0,e7.QP)(n,l.bodyFontWeight||A.ZT.body)||A.ZT.body,a=(0,e8.s8)({fontsMap:u,bodyFontId:e,headingFontId:l.headingFont});r({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{bodyFont:e,bodyFontWeight:i,fonts:a}}})},[r,u,l.headingFont,l.bodyFontWeight]),p=(0,_.useCallback)(e=>r({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{headingFontWeight:e}}}),[r]),g=(0,_.useCallback)(e=>r({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{bodyFontWeight:e}}}),[r]),x=(0,_.useCallback)(e=>r({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{headingColor:null!=e?e:void 0}}}),[r]),f=(0,_.useCallback)(e=>r({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{headingGradient:null!=e?e:void 0}}}),[r]),v=(0,_.useCallback)(e=>r({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{bodyColor:null!=e?e:void 0}}}),[r]),y=(0,_.useCallback)(()=>{let e=(0,te.p6)();window.open(e,"_blank")},[]),C=u[l.headingFont||A.ke.headingFont]||u[A.ke.headingFont],E=u[l.bodyFont||A.ke.bodyFont]||u[A.ke.bodyFont],k=l.headingFontWeight||A.ZT.heading,w=l.bodyFontWeight||A.ZT.body,I=(0,Q.wj)(l);return(0,i.jsx)(eC,{onBackClick:o,label:n,children:(0,i.jsxs)(em.K,{p:6,children:[(0,i.jsxs)(ep.NI,{mb:"2",children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"7OvVwW"})})}),(0,i.jsx)(tr,{fonts:d,value:l.headingFont,customFontsEnabled:t,updateValue:h,onFontUploadClick:y,weight:"bold",defaultFont:A.ke.headingFont,"data-testid":"custom-theme-heading-font-picker"}),t&&(0,i.jsx)(ts,{font:C,value:k,defaultWeight:700,updateValue:p})]}),(0,i.jsxs)(ep.NI,{mb:"2","data-testid":"custom-theme-heading-color-picker",children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"v9mrgh"})})}),(0,i.jsx)(ef.U,{color:l.config.headingColor,updateColor:x,defaultColor:I?A.Qw:A.l0,gradient:l.config.headingGradient,updateGradient:f})]}),(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"B4QCf7"})})}),(0,i.jsx)(tr,{fonts:d,value:l.bodyFont,customFontsEnabled:t,updateValue:m,onFontUploadClick:y,weight:"normal",defaultFont:A.ke.bodyFont,"data-testid":"custom-theme-body-font-picker"}),t&&(0,i.jsx)(ts,{font:E,value:w,defaultWeight:400,updateValue:g})]}),(0,i.jsx)(td,{label:j.ag._({id:"jx8uni"}),value:(null===(e=l.config)||void 0===e?void 0:e.bodyColor)||null,defaultValue:I?A.Z_:A.zL,updateValue:v}),(0,i.jsxs)(e_.b,{fontSize:"xs",mt:"6",children:[(0,i.jsx)(eE.z,{}),(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"3L+fCN"})})]})]})})}},{label:()=>j.ag._({id:"iG7KNr"}),icon:e=>e.logoUrl?eu.Hh4:eu.thV,Component:()=>{let{pop:e,state:t,dispatch:n,label:r}=(0,ed.n)(),{theme:a}=t;return(0,i.jsx)(eC,{onBackClick:e,label:r,children:(0,i.jsx)(em.K,{p:6,children:(0,i.jsx)(ep.NI,{children:(0,i.jsx)(th,{value:a.logoUrl||null,onLogoUploadStart:()=>{n({type:"THEME_LOGO_UPLOAD_STARTED"})}
20,updateValue:e=>n({type:"THEME_LOGO_UPLOAD_SUCCESS",data:{logoUrl:null!=e?e:void 0}}),onLogoUploadFail:()=>{n({type:"THEME_LOGO_UPLOAD_FAIL"})}})})})})}},{label:()=>j.ag._({id:"sxkWRg"}),icon:eu.gr5,Component:()=>{var e,t,n,r,a,o,l;let{pop:s,state:d,dispatch:c,label:u}=(0,ed.n)(),{theme:h}=d;return(0,i.jsx)(eC,{onBackClick:s,label:u,children:(0,i.jsxs)(em.K,{spacing:4,p:6,children:[(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"S0kLOH"})}),(0,i.jsx)(eV.I,{defaultValue:h.id,readOnly:!0})]}),(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"PPYsiY"})}),(0,i.jsx)(eK.g,{defaultValue:null===(t=h.config.keywords)||void 0===t?void 0:null===(e=t.color)||void 0===e?void 0:e.join(", "),onChange:e=>{c({type:"THEME_UPDATE_THEME_KEYWORDS",data:{keywords:{color:e.target.value.split(",").map(e=>e.trim()).filter(Boolean)}}})}}),(0,i.jsx)(ep.Q6,{children:"Should be separated with commas"})]}),(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"valYIJ"})}),(0,i.jsx)(eK.g,{defaultValue:null===(r=h.config.keywords)||void 0===r?void 0:null===(n=r.tone)||void 0===n?void 0:n.join(", "),onChange:e=>{c({type:"THEME_UPDATE_THEME_KEYWORDS",data:{keywords:{tone:e.target.value.split(",").map(e=>e.trim()).filter(Boolean)}}})}}),(0,i.jsx)(ep.Q6,{children:"Should be separated with commas"})]}),(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"1hKEom"})}),(0,i.jsx)(eq.Y2,{defaultValue:h.priority,onChange:(e,t)=>
20{c({type:"THEME_UPDATE_THEME_PROPS",data:{themeProps:{priority:Number.isNaN(t)?void 0:t}}})},children:(0,i.jsx)(eq.zu,{})}),(0,i.jsx)(ep.Q6,{children:"Higher priority themes show up first in the themes list"})]}),(0,i.jsxs)(ep.NI,{children:[(0,i.jsx)(eg.l,{children:(0,i.jsx)(b.cC,{id:"q3il6U"})}),(0,i.jsx)(eq.Y2,{defaultValue:null===(a=h.config)||void 0===a?void 0:a.fontSize,onChange:(e,t)=>{c({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{fontSize:Number.isNaN(t)?void 0:t}}})},children:(0,i.jsx)(eq.zu,{})})]}),(0,i.jsx)(eJ,{label:(0,i.jsx)(b.cC,{id:"3loch2"}),initialValue:null===(o=h.config)||void 0===o?void 0:o.contentStyles,updateValue:e=>c({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{contentStyles:e}}})}),(0,i.jsx)(eJ,{label:(0,i.jsx)(b.cC,{id:"r0cjYF"}),initialValue:null===(l=h.config)||void 0===l?void 0:l.containerStyles,updateValue:e=>c({type:"THEME_UPDATE_THEME_CONFIG",data:{themeConfig:{containerStyles:e}}}),helperText:j.ag._({id:"W5hi5t"})})]})})},isForGammaOnly:!0}],tp=(e,t)=>!!e.featureFlag&&!eh.VH.get(e.featureFlag)||!!e.isForGammaOnly&&!t,tg={outline:"3px dashed var(--chakra-colors-sunglow-500)",outlineOffset:"0"},tx=()=>{let{push:e,state:t,setLabel:n}=(0,ed.n)(),{theme:r}=t,{isGammaOrgUser:a}=(0,S.SE)(),o=(0,_.useMemo)(()=>tm.filter(e=>!tp(e,a)),[a]);return(0,i.jsx)(ec.GS,{listStyleType:"none",marginStart:0,children:o.map((t,o)=>{let{label:l,icon:s,Component:d}=t,c="".concat(o+1,". ").concat(l());return(0,i.jsx)(ec.HC,{children:(0,i.jsx)(ey,{icon:"function"==typeof s?s(r):s,label:c,onClick:()=>{n(c),e(d)},...t.isForGammaOnly&&a&&tg})},l())})})},tf=e=>{let{theme:t,dispatch:n,fonts:r,fontsMap:a}=e,[o,l]=(0,_.useState)("");return(0,i.jsx)(ed.O.Provider,{value:{state:{theme:t,fontState:{fonts:r,fontsMap:a}},dispatch:n,label:o,setLabel:l},children:(0,i.jsx)(es,{InitialComponent:tx})})};var tv=n(58905),tb=n(75230),tj=n(64951),ty=n(29264);let tC=e=>{let{value:t,onSave:n,themeValidationError:r}=e;return(0,i.jsxs)(ep.NI,{isInvalid:!!r,children:[(0,i.jsx)(tv.C,{defaultValue:t,placeholder:(0,A.F)(),onSubmit:n,submitOnBlur:!0,isPreviewFocusable:!0,fontSize:"3xl",children:(0,i.jsxs)(O.U,{minHeight:14,children:[(0,i.jsx)(tb.w,{"data-testid":"custom-theme-name-preview",noOfLines:1}),(0,i.jsx)(eV.I,{as:tj.V,w:{sm:"50%",lg:"40%",xl:"30%","2xl":"20%"},"data-testid":"custom-theme-name-input"}),(0,i.jsx)(t_,{})]})}),r&&(0,i.jsx)(eY.J1,{fontWeight:"500",pb:2,children:r})]})},t_=()=>{let{isEditing:e,getSubmitButtonProps:t,getCancelButtonProps:n,getEditButtonProps:r}=(0,ty.Z)();return e?(0,i.jsxs)(h.h,{justifyContent:"center",size:"sm",spacing:0,children:[(0,i.jsx)(v.kH,{label:(0,i.jsx)(b.cC,{id:"dEgA5A"}),children:(0,i.jsx)(eD.h,{variant:"ghost","aria-label":j.ag._({id:"dEgA5A"}),icon:(0,i.jsx)(H.G,{icon:U.YIN}),...n()})}),(0,i.jsx)(v.kH,{label:(0,i.jsx)(b.cC,{id:"fNzdjk"}),children:(0,i.jsx)(eD.h,{variant:"ghost","aria-label":j.ag._({id:"fNzdjk"}),icon:(0,i.jsx)(H.G,{icon:U.LEp}),...t(),"data-testid":"save-theme-name-button"})})]}):(0,i.jsx)(d.k,{justifyContent:"center",children:(0,i.jsx)(v.kH,{label:(0,i.jsx)(b.cC,{id:"+MxT3Q"}),children:(0,i.jsx)(u.xu,{children:(0,i.jsx)(eD.h,{variant:"ghost","aria-label":j.ag._({id:"+MxT3Q"}),size:"sm",icon:(0,i.jsx)(H.G,{icon:U.Yai}),...r(),ref:null})})})})},tE="theme-editor-root",tk=e=>{var t;let{state:n,dispatch:r,docContent:a,doc:o,workspaceId:l}=e,{theme:s,customizationStep:u}=n,[h,m]=(0,_.useState)(),[p,g]=(0,_.useState)(null),f=(0,T.Kt)(m,300);(0,_.useEffect)(()=>{f(s)},[s,f]);let{globalFonts:v,workspaceFonts:j,fontsMap:y,allThemeFonts:C}=(0,Z.TY)(l);(null==a?void 0:a.content)&&(null===(t=a.content[0].attrs)||void 0===t?void 0:t.background)&&(a.content[0].attrs.background=K.jg);let E=(0,B.CG)(z.mT),k=(0,q.i)({base:"var(--chakra-sizes-xs)",lg:"var(--chakra-sizes-md)","2xl":"var(--chakra-sizes-xl)"})||"var(--chakra-sizes-md)",w=(0,_.useMemo)(()=>(0,X.y)(),[]);(0,_.useEffect)(()=>{let e=null==h?void 0:h.config.accentBackgrounds;if(e){if(p&&0===e.length){p.commands.setContent(w);return}null==p||p.commands.updateThemeAccentImages(e,!0)}}
20,[p,null==h?void 0:h.config.accentBackgrounds,w]);let I=(0,_.useCallback)(e=>{r({type:"SET_NEW_THEME_FOR_SELECTING",data:{theme:(0,Q.mg)(e)}})},[r]),S=(0,_.useCallback)(()=>{r({type:"SET_NEW_THEME_FOR_CUSTOMIZING",data:{theme:(0,Q.mg)(s,!0)}})},[r,s]);return(0,i.jsxs)(d.k,{direction:"row-reverse",h:"100%",children:[(0,i.jsx)(d.k,{direction:"column",overflowY:"auto",w:k,borderLeft:"1px solid",borderColor:"gray.200",children:(0,i.jsx)(d.k,{flex:"1",direction:"column",position:"relative",children:"selection"===u?(0,i.jsx)(et,{theme:s,onThemeClick:I,onSelectClick:S}):(0,i.jsx)(tf,{theme:s,dispatch:r,fonts:{globalFonts:v,workspaceFonts:j},fontsMap:y})})}),(0,i.jsx)(d.k,{flex:1,bg:"gray.100",position:"relative",maxW:"calc(100vw - ".concat(k,")"),children:(0,i.jsxs)(d.k,{className:tE,overflowY:"scroll",width:"100%",height:"100%",direction:"column",position:"relative",css:{"--editor-width":"100%"},children:[(0,i.jsx)(V.Y,{}),(0,i.jsx)(en.J,{fonts:C}),(0,i.jsxs)(N.m,{variant:"soft-rounded",size:"sm","data-testid":"custom-theme-tabs",children:[a&&(0,i.jsx)(x.M,{position:"sticky",top:0,zIndex:2,background:"white",children:(0,i.jsxs)(P.t,{p:2,position:"absolute",top:"1rem",background:"white",borderRadius:"full",shadow:"md",children:[(0,i.jsx)(M.O,{"data-testid":"custom-theme-tester-deck-tab",children:(0,i.jsxs)(O.U,{children:[(0,i.jsx)(H.G,{icon:L.Mdf}),(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"vat9WD"})})]})}),(0,i.jsx)(M.O,{"data-testid":"custom-theme-current-deck-tab",children:(0,i.jsxs)(O.U,{children:[(0,i.jsx)(H.G,{icon:U.s2}),(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"VJUm9p"})})]})})]})}),(0,i.jsxs)(R.n,{"data-testid":"custom-theme-tab-panels",children:[(0,i.jsx)(D.x,{p:0,"data-testid":"custom-theme-preview-editor",children:(0,i.jsx)(W.fb,{onCreate:e=>{let{editor:t}=e;return g(t)},initialContent:w,theme:h,scrollingParentSelector:".".concat(tE),isInsideDrawer:!0})}),a&&(0,i.jsx)(D.x,{p:0,"data-testid":"custom-theme-preview-editor",children:(0,i.jsx)(W.fb,{reduxData:{cards:E},initialContent:a,theme:h,scrollingParentSelector:".".concat(tE),doc:o,isInsideDrawer:!0})})]})]})]})})]})},tw=e=>{var t;let{name:n,doc:r,theme:a,themeValidationError:o,dispatch:l}=e,[s,d]=(0,_.useState)(),{data:u,loading:h}=(0,k.gec)({variables:{id:null==a?void 0:a.id},skip:!a||"new"===a.id}),m=(0,Y.$)(null==r?void 0:r.title);(0,_.useEffect)(()=>{!h&&u&&u.theme&&d(u.theme)},[h,u,d]);let p=(0,_.useCallback)(e=>{let t=e||(0,A.F)();l({type:"THEME_UPDATE_THEME_NAME",data:{name:t}})},[l]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(tC,{value:n||(0,A.F)(),onSave:p,themeValidationError:o}),h?(0,i.jsx)(F.N,{noOfLines:1,fontSize:"sm",maxW:"300px"}):(0,i.jsxs)(c.x,{color:"gray.700",fontSize:"sm",fontWeight:"normal",letterSpacing:"normal",children:[(null==s?void 0:s.createdBy)&&(0,i.jsx)(b.cC,{id:"qeNU2j",values:{0:s.createdBy.displayName}})," ",(null==s?void 0:s.docCount)&&(null==s?void 0:s.docCount)===1&&(null==s?void 0:s.id)===(null==r?void 0:null===(t=r.theme)||void 0===t?void 0:t.id)?(0,i.jsx)(b.cC,{id:"On+kRG",values:{docTitle:m,GAMMA_ARTIFACT_PROPER_NOUN:G.Yc},components:{0:(0,i.jsx)("strong",{})}}):(0,i.jsx)(i.Fragment,{children:(0,i.jsx)(b.cC,{id:"eVRfvp",values:{GAMMA_ARTIFACT_PROPER_NOUN:G.Yc,GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:G.aq,0:(null==s?void 0:s.docCount)||0},components:{0:(0,i.jsx)("strong",{}),1:(0,i.jsx)("strong",{})}})})]})]})},tI=["headingFont","bodyFont","accentColor","logoUrl"],tS=(0,_.memo)(e=>{var t;let{isOpen:n,onClose:x,state:f,dispatch:y,docContent:N,onThemeCreated:P,disableDrawerTransition:M=!1}=e,O=(0,w.z$)(),R=(0,r.p)(),D=(0,E.v9)(I.yx),F=(0,T.NE)(n,500),{user:U,currentWorkspace:L}=(0,S.SE)(),H=(0,_.useRef)(null),z=M?n:F,[G,{loading:B}]=(0,k.Wu6)(),[W,{loading:V}
20]=(0,k.suk)(),K="loading"===f.themeBackgroundImgStatus||"loading"===f.themeLogoImgStatus,q=(0,_.useCallback)(()=>{y({type:"THEME_RESET"}),x()},[y,x]),Y=(0,_.useCallback)(()=>{if(U&&L&&f.theme){if(!f.theme.name){y({type:"THEME_VALIDATION_ERROR",data:{errorMessage:"Theme name is required."}});return}if("new"===f.theme.id){let e={...f.theme,workspaceId:L.id},{id:t,archived:n,fonts:i,...r}=e;G({variables:{input:r},update:(t,n)=>{let{data:i}=n;(null==i?void 0:i.createTheme)&&t.writeQuery({query:k.$LR,variables:{workspaceId:e.workspaceId,archived:!1},data:{themes:[i.createTheme]}})},optimisticResponse:{createTheme:{__typename:"Theme",...e,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}).then(t=>{let{data:n}=t;if(null==n?void 0:n.createTheme){var i;null==O||O.track(w.AA.THEME_CREATED,{theme_id:null==n?void 0:null===(i=n.createTheme)||void 0===i?void 0:i.id,type:"new"}),null==P||P(n.createTheme)}R({title:j.ag._({id:"NE6T/k",values:{0:e.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}),q()}).catch(t=>{t.graphQLErrors&&t.graphQLErrors.length>0&&"duplicate_theme_name"===t.graphQLErrors[0].code?y({type:"THEME_VALIDATION_ERROR",data:{errorMessage:t.message}}):(console.error("Couldn't create theme ".concat(e.name," error: ").concat(t)),R({title:j.ag._({id:"FcSGqc",values:{e:t}}),status:"error",duration:3e3,position:"top",isClosable:!1}))})}else{let{__typename:e,archived:t,createdTime:n,updatedTime:i,createdBy:r,fonts:a,...o}=f.theme;for(let e of tI)e in o&&void 0===o[e]&&(o[e]=null);W({variables:{input:o},update:(e,t)=>{let{data:n}=t;(null==n?void 0:n.updateTheme)&&e.writeQuery({query:k.$LR,variables:{workspaceId:f.theme.workspaceId,archived:!1},data:{themes:[n.updateTheme]}})},optimisticResponse:{updateTheme:{__typename:"Theme",...f.theme,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}).then(()=>{null==O||O.track(w.AA.THEME_UPDATED,{theme_id:f.theme.id}),R({title:j.ag._({id:"WODDpW",values:{0:f.theme.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}),q()}).catch(e=>{e.graphQLErrors&&"duplicate_theme_name"===e.graphQLErrors[0].code?y({type:"THEME_VALIDATION_ERROR",data:{errorMessage:e.message}}):(console.error("Couldn't update theme ".concat(f.theme.name," error: ").concat(e)),R({title:j.ag._({id:"hSYiXl",values:{e:e}}),status:"error",duration:3e3,position:"top",isClosable:!1}))})}}},[U,L,y,null==f?void 0:f.theme,G,R,q,O,P,W]),Z="new"===f.theme.id||!C()(f.theme,f.originalTheme);return(0,i.jsx)(v.Wk,{isDark:!1,children:(0,i.jsxs)(a.d,{placement:"bottom",onClose:q,isOpen:n,isFullHeight:!0,initialFocusRef:H,children:[(0,i.jsx)(o.Z,{}),(0,i.jsxs)(l.s,{borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",transform:M?"none !important":void 0,children:[(0,i.jsx)(s.x,{borderBottom:"1px solid #000",borderColor:"gray.200",children:"selection"===f.customizationStep?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(d.k,{"align-items":"center",letterSpacing:"normal",fontSize:"3xl",minH:14,py:1,children:(0,i.jsx)(c.x,{children:(0,i.jsx)(b.cC,{id:"ytpdnC"})})}),(0,i.jsx)(c.x,{color:"gray.700",fontSize:"sm",fontWeight:"normal",letterSpacing:"normal",children:(0,i.jsx)(b.cC,{id:"d9p6AC"})})]}):(0,i.jsxs)(d.k,{"justify-content":"space-between",alignItems:"flex-end",children:[(0,i.jsx)(u.xu,{flex:1,children:(0,i.jsx)(tw,{name:(null===(t=f.theme)||void 0===t?void 0:t.name)||(0,A.F)(),doc:D,theme:f.theme,dispatch:y,themeValidationError:f.themeValidationError})}),(0,i.jsxs)(h.h,{children:[(0,i.jsx)(m.z,{variant:"ghost",onClick:q,children:(0,i.jsx)(b.cC,{id:"dEgA5A"})}),(0,i.jsx)(v.kH,{isDisabled:!K,label:(0,i.jsx)(b.cC,{id:"yz1qqg"}),children:(0,i.jsx)(u.xu,{display:"inline-flex",children:(0,i.jsx)(m.z,{variant:"solid",isLoading:B||V||K,isDisabled:!Z,onClick:Y,"data-testid":"custom-theme-save",children:(0,i.jsx)(b.cC,{id:"EsJdRp"})})})})]})]})}),(0,i.jsx)(p.f,{p:0,h:"100%",children:z?(0,i.jsx)(tk,{state:f,workspaceId:null==L?void 0:L.id,dispatch:y,docContent:N,doc:D}):(0,i.jsx)(tT,{})}),(0,i.jsx)(g.o,{ref:H})]})]})})});tS.displayName="ThemeEditorDrawer";let tT=()=>(0,i.jsx)(u.xu,{flexDirection:"column",flex:"1",w:"100%",h:"100%",bg:"gray.100",inset:0,children:(0,i.jsx)(x.M,{h:"100%",children:(0,i.jsx)(f.$,{})})})},30233:function(e,t,n){"use strict";n.d(t,{S:function(){return o}});var i=n(52322),r=n(69251),a=n(67109);let o=e=>{let{size:t}=e;return(0,i.jsx)(r.r,{gap:4,flex:1,my:2,templateColumns:{base:"repeat(2, minmax(0, 1fr))"},children:Array(t).fill(!0).map((e,t)=>(0,i.jsx)(a.O,{h:"9em",borderRadius:"base"},t))})}},26838:function(e,t,n){"use strict";n.d(t,{o:function(){return el}});var i=n(52322),r=n(56581),a=n(29117),o=n(77533),l=n(70065),s=n(55478),d=n(28535),c=n(38035),u=n(36474),h=n(5879),m=n(87254),p=n(2784),g=n(90763),x=n(93202),f=n(48832),v=n(11050),b=n(50260),j=n(10625),y=n(67046),C=n(32899),_=n(332),E=n(99058),k=n(27599),w=n(25481),I=n(42946),S=n(54933),T=n(49929),A=n(94523),N=n(82282),P=n(31807),M=n(47749),O=n(29318);let R=(0,p.memo)(e=>{let{theme:t}=e,n=(0,O.eo)({theme:t}),r=t.name.replace(M.Qk,"");return(0,i.jsxs)(j.v,{isLazy:!0,children:[(0,i.jsx)(y.j,{as:C.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,i.jsx)(T.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,i.jsx)(h.cC,{id:"7L01XJ"})}),(0,i.jsx)(_.h,{children:(0,i.jsxs)(E.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)(d.xu,{px:4,py:0,maxWidth:"300px",children:[(0,i.jsx)(o.x,{noOfLines:3,children:r}),t.createdTime&&(0,i.jsx)(o.x,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,i.jsx)(h.cC,{id:"MXSt4t",values:{0:(0,N.Z)((0,P.Z)(t.createdTime),"PPP")}})}),t.createdBy&&(0,i.jsx)(A.kH,{label:t.createdBy.email,children:(0,i.jsx)(o.x,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,i.jsx)(h.cC,{id:"t490IT",values:{0:t.createdBy.displayName}})})})]}),(0,i.jsx)(k.R,{}),(0,i.jsx)(w.s,{icon:(0,i.jsx)(T.G,{icon:S.XnX,fixedWidth:!0}),onClick:n,children:(0,i.jsx)(h.cC,{id:"yKu/3Y"})})]})})]})});var D=n(53596),F=n(36651),U=n(14274),L=n(8393),H=n(21733);let z=(0,p.memo)(e=>{let{onCustomizeThemeClick:t,onEditThemeClick:n}=e,{isGammaOrgUser:r}=(0,H.SE)(),a=r&&"production"!==U.v.APPLICATION_ENVIRONMENT;return(0,i.jsxs)(j.v,{isLazy:!0,children:[(0,i.jsx)(y.j,{as:C.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,i.jsx)(T.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,i.jsx)(h.cC,{id:"7L01XJ"})}),(0,i.jsx)(_.h,{children:(0,i.jsxs)(E.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsx)(w.s,{icon:(0,i.jsx)(T.G,{icon:I.Mw$,fixedWidth:!0}),onClick:t,children:(0,i.jsx)(h.cC,{id:"XZd6AM"})}),a&&(0,i.jsx)(w.s,{color:"orange.500",icon:(0,i.jsx)(d.xu,{boxSize:"4",children:(0,i.jsx)(L.Y,{})}),onClick:n,children:"Edit theme"}),(0,i.jsx)(k.R,{}),(0,i.jsx)(d.xu,{px:4,py:0,maxW:56,children:(0,i.jsx)(o.x,{fontSize:"sm",color:"gray.600",children:(0,i.jsx)(h.cC,{id:"FV8ABd"})})})]})})]})});var G=n(29705),B=n(92850),W=n(26468),V=n(22226),K=n(54326),q=n(97217),Y=n(11082),Z=n(67109),X=n(50250),Q=n(75768),J=n(62614),$=n(2338),ee=n(5632),et=n(94199),en=n(91994),ei=n(47968);let er=e=>{let{theme:t,isOpen:n,onClose:r}=e,{asPath:a}=(0,ee.useRouter)(),[l,s]=(0,p.useState)(),[d,c]=(0,p.useState)(),u=(0,en.CG)(ei.yx),m=(0,O.EW)({theme:t,showLinkToDashboard:!!u}),{data:g,loading:f}=(0,x.gec)({variables:{id:null==t?void 0:t.id},skip:!t||"new"===t.id});(0,p.useEffect)(()=>{var e,t;!f&&g&&((null===(e=g.theme)||void 0===e?void 0:e.docCount)&&s(g.theme.docCount),(null===(t=g.theme)||void 0===t?void 0:t.siteCount)&&c(g.theme.siteCount))},[f,g,s,c]);let v=(0,p.useMemo)(()=>{let e=0;return l&&l>0&&(e+=l),d&&d>0&&(e+=d),e},[l,d]);return(0,i.jsxs)(B.u_,{closeOnOverlayClick:!1,isOpen:n,onClose:r,size:"lg",children:[(0,i.jsx)(W.Z,{}),(0,i.jsxs)(V.h,{children:[(0,i.jsx)(K.x,{children:(0,i.jsx)(h.cC,{id:"oh7Knm",values:{0:t.name}})}),(0,i.jsx)(q.f,{children:v>0?(0,i.jsxs)(o.x,{mb:2,children:[(0,i.jsx)(h.cC,{id:"uSopl9",values:{totalCount:v,GAMMA_ARTIFACT_PROPER_NOUN:et.Yc,GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:et.aq}})," ",(0,i.jsx)(h.cC,{id:"c+lbSJ",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:et.aq}})," ","/#themes"!==a&&(0,i.jsx)(h.cC,{id:"kLomb7",components:{0:(0,i.jsx)(Y.r,{color:"trueblue.500",colorScheme:"trueblue",href:b.oH,textDecoration:"underline",isExternal:!0}),1:(0,i.jsx)(G.h,{mx:"2px"})}})]}):f?(0,i.jsx)(Z.O,{h:"1em",mb:2}):(0,i.jsx)(o.x,{mb:2,children:(0,i.jsx)(h.cC,{id:"KNTN0L",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:et.aq}})})}),(0,i.jsx)(X.m,{children:(0,i.jsxs)(Q.h,{children:[(0,i.jsx)(J.z,{variant:"ghost",onClick:r,children:(0,i.jsx)(h.cC,{id:"dEgA5A"})}),(0,i.jsx)(J.z,{variant:"ghost",colorScheme:"red",onClick:()=>{m(),r()},children:(0,i.jsx)(h.cC,{id:"zck3yw"})})]})}),(0,i.jsx)($.o,{})]})]})},ea=(0,p.memo)(e=>{let{theme:t,openThemeEditorWithThisTheme:n,onDuplicate:r,onArchiveThemeModalOpen:a,isArchiveThemeModalOpen:l,onArchiveThemeModalClose:s}=e,{canMakeStandard:c,convertToStandard:u}=(0,O.Xm)(t);return(0,i.jsxs)(j.v,{isLazy:!0,children:[(0,i.jsx)(y.j,{as:C.h,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,i.jsx)(T.G,{icon:I.S6C}),onClick:e=>e.stopPropagation(),children:(0,i.jsx)(h.cC,{id:"7L01XJ"})}),(0,i.jsx)(_.h,{children:(0,i.jsxs)(E.q,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)(d.xu,{px:4,py:0,maxWidth:"300px",children:[(0,i.jsx)(o.x,{noOfLines:3,children:t.name}),t.createdTime&&(0,i.jsx)(o.x,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,i.jsx)(h.cC,{id:"MXSt4t",values:{0:(0,N.Z)((0,P.Z)(t.createdTime),"PPP")}})}),t.createdBy&&(0,i.jsx)(A.kH,{label:t.createdBy.email,children:(0,i.jsx)(o.x,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,i.jsx)(h.cC,{id:"t490IT",values:{0:t.createdBy.displayName}})})})]}),(0,i.jsx)(k.R,{}),(0,i.jsx)(w.s,{icon:(0,i.jsx)(T.G,{icon:I.q2v,fixedWidth:!0}),onClick:n,children:(0,i.jsx)(h.cC,{id:"ePK91l"})}),(0,i.jsx)(w.s,{icon:(0,i.jsx)(T.G,{icon:I.WM4,fixedWidth:!0}),onClick:r,children:(0,i.jsx)(h.cC,{id:"euc6Ns"})}),(0,i.jsx)(k.R,{}),c&&(0,i.jsx)(w.s,{color:"orange.500",icon:(0,i.jsx)(d.xu,{boxSize:"4",children:(0,i.jsx)(L.Y,{})}),onClick:u,children:(0,i.jsx)(h.cC,{id:"thLYdn"})}),(0,i.jsx)(w.s,{color:"red.500",icon:(0,i.jsx)(T.G,{icon:I.N2j,fixedWidth:!0}),onClick:a,children:(0,i.jsx)(h.cC,{id:"B495Gs"})})]})}),l&&(0,i.jsx)(_.h,{children:(0,i.jsx)(er,{theme:t,isOpen:!0,onClose:s})})]})}),eo=e=>{let{isChecked:t,name:n}=e;return(0,i.jsxs)(a.U,{spacing:1,alignItems:"flex-start",children:[t&&(0,i.jsx)(r.n,{w:3,h:"auto",mr:1,mt:1,color:"trueblue.700"}),(0,i.jsx)(o.x,{fontSize:"sm",noOfLines:1,"data-testid":"theme-name",color:t?"trueblue.700":void 0,children:n})]})},el=(0,p.memo)(e=>{var t,n,r,o;let{theme:j,onThemeClicked:y,isChecked:C=!1,onEditClick:_,variant:E="outline"}=e,k=(0,v.z$)(),w=(0,l.p)(),I="ghost"===E,S=(0,p.useRef)(null),T=(0,p.useCallback)(e=>()=>{_&&(e?_((0,b.mg)(j,!0)):_(j))},[_,j]),{isOpen:A,onOpen:N,onClose:P}=(0,s.q)({id:"ArchiveThemeModalDisclosure"}),{user:M,currentWorkspace:O}=(0,F.SE)(),[U]=(0,x.gFs)(),L=j.name.replace(b.Qk,""),H=(0,p.useCallback)(()=>
20{if(!M||!O)return;let{id:e,...t}=j;U({variables:{id:e},update:(e,t)=>{let{data:n}=t;(null==n?void 0:n.duplicateTheme)&&e.writeQuery({query:x.$LR,variables:{workspaceId:j.workspaceId,archived:!1},data:{themes:[n.duplicateTheme]}})},optimisticResponse:{duplicateTheme:{id:"temp",__typename:"Theme",...t,name:"".concat(L," (copy)"),archived:!1,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}).then(t=>{let{data:n}=t;n&&(null==k||k.track(v.AA.THEME_DUPLICATED,{theme_id:n.duplicateTheme.id,source_theme_id:e,name:L}),null==k||k.track(v.AA.THEME_CREATED,{theme_id:n.duplicateTheme.id,name:n.duplicateTheme.name,type:"duplicate"}),w({title:m.ag._({id:"DvRoa4",values:{0:n.duplicateTheme.name}}),status:"success",duration:3e3,position:"top",isClosable:!0}))}).catch(e=>{console.error("Couldn't duplicate theme ".concat(j.name," error: ").concat(e)),w({title:m.ag._({id:"aOi88n",values:{err:e}}),status:"error",duration:3e3,position:"top",isClosable:!1})})},[M,O,j,U,L,k,w]),G=j.workspaceId&&!!(null===(t=j.createdBy)||void 0===t?void 0:t.displayName),B=!!y,W=!_;return(0,i.jsxs)(d.xu,{ref:S,bgColor:C?"trueblue.100":I?void 0:"linen.50",textAlign:"left",tabIndex:B?0:void 0,borderRadius:"md",transitionProperty:I?"common":"none",transitionDuration:"normal",outline:"none",onClick:()=>null==y?void 0:y(j),onKeyPress:e=>{B&&"Enter"===e.key&&(null==y||y(j))},_hover:B?{shadow:I||C?void 0:"lg",bgColor:C?"trueblue.100":I?"trueblue.50":"gray.100"}:void 0,_focus:{boxShadow:C||!B?void 0:"outline"},shadow:I?void 0:"md",p:I?2:0,"data-theme-id":j.id,"data-testid":C?"current-theme-preview":void 0,cursor:B?"pointer":void 0,children:[(0,i.jsx)(D.n,{theme:j,minH:"9em",maxH:"9em"}),(0,i.jsxs)(c.k,{align:"baseline",mt:1,direction:"column",p:I?0:2,children:[G&&(0,i.jsx)(c.k,{my:2,children:(0,i.jsx)(eo,{name:L,isChecked:C})}),(0,i.jsxs)(a.U,{alignItems:"flex-start",w:"100%",children:[G?(0,i.jsx)(g.l,{createdByYou:(null===(n=j.createdBy)||void 0===n?void 0:n.id)===(null==M?void 0:M.id),createdByName:null===(r=j.createdBy)||void 0===r?void 0:r.displayName,createdByProfileImageUrl:null===(o=j.createdBy)||void 0===o?void 0:o.profileImageUrl,timestampDescription:j.updatedTime&&(0,i.jsx)(h.cC,{id:"E1dtM3",values:{0:(0,f.Dw)(j.updatedTime)}})}):(0,i.jsx)(eo,{name:L,isChecked:C}),(0,i.jsx)(u.L,{}),W?null:j.workspaceId&&!j.archived?(0,i.jsx)(ea,{theme:j,openThemeEditorWithThisTheme:T(!1),onDuplicate:H,onArchiveThemeModalOpen:N,isArchiveThemeModalOpen:A,onArchiveThemeModalClose:P}):j.workspaceId&&!0===j.archived?(0,i.jsx)(R,{theme:j}):(0,i.jsx)(z,{onCustomizeThemeClick:T(!0),onEditThemeClick:T(!1)})]})]})]})});el.displayName="ThemePreview"},53596:function(e,t,n){"use strict";n.d(t,{n:function(){return j}});var i=n(52322),r=n(28535),a=n(82554),o=n(38035),l=n(77533),s=n(73200),d=n(5879),c=n(2784),u=n(50260),h=n(52
2000),m=n(35873),p=n(22569),g=n(87205),x=n(15151),f=n(27333),v=n(5995),b=n(89098);let j=(0,c.memo)(e=>{var t;let{theme:n,variant:c="outline",...j}=e,{contentStyles:C}=n.config,_=(0,p.R5)(n),E=(0,u.wj)(n),k=(0,v.l)(n),w=(0,x.J)(n,!1),I=(0,b.c)(n),S=(0,p.wh)(_,E,g.Iv),T=null===(t=n.config.accentBackgrounds)||void 0===t?void 0:t[0],A=T?(0,p.wh)(T,E,g.Iv):{},N=T?{display:"grid",gridTemplateRows:"minmax(2.5em, auto) auto",gridTemplateAreas:'"accent" "body"',gridTemplateColumns:"1fr",overflow:"hidden"}:{},P=y(n);return(0,i.jsxs)(r.xu,{css:k,sx:w,w:"100%",pos:"relative",children:[P&&null===n.workspaceId&&(0,i.jsx)(a.C,{pos:"absolute",right:-1,top:-1,zIndex:1,colorScheme:"green",children:(0,i.jsx)(d.cC,{id:"isRobC"})}),(0,i.jsxs)(o.k,{borderTopRadius:"ghost"===c?"none":"md",boxShadow:"sm",_focus:{boxShadow:"outline"},p:"1em",transitionProperty:"common",transitionDuration:"normal",...S,backgroundAttachment:"initial",direction:"row",align:"center",...j,children:[(0,i.jsx)(h.P,{theme:n}),(0,i.jsxs)(r.xu,{sx:{...I.cardSx,...C},...N,borderRadius:"base",className:"".concat(m.pL," ").concat(E?"is-dark":""),color:E?"white":"gray.900",flex:1,pointerEvents:"none",children:[T&&(0,i.jsx)(r.xu,{gridArea:'"accent"',...A}),(0,i.jsxs)(r.xu,{gridArea:T?'"body"':void 0,py:T?2:4,px:4,children:[(0,i.jsx)(l.x,{className:"block-title",mt:"0 !important",mb:"".concat(T?"0":"var(--chakra-space-1)"," !important"),children:(0,i.jsx)(l.x,{as:"span",className:(0,s.cx)("title",f.A8),fontSize:"1.6em !important",paddingBottom:"0 !important",children:(0,i.jsx)(d.cC,{id:"MHrjPM"})})}),(0,i.jsx)(l.x,{fontSize:"0.9em !important",noOfLines:3,className:"block block-paragraph",my:"0 !important",children:(0,i.jsx)(d.cC,{id:"U41VTK",components:{0:(0,i.jsx)(l.x,{as:"a",className:"link"})}})})]})]})]})]})});j.displayName="ThemePreviewThumbnail";let y=e=>{if(!e.createdTime)return!1;let t=new Date(e.createdTime),n=new Date;return n.setDate(n.getDate()-30),t>n}},86963:function(e,t,n){"use strict";n.d(t,{g:function(){return d}});var i=n(9850),r=n.n(i),a=n(2784),o=n(47749);let l={theme:o.mU,themeValidationError:null,status:"new",themeBackgroun
20dImgStatus:"idle",themeLogoImgStatus:"idle",customizationStep:null,originalTheme:null};function s(e,t){switch(t.type){case"NEW_BLANK_THEME":return{...r()(l),customizationStep:"customization"};case"THEME_RESET":return r()(l);case"SET_THEME_EDITING":{let{theme:n}=t.data,i=r()(n);return{...e,status:"editing",theme:n,originalTheme:i,customizationStep:"customization"}}case"SET_NEW_THEME_FOR_SELECTING":{let{theme:n}=t.data;return{...e,status:"new",theme:n,customizationStep:"selection"}}case"SET_NEW_THEME_FOR_CUSTOMIZING":{let{theme:n}=t.data,i=r()(n);return{...e,theme:n,originalTheme:i,customizationStep:"customization"}}case"THEME_UPDATE_THEME_PROPS":{let{theme:n}=e,{themeProps:i}=t.data;return{...e,theme:{...n,...i}}}case"THEME_UPDATE_THEME_CONFIG":{let{theme:n}=e,{themeConfig:i}=t.data;return{...e,theme:{...n,config:{...n.config,...i}}}}case"THEME_UPDATE_THEME_KEYWORDS":{let{theme:n}=e,{keywords:i}=t.data;return{...e,theme:{...n,config:{...n.config,keywords:{color:[],tone:[],...n.config.keywords,...i}}}}}case"THEME_BACKGROUND_IMAGE_UPLOAD_STARTED":{let{theme:n}=e,{background:i}=t.data;
20return{...e,themeBackgroundImgStatus:"loading",theme:{...n,config:{...n.config,background:i}}}}case"THEME_BACKGROUND_UPDATE_SUCCESS":{let{theme:n}=e,{background:i}=t.data;return{...e,themeBackgroundImgStatus:"idle",theme:{...n,config:{...n.config,background:i}}}}case"THEME_BACKGROUND_IMAGE_UPLOAD_FAIL":return{...e,themeBackgroundImgStatus:"idle"};case"THEME_LOGO_UPLOAD_STARTED":return{...e,themeLogoImgStatus:"loading"};case"THEME_LOGO_UPLOAD_SUCCESS":{let{theme:n}=e,{logoUrl:i}=t.data;return{...e,themeLogoImgStatus:"idle",theme:{...n,logoUrl:i}}}case"THEME_LOGO_UPLOAD_FAIL":return{...e,themeLogoImgStatus:"idle"};case"THEME_UPDATE_THEME_NAME":{let{theme:n}=e,{name:i}=t.data;return{...e,theme:{...n,name:i},themeValidationError:null}}case"THEME_VALIDATION_ERROR":{let{errorMessage:n}=t.data;return{...e,themeValidationError:n}}case"THEME_VALIDATION_ERROR_RESET":return{...e,themeValidationError:null}}}function d(){return a.useReducer(s,l)}},46409:function(e,t,n){"use strict";n.d(t,{Y:function(){return U}});var i=n(52322),r=n(84586),a=n(28165),o=n(2784),l=n(35873),s=n(71997),d=n(4878);let c={fontSize:"var(--chakra-fontSizes-sm) !important",fontFamily:'"Inter", sans-serif !important',fontWeight:"500 !important",lineHeight:"1.5 !important",textTransform:"none",letterSpacing:"normal !important",textAlign:"left !important",margin:"0 !important",color:"var(--chakra-colors-gray-900) !important",background:"none !important",blockquote:{borderLeftWidth:"0px !important",borderLeftStyle:"solid !important",borderLeftColor:"transparent !important",padding:"0 !important",color:"var(--chakra-colors-gray-900) !important",fontStyle:"normal !important"},border:"0 none !important",padding:"0 !important",content:'""'},u={...c,color:"var(--chakra-colors-blue-500) !important","&:hover":{textDecoration:"underline"},cursor:"pointer"},h={"p,h1,h2,h3,h4,h5,h6, .title, .section-title":{...c,margin:0},a:u,"ul, ol":{marginLeft:"1.2em"},blockquote:{borderLeft:"3px solid var(--chakra-colors-gray-200)",paddingLeft:"0.5em"},color:"var(--chakra-colors-gray-900) !important",wordBreak:"break-word",lineHeight:"1.5 !important",letterSpacing:"normal !important",".mention":{bgColor:"trueblue.50",whiteSpace:"break-spaces"}},m={fontFamily:'"Inter", sans-serif !important',fontWeight:"500","@media screen and (max-width: 30rem)":{".controls-wrapper":{}},"@media screen and (min-width: 30rem)":{".controls-wrapper":{paddingLeft:"var(--comment-padding)"},".controls-wrapper__gridLayout, .controls-wrapper__gallery":{paddingLeft:"calc(-1 * var(--grid-padding) + var(--comment-padding))"}},".comments-list":{".comments-sign-up":{a:{...c,...u,fontSize:"xs",color:"gray.500",fontWeight:"bold","&:hover":{color:"gray.500",textDecoration:"underline"}}},".comment":{".reactions-row ul":{marginLeft:"auto"},".comment-date":{fontSize:"var(--chakra-fontSizes-xs) !important",color:"var(--chakra-colors-gray-500) !important"},...h},".block-image":{"&.is-focused":{"img, .image, .placeholder":{boxShadow:"var(--chakra-shadows-outline)"}}},".block-target-html":{"p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,li, .title, .section-title":{...c,"::after":c},a:{...u},li:{margin:"0 !important",padding:"0 !important",listStyle:"none !important",p:{margin:0}},img:{maxWidth:"200px",maxHeight:"80px"}}},".comment-editor .ProseMirror":{...h,"\n @media only screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 2),\n @media only screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3),\n @media only screen and (max-device-width: 640px) and (-webkit-min-device-pixel-ratio: 4)\n ":{fontSize:"16px !important"},padding:"12px",borderRadius:"5px","&.focus-visible":{boxShadow:"0 0 0 2px rgb(49, 130, 206)"},"a.image-link":{pointerEvents:"none"}}};var p=n(73235),g=n(56974),x=n.n(g),f=n(24992),v=n(93814),b=n(65301);function j(){let e=(0,p._)(["\n 0% {\n box-shadow: ",";\n }\n 7%,\n 60% {\n box-shadow: var(--link-box-shadow);\n }\n 100% {\n box-shadow: ",";\n }\n"]);return j=function(){return e},e}function y(){let e=(0,p._)(["\n 0% \n 100% {\n box-shadow: ",";\n }\n"]);return y=function(){return e},e}let C="0 0 0 0 rgba(0, 0, 0, 0.0)",_=(0,a.F4)(j(),C,C),E=(0,a.F4)(y(),C);var k=n(12304);let w={"math-display":{fontSize:"1.125em",".katex":{whiteSpace:"normal"}},"math-inline":{"&.ProseMirror-selectednode":{marginY:"-0.25em"}},"math-display, math-inline":{"&.ProseMirror-selectednode":{boxShadow:"outline",borderRadius:"var(--box-border-radius)",backgroundColor:"gray.100",padding:".25em",marginX:"3px",".math-src":{color:"gray.700"}}}};var I=n(49354),S=n(58879),T=n(87254);let A=e=>({".block-smartLayout":{'[data-node-view-content-outer="smartLayout"]':{display:"contents"},'[data-node-view-content-inner="smartLayout"]':{display:"contents"},"[data-selection-ring]":{outlineStyle:"none",outlineWidth:"1px",outlineColor:"var(--grid-outline-color)"},'[data-selection-ring="padded"]':{outlineOffset:"0.25em",".add-button":{m:"-0.25em"}},"&:not(.is-focused)":{"[data-content-empty=true] > [data-node-view-content]":{height:0}},"&.is-focused":{"[data-content-empty=true]":{"[placeholder]::before":S.BI}},["&.is-focused, &:hover, &[".concat(b.r,"]")]:{".is-editable":{"[data-selection-ring]":{outlineStyle:"solid"},".add-button":{opacity:1}}}},".node-smartLayoutCell":{display:"contents","> [data-node-view-wrapper]":{display:"contents"}
20,"--heading-placeholder":(0,S.iI)(T.ag._({id:"HX5SVx"})),'[data-node-view-content-inner="smartLayoutCell"] > .first-block':{mt:[0,0]},'[data-node-view-content-inner="smartLayoutCell"] > .last-block':{mb:[0,0]},".slash-menu-prompt":{display:"none"},".block-heading, .block-title":{...(0,I.iL)(e).tight},".block-paragraph":{...(0,I.YW)(e).tight}}});var N=n(97676),P=n(89),M=n(46741);function O(){let e=(0,p._)(["\n 0% {\n align-items: flex-start;\n grid-template-rows: 0.2fr;\n overflow: hidden;\n }\n 99% {\n align-items: flex-start;\n overflow: hidden;\n }\n 100% {\n align-items: initial;\n grid-template-rows: 1fr;\n overflow: visible;\n }\n"]);return O=function(){return e},e}let R=(0,a.F4)(O()),D=e=>({height:"100%",outlineWidth:"0px",lineHeight:e?"1.6 !important":k.I0,"&.is-focused":{".is-empty":{"[data-placeholder]":{_after:S.BI},"[data-multiline-placeholder]":{position:"relative",_after:S.cY,"> [data-node-view-content-inner]":{position:"absolute",width:"100%",minH:"1em"}}}},"--block-margin":(0,I.l1)(e),"--box-border-color":"var(--chakra-colors-blackAlpha-200)","--grid-border":"1px","--grid-padding":"1.22em","&.is-dark":{"--box-border-color":"var(--chakra-colors-whiteAlpha-400)",".block-blockquote":{blockquote:{borderLeftColor:"var(--accent-color)"}},...N.KX.dark,...P.E_.dark},".block-card":{"&.expandable-node":{"&-selected .expandable-selected":{animation:"".concat(_," 3000ms ease-in-out forwards")},"&-reset .expandable-selected":{animation:"".concat(E)}}},".block":{my:"var(--block-margin)",fontFamily:"var(--body-font)",fontWeight:"var(--body-font-weight)",color:"var(--body-color)"},"&.is-nested":{display:"grid",animation:"".concat(R," ").concat(v.nY,"ms ease-out forwards")},"&.is-full-width":{".block.is-full-width":{width:"var(--full-width)",position:"relative",left:"50%",transform:"translateX(-50%)"}},"&.is-borderless":e?{}:{'> [data-node-view-content-inner="card"] > .node-cardAccentLayoutItem':{"> [data-node-view-wrapper]":{display:"flex"},'.card-layout-cell-bg:not([data-card-layout="behind"], [data-card-layout="top"])':{margin:"1em",borderRadius:"var(--box-border-radius)",height:"auto"},'.card-layout-cell-bg:is([data-card-layout="behind"], [data-card-layout="top"])':{width:"var(--editor-width)",position:"absolute",transform:"translateX(-50%)",left:"calc(50% - var(--doc-padding-left, 0px) / 2 + var(--doc-padding-right, 0px) / 2)"}}},'[data-node-view-content-inner="cardLayoutItem"], [data-node-view-content-inner="card"]':{"> .first-block":{mt:"0em"},"> .last-block":{mb:"0em"}},"a.link":{color:"var(--text-color, var(--link-color))",cursor:"pointer",fontWeight:"bold",textDecoration:"underline",'&[href=""]':{textDecorationStyle:"dashed"},"&:hover":{color:"var(--link-color-hover)"},"&:active":{color:"var(--link-color-hover)"}},".block-toggle":{"&.expandable-node":{"&-selected .toggle":{animation:"".concat(_," 3000ms ease-in-out forwards")},"&-reset .toggle":{animation:"".concat(E)}},'[data-open="false"]':{'[data-node-view-content-inner="toggle"]':{"> :not(:first-child)":{display:"none"}}}},...k.g6,...N.KX.default,...P.E_.default,...M.dE,...w,".block-codeBlock":{pre:{fontFamily:"mono",fontSize:I.um.codeBlock,"@media print":{fontSize:x()(I.um.codeBlock)},color:"var(--body-color)",background:"var(--accent-color-background-muted)",borderRadius:"var(--box-border-radius)",overflow:"hidden",code:{display:"block",padding:".75em 1em"}}},code:{backgroundColor:"var(--accent-color-background-muted)",color:"var(--body-color)",...N.FC},".block-blockquote":{blockquote:{pl:"1.5em"}},".block-embed, .block-video":{"&.expandable-node":{"&-selected":{".embed-preview, .embed-viewer, .video-player":{animation:"".concat(_," 3000ms ease-in-out forwards")}},"&-reset":{".embed-preview, .embed-viewer, .video-player":{animation:"".concat(E)}}}},".block-image":{"&.expandable-node":{"&-selected":{"[data-selection-ring]":{animation:"".concat(_," 3000ms ease-in-out forwards")}},"&-reset ":{"[data-selection-ring]":{animation:"".concat(E)}}}},".block-contributors":{".contributors-list":{fontSize:"1.25em",fontWeight:"bold"}},".mention":{bgColor:"var(--accent-color-100)"},".block-gallery":{mx:"calc(-1 * var(--grid-padding))",my:"calc(-0.25 * var(--grid-padding))",".gallery":{px:"var(--grid-padding)",py:"calc(0.75 * var(--grid-padding))",border:"1px solid",borderColor:"transparent",borderRadius:"var(--box-border-radius)",".add-image":{mb:"calc(0.75 * var(--grid-padding))"},["&.".concat(f.A)]:{border:"1px dashed var(--chakra-colors-trueblue-300) !important",backgroundColor:"var(--chakra-colors-trueblue-50) !important",".gallery-placeholder":{pointerEvents:"none"}}},"&.is-focused, &.is-empty":{".gallery":{backgroundColor:"blackAlpha.50"}},["&.is-focused, &:hover, &[".concat(b.r,"]")]:{".gallery":{borderColor:"var(--grid-outline-color)"},".add-image":{opacity:1}},"&.expandable-node":{"&-selected .gallery":{animation:"".concat(_," 3000ms ease-in-out forwards")},"&-reset .gallery":{animation:"".concat(E)}}},...A(e),".block-gridLayout":{mx:"calc(-1 * var(--grid-padding))",".layout-content":{display:"contents","> div":{display:"contents"}},".grid-cell":{position:"relative",height:"100%",paddingX:"var(--grid-padding)",display:"flex",flexDirection:"column",outlineWidth:"1px",outlineStyle:"none",outlineColor:"var(--grid-outline-color)",".block-gallery":{my:"0"}},["&.is-focused, &:hover, &[".concat(b.r,"]")]:{".is-editable":{".grid-cell":{outlineStyle:"solid"}},".add-column":{opacity:1}}},".node-cardLayoutItem, .node-cardAccentLayoutItem":{position:"relative",display:"flex",flexDirection:"column",justifyContent:"stretch",minWidth:0,minHeight:0,"> [data-node-view-wrapper]":{position:"relative",height:"100%",width:"100%"}},".node-cardNotes":{display:"none"},".block-table":{table:{'[data-node-view-content-inner="table"]':{display:"contents",'[data-node-view-content-inner="tableRow"]':{display:"contents"},td:{verticalAlign:"top",".block-heading [data-placeholder]::before":{display:"none"}}}},td:{minWidth:"3em",paddingX:"1em",position:"relative",".block":{maxWidth:e?"75vw":void 0},"&:not(:first-of-type)":{borderLeft:"1px solid transparent"}},".selectedCell:after":{zIndex:2,position:"absolute",content:'""',left:0,right:0,top:0,bottom:0,backgroundColor:"trueblue.100",pointerEvents:"none",opacity:.4},"&.is-focused, &:hover":{"td:not(:first-of-type)":{borderLeft:"1px solid var(--grid-outline-color)"}}},".tippy-arrow":{borderLeftColor:"red"},".footnote-label":{textDecoration:"underline",textDecorationColor:"var(--link-color)",_hover:{bgColor:"var(--accent-color-100)",color:"gray.800",borderRadius:"sm"}},".footnote":{color:"var(--link-color)",_hover:{_after:{bgColor:"var(--accent-color-100)",color:"gray.800"}}},".node-emoji":{color:"initial"},".block-paragraph":{...(0,k.v0)("default")},".block-heading":{...(0,I.iL)(e).default,".heading":{position:"relative"},'.heading[level="1"]':{...(0,k.v0)("h1")},'.heading[level="2"]':{...(0,k.v0)("h2")},'.heading[level="3"]':{...(0,k.v0)("h3")},'.heading[level="4"]':{...(0,k.v0)("h4")}},".block-title":{...(0,I.iL)(e).default,".title":{position:"relative",...(0,k.v0)("title")}}
20,".node-gridLayout, .node-calloutBox":{".block-heading, .block-title":{...(0,I.iL)(e).compact},".block-paragraph":{...(0,I.YW)(e).compact}},".block-table td":{".block":{...(0,I.YW)(e).tight},".block-heading, .block-title":{...(0,I.iL)(e).tight}},'[data-node-view-content-inner="card"]:not(:has(> .node-cardAccentLayoutItem)) [data-node-view-content-inner="cardLayoutItem"] > .first-block:not(.last-block)':{"&.block-heading, &.block-title":{"&:not(:has(+ .block-heading, + .block-title, + .node-gridLayout))":{mb:(0,I.iL)(e).relaxed.mb}}},'[data-node-view-content-inner="cardLayoutItem"] > .first-block:not(.last-block)':{"&.block-paragraph":{...(0,I.YW)(e).compact,"+ .block-heading, + .block-title":{mt:(0,I.iL)(e).compact.mt}},'&.block-heading:has([level="2"], [level="3"], [level="4"])':{mb:(0,I.iL)(e).compact.mb,"+ .block-heading, + .block-title":{mt:(0,I.iL)(e).compact.mt}}}});var F=n(3561);let U=(0,o.memo)(()=>{let e=(0,d.TZ)();return(0,i.jsx)(a.xB,{styles:t=>{let n={[".".concat(l.pL)]:D(e),[".".concat(F.G)]:m,[".".concat(s.d)]:s.l};if(!n)return;let i=(0,r.iv)(n)(t);return i}})});U.displayName="GlobalCardStyles"},58879:function(e,t,n){"use strict";n.d(t,{BI:function(){return i},cY:function(){return r},iI:function(){return a}});let i={content:"attr(data-placeholder)",position:"absolute",top:0,opacity:.25,pointerEvents:"none",left:0,width:"100%",color:"var(--heading-color)",lineClamp:1,textOverflow:"ellipsis",overflow:"hidden",boxOrient:"vertical",wordBreak:"break-all",height:"100%",whiteSpace:"nowrap"},r={...i,content:"attr(data-multiline-placeholder)",color:"inherit",position:"relative",lineClamp:0,whiteSpace:"normal",wordBreak:"normal"},a=e=>'"'.concat(e,'"')},17324:function(e,t,n){"use strict";n.d(t,{a:function(){return I}});var i=n(52322),r=n(28535),a=n(43297),o=n(35183),l=n(97166),s=n(7344),d=n(59905),c=n(73481),u=n(17993),h=n(85573),m=n(62614),p=n(94523),g=n(5879),x=n(87254),f=n(2784),v=n(93202),b=n(94199),j=n(36651);let y=[{id:"consulting",label:()=>x.ag._({id:"m5xed+"})},{id:"creator",label:()=>x.ag._({id:"UE2beD"})},{id:"customer_service",label:()=>x.ag._({id:"FfYIy2"})},{id:"data",label:()=>x.ag._({id:"HKH+W+"})},{id:"design",label:()=>x.ag._({id:"f8fH8W"})},{id:"education",label:()=>x.ag._({id:"aqxYLv"})},{id:"engineering",label:()=>x.ag._({id:"SUXBxp"})},{id:"finance",label:()=>x.ag._({id:"8V6XO3"})},{id:"human_resources",label:()=>x.ag._({id:"aDLrMs"})},{id:"leadership",label:()=>x.ag._({id:"HyFz7F"})},{id:"legal",label:()=>x.ag._({id:"vifyyw"})},{id:"marketing",label:()=>x.ag._({id:"vo2a+a"})},{id:"operations",label:()=>x.ag._({id:"B1MDds"})},{id:"product",label:()=>x.ag._({id:"K47k8R"})},{id:"recruiting",label:()=>x.ag._({id:"bn0SqF"})},{id:"sales",label:()=>x.ag._({id:"mUv9U4"})},{id:"other",label:()=>x.ag._({id:"/IX/7x"})}],C={"get-started":{saveButtonText:()=>x.ag._({id:"ZDIydz"}),formControlMaxW:["100%","80%","50%"],categoryQuestion:()=>x.ag._({id:"kJizcc"})},modal:{saveButtonText:()=>x.ag._({id:"hQRttt"}),formControlMaxW:["100%","60%"],categoryQuestion:()=>x.ag._({id:"06/kLN"})},setup:{saveButtonText:()=>x.ag._({id:"xGVfLh"}),formControlMaxW:["100%"],categoryQuestion:()=>x.ag._({id:"kJizcc"})}},_=[{id:"work",label:()=>x.ag._({id:"rgBHdd"})},{id:"education",label:()=>x.ag._({id:"RKJfzm"})},{id:"personal",label:()=>x.ag._({id:"jo0oU2"})}],E=[{id:"primary",label:()=>x.ag._({id:"LldObG"})},{id:"secondary",label:()=>x.ag._({id:"AtXGMV"})},{id:"university",label:()=>x.ag._({id:"DEb9mB"})},{id:"other",label:()=>x.ag._({id:"/IX/7x"})}],k=[{id:"student",label:()=>x.ag._({id:"a0qEkS"})},{id:"teacher",label:()=>x.ag._({id:"lypRAW"})},{id:"administrator",label:()=>x.ag._({id:"Faptqt"})},{id:"other",label:()=>x.ag._({id:"/IX/7x"})}],w=[{id:"friend",label:()=>x.ag._({id:"Gw0M4G"})},{id:"internet",label:()=>x.ag._({id:"mRh0Qq"})},{id:"search",label:()=>x.ag._({id:"z4/LHW"})},{id:"tiktok",label:()=>x.ag._({id:"zyUxcw"})},{id:"instagram",label:()=>x.ag._({id:"zzlbbf"})},{id:"youtube",label:()=>x.ag._({id:"9Q6UKX"})},{id:"linkedin",label:()=>x.ag._({id:"gggTBm"})},{id:"other",label:()=>x.ag._({id:"/IX/7x"})}],I=e=>{let{onSuccess:t,onError:n,context:I="get-started"}=e,{user:S,refetch:T}=(0,j.SE)(),[A,N]=(0,f.useState)(!1),[P,M]=(0,f.useState)(void 0),[O,R]=(0,f.useState)(void 0),[D,F]=(0,f.useState)(!1),[U,L]=(0,f.useState)(void 0),[H,{loading:z,error:G}]=(0,v.kDo)(),[B,W]=(0,f.useState)(void 0),[V,K]=(0,f.useState)("student"),q="education"===U||"education"===P?B&&V:U,Y=P&&!U,Z=(0,f.useCallback)(()=>{let e="education"===U||"education"===P?"".concat(U,"_").concat(V,"_").concat(B):U;H({variables:{input:{id:null==S?void 0:S.id,referrer:O,jobFunction:e}}}).then(()=>(N(!0),null==T?void 0:T())).then(()=>{t&&t()}).catch(e=>{console.error('[GetStarted.UserInfo] Error updating user info "'.concat(null==S?void 0:S.id,'"'),e.message),N(!1),n&&n()})}
20,[U,B,V,n,t,O,T,H,null==S?void 0:S.id,P]),{formControlMaxW:X,saveButtonText:Q,categoryQuestion:J}=C[I];return(0,i.jsx)(r.xu,{w:"100%",children:(0,i.jsxs)(a.K,{pt:6,alignItems:"center",spacing:6,alignSelf:"center",mb:10,children:[(0,i.jsxs)(o.NI,{maxW:X,as:"fieldset",isRequired:!0,children:[(0,i.jsx)(l.l,{children:J()}),(0,i.jsx)(s.E,{onChange:e=>{M(e),"education"===e?L("education"):L(void 0)},value:P,children:(0,i.jsx)(a.K,{direction:"column",spacing:2,children:_.map(e=>{let{id:t,label:n}=e;return(0,i.jsx)(d.Y,{value:t,children:n()},t)})})})]}),P&&(0,i.jsxs)(i.Fragment,{children:["education"!==P&&(0,i.jsxs)(o.NI,{maxW:X,isRequired:!0,children:[(0,i.jsx)(l.l,{children:(0,i.jsx)(g.cC,{id:"SYYw/x"})}),(0,i.jsx)(c.P,{placeholder:x.ag._({id:"rjLlrw"}),isRequired:!0,onChange:e=>{let t=e.target.value;"work"===P&&"education"===t&&K("teacher"),L(t)},children:y.map((e,t)=>{let{label:n,id:r}=e;return(0,i.jsx)("option",{value:r,children:n()},"".concat(r,"-").concat(t))})})]}),("education"===P||"education"===U)&&(0,i.jsxs)(o.NI,{maxW:X,isRequired:!0,children:[(0,i.jsx)(l.l,{children:(0,i.jsx)(g.cC,{id:"B+ClFT"})}),(0,i.jsxs)(u.g,{spacing:2,children:[(0,i.jsx)(c.P,{placeholder:x.ag._({id:"rjLlrw"}),isRequired:!0,value:V,onChange:e=>{K(()=>e.target.value)},children:k.map((e,t)=>{let{label:n,id:r}=e;return(0,i.jsx)("option",{value:r,children:n()},"".concat(r,"-").concat(t))})}),(0,i.jsx)(c.P,{placeholder:x.ag._({id:"rNbKca"}),isRequired:!0,onChange:e=>{W(()=>e.target.value)},children:E.map((e,t)=>{let{label:n,id:r}=e;return(0,i.jsx)("option",{value:r,children:n()},"".concat(r,"-").concat(t))})})]}),(0,i.jsx)(o.Q6,{fontSize:"xs",children:(0,i.jsx)(g.cC,{id:"9sEdx4"})})]}),(0,i.jsxs)(o.NI,{maxW:X,children:[(0,i.jsx)(l.l,{children:(0,i.jsx)(g.cC,{id:"bxuHg8"})}),(0,i.jsxs)(u.g,{spacing:2,children:[(0,i.jsx)(c.P,{placeholder:x.ag._({id:"rjLlrw"}),value:D?"other":O,onChange:e=>{"other"===e.target.value?(F(!0),R("")):(F(!1),R(e.target.value))},children:w.map((e,t)=>{let{label:n,id:r}=e;return(0,i.jsx)("option",{value:r,children:n()},"".concat(r,"-").concat(t))})}),D&&(0,i.jsx)(h.I,{type:"text",value:O,onChange:e=>{R(e.target.value)}})]}),(0,i.jsx)(o.Q6,{fontSize:"xs",children:O&&(null==O?void 0:O.length)>4?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.cC,{id:"RNrV8M",values:{GRANT_PROPER_NOUN:b.XI}})," ",(0,i.jsx)("span",{role:"img","aria-label":x.ag._({id:"8K1shM"}),children:"\uD83D\uDE4F"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.cC,{id:"Bhgibl",values:{GRANT_PROPER_NOUN:b.XI}})," ",(0,i.jsx)("span",{role:"img","aria-label":x.ag._({id:"bh5RqM"}),children:"\uD83D\uDE0A"})]})})]})]}),(0,i.jsx)(a.K,{alignItems:"center",spacing:4,pt:4,children:(0,i.jsx)(p.kH,{label:(0,i.jsx)(g.cC,{id:"5G+MQW"}),isDisabled:!Y,placement:"top",children:(0,i.jsx)(r.xu,{children:(0,i.jsx)(m.z,{variant:"solid",size:"lg",isDisabled:A||!!G||!q,isLoading:z||A,onClick:Z,children:Q()})})})})]})})}},96475:function(e,t,n){"use strict";n.r(t),n.d(t,{SandboxPage:function(){return Z},default:function(){return X}});var i=n(52322),r=n(28535),a=n(62614),o=n(70065),l=n(5879),s=n(5632),d=n(2784),c=n(71537),u=n(14274),h=n(29117),m=n(4661),p=n(17993),g=n(74409),x=n(29494),f=n(77533),v=n(85573),b=n(20437),j=n(42946),y=n(49929),C=n(94523),_=n(87254),E=n(54691),k=n(94199),w=n(66922),I=n(46772),S=n(1188),T=n(62801),A=n(67475),N=n(36651),P=n(30523),M=n(75009);let O=(0,d.memo)(e=>{let{image:t}=e;return(0,i.jsx)(P.P,{children:(0,i.jsx)("a",{download:"custom-filename1.jpg",href:t.attrs.src,title:"ImageName1",target:"_blank",rel:"noreferrer",children:(0,i.jsx)(M.E,{src:t.attrs.src,w:"100%",borderRadius:"md"},t.attrs.src)})},t.id)});O.displayName="SandboxAiThemeBuilderImage";let R=e=>{let{images:t,setImages:n,selectedImages:r,setSelectedImages:o}=e,{currentWorkspace:s}=(0,N.SE)(),c=null==s?void 0:s.id,{prompt:u,addPrompt:m,promptPageInfo:P,nextPrompt:M,prevPrompt:R,stylePreset:D,setStylePreset:F,aspectRatio:U,setAspectRatio:L,imageGenerateConfig:H}=(0,S.Xc)(),[z,G]=(0,d.useState)(!1),[B,W]=(0,d.useState)(!1),[V,K]=(0,d.useState)(2),q=(0,d.useCallback)(async()=>{if(z)return;G(!0),m("","push");let e=I.S.prepare({variables:{input:u,html:""}}
20),t=await (0,E.I)(e,"context.interactionId");if(!t)throw Error("Couldn't get response from prompt");m(t,"update"),G(!1)},[m,z,u]),Y=(0,d.useCallback)(async()=>{if(o([]),W(!0),z||B)return;let e=await (0,w.Qz)({...H,upscaleFactor:V,interactionId:"context.interactionId",workspaceId:c||"",prompt:u,count:3});n([...e,...t]),W(!1)},[H,z,B,u,n,c,V,o,t]),Z=(0,d.useCallback)(e=>{"Enter"===e.key&&e.metaKey&&(e.preventDefault(),Y()),e.stopPropagation()},[Y]),X=(0,d.useCallback)(e=>{r.includes(e.id)?o(r.filter(t=>t!==e.id)):o([...r,e.id])},[r,o]);return(0,i.jsx)(p.g,{spacing:4,align:"stretch",translate:"no",children:(0,i.jsxs)(p.g,{align:"stretch",spacing:4,width:"100%",children:[(0,i.jsxs)(p.g,{align:"stretch",spacing:1,children:[(0,i.jsxs)(h.U,{position:"relative",align:"center",justify:"space-between",children:[(0,i.jsx)(h.U,{children:(0,i.jsx)(g.X,{size:"sm",children:(0,i.jsx)(l.cC,{id:"W9uQXX"})})}),(0,i.jsx)(h.U,{children:(0,i.jsx)(C.kH,{placement:"top",label:(0,i.jsx)(l.cC,{id:"DZCfCB",values:{GAMMA_PROPER_NOUN:k.N6}}),children:(0,i.jsx)(a.z,{variant:"ghost",rightIcon:(0,i.jsx)(y.G,{icon:j.qHV}),isLoading:z,"aria-label":"magic generate",onClick:q,size:"sm",children:(0,i.jsx)(l.cC,{id:"YqdfV4"})})})})]}),(0,i.jsx)(x.g,{isDisabled:B,placeholder:z?"":_.ag._({id:"6RfNWb"}),onKeyDown:Z,value:u,onChange:e=>{m(e.target.value,"update")},"data-testid":"image-search-input",rows:5}),P.total>1&&(0,i.jsx)(T.O,{alignSelf:"end",promptPageInfo:P,nextPrompt:M,prevPrompt:R,isDisabled:B||z})]}),(0,i.jsxs)(p.g,{align:"stretch",children:[(0,i.jsx)(g.X,{size:"sm",children:(0,i.jsx)(l.cC,{id:"TXeQBY"})}),(0,i.jsx)(A.A2,{value:D,setValue:F}),(0,i.jsx)(g.X,{size:"sm",children:(0,i.jsx)(l.cC,{id:"8JP4mI"})}),(0,i.jsx)(f.x,{fontSize:"sm",children:"Generated image size is 1024 x 1024. Upscale Factor must be >1 and â¤10"}),(0,i.jsx)(v.I,{isDisabled:B,placeholder:"Upscale Factor",onKeyDown:Z,value:V,onChange:e=>{K(Number(e.target.value))}}),(0,i.jsx)(p.g,{spacing:1,align:"stretch",children:(0,i.jsx)(a.z,{variant:"solid",isLoading:B,isDisabled:z,onClick:Y,px:12,children:(0,i.jsx)(l.cC,{id:"ziAjHi"})})})]}),(0,i.jsx)(b.M,{columns:2,spacing:2,children:t.map(e=>(0,i.jsx)(O,{image:e,onSelectImage:X,isSelected:r.includes(e.id)},e.id))})]})})},D=()=>{let[e,t]=(0,d.useState)([]),[n,a]=(0,d.useState)([]);return(0,i.jsx)(h.U,{align:"stretch",width:"100%",spacing:5,p:5,children:(0,i.jsx)(r.xu,{flex:"0.5",children:(0,i.jsx)(R,{images:e,setImages:t,selectedImages:n,setSelectedImages:a})})})};(0,m.o)(D,{isViewOnly:!0});var F=n(81540),U=n(37164),L=n(2090),H=n(26495),z=n(85747);let G=()=>{let[e,t]=(0,d.useState)(null),{currentWorkspace:n}=(0,N.SE)(),r=null==n?void 0:n.id,{onClick:o,inputElement:l}=(0,z.E)({handleFilesCallback:e=>{r&&e.forEach(e=>{let n=(0,U.x0)();t(t=>t?[...t,{name:e.name,tempId:n}]:[{name:e.name,tempId:n}]),(0,H.m)(r,e).then(i=>{t(t=>{if(!t)return[{name:e.name,tempId:n,sourceUrl:i}];let r=t.map(e=>(null==e?void 0:e.tempId)===n?{...e,sourceUrl:i}:e);return r})}).catch(i=>{t(t=>{if(!t)return[{name:e.name,tempId:n,hasError:!0}];let i=t.map(e=>(null==e?void 0:e.tempId)===n?{...e,hasError:!0}:e);return i}),console.warn("[CustomFontsFileUploader] error uploading font file",i),t(e=>{if(!e)return e;let t=e.map(e=>(null==e?void 0:e.tempId)===n?{...e,hasError:!0}:e);return t})})})},multiple:!0,accept:L.Ge.join(",")});return(0,i.jsxs)(i.Fragment,{children:[l,(0,i.jsxs)(p.g,{align:"flex-start",m:10,children:[(0,i.jsx)(a.z,{variant:"solid",leftIcon:(0,i.jsx)(y.G,{icon:j.A$k}),onClick:o,isDisabled:!r,children:"Choose font files"}),e&&e.map((e,t)=>{let n=e.hasError;return(0,i.jsxs)(h.U,{color:n?"red.500":void 0,children:[e.hasError&&(0,i.jsx)(y.G,{icon:j.e7M}),(0,i.jsxs)(f.x,{children:[(0,i.jsx)("strong",{children:"file name: "}),e.name," ",(0,i.jsx)("strong",{children:"id: "}),e.tempId," "]}),e.sourceUrl?(0,i.jsxs)(f.x,{children:[(0,i.jsx)("strong",{children:"src id: "}),e.sourceUrl.split("/")[4]]}):!e.hasError&&(0,i.jsx)(F.$,{}),e.hasError&&(0,i.jsx)(y.G,{icon:j.e7M})]},t)})]})]})};var B=n(1978),W=n(56745),V=n(86963),K=n(17324);let q=()=>{},Y={"ai-theme-builder":function(){return(0,i.jsx)(D,{})},theme:function(){let[e,t]=(0,V.g)();return(0,i.jsx)(W.z,{isOpen:!0,onClose:q,state:e,dispatch:t})},track:function(){return(0,i.jsx)(r.xu,{children:(0,i.jsx)(a.z,{onClick:()=>{},children:"Click!"})})},gradient:function(){let[e,t]=(0,d.useState)({}),n=(0,d.useCallback)(e=>{console.log("setting value to",e),t(t=>({...t,...e}))},[]);return(0,i.jsx)(B._,{value:e,updateValue:n})},fonts:function(){return(0,i.jsx)(G,{})},user_info:function(){return(0,i.jsx)(K.a,{})},toast:function(){let e=(0,o.p)();return(0,i.jsx)(r.xu,{children:(0,i.jsx)(a.z,{onClick:()=>{e({title:(0,i.jsx)(l.cC,{id:"Z3FXyt"}),description:"Another description. What do you think?",status:"info",isClosable:!0}),e({title:"light variant...",description:"Another description. What do you think?",status:"info",variant:"light",isClosable:!0}),e({duration:null,id:"something-else",status:"loading",variant:"subtle",title:"Loading...",description:"Another description",isClosable:!1}),setTimeout(()=>{e.update("something-else",{status:"success",title:"Great work!",duration:5e3,isClosable:!0})},1e3)},children:"Open"})})}},Z=()=>{let{isGammaOrgUser:e,isUserLoading:t}=(0,N.SE)(),{query:n,replace:r,isReady:a}=(0,s.useRouter)(),o=n.pageName,l=o&&Y[o];return((0,d.useEffect)(()=>{a&&"dev"!==u.v.APPLICATION_ENVIRONMENT&&(l||r("/404"),t||e||r("/404"))},[a,l,t,e,r]),l&&!t&&e)?(0,i.jsx)(l,{}):null};var X=(0,c.z)(Z)},90439:function(e,t,n){"use strict";n.d(t,{Oj:function(){return l},Pv:function(){return o},QX:function(){return a},cx:function(){return r}});var i=n(14274);let r=i.v.GAMMA_PUPPETEER_SERVICE,a=r&&"pptx"===window.format,o=r&&"pdf"===window.format,l=r&&"screenshot"===window.format},7e4:function(e,t,n){"use strict";n.d(t,{X:function(){return a}});var i=n(2784),r=n(18733);function a(e,t){let[n,a]=(0,i.useState)(()=>{try{let n=r.Q.getItem(e);if(null===n)return t;return JSON.parse(n)}catch(e){return console.error("[useSessionStorage.getItem] Error getting sessionStorage item",e),t}}),o=(0,i.useCallback)(t=>{try{r.Q.setItem(e,JSON.stringify(t)),a(t)}catch(e){console.error("[useSessionStorage.setItem] Error setting sessionStorage item",e)}},[e]);return[n,o]}},62376:function(){},6991:function(){},76298:function(){},4466:function(){},43839:function(){},25237:function(e,t,n){e.exports=n(99309)},2517:function(){},29264:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var i=n(95083);function r(){let{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}=(0,i.V)();return{isEditing:e,getEditButtonProps:t,getCancelButtonProps:n,getSubmitButtonProps:r}}},99793:function(e,t,n){"use strict";n.d(t,{J1:function(){return p}});var i=n(35183),r=n(62929),a=n(9165),o=n(68023),l=n(91982),s=n(84586),d=n(76801),c=n(31053),u=n(52322),[h,m]=(0,a.k)({name:"FormErrorStylesContext",errorMessage:"useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in \"<FormError />\" "}),p=(0,o.G)((e,t)=>{let n=(0,l.jC)("FormError",e),r=(0,s.Lr)(e),a=(0,i.NJ)();return(null==a?void 0:a.isInvalid)?(0,u.jsx)(h,{value:n,children:(0,u.jsx)(d.m.div,{...null==a?void 0:a.getErrorMessageProps(r,t),className:(0,
20c.cx)("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...n.text}})}):null});p.displayName="FormErrorMessage",(0,o.G)((e,t)=>{let n=m(),a=(0,i.NJ)();if(!(null==a?void 0:a.isInvalid))return null;let o=(0,c.cx)("chakra-form__error-icon",e.className);return(0,u.jsx)(r.J,{ref:t,"aria-hidden":!0,...e,__css:n.icon,className:o,children:(0,u.jsx)("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}).displayName="FormErrorIcon"},59905:function(e,t,n){"use strict";n.d(t,{Y:function(){return u}});var i=n(63367),r=n(7344),a=n(68023),o=n(91982),l=n(84586),s=n(76801),d=n(31053),c=n(52322),u=(0,a.G)((e,t)=>{var n;let a=(0,r.X)(),{onChange:u,value:h}=e,m=(0,o.jC)("Radio",{...a,...e}),p=(0,l.Lr)(e),{spacing:g="0.5rem",children:x,isDisabled:f=null==a?void 0:a.isDisabled,isFocusable:v=null==a?void 0:a.isFocusable,inputProps:b,...j}=p,y=e.isChecked;(null==a?void 0:a.value)!=null&&null!=h&&(y=a.value===h);let C=u;(null==a?void 0:a.onChange)&&null!=h&&(C=(0,d.PP)(a.onChange,u));let _=null!=(n=null==e?void 0:e.name)?n:null==a?void 0:a.name,{getInputProps:E,getCheckboxProps:k,getLabelProps:w,getRootProps:I,htmlProps:S}=(0,i.x)({...j,isChecked:y,isFocusable:v,isDisabled:f,onChange:C,name:_}),[T,A]=function(e,t){let n={},i={};for(let[r,a]of Object.entries(e))t.includes(r)?n[r]=a:i[r]=a;return[n,i]}(S,l.oE),N=k(A),P=E(b,t),M=w(),O=Object.assign({},T,I()),R={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...m.container},D={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...m.control},F={userSelect:"none",marginStart:g,...m.label};return(0,c.jsxs)(s.m.label,{className:"chakra-radio",...O,__css:R,children:[(0,c.jsx)("input",{className:"chakra-radio__input",...P}),(0,c.jsx)(s.m.span,{className:"chakra-radio__control",...N,__css:D}),x&&(0,c.jsx)(s.m.span,{className:"chakra-radio__label",...M,__css:F,children:x})]})});u.displayName="Radio"},73481:function(e,t,n){"use strict";n.d(t,{P:function(){return h}});var i=n(31053),r=n(68023),a=n(76801),o=n(52322),l=(0,r.G)(function(e,t){let{children:n,placeholder:r,className:l,...s}=e;return(0,o.jsxs)(a.m.select,{...s,ref:t,className:(0,i.cx)("chakra-select",l),children:[r&&(0,o.jsx)("option",{value:"",children:r}),n]})});l.displayName="SelectField";var s=n(76874),d=n(91982),c=n(84586),u=n(2784),h=(0,r.G)((e,t)=>{var n;let r=(0,d.jC)("Select",e),{rootProps:u,placeholder:h,icon:m,color:p,height:x,h:f,minH:v,minHeight:b,iconColor:j,iconSize:y,...C}=(0,c.Lr)(e),[_,E]=function(e,t){let n={},i={};for(let[r,a]of Object.entries(e))t.includes(r)?n[r]=a:i[r]=a;return[n,i]}(C,c.oE),k=(0,s.Y)(E),w={paddingEnd:"2rem",...r.field,_focus:{zIndex:"unset",...null==(n=r.field)?void 0:n._focus}};return(0,o.jsxs)(a.m.div,{className:"chakra-select__wrapper",__css:{width:"100%",height:"fit-content",position:"relative",color:p},..._,...u,children:[(0,o.jsx)(l,{ref:t,height:null!=f?f:x,minH:null!=v?v:b,placeholder:h,...k,__css:w,children:e.children}),(0,o.jsx)(g,{"data-disabled":(0,i.PB)(k.disabled),...(j||p)&&{color:j||p},__css:r.icon,...y&&{fontSize:y},children:m})]})});h.displayName="Select";var m=e=>(0,o.jsx)("svg",{viewBox:"0 0 24 24",...e,children:(0,o.jsx)("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),p=(0,a.m)("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),g=e=>{let{children:t=(0,o.jsx)(m,{}),...n}=e,i=(0,u.cloneElement)(t,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return(0,o.jsx)(p,{...n,className:"chakra-select__icon-wrapper",children:(0,u.isValidElement)(t)?i:null})};g.displayName="SelectIcon"}},function(e){e.O(0,[9774,7662,8433,2182,2812,8774,6694,4078,3273,9025,5333,4424,8707,146,3661,3016,116,2545,235,5112,3693,931,2808,6618,205,2252,1537,6656,2681,8794,9718,9656,887,2888,179],function(){return e(e.s=88807)}),_N_E=e.O()}]); 21//# sourceMappingURL=[pageName]-05eacc4e290b3cd0.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.