"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8114],{33698:function(e,o,i){i.d(o,{Vm:function(){return PlanSection}});var s=i(85893),a=i(15282),n=i(67294),t=i(71232),l=i(21380),r=i(95117),d=i(64523),c=i(19236),m=i(97564),p=i(21017),u=i(88393),g=i(49834),h=i(67841),x=i(3941),f=i(89814),b=i(64761),j=i(61885),v=i(8949),y=i(5044),w=i(64203),C=i(96768),M=i(58654),Z=i(10732),k=i(44012),z=i(86896),P=i(34850),I=i(77373),S=i(50472),A=i(49808),_=i(41280),q=i(33422),D=i(40796),F=i(72108),N=i(35662),R=i(55837),W=i(58792),T=i(85176),E=i(74922),L=i(25963),U=i(35282),B=i(74216);let PlanSection=e=>{var o,i,l,x,M,Z;let{close:P,variant:I="default"}=e,S=(0,b.rZ)(),_=(0,z.Z)(),[q,L]=(0,W.ZP)(e=>[e.activeWorkspace,e.user]),[O,K,X,H,Y,J,G]=(0,a.Z)(e=>[e.plans,e.setCurrentPlan,e.setManagementURLs,e.setSubscription,e.setUsage,e.currentPlan,e.subscription]),[$,V]=(0,n.useState)(!0),[Q,ee]=(0,n.useState)(1);(0,n.useEffect)(()=>{if((null==J?void 0:J.id)==="free_plan")return;V((null==J?void 0:J.type)==="annual");let e=null==J?void 0:J.displayName.split(" - ")[1];e&&ee(ei.findIndex(o=>o.label===e)+1)},[J]);let eo=null==O?void 0:O.monthly[Q],ei=[{value:1,label:"Small"},{value:2,label:"Medium"},{value:3,label:"Large"}],{track:es}=(0,B.Xg)(),handleCheckout=async e=>{try{let o=new T.j(null==q?void 0:q.organizationId);if(J&&"free_plan"!==J.id&&(null==G?void 0:G.status)!=="expired")E.N9.show({id:"checkout",loading:!0,title:_.formatMessage({id:"app.editor.common.popover.billing.checkout.notification",defaultMessage:"Please wait..."}),message:_.formatMessage({id:"app.editor.common.popover.billing.checkout.notification.message.new",defaultMessage:"We are moving you to your new plan."}),autoClose:!1,withCloseButton:!1,...N.qX}),await o.changeLSSubscription(e.id),es("initiated_upgrade",{user_id:L.id||"undefined_user_id",user_email:L.email||"undefined_user_email",new_plan_id:e.id,new_plan_name:e.displayName,current_plan_id:(null==J?void 0:J.id)||"undefined_current_plan_id",current_plan_name:(null==J?void 0:J.displayName)||"undefined_current_plan_name"}),setTimeout(()=>{fetchPlans(),E.N9.hide("checkout")},5e3);else{E.N9.show({id:"checkout",loading:!0,title:_.formatMessage({id:"app.editor.common.popover.billing.checkout.notification",defaultMessage:"Please wait..."}),message:_.formatMessage({id:"app.editor.common.popover.billing.checkout.notification.message.checkout",defaultMessage:"Creating your checkout URL."}),autoClose:!1,withCloseButton:!1,...N.qX});let i=await o.getLSCheckOutURL(e.variationId||0);E.N9.show({id:"checkout",title:_.formatMessage({id:"app.editor.common.popover.billing.checkout.notification.success",defaultMessage:"Success"}),message:_.formatMessage({id:"app.editor.common.popover.billing.checkout.notification.message.success",defaultMessage:"You will be redirected to the checkout page."})}),i.checkoutURL&&(LemonSqueezy.Url.Open(i.checkoutURL),es("initiated_checkout",{user_id:L.id||"undefined_user_id",user_email:L.email||"undefined_user_email",new_plan_id:e.id,new_plan_name:e.displayName,current_plan_id:(null==J?void 0:J.id)||"undefined_current_plan_id",current_plan_name:(null==J?void 0:J.displayName)||"undefined_current_plan_name"}))}}catch(e){console.error(e),E.N9.show({id:"checkout",title:_.formatMessage({id:"app.editor.common.popover.billing.checkout.notification.error",defaultMessage:"Error"}),message:_.formatMessage({id:"app.editor.common.popover.billing.checkout.notification.message.error",defaultMessage:"An error occurred while processing your request. Please try again later."}),autoClose:!1,withCloseButton:!0,...N.qX})}},fetchPlans=async()=>{var e;let o=new T.j(null==q?void 0:q.organizationId),i=await o.getPlans();X(i.managementURLs),H(i.subscription);let s=null;if(i.subscription&&(null===(e=i.subscription)||void 0===e?void 0:e.planId)&&O){let e=Object.values(O).flat();s=e.find(e=>e.id===i.subscription.planId)}K(s);let a=await o.getUsage(!1);Y(a)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(d.x,{sx:{display:"default"===I?"block":"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",marginBottom:"default"===I?0:"1.625rem"},children:["default"===I?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(c.D,{order:3,children:(0,s.jsxs)(t.Z,{spacing:"xs",children:[(0,s.jsx)(g.A,{variant:"default",size:"md",onClick:P,children:(0,s.jsx)(D.Z,{size:18})}),(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.choose",defaultMessage:"Plans"})]})}),(0,s.jsx)(c.D,{order:5,mt:"md",sx:{svg:{verticalAlign:"middle",display:"inline-block",marginLeft:"0.2rem",marginRight:"0.2rem"}},children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.choose.description.plan",defaultMessage:"Choose a plan that fits your needs."})})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(r.x,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.choose.description.carousel",defaultMessage:"An easy-to-use AI Carousel maker for everyone."})})}),(0,s.jsx)(j.r,{checked:$,onChange:()=>V(!$),mt:"md",label:(0,s.jsxs)(t.Z,{spacing:"xs",children:[(0,s.jsx)(r.x,{fw:"500",size:"sm",children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.annual.switch",defaultMessage:"Bill Annually"})}),(0,s.jsx)(r.x,{size:"sm",fw:600,color:S.colors[S.primaryColor][5],children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.annual.switch.save-20",defaultMessage:"(Save 20% on annual billing)"})})]})})]}),(0,s.jsxs)(f.M,{mt:"xl",cols:2,spacing:"md",children:[(0,s.jsx)(d.x,{children:(0,s.jsxs)(p.Z,{padding:"lg",radius:"md",withBorder:!0,children:[(0,s.jsxs)(m.K,{mb:"xs",spacing:"xs",children:[(0,s.jsx)(r.x,{weight:700,size:"xs",color:S.colors[S.primaryColor][5],sx:{textTransform:"uppercase"},children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo",defaultMessage:"Solo"})}),(0,s.jsx)(r.x,{weight:600,size:"1.5rem",children:$?(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.annual",defaultMessage:"${price}/month",values:{price:Math.round(.8*N.cJ.price)}}):(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.monthly",defaultMessage:"${price}/month",values:{price:N.cJ.price}})}),$&&(0,s.jsx)(r.x,{size:"md",fw:"600",color:"red",sx:{textDecoration:"line-through"},children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.previous",defaultMessage:"Previously ${price}/month",values:{price:N.cJ.price}})})]}),(0,s.jsx)(r.x,{size:"sm",color:"dimmed",children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.description",defaultMessage:"Perfect for solo creators."})}),(0,s.jsxs)(v.a,{mt:"md",spacing:"xs",size:"sm",center:!0,icon:(0,s.jsx)(y.k,{variant:"outline",color:"brand.4",size:"xs",radius:"xl",children:(0,s.jsx)(U.KBY,{size:"1rem"})}),styles:{item:{lineHeight:"1.3rem",fontSize:"0.9rem"}},children:[(0,s.jsx)(v.a.Item,{children:"No Watermark"}),(0,s.jsx)(v.a.Item,{children:(0,s.jsxs)(t.Z,{align:"center",spacing:"xs",sx:{u:{textDecoration:"underline",textDecorationStyle:"dotted",fontWeight:500}},children:[(0,s.jsx)(d.x,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.access-to-all-ai-models",defaultMessage:"Access to all {aiModels}",values:{aiModels:(0,s.jsx)("u",{children:"AI Models"})}})}),(0,s.jsx)(R.Z,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.access-to-all-ai-models.tooltip",defaultMessage:"Subscription open ups access to all AI models available including Chat GPT-4 and Claude Opus."})})]})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsxs)(t.Z,{align:"center",spacing:"xs",children:[(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.custom",defaultMessage:"5 Custom Templates"}),(0,s.jsx)(R.Z,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.custom.tooltip",defaultMessage:"Maximum number of custom templates you can create in your organization."})})]})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsxs)(t.Z,{align:"center",spacing:"xs",children:[(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.headshots",defaultMessage:"5 Branding Headshots"}),(0,s.jsx)(R.Z,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.headshots.tooltip",defaultMessage:"Maximum number of branding headshots you can create in your organization."})})]})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.slides",defaultMessage:"{limit} Max Slides per Carousel",values:{limit:N.cJ.limitSlides}})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.palettes",defaultMessage:"Custom Color Palettes"})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.downloads",defaultMessage:"Unlimited Downloads"})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.fonts",defaultMessage:"Unlimited Custom Fonts"})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.integrations",defaultMessage:"External Integrations"})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.solo.support",defaultMessage:"Chat and Email Support"})})]}),L.role===N.HB.SUPER_ADMIN?(0,s.jsx)(h.z,{variant:"outline",color:"teal.8",fullWidth:!0,mt:"md",radius:"md",leftIcon:(0,s.jsx)(A.Z,{size:18}),onClick:()=>handleCheckout($?N.PO:N.cJ),disabled:(null==G?void 0:G.status)!=="expired"&&((null==J?void 0:J.id)===($?N.PO.id:N.cJ.id)||!$&&(null==J?void 0:J.type)==="annual"||(null==J?void 0:J.id.includes("agency"))),children:(null==G?void 0:G.status)==="expired"?(0,s.jsx)(s.Fragment,{children:"Renew Plan"}):(0,s.jsx)(s.Fragment,{children:(null==J?void 0:J.id)===($?N.PO.id:N.cJ.id)?(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.currentPlan",defaultMessage:"Current Plan"}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.upgrade",defaultMessage:"Upgrade"})})})}):(0,s.jsx)(u.u,{label:"Only the owner can upgrade the plan.",children:(0,s.jsx)(h.z,{variant:"outline",color:"teal.8",fullWidth:!0,mt:"md",radius:"md",leftIcon:(0,s.jsx)(A.Z,{size:18}),disabled:!0,children:(null==J?void 0:J.id)===($?N.PO.id:N.cJ.id)?(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.currentPlan",defaultMessage:"Current Plan"}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.upgrade",defaultMessage:"Upgrade"})})})}),(0,s.jsx)(r.x,{size:"xs",color:"dimmed",mt:"md",sx:{fontStyle:"italic"},children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.taxes",defaultMessage:"* All prices are subject to applicable taxes."})})]})}),(0,s.jsx)(d.x,{children:(0,s.jsxs)(p.Z,{padding:"lg",radius:"md",withBorder:!0,shadow:"md",sx:{overflow:"visible",borderColor:S.colors[S.primaryColor][3]+" !important",borderWidth:"2px !important"},children:[(0,s.jsx)(d.x,{sx:{width:"150px",height:"150px",overflow:"hidden",position:"absolute",top:"-10px",right:"-10px","&::before":{top:"0",left:"0",borderTopColor:"transparent",borderRightColor:"transparent",position:"absolute",zIndex:-1,content:"''",display:"block",border:"5px solid #a2232e"},"&::after":{bottom:"0",right:"0",borderTopColor:"transparent",borderRightColor:"transparent",position:"absolute",zIndex:-1,content:"''",display:"block",border:"5px solid #a2232e"},"& > span":{left:"-25px",top:"42px",transform:"rotate(45deg)",position:"absolute",display:"block",width:"225px",padding:"12px 0",backgroundColor:"#ee5764",boxShadow:"0 5px 10px rgba(0,0,0,.1)",color:"#fff",font:"700 14px/1 'Lato', sans-serif",letterSpacing:"1px",textShadow:"0 1px 1px rgba(0,0,0,.2)",textTransform:"uppercase",textAlign:"center"}},children:(0,s.jsx)("span",{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.ribbon",defaultMessage:"Most Loved"})})}),(0,s.jsxs)(m.K,{mb:"xs",spacing:"xs",children:[(0,s.jsx)(r.x,{weight:700,size:"xs",color:S.colors[S.primaryColor][5],sx:{textTransform:"uppercase"},children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency",defaultMessage:"Teams & Agencies"})}),(0,s.jsx)(r.x,{weight:600,size:"1.5rem",children:$?(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.annual",defaultMessage:"${price}/month",values:{price:Math.round((null==O?void 0:O.monthly[Q].price)*.8)}}):(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.monthly",defaultMessage:"${price}/month",values:{price:null==O?void 0:O.monthly[Q].price}})}),$&&(0,s.jsx)(r.x,{size:"md",fw:"600",color:"red",sx:{textDecoration:"line-through"},children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.previous",defaultMessage:"Previously ${price}/month",values:{price:null==O?void 0:O.monthly[Q].price}})})]}),(0,s.jsx)(r.x,{size:"sm",color:"dimmed",children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.description",defaultMessage:"Perfect for {plan}",values:{plan:1===Q?"small teams and agencies.":2===Q?"medium teams and agencies.":3===Q?"large teams and agencies.":""}})}),(0,s.jsx)(d.x,{mt:"1.5rem",mb:"1.9rem",children:(0,s.jsx)(w.i,{thumbChildren:(0,s.jsx)(F.Z,{size:"1rem"}),label:e=>{var o;return null==ei?void 0:null===(o=ei.find(o=>o.value===e))||void 0===o?void 0:o.label},defaultValue:1,min:1,max:3,step:1,marks:ei,thumbSize:26,styles:{thumb:{borderWidth:(0,C.h)(2),padding:(0,C.h)(3)},markLabel:{display:"none"}},onChange:e=>ee(e),value:Q})}),(0,s.jsxs)(v.a,{mt:"md",spacing:"xs",size:"sm",center:!0,icon:(0,s.jsx)(y.k,{variant:"outline",color:"brand.4",size:"xs",radius:"xl",children:(0,s.jsx)(U.KBY,{size:"1rem"})}),styles:{item:{lineHeight:"1.3rem",fontSize:"0.9rem"}},children:["agency_small_monthly_plan"===eo.id?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(r.x,{fw:500,mb:10,children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.small",defaultMessage:"Everything In Solo Plan +"})})}):(0,s.jsx)(s.Fragment,{}),"agency_medium_monthly_plan"===eo.id?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(r.x,{fw:500,mb:10,children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.medium",defaultMessage:"Everything In Small Team Plan +"})})}):(0,s.jsx)(s.Fragment,{}),"agency_large_monthly_plan"===eo.id?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(r.x,{fw:500,mb:10,children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.large",defaultMessage:"Everything In Medium Team Plan +"})})}):(0,s.jsx)(s.Fragment,{}),(0,s.jsx)(v.a.Item,{children:(0,s.jsxs)(t.Z,{align:"center",spacing:"xs",sx:{u:{textDecoration:"underline",textDecorationStyle:"dotted",fontWeight:500}},children:[(0,s.jsx)(d.x,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.access-to-all-ai-models",defaultMessage:"Access to all {aiModels}",values:{aiModels:(0,s.jsx)("u",{children:"AI Models"})}})}),(0,s.jsx)(R.Z,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.access-to-all-ai-models.tooltip",defaultMessage:"Subscription open ups access to all AI models available including Chat GPT-4 and Claude Opus."})})]})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsxs)(t.Z,{align:"center",spacing:"xs",children:[(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.workspaces",defaultMessage:"{limit} Workspaces",values:{limit:null==eo?void 0:eo.limitWorkspaces}}),(0,s.jsx)(R.Z,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.workspaces.tooltip",defaultMessage:"Maximum number of workspaces under this plan.{lineBreak} A workspace contains all of the templates, headshots, team members, etc. for a brand/organization.",values:{lineBreak:(0,s.jsx)("br",{})}})})]})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsxs)(t.Z,{align:"center",spacing:"xs",children:[(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.members",defaultMessage:"{limit} Team Members",values:{limit:null==eo?void 0:eo.limitTeamMembers}}),(0,s.jsx)(R.Z,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.members.tooltip",defaultMessage:"Total team members you can distribute across your organization. This includes you as the first user."})})]})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsxs)(t.Z,{align:"center",spacing:"xs",children:[(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.custom",defaultMessage:"{limit} Custom Templates",values:{limit:null==eo?void 0:eo.limitCustomTemplate}}),(0,s.jsx)(R.Z,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.custom.tooltip",defaultMessage:"Maximum number of custom templates you can create in your organization."})})]})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsxs)(t.Z,{align:"center",spacing:"xs",children:[(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.headshots",defaultMessage:"{limit} Branding Headshots",values:{limit:null==eo?void 0:eo.limitBranding}}),(0,s.jsx)(R.Z,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.headshots.tooltip",defaultMessage:"Maximum number of branding headshots you can create in your organization."})})]})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.slides",defaultMessage:"{limit} Max Slides per Carousel",values:{limit:null==eo?void 0:eo.limitSlides}})}),(0,s.jsx)(v.a.Item,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.agency.support",defaultMessage:"Priority Chat and Email support"})})]}),L.role===N.HB.SUPER_ADMIN?(0,s.jsx)(h.z,{variant:"filled",color:"teal.8",fullWidth:!0,mt:"md",radius:"md",leftIcon:(0,s.jsx)(A.Z,{size:18}),onClick:()=>handleCheckout($?null==O?void 0:O.annual[Q]:null==O?void 0:O.monthly[Q]),disabled:(null==G?void 0:G.status)!=="expired"&&($?(null==J?void 0:J.id)===(null==O?void 0:null===(o=O.annual[Q])||void 0===o?void 0:o.id):(null==J?void 0:J.id)===(null==O?void 0:null===(i=O.monthly[Q])||void 0===i?void 0:i.id)),children:(null==G?void 0:G.status)==="expired"?(0,s.jsx)(s.Fragment,{children:"Renew Plan"}):(0,s.jsx)(s.Fragment,{children:(null==J?void 0:J.id)===($?null==O?void 0:null===(l=O.annual[Q])||void 0===l?void 0:l.id:null==O?void 0:null===(x=O.monthly[Q])||void 0===x?void 0:x.id)?(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.currentPlan",defaultMessage:"Current Plan"}):(0,s.jsx)(s.Fragment,{children:J&&N.f0.indexOf(J.id)<N.f0.indexOf(eo.id)?(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.upgrade",defaultMessage:"Upgrade"}):(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.downgrade",defaultMessage:"Downgrade"})})})}):(0,s.jsx)(u.u,{label:"Only the owner can upgrade the plan.",children:(0,s.jsx)(h.z,{variant:"outline",color:"teal.8",fullWidth:!0,mt:"md",radius:"md",leftIcon:(0,s.jsx)(A.Z,{size:18}),disabled:!0,children:(null==J?void 0:J.id)===($?null==O?void 0:null===(M=O.annual[Q])||void 0===M?void 0:M.id:null==O?void 0:null===(Z=O.monthly[Q])||void 0===Z?void 0:Z.id)?(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.currentPlan",defaultMessage:"Current Plan"}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.upgrade",defaultMessage:"Upgrade"})})})}),(0,s.jsx)(r.x,{size:"xs",color:"dimmed",mt:"md",sx:{fontStyle:"italic"},children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.taxes",defaultMessage:"* All prices are subject to applicable taxes."})})]})})]})]})},CancellationSection=e=>{let{close:o}=e,i={"switching-tools":"Switching to a different tool","lack-of-time":"Lack of time to utilize the platform","cost-too-high":"Cost is too high","did-not-meet-expectations":"Did not meet expectations","missing-features":"Missing key features","technical-issues":"Technical issues","customer-service-issues":"Customer service issues",other:"Other"},a={"switching-tools":[{question:"Which tool are you switching to?",answer:""},{question:"What features or benefits does the new tool offer that PostNitro.ai does not?",answer:""},{question:"Is there something specific we could improve to keep you as a customer?",answer:""}],"lack-of-time":[{question:"Can you share more about the time constraints you are facing?",answer:""},{question:"Are there specific features or functionalities that take too much time to use?",answer:""},{question:"Would additional tutorials or time-saving tips help you use the platform more efficiently?",answer:""}],"cost-too-high":[{question:"Can you provide more details on your pricing concerns?",answer:""},{question:"Are there specific features or services that you find are not worth the cost?",answer:""},{question:"Would a different pricing plan or discount make PostNitro.ai more affordable for you?",answer:""}],"did-not-meet-expectations":[{question:"Can you explain how PostNitro.ai fell short of your expectations?",answer:""},{question:"Are there specific features or functionalities that you found lacking?",answer:""},{question:"What improvements or additions would make the platform meet your expectations?",answer:""}],"missing-features":[{question:"Which features do you find are missing from PostNitro.ai?",answer:""},{question:"How would these features improve your experience with the platform?",answer:""},{question:"Are these features available in other tools you are considering?",answer:""}],"technical-issues":[{question:"Can you describe the technical issues you encountered?",answer:""},{question:"How frequently do these issues occur, and how do they impact your use of the platform?",answer:""},{question:"Have you reached out to our support team for assistance, and if so, was the issue resolved?",answer:""}],"customer-service-issues":[{question:"Can you share more about the customer service issues you experienced?",answer:""},{question:"Was there a specific incident or recurring problem that influenced your decision?",answer:""},{question:"How can we improve our customer service to better meet your needs?",answer:""}],other:[{question:"Please provide more details about your reason for cancellation.",answer:""},{question:"Are there any suggestions or feedback you would like to share with us?",answer:""},{question:"How can we improve our platform or services to better serve customers like you?",answer:""}]},[l,r]=(0,n.useState)("switching-tools"),[p,u]=(0,n.useState)(a["switching-tools"]),[x]=(0,W.ZP)(e=>[e.activeWorkspace]),handleReasonChange=e=>{r(e),u(a[e])},handleAnswerChange=(e,o)=>{let i=[...p];i[e]={...i[e],answer:o},u(i);let s={...a};s[l][e].answer=o,a[l]=s[l]},sendCancellationForm=async()=>{if(!l){E.N9.show({id:"send-cancel-form",title:"Please select a reason.",message:"We need to know why you are cancelling, please select a reason.",autoClose:!1,withCloseButton:!0,...N.qX});return}for(let e=0;e<p.length;e++){let o=p[e];if(!o||!o.answer||""===o.answer){E.N9.show({id:"send-cancel-form-reason",title:"Please answer all questions.",message:"We need more information so that we can improve ourselves for you.",color:"red",autoClose:!1,withCloseButton:!0,...N.qX});return}}try{let e=new T.j(null==x?void 0:x.organizationId);await e.cancelSubscriptionForm(i[l],p),E.N9.show({id:"send-cancel-form-success",title:"Cancellation feedback submitted successfully.",message:"We will reachout to you shortly for further action.",autoClose:!0,withCloseButton:!1,...N.qX})}catch(e){E.N9.show({id:"send-cancel-form-fail",title:"Failed to send cancellation feedback.",message:"Please try again or contact support.",color:"red",autoClose:!1,withCloseButton:!0,...N.qX})}o()};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.x,{sx:{display:"block",flexDirection:"column",justifyContent:"center",alignItems:"center",marginBottom:0},children:(0,s.jsx)(c.D,{order:3,children:(0,s.jsxs)(t.Z,{spacing:"xs",children:[(0,s.jsx)(g.A,{variant:"default",size:"md",onClick:o,children:(0,s.jsx)(D.Z,{size:18})}),(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.cancellation.title",defaultMessage:"We are sad to see you go ... \uD83D\uDE14"})]})})}),(0,s.jsx)(c.D,{order:6,mt:"md",children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.cancellation.description",defaultMessage:"Can you please help us understand what went wrong?"})}),(0,s.jsx)(M.Y.Group,{value:l,onChange:e=>handleReasonChange(e),name:"cancellationReason",mt:"xs",children:(0,s.jsx)(m.K,{spacing:"xs",children:Object.entries(i).map(e=>{let[o,i]=e;return(0,s.jsx)(M.Y,{value:o,label:i},o)})})}),p.map((e,o)=>(0,s.jsxs)(n.Fragment,{children:[(0,s.jsx)(c.D,{order:6,mt:"md",children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.cancellation.question.".concat(o),defaultMessage:e.question})}),(0,s.jsx)(Z.g,{mt:"xs",placeholder:"Please provide as much detail as possible so that we can improve ourselves.",value:e.answer,onChange:e=>handleAnswerChange(o,e.target.value),required:!0,minRows:2,maxRows:4})]},o)),(0,s.jsxs)(t.Z,{position:"right",mt:"md",children:[(0,s.jsx)(h.z,{onClick:o,children:"I've changed my mind"}),(0,s.jsx)(h.z,{variant:"outline",color:"red",onClick:sendCancellationForm,children:"Proceed with cancellation"})]})]})};o.ZP=()=>{let[e,o,i,b]=(0,a.Z)(e=>[e.plans,e.subscription,e.usage,e.managementURLs]),[j,v,y,w]=(0,a.Z)(e=>[e.setCurrentPlan,e.setManagementURLs,e.setSubscription,e.fetchUsage]),[C,M]=(0,W.ZP)(e=>[e.organization,e.activeWorkspace]),[Z,z]=(0,n.useState)(!1),[D,F]=(0,n.useState)(!1),U=(0,n.useMemo)(()=>{if(o&&o.planId&&e){let i=Object.values(e).flat();return i.find(e=>e.id===o.planId)}return null},[e,o]);(0,n.useEffect)(()=>{w((null==M?void 0:M.organizationId)||"")},[U]);let handleUpdatePaymentMethod=()=>{LemonSqueezy.Url.Open(b.updatePaymentMethod)},handleCustomerPortal=()=>{window.open(b.customerPortal,"_blank")},B=[{key:"workspaces",color:"#48BFAE",name:"Workspaces"},{key:"teamMembers",color:"#4098D7",name:"Team Members"},{key:"customTemplates",color:"#6C6CFF",name:"Templates"},{key:"aiImages",color:"#00C8FF",name:"AI Images"},{key:"downloads",color:"#c175ff",name:"Downloads"}],O=B.length,K=100/O,X=(0,n.useMemo)(()=>B.map(e=>{let o=(null==i?void 0:i.limits[e.key])||1,s=(null==i?void 0:i.consumed[e.key])||0,a=s/o*K;return{value:Math.min(K,a),color:e.color,tooltip:"".concat(e.name," ").concat(s,"/").concat(o)}}),[i,U]),H=(0,n.useMemo)(()=>B.map(e=>{let o=(null==i?void 0:i.limits[e.key])||0,a=o.toString(),n=(null==i?void 0:i.consumed[e.key])||0,d=n>o;return(null==U?void 0:U.type)!=="free"&&"downloads"===e.key&&(a="Unlimited"),(0,s.jsxs)(t.Z,{spacing:"xs",noWrap:!0,children:[(0,s.jsx)(l.b,{size:"1rem",color:e.color}),(0,s.jsxs)(t.Z,{spacing:"6px",noWrap:!0,children:[(0,s.jsxs)(r.x,{size:"sm",fw:"500",children:[e.name,":"]}),(0,s.jsx)(r.x,{size:"sm",fw:d?"600":"500",color:d?"red":"dimmed",children:"".concat(n,"/").concat(a)})]})]},e.key)}),[i]);if(Z)return(0,s.jsx)(PlanSection,{close:()=>z(!1)});let fetchPlans=async()=>{var o;let i=new T.j(null==M?void 0:M.organizationId),s=await i.getPlans();v(s.managementURLs),y(s.subscription);let a=null;if(s.subscription&&(null===(o=s.subscription)||void 0===o?void 0:o.planId)&&e){let o=Object.values(e).flat();a=o.find(e=>e.id===s.subscription.planId)}j(a),w((null==M?void 0:M.organizationId)||"")},resumeSubscription=async()=>{let e=new T.j(null==C?void 0:C.id);L.qk.openConfirmModal({title:"Resume Subscription",children:"Are you sure you want to resume your subscription?",labels:{cancel:"Cancel",confirm:"Resume"},onConfirm:async()=>{try{E.N9.show({id:"resume",loading:!0,title:"Please wait...",message:"Resuming your subscription.",autoClose:!1,withCloseButton:!1,...N.qX}),await e.resumeLSSubscription(),setTimeout(()=>{fetchPlans(),E.N9.hide("resume")},3e3)}catch(e){console.error(e),E.N9.show({id:"resume",title:"Error",message:"An error occurred while processing your request. Please try again later.",autoClose:!1,withCloseButton:!0,...N.qX})}}})};return D?(0,s.jsx)(CancellationSection,{close:()=>F(!1)}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(d.x,{children:[(0,s.jsx)(c.D,{order:3,children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing",defaultMessage:"Billing"})}),(0,s.jsx)(c.D,{order:5,mt:"md",sx:{svg:{verticalAlign:"middle",display:"inline-block",marginLeft:"0.2rem",marginRight:"0.2rem"}},children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.description",defaultMessage:"Manage your subscription and billing information."})})]}),(0,s.jsxs)(d.x,{mt:"xl",children:[(0,s.jsx)(t.Z,{position:"apart",align:"flex-start",children:(0,s.jsxs)(d.x,{children:[(0,s.jsx)(c.D,{order:5,children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.current",defaultMessage:"Current Plan & Usage"})}),(0,s.jsx)(r.x,{size:"sm",color:"dimmed",mt:"xs",children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.current.description",defaultMessage:"Your current plan and usage details."})})]})}),(0,s.jsxs)(m.K,{mt:"md",spacing:"xl",children:[(0,s.jsxs)(p.Z,{padding:"md",radius:"md",withBorder:!0,sx:{background:"linear-gradient(90deg, rgba(255,255,255,1) 30%, rgba(242, 242, 242, .8) 100%)",display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[(0,s.jsxs)(m.K,{spacing:"6px",children:[(0,s.jsxs)(t.Z,{spacing:"4px",children:[(0,s.jsx)(r.x,{size:"sm",weight:600,children:null==U?void 0:U.displayName}),(null==o?void 0:o.status)&&(0,s.jsxs)(r.x,{size:"sm",weight:600,sx:{textTransform:"capitalize",color:(null==o?void 0:o.status)==="active"?"green":"#ff8787",verticalAlign:"middle"},children:["(",null==o?void 0:o.status,")",(null==o?void 0:o.status)==="cancelled"&&(0,s.jsx)(R.Z,{sx:{verticalAlign:"middle",marginLeft:"0.2rem"},children:"Your subscription has been cancelled. You can still use the service until the end of the billing period."})]})]}),(0,s.jsx)(r.x,{size:"sm",children:"Current billing period"}),(0,s.jsx)(r.x,{size:"xs",color:"dimmed",children:(null==o?void 0:o.nextPaymentDate)?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.period",defaultMessage:"Next billing date: {billingDate}",values:{billingDate:(0,P.Z)(new Date(null==o?void 0:o.nextPaymentDate),"MMMM d, yyyy")}})}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.period.na",defaultMessage:"N/A"})})})]}),(0,s.jsx)(d.x,{children:(0,s.jsxs)(t.Z,{spacing:"xs",align:"center",children:[(null==o?void 0:o.status)!=="active"&&(null==o?void 0:o.status)?(0,s.jsx)(h.z,{leftIcon:(0,s.jsx)(S.Z,{size:18}),onClick:()=>resumeSubscription(),children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.resume",defaultMessage:"Resume Subscription"})}):(0,s.jsx)(u.u,{label:"Cancel Subscription",withinPortal:!0,children:(0,s.jsx)(g.A,{size:"lg",variant:"filled",color:"red",disabled:(null==o?void 0:o.billedAs)==="free",onClick:()=>F(!0),children:(0,s.jsx)(I.Z,{size:18})})}),(null==o?void 0:o.status)==="active"||(null==U?void 0:U.id)==="free_plan"?(0,s.jsx)(u.u,{label:(null==U?void 0:U.id)==="free_plan"?"Start subscription to get more out of PostNitro.":"Upgrade/Downgrade to a different plan.",withinPortal:!0,children:(0,s.jsx)(h.z,{leftIcon:(0,s.jsx)(A.Z,{size:18}),onClick:()=>z(!0),children:(null==U?void 0:U.id)==="free_plan"?(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.start",defaultMessage:"Start Subscription"}):(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.upgrade",defaultMessage:"Upgrade"})})}):(0,s.jsx)(s.Fragment,{})]})})]}),(0,s.jsx)(d.x,{children:(0,s.jsxs)(t.Z,{spacing:"xs",align:"center",children:[(0,s.jsx)(u.u,{label:"Update your payment method to avoid failure of payments and closure of account.",withinPortal:!0,children:(0,s.jsx)(h.z,{leftIcon:(0,s.jsx)(_.Z,{size:18}),onClick:()=>handleUpdatePaymentMethod(),variant:"outline",disabled:(null==o?void 0:o.billedAs)==="free"||!(null==b?void 0:b.updatePaymentMethod),children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.update",defaultMessage:"Update Payment Method"})})}),(0,s.jsx)(u.u,{label:"Access your customer portal to manage your subscription and billing information.",withinPortal:!0,children:(0,s.jsx)(h.z,{leftIcon:(0,s.jsx)(q.Z,{size:18}),onClick:()=>handleCustomerPortal(),variant:"outline",disabled:(null==o?void 0:o.billedAs)==="free"||!(null==b?void 0:b.customerPortal),children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.portal",defaultMessage:"Customer Portal"})})})]})}),(0,s.jsxs)(d.x,{sx:{flex:1},children:[(0,s.jsx)(c.D,{order:5,mb:"md",children:(0,s.jsx)(k.Z,{id:"app.editor.common.popover.billing.usage",defaultMessage:"Usage"})}),(0,s.jsxs)(m.K,{children:[(0,s.jsx)(x.E,{radius:"xl",size:"lg",sections:X}),(0,s.jsx)(f.M,{cols:2,spacing:"xs",children:H})]})]})]})]})]})}},95386:function(e,o,i){var s=i(85893),a=i(97930),n=i(67294),t=i(64523),l=i(95117),r=i(19236),d=i(31194),c=i(69876),m=i(67841),p=i(50331),u=i(80061),g=i(96768),h=i(71232),x=i(88393),f=i(49834),b=i(44012),j=i(77249),v=i(87328),y=i(50472);let EmbedTabHeader=()=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.D,{order:3,children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed",defaultMessage:"Postnitro Embed"})}),(0,s.jsx)(r.D,{order:5,mt:"md",children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed.description",defaultMessage:"Add a full-fledged integrated carousel maker in your app in seconds."})})]});o.Z=()=>{let e=new a.O,[o,i]=(0,n.useState)(!1),[w,C]=(0,n.useState)(!1),[M,Z]=(0,n.useState)(null),[k,z]=(0,n.useState)(["localhost"]),[P,I]=(0,n.useState)("");(0,n.useEffect)(()=>{fetchEmbeds()},[]);let fetchEmbeds=async()=>{i(!0);let o=await e.getAllEmbeds();o&&o.embeds.length>0&&(Z(o.embeds[0]),I(o.embeds[0].apiKey),o.embeds[0].whitelist.split(","),o.embeds[0].whitelist&&z(o.embeds[0].whitelist.split(","))),i(!1)},addNewDomain=function(e){let o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=RegExp("^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$");if(i.test(e)){let i=k.find(o=>o===e);if(!i)return z([...k,e]),o&&updateEmbed([...k,e]),e}else if(e.includes("localhost")){let e="localhost",i=k.find(o=>o===e);if(!i)return z([...k,e]),o&&updateEmbed([...k,e]),e}return null},createEmbed=async()=>{if(k.length>0){C(!0);let o=await e.createEmbed(k);o&&o.embed&&(Z(o.embed),I(o.embed.apiKey),o.embed.whitelist&&z(o.embed.whitelist.split(","))),C(!1)}},regenerateKey=()=>{M&&(C(!0),e.regenerateEmbedKey(M.id).then(e=>{e&&e.embed&&(Z(e.embed),I(e.embed.apiKey),e.embed.whitelist&&z(e.embed.whitelist.split(","))),C(!1)}))},updateEmbed=o=>{M&&(C(!0),e.updateEmbed(M.id,o).then(e=>{e&&e.embed&&(Z(e.embed),I(e.embed.apiKey),e.embed.whitelist&&z(e.embed.whitelist.split(","))),C(!1)}))};return o?(0,s.jsxs)(t.x,{children:[(0,s.jsx)(EmbedTabHeader,{}),(0,s.jsx)(l.x,{color:"dimmed",size:"sm",mt:"md",children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.embed.loading",defaultMessage:"Loading..."})})]}):(0,s.jsxs)(t.x,{children:[(0,s.jsx)(EmbedTabHeader,{}),M?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.x,{children:[(0,s.jsx)(r.D,{order:6,mt:"xl",children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed.api",defaultMessage:"API Key"})}),(0,s.jsx)(l.x,{color:"dimmed",size:"sm",mt:"sm",children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed.api.description",defaultMessage:"You can use this API key to authenticate with our API."})}),(0,s.jsx)(p.q,{value:P,children:e=>{let{copied:o,copy:i}=e;return(0,s.jsx)(u.o,{mt:"sm",placeholder:"API Key",readOnly:!0,rightSectionWidth:(0,g.h)(100),rightSection:(0,s.jsxs)(h.Z,{spacing:"xs",children:[(0,s.jsx)(x.u,{label:o?"Copied":"Copy",withinPortal:!0,children:(0,s.jsx)(f.A,{onClick:()=>i(),variant:"transparent",color:o?"teal":"gray","aria-label":"Copy key",children:o?(0,s.jsx)(j.Z,{size:18}):(0,s.jsx)(v.Z,{size:18})})}),(0,s.jsx)(x.u,{label:"Regenerate",withinPortal:!0,children:(0,s.jsx)(f.A,{onClick:()=>regenerateKey(),variant:"transparent",color:o?"teal":"gray","aria-label":"Regenerate key",children:(0,s.jsx)(y.Z,{size:18})})})]}),value:P,disabled:w})}})]}),(0,s.jsxs)(t.x,{children:[(0,s.jsx)(r.D,{order:6,mt:"xl",children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed.domains",defaultMessage:"Whitelisted Domains"})}),(0,s.jsx)(l.x,{color:"dimmed",size:"sm",mt:"sm",children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed.domains.description",defaultMessage:"Add your domain to allow embedding the carousel maker in your app."})}),(0,s.jsx)(d.NU,{mt:"sm",data:k,creatable:!0,searchable:!0,getCreateLabel:e=>'Add "'.concat(e,'"'),placeholder:"Add your domain",onCreate:e=>addNewDomain(e,!0),disabled:o,value:k,onChange:e=>{z(e),updateEmbed(e)}})]}),(0,s.jsxs)(l.x,{color:"dimmed",size:"sm",mt:"md",children:["Learn more about Postnitro Embed in our ",(0,s.jsx)("a",{href:"https://postnitro.ai/docs/embed/installation",target:"_blank",children:"documentation"}),"."]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.x,{children:[(0,s.jsx)(r.D,{order:6,mt:"xl",children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed.domains",defaultMessage:"Whitelisted Domains"})}),(0,s.jsx)(l.x,{color:"dimmed",size:"sm",mt:"sm",children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed.domains.description",defaultMessage:"Add your domain to allow embedding the carousel maker in your app."})}),(0,s.jsx)(d.NU,{mt:"sm",data:k,creatable:!0,searchable:!0,getCreateLabel:e=>'Add "'.concat(e,'"'),placeholder:"Add your domain",onCreate:e=>addNewDomain(e),disabled:w,value:k,onChange:e=>{z(e)}})]}),(0,s.jsx)(c.k,{mt:"md",justify:"flex-end",children:(0,s.jsx)(m.z,{onClick:()=>createEmbed(),disabled:0===k.length,loading:w,children:(0,s.jsx)(b.Z,{id:"app.editor.common.popover.postnitro.embed.api.generate",defaultMessage:"Generate API Key"})})}),(0,s.jsxs)(l.x,{color:"dimmed",size:"sm",mt:"md",children:["Learn more about Postnitro Embed in our ",(0,s.jsx)("a",{href:"https://postnitro.ai/docs/embed",target:"_blank",children:"documentation"}),"."]})]})]})}},26311:function(e,o,i){var s=i(85893),a=i(64761),n=i(64523),t=i(19236),l=i(95117),r=i(50331),d=i(80061),c=i(88393),m=i(49834),p=i(89814),u=i(67841),g=i(5044),h=i(44012),x=i(77249),f=i(87328),b=i(19151),j=i(39715);i(67294);var v=i(27217),y=i(74922),w=i(35662);let PabblyIcon=()=>(0,s.jsx)(g.k,{size:"22px",sx:{backgroundColor:"transparent",filter:"grayscale(100%)"},children:(0,s.jsxs)("svg",{width:"22",height:"22",viewBox:"0 0 2014 2009",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M2014 1004.5C2014 1559.1 1563.14 2008.68 1007 2008.68C832.627 2008.68 668.607 1964.5 525.593 1886.72C212.457 1716.43 0 1385.22 0 1004.5C0 449.914 450.849 0.324219 1006.99 0.324219C1563.14 0.324219 2014 449.914 2014 1004.5Z",fill:"#20B276"}),(0,s.jsx)("path",{d:"M1408.74 1290.25C1302.17 1399.74 1172.83 1454.53 1020.76 1454.53C927.944 1454.53 841.711 1438.87 760.872 1393.37L759.899 1976.4L752.239 1974.34L747.497 1973.13L741.9 1970.09L739.261 1965.33L736.832 1959.96L739.526 1956.59L472.838 1639.59L472.916 890.235C472.916 734.095 526.196 601.485 632.779 492.382C739.339 383.272 868.67 328.729 1020.76 328.729C1172.83 328.729 1302.16 383.466 1408.74 492.98C1515.3 602.478 1568.6 735.367 1568.6 891.625C1568.6 1047.9 1515.3 1180.76 1408.74 1290.25ZM1205.31 701.833C1154.71 649.796 1093.19 623.789 1020.76 623.789C948.302 623.789 886.785 649.796 836.199 701.833C785.597 753.869 760.296 817.12 760.296 891.64C760.296 966.137 785.589 1029.39 836.199 1081.42C886.785 1133.47 948.302 1159.49 1020.76 1159.49C1093.19 1159.49 1154.71 1133.47 1205.31 1081.42C1255.91 1029.39 1281.21 966.137 1281.21 891.64C1281.21 817.12 1255.91 753.861 1205.31 701.833Z",fill:"#147F52"}),(0,s.jsx)("path",{d:"M1387.73 1269.55C1281.15 1379.09 1151.81 1433.88 999.726 1433.88C906.909 1433.88 820.093 1411.12 739.257 1365.61L739.172 1973.17C739.172 1973.17 719.498 1967.77 693.892 1959.52C687.578 1957.49 681.202 1955.31 674.522 1952.96C671.345 1951.83 669.796 1951.17 666.526 1950.23C658.149 1947.83 647.53 1943.18 639.347 1940.01C611.849 1929.33 589.567 1919.16 589.03 1918.91C588.493 1918.65 509.782 1881.21 500.907 1875.68C492.958 1870.73 485.881 1866.85 479.816 1862.51C477.878 1861.13 476.414 1860.14 474.577 1858.88C460.158 1849 452.1 1843.32 452.1 1843.32L451.859 869.427C451.859 713.231 505.142 580.581 611.732 471.453C718.307 362.302 847.638 307.75 999.734 307.75C1151.82 307.75 1281.15 362.504 1387.74 472.051C1494.31 581.582 1547.62 714.512 1547.62 870.809C1547.6 1027.11 1494.3 1160.02 1387.73 1269.55ZM1184.29 680.952C1133.68 628.899 1072.17 602.884 999.718 602.884C927.26 602.884 865.739 628.899 815.15 680.952C764.544 733.004 739.25 796.274 739.25 870.809C739.25 945.336 764.544 1008.61 815.15 1060.65C865.739 1112.73 927.26 1138.75 999.718 1138.75C1072.16 1138.75 1133.68 1112.73 1184.29 1060.65C1234.88 1008.61 1260.2 945.336 1260.2 870.809C1260.2 796.274 1234.88 733.004 1184.29 680.952Z",fill:"white"})]})});o.Z=e=>{let{authKey:o,isZapierConnected:i,handleConnectZapier:g,isMakeConnected:C,handleConnectMake:M}=e,Z=(0,a.rZ)(),onConnectZapier=e=>{if(e){y.N9.show({title:"Upgrade Required",message:"You need to upgrade your plan to connect with Zapier.",color:"red",autoClose:6e3,...w.qX});return}g()},onConnectMake=e=>{if(e){y.N9.show({title:"Upgrade Required",message:"You need to upgrade your plan to connect with Make.",color:"red",autoClose:6e3,...w.qX});return}M()};return(0,s.jsxs)(n.x,{children:[(0,s.jsx)(t.D,{order:3,children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations",defaultMessage:"Integrations"})}),(0,s.jsx)(t.D,{order:5,mt:"md",sx:{svg:{verticalAlign:"middle",display:"inline-block",marginLeft:"0.2rem",marginRight:"0.2rem"}},children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations.description",defaultMessage:"Connect your Postnitro.ai account with your favorite apps."})}),(0,s.jsxs)(n.x,{children:[(0,s.jsx)(t.D,{order:6,mt:"xl",children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations.description2",defaultMessage:"Authentication Key"})}),(0,s.jsx)(l.x,{color:"dimmed",size:"sm",mt:"sm",children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations.description3",defaultMessage:"You can use this key to authenticate with our API with Zapier or Pabbly."})}),(0,s.jsx)(r.q,{value:o,children:e=>{let{copied:i,copy:a}=e;return(0,s.jsx)(d.o,{mt:"sm",value:o,placeholder:"Authentication Key",readOnly:!0,rightSection:(0,s.jsx)(c.u,{label:i?"Copied":"Copy",withinPortal:!0,children:(0,s.jsx)(m.A,{onClick:()=>a(),variant:"transparent",color:i?"teal":"gray","aria-label":"Copy key",children:i?(0,s.jsx)(x.Z,{size:18}):(0,s.jsx)(f.Z,{size:18})})})})}})]}),(0,s.jsxs)(p.M,{cols:2,mt:"lg",children:[(0,s.jsx)(v.Z,{feature:"integrations",children:e=>(0,s.jsx)(u.z,{variant:"light",color:"gray",h:"60px",leftIcon:(0,s.jsx)(b.wTK,{size:"22px"}),sx:{color:Z.colors.gray[9],borderColor:i?Z.colors.teal[6]:"rgb(234, 234, 234)",backgroundColor:i?Z.colors.teal[2]:"rgb(234, 234, 234)","&:hover":{backgroundColor:i?Z.colors.teal[2]:""}},onClick:()=>onConnectZapier(e),children:i?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations.zapier.connected",defaultMessage:"Zapier Connected"})}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations.zapier",defaultMessage:"Connect with Zapier"})})})}),(0,s.jsx)(v.Z,{feature:"integrations",children:e=>(0,s.jsx)(u.z,{variant:"light",color:"gray",h:"60px",leftIcon:(0,s.jsx)(j.imJ,{size:"22px"}),sx:{color:Z.colors.gray[9],borderColor:C?Z.colors.teal[6]:"rgb(234, 234, 234)",backgroundColor:C?Z.colors.teal[2]:"rgb(234, 234, 234)","&:hover":{backgroundColor:C?Z.colors.teal[2]:""}},onClick:()=>onConnectMake(e),children:C?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations.make.connected",defaultMessage:"Make Connected"})}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations.make",defaultMessage:"Connect with Make"})})})}),(0,s.jsx)(u.z,{variant:"light",color:"gray",h:"60px",leftIcon:(0,s.jsx)(PabblyIcon,{}),sx:{color:Z.colors.gray[9],backgroundColor:"rgb(234, 234, 234)"},disabled:!0,children:(0,s.jsx)(h.Z,{id:"app.editor.common.popover.integrations.pabbly",defaultMessage:"Connect with Pabbly"})})]})]})}},79100:function(e,o,i){var s=i(85893),a=i(86896),n=i(44012),t=i(58792),l=i(67294),r=i(62023),d=i(35662),c=i(74922),m=i(25963),p=i(95117),u=i(64523),g=i(19236),h=i(20050),x=i(71232),f=i(80061),b=i(28855),j=i(49834),v=i(54777),y=i(67841),w=i(55837),C=i(70278),M=i(63920),Z=i(97975),k=i(58409),z=i(27217),P=i(85176),I=i(15282);o.Z=()=>{var e;let o=(0,a.Z)(),[i,S,A]=(0,t.ZP)(e=>[e.user,e.activeWorkspace,e.setActiveWorkspace]),[_,q]=(0,l.useState)([{email:"",role:"manager"}]),[D,F]=(0,l.useState)(!1),[N]=(0,I.Z)(e=>[e.setUsage]);(0,l.useEffect)(()=>{if(!S)return;let e=new r.G(null==S?void 0:S.id);e.getWorkspaceTeam().then(e=>{A({...S,members:e})})},[]);let addNewField=()=>{q([..._,{email:"",role:"admin"}])},removeField=e=>{q(_.filter((o,i)=>i!==e))},handleFieldChange=(e,o,i)=>{let s=_.map((s,a)=>a===e?{...s,[o]:i}:s);q(s)},R=(0,l.useMemo)(()=>{var e;if(!S||!i)return!1;let o=null==S?void 0:null===(e=S.members.find(e=>e.id===(null==i?void 0:i.id)))||void 0===e?void 0:e.role;return o===d.HB.SUPER_ADMIN||o===d.HB.ADMIN},[S,i]),sendInvitations=async e=>{if(e){c.N9.show({title:"Upgrade Required",message:"You've reached your plan's limit for adding further team members. To add more, please consider upgrading your plan.",color:"red",autoClose:6e3,...d.qX});return}if(F(!0),!S)return;let o=new r.G(null==S?void 0:S.id);o.createWorkspaceTeam(_[0]).then(async e=>{let i=await o.getWorkspaceTeam();A({...S,members:i}),q([{email:"",role:"manager"}]),c.N9.show({title:"Invitations sent!",message:"Invitations have been sent successfully",autoClose:6e3,...d.qX})}).catch(e=>{var o;c.N9.show({title:"Whoops!",message:null!==(o=null==e?void 0:e.error)&&void 0!==o?o:"Something went wrong",color:"red",autoClose:6e3,...d.qX})}).finally(async()=>{let e=new P.j(null==S?void 0:S.organizationId),o=await e.getUsage(!1);N(o),F(!1)})},confirmRemoveTeamMember=e=>{m.qk.openConfirmModal({title:o.formatMessage({id:"app.editor.common.popover.members.delete-modal.title",defaultMessage:"Are you sure?"}),children:(0,s.jsx)(p.x,{size:"sm",children:(0,s.jsx)(n.Z,{id:"app.editor.common.popover.members.delete-modal.content",defaultMessage:"You are about to remove {email} from your workspace. This action cannot be undone.",values:{email:e.email}})}),labels:{confirm:o.formatMessage({id:"app.editor.common.popover.members.delete-modal.confirm",defaultMessage:"Delete"}),cancel:o.formatMessage({id:"app.editor.common.popover.members.custom.delete-modal.cancel",defaultMessage:"Cancel"})},confirmProps:{color:"red"},onConfirm:async()=>{try{c.N9.show({id:"deleting-data",loading:!0,title:o.formatMessage({id:"app.editor.common.popover.members.delete-modal.notification.title",defaultMessage:"Please wait..."}),message:o.formatMessage({id:"app.editor.common.popover.members.delete-modal.notification.content",defaultMessage:"We are removing your team member"}),autoClose:!1,withCloseButton:!1,...d.qX});let i=await handleTeamMemberRemove(e);i?c.N9.update({id:"deleting-data",loading:!1,title:o.formatMessage({id:"app.editor.common.popover.members.delete-modal.notification.success.title",defaultMessage:"Success"}),message:o.formatMessage({id:"app.editor.common.popover.members.delete-modal.notification.success.content",defaultMessage:"Your member has been removed"}),autoClose:!0,withCloseButton:!0,...d.qX}):c.N9.update({id:"deleting-data",loading:!1,title:o.formatMessage({id:"app.editor.common.popover.members.delete-modal.notification.failed.title",defaultMessage:"Failed"}),message:o.formatMessage({id:"app.editor.common.popover.members.delete-modal.notification.failed.content",defaultMessage:"Failed to remove your member"}),autoClose:!0,withCloseButton:!0,...d.qX})}catch(e){}}})},handleTeamMemberRemove=async e=>{if(!S)return;let o=new r.G(null==S?void 0:S.id);try{var i;await o.deleteWorkspaceTeam(e.id);let s=null!==(i=null==S?void 0:S.members.filter(o=>o.id!==e.id))&&void 0!==i?i:[];return A({...S,members:s}),!0}catch(e){return!1}},handleRoleChange=(e,o)=>{if(!S)return;let i=new r.G(null==S?void 0:S.id);i.updateWorkspaceTeam(e.id,{role:o}).then(async e=>{let o=await i.getWorkspaceTeam();A({...S,members:o}),c.N9.show({title:"Role updated!",message:"Role has been updated successfully",autoClose:6e3,...d.qX})}).catch(e=>{var o;c.N9.show({title:"Whoops!",message:null!==(o=null==e?void 0:e.error)&&void 0!==o?o:"Something went wrong",color:"red",autoClose:6e3,...d.qX})})};return(0,s.jsxs)(u.x,{children:[(0,s.jsx)(g.D,{order:3,children:(0,s.jsx)(n.Z,{id:"app.editor.common.popover.members",defaultMessage:"Members"})}),(0,s.jsx)(g.D,{order:5,mt:"md",sx:{svg:{verticalAlign:"middle",display:"inline-block",marginLeft:"0.2rem",marginRight:"0.2rem"}},children:(0,s.jsx)(n.Z,{id:"app.editor.common.popover.members.description",defaultMessage:"Manage your team members and their permissions."})}),(0,s.jsxs)(h.r,{gutter:"xs",mt:"xl",children:[(0,s.jsx)(h.r.Col,{span:8,children:(0,s.jsx)(g.D,{order:6,mb:"xs",fw:500,children:(0,s.jsx)(n.Z,{id:"app.editor.common.popover.members.email",defaultMessage:"Email Address"})})}),(0,s.jsx)(h.r.Col,{span:4,children:(0,s.jsx)(g.D,{order:6,mb:"xs",fw:500,children:(0,s.jsxs)(x.Z,{spacing:"xs",children:[(0,s.jsx)(n.Z,{id:"app.editor.common.popover.members.role",defaultMessage:"Role"}),(0,s.jsxs)(w.Z,{children:["Role determines the level of access a team member has to your workspace.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)("strong",{children:"Owner"})," has full access to the workspace and can manage billing and members.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)("strong",{children:"Admin"})," can create and edit content, manage members and workspace settings.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)("strong",{children:"Manager"})," can create and edit content."]})]})})})]}),(0,s.jsxs)(h.r,{children:[null==S?void 0:null===(e=S.members)||void 0===e?void 0:e.map((e,o)=>(0,s.jsxs)(l.Fragment,{children:[(0,s.jsx)(h.r.Col,{span:8,children:(0,s.jsx)(f.o,{placeholder:"name@postnitro.ai",radius:"md",sx:{flex:1},value:e.email,disabled:(null==i?void 0:i.id)===e.id||!R||"super_admin"===e.role,readOnly:!0})}),(0,s.jsx)(h.r.Col,{span:4,children:(0,s.jsxs)(x.Z,{noWrap:!0,spacing:"xs",children:[(0,s.jsx)(b.Ph,{placeholder:"Select role",radius:"md",defaultValue:"admin",data:[{value:"super_admin",label:"Owner",disabled:!0},{value:"admin",label:"Admin"},{value:"manager",label:"Manager"}],onChange:o=>handleRoleChange(e,o),value:e.role,disabled:(null==i?void 0:i.id)===e.id||!R||"super_admin"===e.role}),(0,s.jsx)(j.A,{variant:"default","aria-label":"Remove team member",size:"lg",disabled:!R||"super_admin"===e.role||(null==i?void 0:i.id)===e.id,onClick:()=>confirmRemoveTeamMember(e),children:(0,s.jsx)(C.Z,{size:18})})]})})]},o)),(0,s.jsx)(h.r.Col,{span:12,children:(0,s.jsx)(v.i,{variant:"dashed"})}),_.map((e,o)=>(0,s.jsxs)(l.Fragment,{children:[(0,s.jsx)(h.r.Col,{span:8,children:(0,s.jsx)(f.o,{placeholder:"name@postnitro.ai",radius:"md",sx:{flex:1},value:e.email,onChange:e=>handleFieldChange(o,"email",e.currentTarget.value)})}),(0,s.jsx)(h.r.Col,{span:4,children:(0,s.jsxs)(x.Z,{noWrap:!0,spacing:"xs",children:[(0,s.jsx)(b.Ph,{placeholder:"Select role",radius:"md",defaultValue:"admin",data:[{value:"admin",label:"Admin"},{value:"manager",label:"Manager"}],value:e.role,onChange:e=>handleFieldChange(o,"role",e)}),(0,s.jsx)(j.A,{onClick:()=>removeField(o),variant:"default","aria-label":"Remove field",size:"lg",sx:{color:"red"},children:(0,s.jsx)(M.Z,{size:18})})]})})]},o))]}),R&&(0,s.jsx)(s.Fragment,{children:0===_.length?(0,s.jsx)(u.x,{mt:"md",children:(0,s.jsx)(y.z,{variant:"outline",color:"gray.5",fullWidth:!0,onClick:()=>addNewField(),sx:{borderStyle:"dashed"},leftIcon:(0,s.jsx)(Z.Z,{size:18}),children:(0,s.jsx)(n.Z,{id:"app.editor.common.popover.members.add",defaultMessage:"Add more"})})}):(0,s.jsx)(u.x,{mt:"md",children:(0,s.jsx)(z.Z,{feature:"invite_team_member",children:e=>(0,s.jsx)(y.z,{fullWidth:!0,leftIcon:(0,s.jsx)(k.Z,{size:18}),onClick:()=>sendInvitations(e),loading:D,children:(0,s.jsx)(n.Z,{id:"app.editor.common.popover.members.invite",defaultMessage:"Send Invitation"})})})})})]})}}}]);