1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[853,398],{34936:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var r=n(59499),i=n(4730),o=(n(67294),n(46901)),a=n(58793),c=n(99038),s=n(85893),l=["severity","children"];function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var p=(0,a.Z)((0,c.Z)(o.Z))((function(e){var t=e.theme;return{color:t.palette.text.primary,backgroundColor:t.palette.grey[50],fontSize:"inherit"}}));function h(e){var t=e.severity,n=e.children,r=(0,i.Z)(e,l);return"default"===t?(0,s.jsx)(p,d(d({},r),{},{children:n})):(0,s.jsx)(o.Z,d(d({},d({severity:t},r)),{},{children:n}))}},24109:function(e,t,n){"use strict";n.d(t,{Z:function(){return g}});n(67294);var r=n(11163),i=n(41664),o=n.n(i),a=n(15861),c=n(11057),s=n(59499),l=(0,n(45522).Z)((function(e){return{root:(0,s.Z)({display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",padding:e.spacing(4),backgroundColor:"#7833FF",color:e.palette.common.white,borderRadius:e.spacing(1),boxShadow:e.shadows[3],"& img":{marginTop:e.spacing(-1)},"& h5":{margin:e.spacing(0,6)}},e.breakpoints.down("md"),{display:"grid",alignItems:"center",justifyItems:"center","& img":{height:70},"& a":{maxWidth:150,marginTop:15},"& p":{fontSize:35,lineHeight:"1.4",textAlign:"center"}}),button:{padding:e.spacing(1.3,4),textTransform:"none",fontWeight:e.typography.fontWeightBold,borderRadius:40,color:e.palette.common.white,background:"none",border:"1px solid ".concat(e.palette.common.white),boxShadow:"none","&:hover":{backgroundColor:e.palette.common.white,color:"#7833FF"}},invite:{fontSize:"32px",margin:"0px 50px"}}})),u=n(83657),d=n(85893),p={title:(0,d.jsxs)(d.Fragment,{children:["Invite your friends and ",(0,d.jsx)("br",{})," collect rewards together"]}),textButton:"Learn more"},h={title:(0,d.jsxs)(d.Fragment,{children:["Invita a tus amigos y ",(0,d.jsx)("br",{})," coleccionad recompensas juntos"]}),textButton:"M\xe1s informaci\xf3n"},f={title:(0,d.jsxs)(d.Fragment,{children:["Invitez vos amis et collectez ",(0,d.jsx)("br",{})," des r\xe9compenses ensemble"]}),textButton:"En savoir plus"},m={title:(0,d.jsxs)(d.Fragment,{children:["Invita i tuoi amici e ",(0,d.jsx)("br",{})," raccogliere i premi insieme"]}),textButton:"Per saperne di pi\xf9"};function g(){var e=l(),t=(0,r.useRouter)().locale,n=(0,u.i_)(t,{en:p,es:h,fr:f,it:m,ja:p,zh:p});return(0,d.jsxs)("div",{className:e.root,children:[(0,d.jsx)("img",{src:"/images/gift-icon-white.svg",alt:"Gift icon"}),(0,d.jsx)(a.Z,{className:e.invite,children:n.title}),(0,d.jsx)(o(),{passHref:!0,href:"/friends-referral",children:(0,d.jsx)(c.Z,{className:e.button,color:"primary",variant:"contained",children:n.textButton})})]})}},41656:function(e,t,n){"use strict";n.d(t,{Z:function(){return Z}});var r=n(59499),i=n(16835),o=n(86010),a=n(67294),c=n(34386),s=n(50135),l=n(11057),u=n(98456),d=n(76627),p=n.n(d),h=n(62425),f=n(63149),m=n(45522),g=n(18972),b=n(56815),x=n(94054),y=n(18360),v=n(34631),j=n(85893);function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=(0,m.Z)((function(e){return{formControl:{margin:e.spacing(0,0,0,1),minWidth:130,"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:v.l$,borderWidth:"1px"},"& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline":{borderColor:"#A6A5A5"}},customLabel:{fontFamily:"lato",fontWeight:400,fontSize:14,lineHeight:"20px",color:"#575757",textTransform:"uppercase",marginLeft:e.spacing(.5)},customForm:{display:"flex",alignItems:"flex-end",justifyContent:"space-between",margin:e.spacing(2.5,1,0)},inputWrapper:{display:"flex",gap:"24px"},select:{height:"48px",textAlign:"left","&.MuiButtonBase-root-MuiMenuItem-root.Mui-selected":{backgroundColor:v.l$,"&:hover":{backgroundColor:v.l$}}}
1,input:{height:"48px",width:"130px","&.MuiOutlinedInput-root":{"& .MuiOutlinedInput-notchedOutline":{borderColor:"#A6A5A5",borderWidth:"1px !important"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:v.l$,borderWidth:"1px !important"}}},inputFocused:{borderColor:"pink !important",borderWidth:"1px !important"},button:{height:"50px",width:"120px",color:v.Yf,backgroundColor:v.l$,borderWidth:"0px",borderRadius:"40px",marginBottom:"4px",textTransform:"capitalize","&:hover":{filter:"brightness(0.9)",backgroundColor:v.l$,color:v.Yf,borderWidth:"0px"}},buttonDisabled:{opacity:.3,pointerEvents:"none","&.MuiButtonBase-root.MuiButton-root.Mui-disabled":{color:"#ffffff"}}}}));function Z(e){var t,n=e.busy,d=e.disabled,m=e.onSubmit,v=e.variant,C=e.color,Z=P(),k=(0,a.useState)(!1),S=k[0],O=k[1],E=(0,a.useState)(!1),_=E[0],U=E[1],A=(0,a.useState)({measurementUnit:"px",width:"",height:""}),I=A[0],D=A[1],R=d||!I.width||!I.height,N=a.useState("px"),B=(0,i.Z)(N,2),M=B[0],T=B[1];function F(){return"px"===I.measurementUnit?"Min: ".concat(f.hk.MIN," | Max: ").concat(f.hk.MAX):"Min: 4 | Max: 88"}function L(e,t){return"px"===t&&(e=parseInt(e)>=f.hk.MIN?e:""),"cm"===t&&(e=parseInt(e)>=4&&parseInt(e)<=88?e:""),e}function z(e){var t=L(I[e],I.measurementUnit);t!==I[e]&&D(w(w({},I),{},(0,r.Z)({},e,t))),O(!1),U(!1)}return(0,j.jsxs)("form",{autoComplete:"off",onSubmit:function(e){e.preventDefault();var t=L(I.width,I.measurementUnit),n=L(I.height,I.measurementUnit);t&&n?("cm"===I.measurementUnit&&(t=String((0,h.rJ)(I.width)),n=String((0,h.rJ)(I.height))),m(Number(t),Number(n))):(z("width"),z("height"))},className:Z.customForm,children:[(0,j.jsxs)("div",{className:Z.inputWrapper,children:[(0,j.jsxs)(c.Z,{classes:{tooltip:Z.tooltip},open:S,title:F(),placement:"top",disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,PopperProps:{disablePortal:!0},onClose:function(){return O(!1)},children:[(0,j.jsx)(b.Z,{className:Z.customLabel,children:"Width"}),(0,j.jsx)(s.Z,{variant:v,size:"small",margin:"dense",fullWidth:!0,InputLabelProps:{classes:{root:Z.input}},classes:{input:Z.bootstrapInput},InputProps:{classes:{root:Z.input},inputComponent:p(),inputProps:{mask:"9999",maskChar:""},"aria-label":"Width"},value:I.width,onChange:function(e){var t=e.target.value;t>f.hk.MAX_WIDTH&&(t=f.hk.MAX_WIDTH),D(w(w({},I),{},{width:t}))},onFocus:function(){return O(!0)},onBlur:function(){return z("width")}})]}),(0,j.jsxs)(c.Z,{classes:{tooltip:Z.tooltip},open:_,title:F(),placement:"bottom",disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,PopperProps:{disablePortal:!0},onClose:function(){return U(!1)},children:[(0,j.jsx)(b.Z,{className:Z.customLabel,children:"Height"}),(0,j.jsx)(s.Z,{variant:v,size:"small",margin:"dense",fullWidth:!0,InputLabelProps:{classes:{focused:Z.inputLabelFocused}},InputProps:{classes:{root:Z.input},inputComponent:p(),inputProps:{mask:"9999",maskChar:""},"aria-label":"Height"},value:I.height,onChange:function(e){var t=e.target.value;t>f.hk.MAX_HEIGHT&&(t=f.hk.MAX_HEIGHT),D(w(w({},I),{},{height:t}))},onFocus:function(){return U(!0)},onBlur:function(){return z("height")}})]}),(0,j.jsxs)(x.Z,{className:Z.formControl,sx:{m:1,minWidth:120},children:[(0,j.jsx)(b.Z,{className:Z.customLabel,children:"Unit"}),(0,j.jsxs)(y.Z,{value:M,onChange:function(e){T(e.target.value),function(){var e="px"===I.measurementUnit?"cm":"px",t=L(I.width,e),n=L(I.height,e);D({measurementUnit:e,width:t,height:n})}()},displayEmpty:!0,inputProps:{"aria-label":"Unit"},sx:{marginTop:"8px"},className:Z.select,children:[(0,j.jsx)(g.Z,{value:"px",children:"Pixels"}),(0,j.jsx)(g.Z,{value:"cm",children:"Centimeter"})]})]})]}),(0,j.jsx)(l.Z,{classes:{root:(0,o.default)(Z.button,(t={},(0,r.Z)(t,Z.defaultButton,!R&&"default"===C),(0,r.Z)(t,Z.primaryButton,!R&&"primary"===C),t)),disabled:Z.buttonDisabled},variant:"outlined",type:"submit",disabled:R,children:n?(0,j.jsx)(u.Z,{className:Z.progress,size:20}):"Create"})]})}Z.defaultProps={variant:"filled",color:"default"}},68191:function(e,t,n){"use strict";n(74069),n(96493),n(11163);var r=n(34631),i=n(59499);(0,n(45522).Z)((function(e){var t;return{text:(t={},(0,i.Z)(t,e.breakpoints.up("md"),{fontSize:13}),(0,i.Z)(t,"fontSize",10),(0,i.Z)(t,"fontWeight",700),(0,i.Z)(t,"color",e.palette.common.white),t),link:{fontSize:13,color:e.palette.common.white,fontWeight:900,textDecorationColor:e.palette.common.white},icon:{width:35},banner:(0,i.Z)({backgroundColor:r.l$,display:"flex",justifyContent:"space-between",alignItems:"center",gap:e.spacing(.75),padding:e.spacing(.75),flexDirection:"column"},e.breakpoints.up("md"),{padding:e.spacing(2,10),gap:e.spacing(4),flexDirection:"row"})}})),n(64017),n(53497),n(97839),n(75452),n(85893)},88550:function(e,t,n){"use strict";n.d(t,{Z:function(){return O}});var r=n(50029),i=n(59499),o=n(87794),a=n.n(o),c=n(94253),s=n(15861),l=n(50135),u=n(98456),d=n(23795),p=n(14354),h=n(46901),f=n(49041),m=n(67294),g=n(45522),b=n(34631),x=(0,g.Z)((function(e){return{codeButton:{lineHeight:"20px",color:e.palette.common.COLOR_PURPLE_HOVER,fontFamily:"Lato"},unstyledButton:{fontWeight:600,fontSize:16,textDecoration:"underline"},headerButton:{fontWeight:500,fontSize:14,textDecoration:"underline"},couponActivation:{width:224,height:42,borderRadius:5,backgroundColor:b.n6,padding:"10px 10px",position:"relative",display:"flex",justifyContent:"center",alignItems:"center","&:hover":{boxShadow:"0 4px 6px 0 rgba(0, 0, 0, 0.2)","& a":{textDecoration:"underline"}},"&::after":{position:"absolute",content:'""',height:16,width:16,right:-10,borderRadius:9,zIndex:1,top:13,backgroundColor:function(t){return t.pseudoElementBgColor||e.palette.common.white}},"&::before":{position:"absolute",content:'""',height:16,width:16,left:-10,borderRadius:9,zIndex:1,top:13,backgroundColor:function(t){return t.pseudoElementBgColor||e.palette.common.white}},"& a":{color:e.palette.common.white,fontFamily:"Lato",fontWeight:700,"&:hover":{textDecoration:"none"}}},title:{fontWeight:700,color:b.n6,lineHeight:"40px",paddingBottom:e.spacing(2),textAlign:"center"},description:{color:b.Lx,fontWeight:700,width:"100%",textAlign:"center",paddingBottom:e.spacing(2),"& a":{textDecoration:"none"}}
1,input:{paddingBottom:e.spacing(2),"& input":{textAlign:"center"},"&::placeholder":{textAlign:"center"}},errorMessage:{color:"#ff0000",textAlign:"center",fontSize:12,paddingBottom:e.spacing(2),marginTop:e.spacing(-2)}}})),y=n(26925),v=n(92777),j=n(82262),C=n(24128),w=function(){function e(){(0,v.Z)(this,e)}return(0,j.Z)(e,null,[{key:"applyCodeAtivationFroEditage",value:function(e){return C.Z.post("/activation-code/apply-coupon-from-editage",{activationCode:e})}}]),e}(),P=n(63149),Z=n(85893);function k(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?k(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function O(e){var t=e.setValidCoupon,n=e.pseudoElementBgColor,i=e.initialModalState,o=void 0!==i&&i,g=e.purpleBallonDesign,b=void 0===g||g,v=e.fromHeader,j=void 0!==v&&v,C=x({pseudoElementBgColor:n}),k=(0,m.useState)({isOpen:o,isLoading:!1,couponCode:"",errorMessage:"",snackBarOpen:!1}),O=k[0],E=k[1];if((0,m.useEffect)((function(){o&&E((function(e){return S(S({},e),{},{isOpen:!0})}))}),[o]),!t)throw new Error("setValidCoupon is required");function _(){E(S(S({},O),{},{isOpen:!1}))}function U(e){var t,n,r=null!==(t=null===e||void 0===e||null===(n=e.target)||void 0===n?void 0:n.value)&&void 0!==t?t:"";E(S(S({},O),{},{couponCode:r,errorMessage:""}))}function A(){return I.apply(this,arguments)}function I(){return(I=(0,r.Z)(a().mark((function e(){var n,r;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,E(S(S({},O),{},{isLoading:!0})),e.next=4,w.applyCodeAtivationFroEditage(O.couponCode);case 4:if(n=e.sent,!0!==(null===(r=n.data)||void 0===r?void 0:r.validCoupon)){e.next=10;break}return t(!0),E({isOpen:!1,isLoading:!1,couponCode:"",errorMessage:"",snackBarOpen:!0}),e.abrupt("return");case 10:E(S(S({},O),{},{isLoading:!1,errorMessage:r.message})),e.next=17;break;case 13:e.prev=13,e.t0=e.catch(0),console.error("Error applying coupon:",e.t0),E(S(S({},O),{},{isLoading:!1}));case 17:case"end":return e.stop()}}),e,null,[[0,13]])})))).apply(this,arguments)}function D(e){(e.ctrlKey||e.metaKey)&&e.keyCode===P.Po.V&&(e.stopPropagation(),e.nativeEvent&&e.nativeEvent.stopImmediatePropagation&&e.nativeEvent.stopImmediatePropagation())}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(c.Z,{className:b?C.couponActivation:C.codeButton,children:(0,Z.jsx)(d.Z,{className:j?C.headerButton:C.unstyledButton,onClick:function(){E(S(S({},O),{},{isOpen:!0}))},children:j?"Use activation code":"Have an activation code?"})}),(0,Z.jsx)(f.Z,{size:"sm",open:O.isOpen,onClose:_,content:(0,Z.jsxs)(c.Z,{px:8,children:[(0,Z.jsx)(s.Z,{variant:"h4",component:"p",className:C.title,children:"Enter activation code"}),(0,Z.jsx)(s.Z,{variant:"body1",component:"p",className:C.description,children:"Please enter the activation code provided by your university or institute."}),(0,Z.jsx)(l.Z,{variant:"outlined",placeholder:"Enter activation code",fullWidth:!0,value:O.couponCode,onChange:U,onKeyDown:D,className:C.input,InputProps:{classes:{input:C.input}}}),O.errorMessage&&(0,Z.jsx)(s.Z,{variant:"body1",component:"p",className:C.errorMessage,children:O.errorMessage}),O.errorMessage&&(0,Z.jsx)(y.Z,{onClick:_,style:{minWidth:"100%",marginBottom:24},children:"Close"}),!O.errorMessage&&(0,Z.jsxs)(y.Z,{disabled:O.isLoading||!O.couponCode,onClick:A,style:{minWidth:"100%",marginBottom:24},children:[O.isLoading&&(0,Z.jsx)(u.Z,{size:14,color:"inherit",style:{marginRight:5}}),"Submit"]})]}),actionButton:!1,cancelButton:!1}),(0,Z.jsx)(p.Z,{anchorOrigin:{vertical:"bottom",horizontal:"center"},open:O.snackBarOpen,autoHideDuration:2e3,onClose:function(){setTimeout((function(){E(S(S({},O),{},{snackBarOpen:!1}))}),2e3)},children:(0,Z.jsx)(h.Z,{severity:"success",children:"Coupon applied successfully! "})})]})}},75452:function(e,t,n){"use strict";n.d(t,{z:function(){return r}});var r={US:{discount:60,currency:"USD",description:"60OFFUSD"},BR:{discount:67,currency:"BRL",description:"67OFFBRL"}}},24987:function(e,t){"use strict";t.Z={gallery:"Gallery",myCreations:"My Creations",infographicTemplates:"Infographic Templates",pricing:"Pricing",institutions:"Institutions",customServices:"Custom Design",aboutUs:"About Us",blog:"Blog",template_page_title:{"Graphical Abstracts":"Graphical Abstract Templates: Visual Abstract Templates","Slides Presentations":"Scientific Presentation Templates: Free Presentation Templates",Infographics:"Infographic Templates - Free Download",Posters:"Scientific Poster Templates: Find Academic & Research Posters"},template_page_description:{"Graphical Abstracts":"Find graphical abstract templates easily with Mind the Graph. Our visual templates help you share complex research in a clear, compelling way. Create stunning visuals that make your work stand out.","Slides Presentations":"Find scientific presentation templates easily with Mind the Graph. Our professionally designed slides help researchers communicate complex findings visually. ",Infographics:"Download free infographic templates designed for scientists. Mind the Graph offers customizable, professional infographics that help communicate complex information visually.",Posters:"Find scientific poster templates easily with Mind the Graph. Our professionally designed academic and research poster templates help researchers communicate complex findings visually. "}}},99551:function(e,t){"use strict";t.Z={gallery:"Gallery",myCreations:"MisCreaciones",infographicTemplates:"Plantillas Infogr\xe1ficas",pricing:"Precios",institutions:"Instituciones",customServices:"Dise\xf1o personalizado",aboutUs:"SobreNosotros",blog:"Blog"}},96153:function(e,t){"use strict";t.Z={gallery:"Galerie",myCreations:"Mes cr\xe9ations",infographicTemplates:"Mod\xe8les d'infographies",pricing:"Tarification",institutions:"Institutions",customServices:"Design sur mesure",aboutUs:"A propos d'AAC",blog:"Blog"}},31375:function(e,t){"use strict";t.Z={gallery:"Galleria",myCreations:"Le mie creazioni",infographicTemplates:"Modelli di infografica",pricing:"Prezzi",institutions:"Istituzioni",customServices:"Design personalizzato",aboutUs:"Chi siamo",blog:"Blog"}},16946:function(e,t,n){"use strict";n.d(t,{L:function(){return a}});var r=n(67294),i=n(63149),o=n(97839);function a(){var e=(0,o.fC)(),t=e.user,n=e.userJournalSettings;return{canAccessFeature:(0,r.useCallback)((function(e,r){var o,a;if((null===t||void 0===t?void 0:t.tp_user)!==i.E_.JOURNAL)return!0;var c=null!==n&&void 0!==n&&n.features?JSON.parse(n.features):{};return null!==(o=null===c||void 0===c||null===(a=c[e])||void 0===a?void 0:a[r])&&void 0!==o&&o}),[t,n])}}},61301:function(e,t,n){"use strict";n.d(t,{o:function(){return o}});var r=n(67294),i=n(62425);function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5e3,t=(0,i.dU)("GA_MEASUREMENT_ID"),n=(0,r.useState)(null),o=n[0],a=n[1],c=(0,r.useState)(!0),s=c[0],l=c[1],u=(0,r.useState)(null),d=u[0],p=u[1];return(0,r.useEffect)((function(){var n;window.dataLayer=window.dataLayer||[],window.gtag=window.gtag||function(){window.dataLayer.push(arguments)};var r=setTimeout((function(){!function(){n=setTimeout((function(){p(new Error("Analytics IDs request timed out after ".concat(e,"ms"))),l(!1)}),e);try{window.gtag("get",t,"client_id",(function(e){if(!e)return clearTimeout(n),p(new Error("Failed to retrieve client ID")),void l(!1);window.gtag("get",t,"session_id",(function(t){if(clearTimeout(n),!t)return p(new Error("Failed to retrieve session ID")),void l(!1);a({client_id:e,session_id:t}),l(!1)}))}))}catch(r){clearTimeout(n),p(r),l(!1)}}()}),100);return function(){clearTimeout(r),n&&clearTimeout(n)}}
1),[t,e]),{gaIdentifiers:o,isGALoading:s,error:d}}},46637:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var r=n(50029),i=n(87794),o=n.n(i),a=n(67294),c=n(99290),s=n(97839);function l(){var e=(0,a.useState)(null),t=e[0],n=e[1],i=(0,s.fC)().isAuthenticated,l=new c.Z;return(0,a.useEffect)((function(){function e(){return(e=(0,r.Z)(o().mark((function e(){var t;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,l.getStripeSubscription();case 3:(t=e.sent).data&&n(t.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}i&&function(){e.apply(this,arguments)}()}),[i]),t}},27831:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return D}});var r=n(59499),i=n(67294),o=n(5152),a=n.n(o),c=n(86061),s=n(186),l=n(34631),u=s.default.div.withConfig({displayName:"styles__Container",componentId:"sc-1y2qpen-0"})(["background:",";width:100%;"],l.hx),d=n(94253),p=n(85893);function h(e){var t=e.children,n=e.bgBrandColor;return(0,p.jsx)(p.Fragment,{children:n?(0,p.jsx)(d.Z,{bgcolor:n,children:t}):(0,p.jsx)(u,{children:t})})}var f=n(62425),m=n(83657),g=n(11163),b=n(24987),x=n(99551),y=n(96153),v=n(31375),j=function(){var e=(0,g.useRouter)(),t=e.locale,n=e.asPath.includes("/illustrations")?(0,m.i_)(t,{en:b.Z,es:x.Z,fr:y.Z,it:v.Z,ja:b.Z,zh:b.Z}):(0,m.i_)("en",{en:b.Z}),r=[{path:"/my-creations",label:n.myCreations,isLogged:!0},{path:"/illustrations",label:n.gallery},{path:"/infographic-templates",label:n.infographicTemplates},{path:f.wz?"/pricing-alt":"/pricing",label:n.pricing},{path:"/institutions",label:n.institutions},{path:"/custom-services",label:n.customServices},{path:"/about-us",label:n.aboutUs},{path:(0,f.dU)("MTG_URL_APP")+"/blog",label:n.blog,isExternal:!0,isBlank:!0}];return r},C=n(64017),w=n(12785);n(68191);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var k=a()((function(){return Promise.all([n.e(1216),n.e(893),n.e(1214)]).then(n.bind(n,30893))}),{loadableGenerated:{webpack:function(){return[30893]}}}),S=a()((function(){return Promise.all([n.e(1216),n.e(8175)]).then(n.bind(n,83877))}),{loadableGenerated:{webpack:function(){return[83877]}}}),O=a()((function(){return n.e(353).then(n.bind(n,80353))}),{loadableGenerated:{webpack:function(){return[80353]}}}),E=a()((function(){return Promise.all([n.e(2395),n.e(8760),n.e(6886),n.e(4354),n.e(2223),n.e(420)]).then(n.bind(n,19641))}),{loadableGenerated:{webpack:function(){return[19641]}}}),_=a()((function(){return n.e(5078).then(n.bind(n,5078))}),{loadableGenerated:{webpack:function(){return[5078]}}}),U=a()((function(){return n.e(6584).then(n.bind(n,16584))}),{ssr:!1,loadableGenerated:{webpack:function(){return[16584]}}}),A=a()((function(){return n.e(9966).then(n.bind(n,89966))}),{ssr:!1,loadableGenerated:{webpack:function(){return[89966]}}}),I=["/teams-and-labs","/institutions","/partners"];function D(e){var t=e.children,n=e.hero,r=e.section,o=e.hasPadding,a=e.FooterProps,s=e.bgBrandColor,u=e.typeBtn,d=e.scrolled,m=e.hamburgerMenuActive,b=e.headerWhite,x=e.context,y=e.userCountry,v=(0,i.useState)(!1),P=v[0],D=v[1],R=(0,C.Z)(),N=(0,g.useRouter)(),B="/"===N.pathname,M=!!I.some((function(e){return N.pathname.includes(e)})),T={white:{editage:"/images/mtg-logo-editage.svg",default:"/images/mtg-logo.svg"},red:{editage:"/images/mtg-logo-red-editage.svg",default:"/images/mtg-logo-red.svg"}},F=B||!M?"editage":"default";return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(w.Z,{}),(0,p.jsxs)(h,{bgBrandColor:s,children:[(0,p.jsx)(c.Z,{bgBrandColor:s,brandSrc:s!==l.Yf?T.white[F]:T.red[F],brandType:F,brandAlt:"Mind the Graph",brandHref:"/",menuItems:j(),isNavOpen:P,onNavClose:function(){return D(!1)},onNavOpen:function(){return D(!0)},typeBtn:u,scrolled:d,hamburgerMenuActive:m,headerWhite:b}),(0,p.jsx)(U,{}),(0,f.Gb)()&&B?(0,p.jsx)(A,{}):null,n]}),(0,p.jsx)(E,{context:x}),(0,p.jsx)(O,{hasPadding:o,children:t}),r,["JP","CN"].includes(y)?(0,p.jsx)(_,{}):R?(0,p.jsx)(S,Z({},a)):(0,p.jsx)(k,Z({},a))]})}D.defaultProps={hero:null,section:null,hasPadding:!0,FooterProps:{}}},84226:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return et},useStyles:function(){return Qe}});var r=n(50029),i=n(59499),o=n(16835),a=n(87794),c=n.n(a),s=n(67294),l=n(9008),u=n.n(l),d=n(41664),p=n.n(d),h=n(10633),f=n(21214),m=n(94253),g=n(23795),b=n(11057),x=n(67720),y=n(96540),v=n(45522),j=n(27831),C=n(53864),w=n(46637),P=n(57972),Z=n(86010),k=n(49089),S=n(98456),O
1=n(86886),E=n(15861),_=n(63149),U=n(24085),A=n(41656),I=n(34631),D=(0,v.Z)((function(e){return{shapesBox:{padding:e.spacing(4),backgroundColor:"#D7486E",borderRadius:10,color:e.palette.common.black},borderRightMd:{paddingBottom:e.spacing(3.5),marginBottom:e.spacing(3.5),borderBottom:"1.5px solid #DDDDDD",margin:e.spacing(0,2)},sizeWrapper:{padding:e.spacing(0,4),alignItems:"flex-end"},shapesBoxItem:(0,i.Z)({marginBottom:e.spacing(2),padding:e.spacing(2.5),textAlign:"center",maxWidth:"155px",borderRadius:8,transition:"all 0.3s ease",cursor:"pointer","&:hover":{backgroundColor:"#FFE8F2"},"&:hover $shapeButton":{borderColor:I.l$,borderWidth:"1.5px",backgroundColor:"transparent"},"&:hover $shapeTitle":{textDecoration:"underline"},"&:hover $shapeButtonImage":{content:'url("/images/plus-circle-filled.svg")'}},e.breakpoints.up("sm"),{marginBottom:0}),shapeButtonContainer:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"140px"},shapeButton:{maxWidth:"100%",maxHeight:"100%",borderWidth:"1.5px",borderColor:"#424242",borderRadius:4,marginRight:"auto",marginLeft:"auto",marginBottom:e.spacing(1),"&:hover":{backgroundColor:"transparent"}},shapeButtonDisabled:{borderColor:"".concat(e.palette.grey[400]," !important")},abstract:{width:89,height:57},slide:{width:110,height:88},infographic:{width:85,height:119},poster:{width:110,height:132},shapeButtonProgress:{color:I.l$},header:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingBottom:e.spacing(2.5),margin:e.spacing(-2,2,2),fontFamily:"lato",fontWeight:700,fontSize:24,lineHeight:"20px",color:I.gU,borderBottom:"1.5px solid #DDDDDD","& .headerLink":{color:I.l$,fontSize:16,lineHeight:"24px",textDecoration:"underline",cursor:"pointer"}},shapeTitle:{fontFamily:"lato",fontSize:16,lineHeight:"24px",color:I.gU,minHeight:"48px",marginBottom:e.spacing(1),display:"flex",alignItems:"center",justifyContent:"center"},customHeader:{display:"flex",alignItems:"center",margin:e.spacing(0,2,1),justifyContent:"space-between"},customTitle:{fontFamily:"lato",fontWeight:700,fontSize:24,lineHeight:"20px",color:I.gU},arrow:{width:"12px",height:"12px",borderLeft:"2px solid black",borderBottom:"2px solid black",transform:"rotate(-45deg)",marginLeft:"8px",transition:"transform 0.3s ease",cursor:"pointer",marginRight:e.spacing(.5),borderBottomLeftRadius:"2px"},arrowUp:{transform:"rotate(135deg)"},shapeButtonImage:{width:"35px",height:"35px",objectFit:"contain",transition:"0.3s ease",display:"block",visibility:"visible",opacity:1,content:'url("/images/plus-circle.svg")'},actionsOverride:{padding:"0px !important"}}})),R=n(62425),N=n(7388),B=n(68918),M=n(29139),T=n(847),F=n(83657),L=n(49041),z=n(26925),W=n(97839),J=n(85893),H=(0,v.Z)((function(e){return{rootModal:{paddingBottom:e.spacing(3)},description:{color:I.gU,lineHeight:"24px",textAlign:"center","& span":{fontWeight:900}},mainButton:{display:"flex",alignItems:"center",justifyContent:"center",padding:e.spacing(1),maxWidth:320,gap:8,borderRadius:8,border:"1px solid #EAECF0",backgroundColor:"#F9FAFB"},button:{padding:e.spacing(1,2),borderRadius:6,fontWeight:900,color:I.lH,textTransform:"none",textAlign:"center",border:"1px solid transparent","&:hover":{backgroundColor:e.palette.common.white,boxShadow:"0px 1px 3px 0px rgba(16, 24, 40, 0.10)"}},buttonSelected:{color:I.n6,backgroundColor:e.palette.common.white,border:"1px solid #EAECF0"},boxPrice:{padding:e.spacing(4,4,0,4),display:"flex",flexDirection:"column",alignItems:"flex-start",borderRadius:16,border:"1px solid ".concat(I.l$),boxShadow:"0px 4px 6px -2px rgba(16, 24, 40, 0.03), 0px 12px 16px -4px rgba(16, 24, 40, 0.08)",width:300},researcherText:{fontSize:18,fontWeight:700,lineHeight:"22px",color:I.l$},mostPopular:{backgroundColor:"#FDF2FA",border:"1px solid #FCCEEE",padding:"2px 8px",borderRadius:6,fontWeight:700,fontSize:14,lineHeight:"20px",fontFamily:"Lato",color:I.l$},priceValue:{display:"flex",alignItems:"center",gap:"4px",color:I.l$,fontSize:20,fontWeight:700,lineHeight:"24px","& span":{fontSize:40,fontWeight:800},"& p":{fontSize:18,fontWeight:400,color:I.lH,lineHeight:"22px"}},totalPriceYear:{fontSize:11,color:I.lH,textAlign:"left",marginTop:-e.spacing(2)},watermarkFreeText:{color:I.lH,textAlign:"left",fontSize:15}}}));function G(e){var t=e.open,n=e.onClose,r=(0,W.fC)().user,i=H();function o(e){k.ZP.event({category:"my_creations",action:"limitation_modal_trial_clicked",label:"My Creations Limitation Modal Trial Clicked",value:r.
1id}),window.open("/pricing","_blank")}return(0,s.useEffect)((function(){t&&k.ZP.event({category:"workspace",action:"trial_modal_presented",label:"My Creations Limitation Modal Presented",value:r.id})}),[t]),(0,J.jsx)(L.Z,{classes:{paper:i.rootModal},open:t,title:(0,J.jsx)("b",{children:"Unlimited creations are just one step away"}),size:"md",fullWidth:!1,content:(0,J.jsxs)(m.Z,{children:[(0,J.jsxs)(E.Z,{className:i.description,children:["We know you want to create more designs, but you've reached your account's limit. ",(0,J.jsx)("br",{}),(0,J.jsx)("span",{children:"Upgrade your subscription and activate unlimited creations"}),"\xa0at the best market's price."]}),(0,J.jsxs)(m.Z,{display:"flex",justifyContent:"center",gap:"16px",pt:4,children:[(0,J.jsxs)(m.Z,{className:i.boxPrice,style:{border:"1px solid #E0E0E0"},children:[(0,J.jsx)(E.Z,{className:i.researcherText,children:"Monthly plan"}),(0,J.jsx)(m.Z,{pt:2.5,children:(0,J.jsx)(E.Z,{className:i.totalPriceYear,children:"7 days free, then"})}),(0,J.jsx)(m.Z,{pt:2,pb:.6,children:(0,J.jsxs)(E.Z,{variant:"body1",className:i.priceValue,children:["US$ ",(0,J.jsx)("span",{children:"19"}),(0,J.jsx)("p",{children:"/month"})]})}),(0,J.jsx)(E.Z,{className:i.totalPriceYear,children:"Cancel anytime"}),(0,J.jsx)(z.Z,{style:{minWidth:"100%",marginTop:"47px"},onClick:function(){return o()},variant:"buttonSecondary",children:"Start your free trial"}),(0,J.jsx)(m.Z,{pb:5})]}),(0,J.jsxs)(m.Z,{className:i.boxPrice,children:[(0,J.jsxs)(m.Z,{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",children:[(0,J.jsx)(E.Z,{className:i.researcherText,children:"Yearly plan"}),(0,J.jsx)(E.Z,{className:i.mostPopular,children:"Save 38%"})]}),(0,J.jsx)(m.Z,{pt:2.5,children:(0,J.jsx)(E.Z,{className:i.totalPriceYear,children:"7 days free, then"})}),(0,J.jsxs)(m.Z,{pt:2,pb:3,children:[(0,J.jsxs)(E.Z,{variant:"body1",className:i.priceValue,children:["US$ ",(0,J.jsx)("span",{children:"12"}),(0,J.jsx)("p",{children:"/month"})]}),(0,J.jsx)(m.Z,{pt:.5,children:(0,J.jsx)(E.Z,{className:i.totalPriceYear,children:"US$ 144 charged yearly"})})]}),(0,J.jsx)(E.Z,{className:i.totalPriceYear,children:"Cancel anytime"}),(0,J.jsx)(z.Z,{style:{minWidth:"100%",marginTop:24},onClick:function(){return o()},variant:"buttonSecondary",children:"Start your free trial"}),(0,J.jsx)(m.Z,{pb:5})]})]})]}),cancelButton:!1,actionButton:!1,onClose:n})}var Y=n(11163),$=n(53497),q=n(82916);function V(e){var t=e.isOpen,n=e.onClose,i=D(),a=(0,W.fC)(),l=a.user,u=a.userJournalSettings,d=(0,C.V)(),p=(0,o.Z)(d,1)[0],h=(0,U.Z)(),f=h.createCreationFromShape,x=h.createCreationFromShapeWithContinueUrl,y=(0,s.useState)(),v=y[0],j=y[1],w=(0,s.useState)(!1),P=w[0],z=w[1],H=(0,Y.useRouter)(),V=(0,R.Od)(),K=(0,s.useState)(!1),Q=K[0],X=K[1],ee=(0,s.useState)(!1),te=ee[0],ne=ee[1],re=(0,s.useState)(),ie=re[0],oe=re[1],ae=(0,s.useState)(!1),ce=ae[0],se=ae[1],le=(0,s.useState)(!1),ue=le[0],de=le[1],pe=(0,s.useState)(!1),he=pe[0],fe=pe[1],me=(0,$.Z)(),ge=R.wz&&!ie&&(0,R.dy)(l)&&!(Q||te),be=l.tp_user===_.E_.JOURNAL&&p.length>=u.creationsAvailable;function xe(){return xe=(0,r.Z)(c().mark((function e(){var t,n,r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new T.Z,e.next=3,t.getLastInvoice();case 3:n=e.sent,r=n.data,oe(r);case 6:case"end":return e.stop()}}),e)}))),xe.apply(this,arguments)}function ye(){return(ye=(0,r.Z)(c().mark((function e(){var t,n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,F.uM.isChina(l);case 2:return t=e.sent,e.next=5,F.uM.isJapan(l);case 5:n=e.sent,X(t),ne(n);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ve(e,t,n){var r=(0,U.Q)(e,t,n),i="".concat((0,R.dU)("MTG_URL_LEGACY"),"/workspace/create_base_slide/").concat(r.themeSlug);r.width&&r.height&&(i="".concat((0,R.dU)("MTG_URL_LEGACY"),"/workspace/create_base_slide/").concat(r.themeSlug,"/").concat(r.width,"/").concat(r.height)),window.location.href=i}function je(e){return Ce.apply(this,arguments)}function Ce(){return Ce=(0,r.Z)(c().mark((function e(t){var r,i,o,a=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.length>1&&void 0!==a[1]?a[1]:null,i=a.length>2&&void 0!==a[2]?a[2]:null,o=a.length>3&&void 0!==a[3]?a[3]:null,!(ge&&p.length>=_.b$[l.tp_user])){e.next=6;break}return se(!0),e.abrupt("return");case 6:if(!(p.length>=_.b$[l.tp_user])){e.next=11;break}return k.ZP.event({category:"workspace",action:"new_creation_upgrade_banner",label:"When Banner Presented to free users",value:l.id}),me.event.push("Banner Click",{Product:"MTG",Email:l.email,URL:H.asPath,Description:"New Creation Upgrade Banner",Locale:"my-creations"}),z(!0),e.abrupt("return");case 11:if(l.useNewWorkspace){e.next=14;break}return ve(t,r,i),e.abrupt("return");case 14:if(e.prev=14,j(t),me.event.push("New Creation",{Product:"MTG",Email:l.email,URL:H.asPath,Description:"New Creation Button",Locale:"my-creations",Type:t}),!o){e.next=22;break}return e.next=20,x(t,r,i,o);case 20:e.next=24;break;case 22:return e.next=24,f(t,r,i);case 24:n(),e.next=30;break;case 27:e.prev=27,e.t0=e.catch(14),console.error(e.t0);case 30:return e.prev=30,j(),e.finish(30);case 33:case"end":return e.stop()}}),e,null,[[14,27,30,33]])}
1))),Ce.apply(this,arguments)}var we=(0,s.useCallback)((function(){z(!1)}),[]),Pe=s.useMemo((function(){return P?V.isActive?(0,J.jsx)(N.Z,{open:P,onClose:we}):(0,R.Gb)()?(0,J.jsx)(B.Z,{open:P,onClose:we}):V.isActive||(0,R.Gb)()?void 0:(0,J.jsx)(M.Z,{open:P,onClose:we}):null}),[P,V.isActive,we]);return(0,s.useEffect)((function(){!function(){xe.apply(this,arguments)}(),function(){ye.apply(this,arguments)}()}),[l]),(0,J.jsxs)(J.Fragment,{children:[ce&&(0,J.jsx)(G,{open:ce,onClose:function(){return se(!1)}}),Pe,(0,J.jsx)(L.Z,{size:"md",open:t,header:(0,J.jsxs)("div",{className:i.header,children:[(0,J.jsx)("span",{children:"What would you like to create today?"}),(0,J.jsxs)(g.Z,{sx:{textDecoration:"none",opacity:he?.5:1},onClick:(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return fe(!0),e.next=3,je(q.L[0].shape,q.L[0].width,q.L[0].height,"?template=true");case 3:fe(!1);case 4:case"end":return e.stop()}}),e)}))),disabled:be||he,children:[he&&(0,J.jsx)(S.Z,{size:20,sx:{mr:1,color:I.l$}}),(0,J.jsx)("span",{className:"headerLink",children:"Start with a template"})]})]}),classes:{actions:i.actionsOverride},fill:!0,content:(0,J.jsx)(m.Z,{children:(0,J.jsxs)(m.Z,{spacing:2,children:[(0,J.jsx)(O.ZP,{className:i.borderRightMd,item:!0,xs:12,md:9,children:(0,J.jsx)(O.ZP,{container:!0,className:i.sizeWrapper,children:q.L.map((function(e){return(0,J.jsx)(O.ZP,{item:!0,xs:12,sm:3,children:(0,J.jsxs)("div",{className:i.shapesBoxItem,onClick:function(){v||be||(k.ZP.event({category:"workspace",action:"new_creation_my_creations",label:'Click on any format option or "Create" button in My Creations',value:l.id}),je(e.shape))},children:[(0,J.jsx)("div",{className:i.shapeButtonContainer,children:(0,J.jsx)(b.Z,{classes:{root:(0,Z.default)(i.shapeButton,i[e.shape.toLowerCase()]),disabled:i.shapeButtonDisabled},variant:"outlined",children:v===e.shape&&!1===!!he?(0,J.jsx)(S.Z,{className:i.shapeButtonProgress,size:25}):(0,J.jsx)("img",{alt:"Plus icon",className:i.shapeButtonImage})})}),(0,J.jsx)(E.Z,{className:i.shapeTitle,children:(0,J.jsx)("b",{children:e.label})}),(0,J.jsxs)(E.Z,{children:[e.width," x ",e.height," px"]})]})},e.id)}))})}),(0,J.jsxs)(m.Z,{className:i.customHeader,children:[(0,J.jsx)(E.Z,{className:i.customTitle,children:"Looking for a specific creation size?"}),(0,J.jsx)("div",{onClick:function(){de((function(e){return!e}))},className:"".concat(i.arrow," ").concat(ue?i.arrowUp:"")})]}),ue&&(0,J.jsx)(O.ZP,{item:!0,xs:12,md:2,children:(0,J.jsx)(m.Z,{textAlign:"center",px:1,children:(0,J.jsx)(A.Z,{variant:"outlined",color:"primary",busy:v===_.EW.CUSTOM,disabled:!!v||be,onSubmit:function(e,t){return je(_.EW.CUSTOM,e,t)}})})})]})}),cancelButton:!1,actionButton:!1,onClose:n})]})}var K=n(94054),Q=n(47312),X=n(18360),ee=n(18972),te=n(34386),ne=n(93946),re=n(88322),ie=n(88550);function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ce=(0,v.Z)((function(e){return{divider:{marginTop:e.spacing(2)},input:(0,i.Z)({width:160,marginRight:e.spacing(1)},e.breakpoints.up("sm"),{marginRight:e.spacing(3)}),textRight:{textAlign:"right"},tooltip:{backgroundColor:e.palette.common.black}}}));function se(e){var t=e.filters,n=e.onChange,r=e.onCreateFolderClick,i=ce(),a=(0,W.fC)(),c=a.user,l=a.updateUser,u=a.userJournalSettings,d=(0,C.V)(),p=(0,o.Z)(d,1)[0],h=(0,s.useState)(0),f=(h[0],h[1]),g=(0,s.useState)(!1),b=g[0],y=g[1],v=(0,s.useState)(!1),j=v[0],w=v[1],P=function(e){switch(e){case"available":return"Owned by me";case"shared":return"Shared with me";case"deleted":return"Deleted";case"last_modified":return"Last modified";case"a_to_z":return"A to Z";default:return"Unknown"}};return(0,s.useEffect)((function(){if(c.tp_user===_.E_.JOURNAL&&null!==u&&void 0!==u&&u.createdAt){var e=new Date(u.createdAt),t=p.filter((function(t){return new Date(t.created_at)>=e}));f(t.length)}}),[p,c.tp_user,u]),(0,s.useEffect)((function(){"true"===sessionStorage.getItem("fromJournalRegistration")&&(y(!0),sessionStorage.removeItem("fromJournalRegistration"))}),[]),(0,s.useEffect)((function(){j&&l()}),[j]),(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(O.ZP,{container:!0,spacing:2,alignItems:"center",children:[(0,J.jsxs)(O.ZP,{item:!0,xs:10,style:{display:"flex",alignItems:"center"},children:[(0,J.jsxs)(K.Z,{variant:"outlined",size:"small",className:i.input,children:[(0,J.jsx)(Q.Z,{id:"recent-creations-label",style:{background:"#fafafa",paddingInline:"6px",marginLeft:"-3px"},children:"Recent creations"}),(0,J.jsxs)(X.Z,{labelId:"recent-creations-label",id:"recent-creations",value:t.status,onChange:function(e){var r=e.target.value;return n(ae(ae({},t),{},{status:r}))},renderValue:function(e){return(0,J.jsx)("div",{role:"textbox","aria-readonly":"true",tabIndex:-1,"aria-label":"Selected filter: Recent creations",children:P(e)}
1)},inputProps:{"aria-controls":"recent-creations-menu"},MenuProps:{id:"recent-creations-menu"},children:[(0,J.jsx)(ee.Z,{value:"available",role:"option",children:"Owned by me"}),(0,J.jsx)(ee.Z,{value:"shared",role:"option",children:"Shared with me"}),(0,J.jsx)(ee.Z,{value:"deleted",role:"option",children:"Deleted"})]})]}),(0,J.jsxs)(K.Z,{variant:"outlined",size:"small",className:i.input,children:[(0,J.jsx)(Q.Z,{id:"sort-by-label",style:{background:"#fafafa",paddingInline:"6px",marginLeft:"-3px"},children:"Sort by"}),(0,J.jsxs)(X.Z,{labelId:"sort-by-label",id:"sort-by",value:t.order,onChange:function(e){var r=e.target.value;return n(ae(ae({},t),{},{order:r}))},renderValue:function(e){return(0,J.jsx)("div",{role:"textbox","aria-readonly":"true",tabIndex:-1,"aria-label":"Selected sort option: Sort by",children:P(e)})},inputProps:{"aria-controls":"sort-by-menu"},MenuProps:{id:"sort-by-menu"},variant:"outlined",size:"small",className:i.input,children:[(0,J.jsx)(ee.Z,{value:"last_modified",role:"option",children:"Last modified"}),(0,J.jsx)(ee.Z,{value:"a_to_z",role:"option",children:"A to Z"})]})]}),c.tp_user===_.E_.TRIAL&&(0,J.jsx)(m.Z,{display:"inline-block",children:(0,J.jsx)(ie.Z,{initialModalState:b,setValidCoupon:w,purpleBallonDesign:!1,fromHeader:!1})})]}),(0,J.jsx)(O.ZP,{className:i.textRight,item:!0,xs:2,children:(0,J.jsx)(te.Z,{classes:{tooltip:i.tooltip},title:"Create new folder",placement:"top",children:(0,J.jsx)(ne.Z,{onClick:r,size:"large",children:(0,J.jsx)(re.Z,{fontSize:"large"})})})})]}),(0,J.jsx)(x.Z,{className:i.divider})]})}var le=n(67358),ue=n(38895),de=n(12963),pe=n(22797),he=n(6571),fe=n(60452),me=n(50135),ge=(0,v.Z)((function(){return{input:{width:230,maxWidth:"100%",marginTop:6}}}));function be(e){var t=e.open,n=e.folder,r=e.onActionClick,i=e.onClose,o=ge(),a=(0,s.useState)(""),c=a[0],l=a[1];return(0,s.useEffect)((function(){l(n?n.name:"")}),[n]),(0,s.useEffect)((function(){t||l("")}),[t]),(0,J.jsx)(L.Z,{open:t,title:n?(0,J.jsx)("b",{children:"Rename your folder"}):(0,J.jsx)("b",{children:"Name your new folder"}),content:(0,J.jsx)(me.Z,{className:o.input,variant:"outlined",label:"Name",size:"small",value:c,onChange:function(e){var t=e.target.value;return l(t.slice(0,255))}}),actionText:n?"Update":"Create",disableActionButton:c.length<2,onActionClick:function(){return r(c)},onClose:i})}var xe=n(25464),ye=n(59301);function ve(e){var t=e.options,n=e.onOptionClick,r=(0,s.useState)(),i=r[0],o=r[1];return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ne.Z,{onClick:function(e){return o(e.currentTarget)},"aria-label":"Show Menu",children:(0,J.jsx)(ye.Z,{})}),(0,J.jsx)(xe.Z,{anchorEl:i,open:!!i,onClose:function(){return o()},children:t.map((function(e,t){return(0,J.jsx)(ee.Z,{onClick:function(){return function(e){n(e),o()}(e)},children:e.label},t)}))})]})}var je=(0,v.Z)((function(e){return{card:{"& > div":{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"18px 8px 8px 8px",marginTop:-10,backgroundColor:e.palette.common.white,borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,boxShadow:e.shadows[1],transition:"box-shadow 250ms ".concat(e.transitions.easing.easeInOut)},"&:hover > div":{boxShadow:e.shadows[3]}},cardMedia:{height:122,display:"flex",alignItems:"center",justifyContent:"center","& img":{display:"block",maxWidth:"100%",maxHeight:"100%"}},cardText:{flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","& a":{color:"inherit",textDecoration:"none !important"}}}}));function Ce(e){var t=e.folder,n=e.onEnter,r=e.options,i=e.onOptionClick,o=je();return(0,J.jsxs)("div",{className:o.card,children:[(0,J.jsx)(g.Z,{onClick:n,underline:"hover",children:(0,J.jsx)("div",{className:o.cardMedia,children:(0,J.jsx)("img",{src:"/images/folder-icon.svg",alt:"Folder icon"})})}),(0,J.jsxs)("div",{children:[(0,J.jsx)(E.Z,{className:o.cardText,variant:"body2",color:"textSecondary",children:(0,J.jsx)(g.Z,{onClick:n,underline:"hover",children:t.name})}),(0,J.jsx)(ve,{options:r,onOptionClick:i})]})]})}var we=(0,v.Z)((function(){return{panel:{background:"none",boxShadow:"none","&:before":{display:"none"}},panelExpanded:{margin:"auto !important"},panelSummary:{minHeight:"auto !important"},panelSummaryContent:{margin:"0 !important"},panelDetails:{display:"block"}}}));function Pe(e){var t=e.folders,n=e.activeFolder,r=e.creationsListComponent,i=e.onEnter,o=e.onOut,a=e.onOptionClick,c=e.modalOpen,l=e.onModalClose,u=e.onModalActionClick,d=e.onDeleteModalActionClick,p=we(),h=(0,s.use
1State)(),f=h[0],m=h[1],b=(0,s.useState)(!1),x=b[0],y=b[1];function v(e,t){switch(e.key){case"rename":m(t);break;case"delete":m(t),y(!0)}a(e)}return(0,J.jsxs)(J.Fragment,{children:[!!t.length&&(0,J.jsxs)(le.Z,{classes:{root:p.panel,expanded:p.panelExpanded},defaultExpanded:!0,children:[(0,J.jsx)(ue.Z,{classes:{root:p.panelSummary,content:p.panelSummaryContent},expandIcon:(0,J.jsx)(he.Z,{}),"aria-label":"Folders Accordion",children:n?(0,J.jsxs)(de.Z,{separator:(0,J.jsx)(fe.Z,{fontSize:"small"}),children:[(0,J.jsx)(g.Z,{color:"inherit",onClick:function(e){e.stopPropagation(),o()},underline:"hover",children:(0,J.jsx)("b",{children:"Folders"})}),(0,J.jsx)(E.Z,{color:"textPrimary",children:(0,J.jsx)("b",{children:n.name})})]}):(0,J.jsx)(de.Z,{separator:(0,J.jsx)(fe.Z,{fontSize:"small"}),children:(0,J.jsx)(E.Z,{color:"textPrimary",children:(0,J.jsx)("b",{children:"Folders"})})})}),(0,J.jsx)("div",{role:"region","aria-label":"Folders Section",children:(0,J.jsx)(pe.Z,{className:p.panelDetails,children:r||(t.length?(0,J.jsx)(O.ZP,{container:!0,spacing:3,children:t.map((function(e){return(0,J.jsx)(O.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,J.jsx)(Ce,{folder:e,onEnter:function(){return i(e)},options:[{key:"rename",label:"Rename"},{key:"delete",label:"Delete"}],onOptionClick:function(t){return v(t,e)}})},e.id)}))}):(0,J.jsx)(E.Z,{variant:"body2",color:"textSecondary",children:"No items"}))})})]}),(0,J.jsx)(be,{open:c,folder:f,onActionClick:function(e){u(e,f),m()},onClose:function(){m(),l()}}),(0,J.jsx)(L.Z,{open:x,title:(0,J.jsxs)("b",{children:["Delete the folder ",(0,J.jsx)("i",{children:null===f||void 0===f?void 0:f.name}),"?"]}),actionText:"Delete",onActionClick:function(){d(f),m(),y(!1)},onClose:function(){m(),y(!1)}})]})}var Ze=n(30381),ke=(0,v.Z)((function(e){return{input:{width:230,maxWidth:"100%",textAlign:"left"}}}));function Se(e){var t=e.open,n=e.onActionClick,i=e.onClose,o=ke(),a=(0,s.useState)([]),l=a[0],u=a[1],d=(0,s.useState)(""),p=d[0],h=d[1];function f(){return(f=(0,r.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P.Z.findAllFolders();case 3:t=e.sent,u(t.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}return(0,s.useEffect)((function(){t?function(){f.apply(this,arguments)}():h("")}),[t]),(0,s.useEffect)((function(){l.length&&h(l[0].id)}),[l]),(0,J.jsx)(L.Z,{open:t,title:(0,J.jsx)("b",{children:"Select a folder"}),content:(0,J.jsx)(me.Z,{className:o.input,select:!0,variant:"outlined",label:"Folder",size:"small",value:p,onChange:function(e){var t=e.target.value;return h(t)},children:l.map((function(e){return(0,J.jsx)(ee.Z,{value:e.id,children:e.name},e.id)}))}),actionText:"Add to folder",onActionClick:function(){return n(p)},onClose:i})}var Oe=n(32777);function Ee(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return _e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _e(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw o}}}}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ue(e,t,n){return Ae.apply(this,arguments)}function Ae(){return Ae=(0,r.Z)(c().mark((function e(t,n,i){var o,a,s,l,u,d,p=arguments;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=!(p.length>3&&void 0!==p[3])||p[3],n(!0),e.next=4,P.Z.findOne(t.id);case 4:a=e.sent,s=a.data.slides,l=Ee(s),e.prev=7,d=c().mark((function e(){var a,s,l;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=u.value,e.next=3,P.Z.getSlideContent(t.id,a.id);case 3:return s=e.sent,l=void 0,e.next=7,new Promise((function(e){var u=new Oe.fabric.Canvas;u.setWidth(t.width),u.setHeight(t.height);u.loadFromJSON((0,R.oi)(s.data.content),(0,r.Z)(c().mark((function r(){var s,d;return c().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:try{l=u.toDataURL({format:"png",width:t.width,left:(1500-t.width)/2,top:(1500-t.height)/2,multiplier:1})}catch(c){i(),n(!1),console.error("Error downloading creation:",c)}return r.next=3,P.Z.downloadSlide(t.id,a.id,{content:(0,R.AY)(l),format:"png",dpi:300,thumbnail:!1,grayscale:!1,email:!1,cmyk:!1,legacyCreation:!0});case 3:s=r.sent,d=s.data,o&&(0,R.lm)(d,"".concat(t.name," - slide ").concat(a.id,".png")),e(),n(!1);case 8:case"end":return r.stop()}}),r)}))))}));case 7:case"end":return e.stop()}}),e)})),l.s();case 10:if((u=l.n()).done){e.next=14;break}return e.delegateYield(d(),"t0",12);case 12:e.next=10;break;case 14:e.next=19;break;case 16:e.prev=16,e.t1=e.catch(7),l.e(e.t1);case 19:return e.prev=19,l.f(),e.finish(19);case 22:case"end":return e.stop()}}),e,null,[[7,16,19,22]])}))),Ae.apply(this,arguments)}function Ie(e,t,n,r){return De.apply(this,arguments)}function De(){return(De=(0,r.Z)(c().mark((function e(t,n,r,i){var o,a;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,Ue(t,n,r,!1);case 4:return e.next=6,P.Z.convertCreationToNewWorkspace(t.id);case 6:if(o=e.sent,a=o.data.convertedCreationId){e.next=10;break}throw new Error("Failed to convert creation");case 10:return n(!1),i.push("/workspace/".concat(a)),e.abrupt("return");case 15:e.prev=15,e.t0=e.catch(1),r(),n(!1),console.error("Error converting creation:",e.t0);case 20:case"end":return e.stop()}}),e,null,[[1,15]])})))).apply(this,arguments)}function Re(e){var t=e.open,n=e.onClose,i=e.creation,o=(0,W.fC)().user,a=(0,Y.useRouter)(),l=(0,s.use
1State)(!1),u=l[0],d=l[1],p=(0,s.useState)(!1),h=p[0],f=p[1],g=(0,s.useState)(!1),b=g[0],x=g[1],y=(0,s.useState)(!1),v=y[0],j=y[1],C=(0,s.useState)(!1),w=C[0],P=C[1];function Z(){x(!0),setTimeout((function(){x(!1)}),4e3)}function k(){return(k=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Ue(i,d,Z);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function O(){return _.apply(this,arguments)}function _(){return(_=(0,r.Z)(c().mark((function e(){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:v?Ie(i,f,Z,a):j(!0);case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var U=(0,J.jsxs)(m.Z,{px:2,children:[(0,J.jsx)(E.Z,{children:"By converting it, a new version will be available for editing in a few seconds."}),(0,J.jsxs)(m.Z,{display:"flex",justifyContent:"center",mt:4,gap:1,children:[(0,J.jsx)(z.Z,{style:{minWidth:180},variant:"ctaPrimaryOutline",onClick:function(){return j(!1)},disabled:u||h,children:"Cancel"}),(0,J.jsx)(z.Z,{style:{minWidth:180},disabled:u||h,onClick:O,children:h?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(S.Z,{size:14,color:"inherit",style:{marginRight:5}}),"Converting"]}):"Convert Creation"})]})]}),A=(0,J.jsxs)(m.Z,{px:2,minHeight:150,children:[(0,J.jsx)(E.Z,{children:"This creation was made using an outdated version of the workspace. You can download a non-editable file as it is or edit it using new features."}),(0,J.jsxs)(m.Z,{display:"flex",justifyContent:"center",mt:4,gap:2,children:[(0,J.jsx)(z.Z,{disabled:u||h,variant:"ctaPrimaryOutline",onClick:function(){return k.apply(this,arguments)},style:{minWidth:180},children:u?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(S.Z,{size:14,color:"inherit",style:{marginRight:5}}),"Downloading"]}):"Download File"}),(0,J.jsx)(z.Z,{style:{minWidth:180},disabled:u||h,onClick:O,children:"Edit My Creation"})]}),b&&(0,J.jsx)(m.Z,{position:"absolute",bottom:24,left:0,right:0,children:(0,J.jsx)(E.Z,{variant:"body2",style:{color:"#FF0000"},children:"An error occurred. Please try again later!"})})]}),I=(0,J.jsxs)(m.Z,{px:2,minHeight:150,children:[(0,J.jsx)(E.Z,{children:"This creation was made using an outdated version of the workspace. Unfortunately, only subscribers can convert creations. Subscribe to a plan and edit it in the new workspace."}),(0,J.jsxs)(m.Z,{display:"flex",justifyContent:"center",mt:4,gap:2,children:[(0,J.jsx)(z.Z,{style:{minWidth:180},variant:"ctaPrimaryOutline",onClick:n,children:"Cancel"}),(0,J.jsx)(z.Z,{style:{minWidth:180},onClick:function(){P(!0),n()},children:"Subscribe to a Plan"})]})]});return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(L.Z,{open:t,title:v?(0,J.jsx)("b",{children:"Are you sure you want to convert this creation?"}):(0,J.jsx)("b",{children:"Old workspace version"}),content:"T"===o.tp_user?I:v?U:A,cancelButton:!1,actionText:"Got it!",onClose:n,actionButton:!1}),(0,J.jsx)(M.Z,{open:w,onClose:function(){return P(!1)}})]})}var Ne=n(19620),Be=(0,v.Z)((function(e){return{cardMedia:{height:122,display:"flex",alignItems:"center",justifyContent:"center",position:"relative","& img":{display:"block",maxWidth:"100%",maxHeight:"100%"}},cardMediaBadge:{display:"flex",alignItems:"center",position:"absolute",top:e.spacing(1),right:e.spacing(1),"& > *":{display:"inline-block",padding:4,marginLeft:e.spacing(1),color:e.palette.grey[700],borderRadius:e.shape.borderRadius,backgroundColor:e.palette.common.white,boxShadow:e.shadows[1],marginTop:84,marginRight:-5}}}}));function Me(e){var t=e.creation,n=e.blockedAccess,r=Be(),i=(0,W.fC)().user,o=n&&i.id===t.user&&!t.deleted;return(0,J.jsxs)("div",{className:r.cardMedia,children:[(0,J.jsxs)("div",{className:r.cardMediaBadge,children:[(0,J.jsx)(E.Z,{variant:"caption",children:{0:"\u26a0\ufe0f Outdated Creation",1328531:"Graphical Abstracts",800600:"Slides Presentations",595842:"Infographics",711948:"Posters"}[0===t.new_version?"0":"".concat(t.width).concat(t.height)]||"Custom"}),o&&(0,J.jsx)("div",{children:(0,J.jsx)(Ne.Z,{fontSize:"small"})})]}),(0,J.jsx)("img",{src:t.thumb,alt:"Creation ".concat(t.name)})]})}var Te=(0,v.Z)((function(e){return{card:{backgroundColor:e.palette.common.white,boxShadow:e.shadows[1],borderBottomLeftRadius:e.shape.borderRadius,borderBottomRightRadius:e.shape.borderRadius,transition:"box-shadow 250ms ".concat(e.transitions.easing.easeInOut),"&:hover":{boxShadow:e.shadows[3]},"& > div":{display:"flex",alignItems:"center",justifyContent:"space-between",padding:e.spacing(1),borderTop:"1px solid ".concat(e.palette.grey[200])}},cardText:{flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","& a":{color:"inherit",textDecoration:"none !important"}}}}));function Fe(e){var t=e.creation,n=e.blockedAccess,r=e.options,i=e.onOptionClick,o=Te(),a=(0,W.fC)().user,c=(0,Y.useRouter)(),l=(0,s.use
1State)(!1),u=l[0],d=l[1],h=(0,s.useState)(!1),f=h[0],m=h[1],b="".concat((0,R.dU)("MTG_URL_LEGACY"),"/workspace/user-creations/").concat(t.id),x=(0,R.Od)(),y=(0,$.Z)();function v(e){k.ZP.event({category:"workspace",action:"access_existing_creation",label:"Click on any creation in My Creations",value:a.id}),y.event.push("View Project",{Product:"MTG",Email:a.email,"Country code":a.country_code,URL:c.asPath,Description:"Access Existing Creation",Locale:"my-creations"}),n&&(e.preventDefault(),d(!0)),a.useNewWorkspace&&!t.new_version&&(e.preventDefault(),m(!0))}function j(e){return t.new_version?(0,J.jsx)(p(),{href:"/workspace/".concat(t.id),passHref:!0,children:(0,J.jsx)(g.Z,{onClick:v,underline:"hover",children:e})}):(0,J.jsx)(g.Z,{href:a.useNewWorkspace?void 0:b,onClick:v,underline:"hover",children:e})}return(0,J.jsxs)(J.Fragment,{children:[x.isActive&&(0,J.jsx)(N.Z,{open:u,onClose:function(){return d(!1)}}),(0,R.Gb)()&&(0,J.jsx)(B.Z,{open:u,onClose:function(){return d(!1)}}),!x.isActive&&!(0,R.Gb)()&&(0,J.jsx)(M.Z,{open:u,onClose:function(){return d(!1)}}),(0,J.jsx)(Re,{open:f,onClose:function(){m(!1)},creation:t}),(0,J.jsxs)("div",{className:o.card,children:[t.deleted?(0,J.jsx)(Me,{creation:t,blockedAccess:n}):j((0,J.jsx)(Me,{creation:t,blockedAccess:n})),(0,J.jsxs)("div",{children:[(0,J.jsx)(E.Z,{className:o.cardText,variant:"body2",color:"textSecondary",children:t.deleted?t.name:j(t.name)}),!!r.length&&(0,J.jsx)(ve,{options:r,onOptionClick:i})]})]})]})}function Le(e){var t=e.creations,n=e.shared,i=e.addToFolderOption,a=e.onOptionClick,l=e.onModalActionClick,u=e.onDeleteModalActionClick,d=(0,C.V)(),p=(0,o.Z)(d,3),h=(p[0],p[2]),f=(0,W.fC)().user,g=(0,s.useState)(!1),b=g[0],x=g[1],y=(0,s.useState)(!1),v=y[0],j=y[1],w=(0,s.useState)(!1),P=w[0],Z=w[1],U=(0,s.useState)(!1),A=U[0],I=U[1],D=(0,s.useState)(),T=D[0],F=D[1],z=(0,R.Od)(),H=(0,Y.useRouter)(),G=(0,$.Z)();function q(e){return n?[{key:"delete_sharing",label:"Exit from sharing"}]:e.deleted?[{key:"restore",label:"Restore"}]:i?[{key:"add_to_folder",label:"Add to folder"},{key:"delete",label:"Delete"}]:e.folder?[{key:"remove_from_folder",label:"Remove from folder"},{key:"delete",label:"Delete"}]:[{key:"delete",label:"Delete"}]}function V(e,t){switch(e.key){case"restore":f.tp_user===_.E_.TRIAL?I(!0):a(e,t);break;case"add_to_folder":F(t),x(!0),a(e,t);break;case"delete":F(t),j(!0),a(e,t);break;case"remove_from_folder":case"delete_sharing":a(e,t)}}function K(){return(K=(0,r.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(k.ZP.event({category:"workspace",action:"delete_creation",label:'Click on "Delete" button in My Creations',value:f.id}),G.event.push("Delete Creation",{Product:"MTG",Email:f.email,URL:H.asPath,Description:"Delete Creation",Locale:"my-creations"}),f.tp_user!==_.E_.TRIAL||!f.dt_delete){e.next=12;break}if(t=Ze.utc(f.dt_delete),!(Ze.utc().diff(t,"hours")<2)){e.next=12;break}return F(),j(!1),k.ZP.event({category:"workspace",action:"delete_creation_upgrade_banner",label:"When Banner Presented to free users",value:f.id}),G.event.push("Banner Click",{Product:"MTG",Email:f.email,"Country code":f.country_code,URL:H.asPath,Description:"Delete Creation Upgrade Banner",Locale:"my-creations"}),Z(!0),e.abrupt("return");case 12:return e.next=14,u(T);case 14:F(),j(!1);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return h?(0,J.jsxs)(m.Z,{display:"flex",justifyContent:"center",alignItems:"center",height:"100%",children:[(0,J.jsx)(m.Z,{mr:1,children:(0,J.jsx)(S.Z,{size:20})}),(0,J.jsx)(E.Z,{variant:"body2",color:"textSecondary",children:"Loading..."})]}):null!==t&&void 0!==t&&t.length?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(O.ZP,{container:!0,spacing:3,children:t.map((function(e){return(0,J.jsx)(O.ZP,{item:!0,xs:12,sm:6,md:3,children:(0,J.jsx)(Fe,{creation:e,blockedAccess:!1,options:q(e),onOptionClick:function(t){return V(t,e)}})},e.id)}))}),(0,J.jsx)(Se,{open:b,onActionClick:function(e){l(e,T),F(),x(!1)},onClose:function(){F(),x(!1)}}),(0,J.jsx)(L.Z,{open:v,title:(0,J.jsxs)("b",{children:["Delete the creation ",(0,J.jsx)("i",{children:null===T||void 0===T?void 0:T.name}),"?"]}),content:(0,J.jsx)(E.Z,{children:"Your creation will be moved to the Deleted folder."}),actionText:"Delete",onActionClick:function(){return K.apply(this,arguments)},onClose:function(){F(),j(!1)}}),z.isActive&&(0,J.jsx)(N.Z,{open:P,onClose:function(){return Z(!1)}}),(0,R.Gb)()&&(0,J.jsx)(B.Z,{open:P,onClose:function(){return Z(!1)}}),!z.isActive&&!(0,R.Gb)()&&(0,J.jsx)(M.Z,{open:P,onClose:function(){return Z(!1)}}),z.isActive&&(0,J.jsx)(N.Z,{open:A,onClose:function(){return I(!1)}}),(0,R.Gb)()&&(0,J.jsx)(B.Z,{open:A,onClose:function(){return I(!1)}}),!z.isActive&&!(0,R.Gb)()&&(0,J.jsx)(M.Z,{open:A,onClose:function(){return I(!1)}})]}):(0,J.jsx)(E.Z,{variant:"body2",color:"textSecondary",children:"No items"})}function ze(e){var t=e.children,n=e.creations,r=e.shared,i=e.addToFolderOption,o=e.onOptionClick,a=e.onModalActionClick,c=e.onDeleteModalActionClick,s=we();return(0,J.jsxs)(le.Z,{classes:{root:s.panel,expanded:s.panelExpanded},defaultExpanded:!0,children:[(0,J.jsx)(ue.Z,{classes:{root:s.panelSummary,content:s.panelSummaryContent}
1,expandIcon:(0,J.jsx)(he.Z,{}),children:(0,J.jsx)(E.Z,{children:(0,J.jsx)("b",{children:"Creations"})})}),(0,J.jsxs)(pe.Z,{className:s.panelDetails,children:[(0,J.jsx)(Le,{creations:n,shared:r,addToFolderOption:i,onOptionClick:o,onModalActionClick:a,onDeleteModalActionClick:c}),t]})]})}n(24109);var We=n(34936),Je=n(64017),He=n(30202),Ge=n(61897),Ye=n(27134),$e=n(16946),qe=n(47108);function Ve(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ve(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ve(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Qe=(0,v.Z)((function(e){return{headerBox:{padding:e.spacing(3,0),backgroundColor:"#f9f9f9"},header:{fontSize:"1.75rem"},newCreationButton:{backgroundColor:"#D6246E",color:e.palette.common.white,borderRadius:"40px",padding:e.spacing(1,3),textTransform:"none","&:hover":{filter:"brightness(0.9)",backgroundColor:"#D6246E"}},divider:{margin:e.spacing(4,0)},greyText:{color:e.palette.grey[700]},pagination:{display:"flex",justifyContent:"flex-end",marginTop:e.spacing(4),"& li:not(:first-child, :last-child) button":{color:"#5F29CC"},"& li button.Mui-selected, & li button.Mui-selected:hover":{color:"".concat(e.palette.common.white," !important"),backgroundColor:"#5F29CC"}},alert:{justifyContent:"center"}}})),Xe={page:1,perPage:16,total:0,data:[]};var et=(0,Ye.Q)((function(){var e=Qe(),t=(0,Je.Z)(),n=(0,He.NL)(),i=(0,W.fC)(),a=i.user,l=i.userJournalSettings,d=(0,C.V)(),v=(0,o.Z)(d,2),Z=v[0],k=v[1],S=(0,w.Z)(),O=(0,Y.useRouter)(),E=(0,s.useState)(1),U=E[0],A=E[1],D=(0,s.useState)(1),R=D[0],N=D[1],B=(0,s.useState)({status:"available",order:"last_modified"}),M=B[0],T=B[1],F=(0,s.useState)([]),L=F[0],z=F[1],H=(0,s.useState)(),G=H[0],$=H[1],q=(0,s.useState)(Ke({},Xe)),K=q[0],Q=q[1],X=(0,s.useState)(!1),ee=X[0],te=X[1],ne=(0,s.useState)(!1),re=ne[0],ie=ne[1],oe=(0,s.useState)(null),ae=oe[0],ce=oe[1],le="open"===(null===ae||void 0===ae?void 0:ae.status)&&0===(null===ae||void 0===ae?void 0:ae.attempt_count),ue="unpaid"===(null===ae||void 0===ae?void 0:ae.status)||(null===ae||void 0===ae?void 0:ae.attempt_count)>0&&"paid"!==(null===ae||void 0===ae?void 0:ae.status),de=(0,$e.L)().canAccessFeature,pe=a.tp_user===_.E_.JOURNAL&&Z.length>=l.creationsAvailable;function he(){return fe.apply(this,arguments)}function fe(){return(fe=(0,r.Z)(c().mark((function e(){var t;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P.Z.findAllFolders();case 3:t=e.sent,z(t.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}(0,s.useEffect)((function(){var e=O.query,t=e.journal_id,n=e.publishers;e.mode;t&&"true"===n&&qe.Z.updateUserJournal(t).then((function(){console.log("User journal updated")})).catch((function(e){console.error("Error updating user journal:",e)}))}),[O.query]);var me=(0,Ge.a)({queryKey:["creations",M.status,M.order,U],queryFn:function(){var e=(0,r.Z)(c().mark((function e(){var t,n;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=je({folderId:"-1",page:U,perPage:Xe.perPage}),e.next=3,P.Z.findAll(t);case 3:return n=e.sent,e.abrupt("return",n.data);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}),ge=me.data,be=void 0===ge?Xe:ge,xe=me.refetch;function ye(e,t){return ve.apply(this,arguments)}function ve(){return(ve=(0,r.Z)(c().mark((function e(t,n){var r;return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P.Z.findAll(je({folderId:t.id,page:n,perPage:Xe.perPage}));case 3:r=e.sent,Q(r.data),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),console.error(e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})))).apply(this,arguments)}function je(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"last_modified"===M.order?(e="edited",t="DESC"):"a_to_z"===M.order&&(e="name",t="ASC"),Ke(Ke({},n),{},{status:M.status,orderField:e,orderDirection:t})}function Ce(){return(Ce=(0,r.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n){e.next=6;break}return e.next=4,P.Z.createFolder({name:t});case 4:e.next=8;break;case 6:return e.next=8,P.Z.updateFolder(n.id,{name:t});case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.error(e.t0);case 13:return e.prev=13,he(),te(!1),e.finish(13);case 17:case"end":return e.stop()}}),e,null,[[0,10,13,17]])})))).apply(this,arguments)}function we(){return(we=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P.Z.deleteFolder(t.id);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error(e.t0);case 8:return e.prev=8,he(),A(U),xe(),e.finish(8);case 13:case"end":return e.stop()}}),e,null,[[0,5,8,13]])})))).apply(this,arguments)}function Ze(){1===be.data.length&&U>1?(A(U-1),xe()):(A(U),xe())}
1function ke(){if(1===K.data.length&&R>1){var e=R-1;N(e),ye(G,e)}else ye(G,R)}function Se(e,t){return Oe.apply(this,arguments)}function Oe(){return(Oe=(0,r.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.key,e.next="restore"===e.t0?3:"remove_from_folder"===e.t0?6:"delete_sharing"===e.t0?9:12;break;case 3:return e.next=5,Ie(n);case 5:case 8:case 11:return e.abrupt("break",12);case 6:return e.next=8,Ee(null,n);case 9:return e.next=11,Re(n);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ee(e,t){return _e.apply(this,arguments)}function _e(){return(_e=(0,r.Z)(c().mark((function e(t,r){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P.Z.update(r.id,{folderId:t});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error(e.t0);case 8:return e.prev=8,Ze(),G&&ke(),n.invalidateQueries("creations"),e.finish(8);case 13:case"end":return e.stop()}}),e,null,[[0,5,8,13]])})))).apply(this,arguments)}function Ue(e){return Ae.apply(this,arguments)}function Ae(){return(Ae=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P.Z.delete(t.id);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error(e.t0);case 8:return e.prev=8,Ze(),k(),G&&ke(),n.invalidateQueries("creations"),e.finish(8);case 14:case"end":return e.stop()}}),e,null,[[0,5,8,14]])})))).apply(this,arguments)}function Ie(e){return De.apply(this,arguments)}function De(){return(De=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P.Z.restore(t.id);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error(e.t0);case 8:return e.prev=8,Ze(),k(),G&&ke(),n.invalidateQueries("creations"),e.finish(8);case 14:case"end":return e.stop()}}),e,null,[[0,5,8,14]])})))).apply(this,arguments)}function Re(e){return Ne.apply(this,arguments)}function Ne(){return(Ne=(0,r.Z)(c().mark((function e(t){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,P.Z.deleteSharing(t.id);case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error(e.t0);case 8:return e.prev=8,Ze(),e.finish(8);case 11:case"end":return e.stop()}}),e,null,[[0,5,8,11]])})))).apply(this,arguments)}function Be(){return(Be=(0,r.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n===U){e.next=4;break}return A(n),e.next=4,xe();case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Me(){return(Me=(0,r.Z)(c().mark((function e(t,n){return c().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n===R){e.next=4;break}return N(n),e.next=4,ye(G,n);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,s.useEffect)((function(){if("shared"===M.status)return z([]),$(),N(1),Q(Ke({},Xe)),void A(1);A(1),he(),G&&(N(1),ye(G,1))}),[M]),(0,s.useEffect)((function(){ce(null===S||void 0===S?void 0:S.latest_invoice)}),[S]),(0,J.jsxs)(j.default,{bgBrandColor:t?I.iD:I.Yf,headerWhite:!0,typeBtn:"buttonSecondary",hasPadding:!1,children:[(0,J.jsx)(u(),{children:(0,J.jsx)("title",{children:"My Creations - Mind The Graph"})}),(0,J.jsx)("div",{className:e.headerBox,children:(0,J.jsxs)(f.Z,{maxWidth:"md",disableGutters:!0,children:[ue&&(0,J.jsx)(m.Z,{mb:3,children:(0,J.jsxs)(We.Z,{className:e.alert,severity:"error",children:["Alert: Credit card update required,"," ",(0,J.jsx)(p(),{href:"/my-account/billing/update-card",passHref:!0,children:(0,J.jsx)(g.Z,{underline:"hover",children:"click to update"})}),"."]})}),le&&(0,J.jsx)(m.Z,{mb:3,children:(0,J.jsxs)(We.Z,{className:e.alert,severity:"warning",children:["You have an open invoice."," ",(0,J.jsx)(p(),{href:"/my-account/billing/update-card",passHref:!0,children:(0,J.jsx)(g.Z,{underline:"hover",children:"Click here"})})," ","to confirm the subscription."]})}),(0,J.jsxs)(m.Z,{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,J.jsx)("h1",{className:e.header,children:"My Creations"}),(0,J.jsx)(b.Z,{variant:"contained",className:e.newCreationButton,startIcon:(0,J.jsx)(y.Z,{}),onClick:function(){return ie(!0)},disabled:pe,children:"New Creation"})]})]})}),(0,J.jsx)(f.Z,{maxWidth:"md",disableGutters:!0,children:(0,J.jsxs)(m.Z,{mt:5,pb:5,children:[(0,J.jsx)(m.Z,{mt:4,children:(0,J.jsx)(se,{filters:M,onChange:function(e){return T(e)},onCreateFolderClick:function(){return te(!0)}})}),(0,J.jsxs)(m.Z,{mt:4,children:[(0,J.jsx)(Pe,{folders:L,activeFolder:G,creationsListComponent:G&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(Le,{creations:K.data,onOptionClick:Se,onModalActionClick:Ee,onDeleteModalActionClick:Ue}),K.total>Xe.perPage&&(0,J.jsx)(h.Z,{className:e.pagination,page:R,count:Math.ceil(K.total/Xe.perPage),onChange:function(e,t){return Me.apply(this,arguments)}})]}),onEnter:function(e){$(e),ye(e,R)},onOut:function(){$(),Q(Ke({},Xe)),N(1)},onOptionClick:function(e){"rename"===e.key&&te(!0)},modalOpen:ee,onModalClose:function(){return te(!1)},onModalActionClick:function(e,t){return Ce.apply(this,arguments)},onDeleteModalActionClick:function(e){return we.apply(this,arguments)}}),!!L.length&&(0,J.jsx)(x.Z,{className:e.divider}),(0,J.jsx)(ze,{creations:be.data,shared:"shared"===M.status,addToFolderOption:!!L.length,onOptionClick:Se,onModalActionClick:Ee,onDeleteModalActionClick:Ue,children:be.total>Xe.perPage&&(0,J.jsx)(h.Z,{className:e.pagination,page:U,count:Math.ceil(be.total/Xe.perPage),onChange:function(e,t){return Be.apply(this,arguments)}})})]}),de("MyCreations","banner")&&(0,J.jsx)(m.Z,{mt:4})]})}),(0,J.jsx)(V,{isOpen:re,onClose:function(){return ie(!1)}})]})}))},99290:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(92777),i=n(82262),o=n(24128),a=function(){function e(){(0,r.Z)(this,e)}return(0,i.Z)(e,[{key:"data",value:function(){return o.Z.get("/payments/data")}},{key:"paypal",value:function(e){return o.Z.post("/payments/paypal",e)}},{key:"stripe",value:function(e){return o.Z.post("/payments/stripe",e)}},{key:"stripeTrial",value:function(e){return o.Z.post("/payments/stripe/trial-subscription",e)}},{key:"createOneTimeSubscription",value:function(e){return o.Z.post("/payments/stripe/one-time",e)}
1},{key:"createStripeSetupIntentBasic",value:function(){return o.Z.post("/payments/stripe/setup-intent-basic")}},{key:"createStripeSetupIntent",value:function(e){return o.Z.post("/payments/stripe/setup-intent",e)}},{key:"getStripeSetupIntent",value:function(e){return o.Z.get("/payments/stripe/setup-intent/".concat(e))}},{key:"attachStripePaymentMethod",value:function(e){return o.Z.post("/payments/stripe/attach-payment-method",e)}},{key:"updateStripePaymentMethod",value:function(e){return o.Z.put("/payments/stripe/payment-method",e)}},{key:"getStripeSubscription",value:function(){return o.Z.get("/payments/stripe/subscription")}},{key:"getStripePaymentMethods",value:function(){return o.Z.get("/payments/stripe/payment-method")}},{key:"deleteStripePaymentMethod",value:function(e){return o.Z.delete("/payments/stripe/payment-method/".concat(e))}},{key:"chargeStripeInvoice",value:function(e){return o.Z.post("/payments/stripe/charge-invoice",e)}},{key:"updateStripeSubscription",value:function(e){return o.Z.put("/payments/stripe/subscription",e)}},{key:"createPaymentInfo",value:function(e){return o.Z.post("/payment-infos",e)}},{key:"getPaymentInfoById",value:function(e){return o.Z.get("payment-infos/".concat(e))}}]),e}()},63988:function(e,t,n){"use strict";n.d(t,{Cq:function(){return c},KF:function(){return a},a3:function(){return o},ox:function(){return s},so:function(){return l}});var r=n(68481),i=n.n(r),o=["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"],a=["RU","IR","IQ","BY","SY","KP","CU","SD"];function c(e){return i().getCode("Taiwan"===e?"Taiwan, Province of China":e)}function s(){return i().getCountries().map((function(e){return"Taiwan, Province of China"===e?"Taiwan":e}))}function l(e){return c(e)}},83657:function(e,t,n){"use strict";n.d(t,{FK:function(){return c},i_:function(){return s},jK:function(){return p},uM:function(){return l}});var r=n(50029),i=n(87794),o=n.n(i),a=n(99290),c="US";function s(e,t){return t[e]?t[e]:{}}var l={isChina:function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(t,"CN");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),isJapan:function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(t,"JP");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),isBrazil:function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(t,"BR");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),isIndia:function(){var e=(0,r.Z)(o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,u(t,"IN");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),getUserCountry:function(){var e=(0,r.Z)(o().mark((function e(t){var n,r,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.next=2;break;case 2:if(!t){e.next=5;break}return localStorage.setItem("countryFromUser",t.country_code),e.abrupt("return",t.country_code);case 5:if(!localStorage.getItem("countryFromUser")){e.next=7;break}return e.abrupt("return",localStorage.getItem("countryFromUser"));case 7:return n=new a.Z,e.next=10,n.data();case 10:return r=e.sent,i=r.data,localStorage.setItem("countryFromUser",i.countryCode),e.abrupt("return",i.countryCode);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()};function u(e,t){return d.apply(this,arguments)}function d(){return(d=(0,r.Z)(o().mark((function e(t,n){var r,i,c,s,l;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.next=2;break;case 2:if(r=new a.Z,!t){e.next=7;break}return i=t.country_code===n,localStorage.setItem("countryFromUser",t.country_code),e.abrupt("return",i);case 7:if(!localStorage.getItem("countryFromUser")){e.next=9;break}return e.abrupt("return",localStorage.getItem("countryFromUser")===n);case 9:return e.next=11,r.data();case 11:return c=e.sent,s=c.data,l=s.countryCode===n,localStorage.setItem("countryFromUser",s.countryCode),e.abrupt("return",l);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return{USD:"US$",BRL:"R$",INR:"\u20b9"}[e]||e}},90398:function(e,t,n){"use strict";n.d(t,{ID:function(){return U},Bd:function(){return L},_9:function(){return x},qQ:function(){return D},k4:function(){return _},dZ:function(){return N},Pw:function(){return J},IS:function(){return z},Vy:function(){return M},l_:function(){return b},tv:function(){return S},Ll:function(){return E},IC:function(){return g},mG:function(){return m}});var r=n(50029),i=n(59499),o=n(87794),a=n.n(o),c=n(17563),s=n(63149),l=n(63988),u=JSON.parse('{"S":{"id":"S","name":"Student","locales":{"US":{"id":"US","cycles":{"month":{"billedPrice"
1:14},"year":{"billedPrice":84}}},"BR":{"id":"BR","cycles":{"month":{"billedPrice":78},"year":{"billedPrice":470}}},"IN":{"id":"IN","cycles":{"month":{"billedPrice":1044},"year":{"billedPrice":6260}}},"EU":{"id":"EU","cycles":{"month":{"billedPrice":12},"year":{"billedPrice":74}}},"JP":{"id":"JP","cycles":{"month":{"billedPrice":2078},"year":{"billedPrice":12466}}},"CN":{"id":"CN","cycles":{"month":{"billedPrice":94.9},"year":{"billedPrice":569.42}}}}},"R":{"id":"R","name":"Researcher","locales":{"US":{"id":"US","cycles":{"month":{"billedPrice":12},"year":{"billedPrice":89}}},"BR":{"id":"BR","cycles":{"month":{"billedPrice":106},"year":{"billedPrice":806}}},"IN":{"id":"IN","cycles":{"month":{"billedPrice":1415},"year":{"billedPrice":10731}}},"EU":{"id":"EU","cycles":{"month":{"billedPrice":17},"year":{"billedPrice":127}}},"JP":{"id":"JP","cycles":{"month":{"billedPrice":2820},"year":{"billedPrice":21370}}},"CN":{"id":"CN","cycles":{"month":{"billedPrice":128.8},"year":{"billedPrice":976.15}}}}},"L":{"id":"L","name":"Teams & Institutions","locales":{"US":{"id":"US","cycles":{"month":{"billedPrice":6.5},"year":{"billedPrice":48.1}}},"BR":{"id":"BR","cycles":{"month":{"billedPrice":55.4},"year":{"billedPrice":436.8}}},"IN":{"id":"IN","cycles":{"month":{"billedPrice":737.8},"year":{"billedPrice":5812.9}}},"EU":{"id":"EU","cycles":{"month":{"billedPrice":8.7},"year":{"billedPrice":68.6}}},"JP":{"id":"JP","cycles":{"month":{"billedPrice":1469.2},"year":{"billedPrice":11575.5}}},"CN":{"id":"CN","cycles":{"month":{"billedPrice":67.11},"year":{"billedPrice":528.746}}}}}}'),d=JSON.parse('{"US":{"currency":{"id":"USD","langTag":"en-US","label":"US$"}},"BR":{"currency":{"id":"BRL","langTag":"pt-BR","label":"R$"},"promotion":{"code":"brl_discount","discountPercentage":50}},"IN":{"currency":{"id":"INR","langTag":"en-IN","label":"\u20b9"},"promotion":{"code":"inr_discount","discountPercentage":50}},"EU":{"currency":{"id":"EUR","langTag":"es","label":"\u20ac"}},"JP":{"currency":{"id":"JPY","langTag":"ja-JP","label":"\xa5"}},"CN":{"currency":{"id":"CNY","langTag":"zh-CN","label":"\xa5"}}}'),p=n(62425);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){(0,i.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(e){return[s.fu.STUDENT,s.fu.RESEARCHER,s.fu.LAB_RESEARCHER].includes(e)?e:s.fu.RESEARCHER}function g(e,t){return e===s.oz.SEMESTER&&t!==s.fu.RESEARCHER?s.oz.YEAR:Object.values(s.oz).includes(e)?e:s.oz.YEAR}function b(e,t,n){switch(e){case s.fu.STUDENT:return t===s.oz.YEAR?"CN"===n?{label:s.J1[e],currency:"CNY",monthlyPrice:24.91,totalPrice:299,discount:549.42,discountPercent:45.6,totalUsd:84}:"JP"===n?{label:s.J1[e],currency:"JPY",monthlyPrice:980,totalPrice:11760,discount:11760,discountPercent:50,totalUsd:84}:{label:s.J1[e],currency:"US$",monthlyPrice:7,totalPrice:84,discount:84,discountPercent:50,totalUsd:84}:t===s.oz.QUARTER&&"CN"===n?{label:s.J1[e],currency:"CNY",monthlyPrice:29.33,totalPrice:88,discount:284.7,discountPercent:69.1,totalUsd:36}:"CN"===n?{label:s.J1[e],currency:"CNY",monthlyPrice:38,totalPrice:38,discount:null,discountPercent:null,totalUsd:14}:"JP"===n?{label:s.J1[e],currency:"JPY",monthlyPrice:1960,totalPrice:1960,discount:null,discountPercent:null,totalUsd:14}:{label:s.J1[e],currency:"US$",monthlyPrice:14,totalPrice:14,discount:null,discountPercent:null,totalUsd:14};case s.fu.RESEARCHER:return t===s.oz.YEAR?"CN"===n?{label:s.J1[e],currency:"CNY",monthlyPrice:58.25,totalPrice:699,discount:976.15,discountPercent:28.4,totalUsd:144}:"JP"===n?{label:s.J1[e],currency:"JPY",monthlyPrice:1658,totalPrice:19900,discount:22100,discountPercent:53,totalUsd:144}:{label:s.J1[e],currency:"US$",monthlyPrice:12,totalPrice:144,discount:84,discountPercent:37,totalUsd:144}:t===s.oz.SEMESTER?{label:s.J1[e],currency:"US$",monthlyPrice:10.83,totalPrice:65,discount:25,discountPercent:28,totalUsd:65}:t===s.oz.QUARTER?"CN"===n?{label:s.J1[e],currency:"CNY",monthlyPrice:63,totalPrice:189,discount:38
16,discountPercent:51,totalUsd:36}:{label:s.J1[e],currency:"US$",monthlyPrice:12,totalPrice:36,discount:21,discountPercent:37,totalUsd:36}:"CN"===n?{label:s.J1[e],currency:"CNY",monthlyPrice:68,totalPrice:68,discount:null,discountPercent:null,totalUsd:19}:"JP"===n?{label:s.J1[e],currency:"JPY",monthlyPrice:3500,totalPrice:3500,discount:null,discountPercent:null,totalUsd:19}:{label:s.J1[e],currency:"US$",monthlyPrice:19,totalPrice:19,discount:null,discountPercent:null,totalUsd:19};case s.fu.LAB_RESEARCHER:return t===s.oz.YEAR?"CN"===n?{label:s.J1[e],currency:"CNY",monthlyPrice:249.91,totalPrice:2999,discount:5287.46,discountPercent:43.2,totalUsd:780}:"JP"===n?{label:s.J1[e],currency:"JPY",monthlyPrice:8333,totalPrice:99999,discount:65601,discountPercent:40,totalUsd:780}:{label:s.J1[e],currency:"US$",monthlyPrice:65,totalPrice:780,discount:408,discountPercent:34,totalUsd:780}:"CN"===n?{label:s.J1[e],currency:"CNY",monthlyPrice:399,totalPrice:399,discount:null,discountPercent:null,totalUsd:99}:"JP"===n?{label:s.J1[e],currency:"JPY",monthlyPrice:13800,totalPrice:13800,discount:null,discountPercent:null,totalUsd:99}:{label:s.J1[e],currency:"US$",monthlyPrice:99,totalPrice:99,discount:null,discountPercent:null,totalUsd:99};default:throw new Error("Failed to get plan data. Unknown plan [".concat(e,"]"))}}function x(e,t){if("number"!==typeof e)return e;var n=e%1!==0,r=d[t].currency,i=new Intl.NumberFormat(r.langTag,{style:"currency",currency:r.id,minimumFractionDigits:n?2:0,maximumFractionDigits:2}).format(e);return r.id===d.US.currency.id?i.replace("$","US$"):i}function y(e){var t=e.toUpperCase(),n=Object.keys(d),r=l.a3.includes(t),i=n.includes(t);return r?"EU":i?t:"US"}function v(e,t){var n=t.toUpperCase();return"EUR"===n?1.08*e:"BRL"===n?5.6*e:"INR"===n?.012*e:e}function j(e,t){var n,r=u[e],i=function(e,t){return e.locales[t]?e.locales[t]:e.locales.US}(r,t);return{localeData:i,planData:{id:r.id,label:r.name,locale:t,promotion:null===(n=d[t].promotion)||void 0===n?void 0:n.code,currency:d[t].currency}}}function C(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{floor:!1},r=n.floor;return r?Math.floor(e*(1-t/100)):e*(1-t/100)}function w(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{floor:!1},r=n.floor;return r?Math.floor(e*t):e*t}function P(e,t,n,r){var i=t===s.oz.YEAR,o=i?e:12*e,a=i?o/12:e,c={};return d[r].promotion&&(c={promotionalBilledPrice:C(w(e,n),d[r].promotion.discountPercentage),promotionalPricePerMonth:C(w(a,n),d[r].promotion.discountPercentage),promotionalPricePerYear:C(w(o,n),d[r].promotion.discountPercentage)}),f({billedPrice:w(e,n),pricePerMonth:w(a,n),pricePerYear:w(o,n)},c)}function Z(e,t){return function(e,t){var n=e-t,r=n/e*100;return{savings:n,savingsPercentage:r,savingsPercentageDisplay:"".concat(Math.floor(r),"%")}}(e,t)}function k(e,t){return{promotionalPricePerMonthDisplay:e.promotionalPricePerMonth&&x(e.promotionalPricePerMonth,t),promotionalPricePerYearDisplay:e.promotionalPricePerYear&&x(e.promotionalPricePerYear,t),billedPriceDisplay:x(e.billedPrice,t),pricePerMonthDisplay:x(e.pricePerMonth,t),pricePerYearDisplay:x(e.pricePerYear,t)}}function S(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"US",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!u[e])throw new Error("Failed to get plan pricing data. Unknown plan [".concat(e,"]"));if(!n)throw new Error("Failed to get plan pricing data. Invalid countryCode [".concat(n,"]"));var i=y(n),o=j(e,i),a=o.localeData,c=o.planData,l=P(a.cycles[t].billedPrice,t,r,i),p=12*w(a.cycles[s.oz.MONTH].billedPrice,r),h=t===s.oz.YEAR,m=h?Z(p,l.pricePerYear):{};return f(f(f(f(f({},c),m),l),k(l,i)),{},{priceInUSD:v(l.billedPrice,d[i].currency.id),savingsDisplay:x(m.savings,i)})}function O(e,t,n,r){return t.reduce((function(t,i){var o,a=y(i),c=function(e,t,n,r){return n.reduce((function(n,i){var o=S(e,i,t,r);return n[i]=f({},o),n}),{})}(e,a,n,r);return t[a]={locale:a,promotion:null===(o=d[a].promotion)||void 0===o?void 0:o.code,currency:d[a].currency,cycles:c},t}),{})}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.plansIds,n=void 0===t?["R","L"]:t,r=e.countriesCodes,i=void 0===r?["US"]:r,o=e.billingIntervals,a=void 0===o?["year","month"]:o,c=e.teamSize,l=void 0===c?1:c,d=n.reduce((function(e,t){var n=O(t,i,a,t===s.fu.LAB_RESEARCHER?l:1);return e[t]={id:t,label:u[t].name,locales:n},e}),{});return d}function _(e){var t=y(e||"US");return f({id:t},d[t])}function U(e,t){var n=y(t),r=[{localeCode:"BR",couponCode:"brl_discount"},{localeCode:"IN",couponCode:"inr_discount"}].find((function(t){return e===t.couponCode}));return!r||r.localeCode===n}var A="".concat((0,p.dU)("R_LIFE_SUBSCRIPTION_API_URL"),"/get-pack-detail
1s");function I(e){return null!==e&&void 0!==e&&e.benefits?e.benefits.reduce((function(e,t){return f(f({},e),{},(0,i.Z)({},t.product_name.replaceAll(" ","_"),t))}),{}):{}}function D(e){return R.apply(this,arguments)}function R(){return(R=(0,r.Z)(a().mark((function e(t){var n,r,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(A,"?").concat(c.stringify({currency:t.toLowerCase(),user_country:t,product:"r-life",pack_type:"all-access-ai-tools",pack_machine_name:"all-access-tools-monthly,all-access-tools-quarterly,all-access-tools-annual"})));case 2:return n=e.sent,e.next=5,n.json();case 5:return r=e.sent,i={annual:f(f({},r.data["all-access-tools-annual"]),{},{benefits:I(r.data["all-access-tools-annual"])}),quarterly:f(f({},r.data["all-access-tools-quarterly"]),{},{benefits:I(r.data["all-access-tools-quarterly"])}),monthly:f(f({},r.data["all-access-tools-monthly"]),{},{benefits:I(r.data["all-access-tools-monthly"])})},e.abrupt("return",i);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(e){return B.apply(this,arguments)}function B(){return(B=(0,r.Z)(a().mark((function e(t){var n,r,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(A,"?").concat(c.stringify({currency:t.toLowerCase(),user_country:t,product:"mtg",pack_type:"mind-the-graph",pack_machine_name:"mtg-researcher-monthly,mtg-researcher-annual"})));case 2:return n=e.sent,e.next=5,n.json();case 5:return r=e.sent,i={annual:f(f({},r.data["mtg-researcher-annual"]),{},{benefits:I(r.data["mtg-researcher-annual"]),pack_machine_name:"mtg-researcher-annual"}),monthly:f(f({},r.data["mtg-researcher-monthly"]),{},{benefits:I(r.data["mtg-researcher-monthly"]),pack_machine_name:"mtg-researcher-monthly"})},e.abrupt("return",i);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(e){return T.apply(this,arguments)}function T(){return(T=(0,r.Z)(a().mark((function e(t){var n,r,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(A,"?").concat(c.stringify({currency:t.toLowerCase(),user_country:t,product:"mtg",pack_type:"mind-the-graph-students",pack_machine_name:"mtg-student-monthly,mtg-student-quarterly,mtg-student-annual"})));case 2:return n=e.sent,e.next=5,n.json();case 5:return r=e.sent,i={annual:f(f({},r.data["mtg-student-annual"]),{},{benefits:I(r.data["mtg-student-annual"]),pack_machine_name:"mtg-student-annual"}),quarterly:f(f({},r.data["mtg-student-quarterly"]),{},{benefits:I(r.data["mtg-student-quarterly"]),pack_machine_name:"mtg-student-quarterly"}),monthly:f(f({},r.data["mtg-student-monthly"]),{},{benefits:I(r.data["mtg-student-monthly"]),pack_machine_name:"mtg-student-monthly"})},e.abrupt("return",i);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var F=[{id:"JPY",symbol:"\xa5",inUSD:138},{id:"CNY",symbol:"\uffe5",inUSD:7.1},{id:"GBP",symbol:"\xa3",inUSD:.9},{id:"EUR",symbol:"\u20ac",inUSD:.98},{id:"INR",symbol:"\u20b9",inUSD:85},{id:"KRW",symbol:"\uffe6",inUSD:1300},{id:"KRW",symbol:"\u20a9",inUSD:1300}];function L(e,t,n){if("$"===t)return{price:Math.round(e),symbol:t};if("JP"===n.toUpperCase()){var r=F.find((function(e){return"JPY"===e.id}));return{price:Math.round(e*r.inUSD),symbol:r.symbol}}var i=F.find((function(e){return e.symbol===t}));return{price:Math.round(e*i.inUSD),symbol:i.symbol}}function z(e){return W.apply(this,arguments)}function W(){return(W=(0,r.Z)(a().mark((function e(t){var n,r,i,o,s;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(A,"?").concat(c.stringify({currency:t.toLowerCase(),user_country:t,product:"mtg",pack_type:"mind-the-graph-publisher",pack_machine_name:"mtg-publisher-semi-annual"})));case 2:return r=e.sent,e.next=5,r.json();case 5:if(i=e.sent,o=null===(n=i.data)||void 0===n?void 0:n["mtg-publisher-semi-annual"]){e.next=10;break}return console.error("mtg-publisher-semi-annual pack data not found in API response"),e.abrupt("return",null);case 10:return s={semiAnnual:f(f({},o),{}
1,{benefits:o.benefits?I(o):{},pack_machine_name:"mtg-publisher-semi-annual"})},e.abrupt("return",s);case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function J(e){return H.apply(this,arguments)}function H(){return(H=(0,r.Z)(a().mark((function e(t){var n,r,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,fetch("".concat(A,"?").concat(c.stringify({currency:t.toLowerCase(),user_country:t,product:"mtg",pack_type:"pp-prime-v2",pack_machine_name:"paperpal-prime-v2,paperpal-prime-monthly-v2"})));case 2:return n=e.sent,e.next=5,n.json();case 5:return r=e.sent,i={annual:f(f({},r.data["paperpal-prime-v2"]),{},{benefits:I(r.data["paperpal-prime-v2"])}),monthly:f(f({},r.data["paperpal-prime-monthly-v2"]),{},{benefits:I(r.data["paperpal-prime-monthly-v2"])})},e.abrupt("return",i);case 8:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},9516:function(e,t,n){"use strict";n(87794),n(63149),n(62425),n(53497)},82916:function(e,t,n){"use strict";n.d(t,{L:function(){return i},b:function(){return o}});var r=n(63149),i=[{id:1,shape:r.EW.ABSTRACT,label:"Graphical Abstract",width:1328,height:531},{id:2,shape:r.EW.SLIDE,label:"Slides Presentation",width:800,height:600},{id:3,shape:r.EW.INFOGRAPHIC,label:"Infographic",width:595,height:842},{id:4,shape:r.EW.POSTER,label:"Poster",width:711,height:948}];function o(e,t){var n=i.find((function(n){return n.width===e&&n.height===t}));return n?n.label:"Custom"}},21653:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/my-creations",function(){return n(84226)}])},24960:function(){},26759:function(){},56272:function(){}},function(e){e.O(0,[4885,5498,4789,9043,5464,5675,5522,6269,5928,2395,8760,6886,4030,2893,6502,4354,2179,7381,8481,6015,8676,8618,9249,7134,87,9774,2888,179],(function(){return t=21653,e(e.s=t);var t}));var t=e.O();_N_E=t}]); 2//# sourceMappingURL=my-creations-eaf25d96e8a9e547.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.