1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="85be8044-d5a6-465e-bdc6-dbdbf9cbc7e2",e._sentryDebugIdIdentifier="sentry-dbid-85be8044-d5a6-465e-bdc6-dbdbf9cbc7e2")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71],{70739:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/redeem",function(){return t(59816)}])},88761:function(e,n,t){"use strict";t.d(n,{U:function(){return a}});var r=t(85893),s=t(86010);let a=(0,t(67294).memo)(e=>{let{children:n,id:t,...a}=e;return(0,r.jsx)("section",{id:t,...a,className:(0,s.Z)("section-wrapper",a.className),children:n})});a.displayName="SectionWrapper"},10711:function(e,n,t){"use strict";var r=t(85893),s=t(94184),a=t.n(s);n.Z=function(e){return(0,r.jsx)("div",{role:"status",className:"row",children:(0,r.jsxs)("svg",{"aria-hidden":"true",className:a()("spinner",e.className),viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,r.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]})})}},43959:function(e,n,t){"use strict";t.d(n,{Z:function(){return u}});var r=t(85893),s=t(67294),a=t(94184),i=t.n(a),l=t(66864);let o=e=>{let{children:n}=e;return(0,r.jsx)("span",{className:"text-xs",children:n})},d=(0,s.forwardRef)(function(e,n){let{className:t,children:s,...a}=e;return(0,r.jsxs)("div",{className:i()("margin-vertical-2xs",t,{"not-allowed":a.disabled}),children:[(0,r.jsx)(l.Z,{condition:s,children:(0,r.jsx)("span",{className:"row padding-left-xs text-light-70 padding-bottom-s",children:s})}),(0,r.jsx)("input",{...a,className:i()("input",t),ref:n})]})}),c=e=>{let{children:n,className:t}=e;return(0,r.jsx)("div",{className:i()(t),children:n})};c.Hint=o,c.Label=e=>{let{children:n,className:t,as:r,...a}=e;return(0,s.createElement)(r??"label",{className:i()("full-width text-xs text-light-70 ",t),...a},n)},c.Input=d,c.Error=e=>{let{error:n,...t}=e;return(0,r.jsx)(o,{children:(0,r.jsx)("span",{...t,className:"margin-bottom-xs text-error-90",children:n})})};var u=c},59816:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return C}});var r=t(85893),s=t(9008),a=t.n(s),i=t(41664),l=t.n(i),o=t(11163),d=t(67294),c=t(1762),u=t(59820),m=t(1604),h=t(88761),x=t(1897),p=t(41559),f=t(60531),g=t(10711),j=t(43959);let y={licenses_created:(0,r.jsx)("p",{children:"License created"}),invalid_license_key:(0,r.jsx)("p",{style:{color:"red"},children:"Invalid license key or email"}),invalid_email:(0,r.jsx)("p",{style:{color:"red"},children:"Invalid license key or email"}),error:(0,r.jsxs)("p",{children:["An error occurred, please contact us at"," ",(0,r.jsx)("a",{href:`mailto:${p.default.site.supportEmail}`,children:p.default.site.supportEmail})]}),"":null},b=()=>(0,r.jsx)(h.U,{id:"hero",children:(0,r.jsxs)("div",{className:"column gap-m items-center text-center padding-top-3xl padding-bottom-xl",children:[(0,r.jsx)("span",{className:"badge",children:"Core Framework"}),(0,r.jsxs)("h1",{children:[(0,r.jsx)("span",{className:"text-gradient-1",children:"OxyNinja"}),(0,r.jsx)("br",{}),(0,r.jsx)("span",{className:"font-300",children:"Giveaway"})]}),(0,r.jsxs)("p",{className:"max-width-60",children:["Core Framework is a successor of the original Core by OxyNinja. As we deeply value every single customer of the initial"," ",(0,r.jsx)("span",{className:"font-600 text-light-80",children:"OxyNinja"})," product, we want to give you a"," ",(0,r.jsx)("span",{className:"font-600 text-light-80",children:"FREE"})," lifetime license of Oxygen Builder add-on."," ",(0,r.jsx)("a",{href:"https://docs.coreframework.com/getting-started/oxyninja-users",className:"underline",children:"Instructions"})]})]})}),w=e=>{let{coupon:n,organizationId:t,csrfToken:s}=e,[a,i]=(0,d.useState)(!0),[l,o]=(0,d.useState)(null),[c,u]=(0,d.useState)(null),h=async()=>
1{if(i(!0),!n){i(!1);return}try{let e=await fetch(p.default.paths.api.renew,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({couponId:n.couponId,promotionCode:n.promotionCode,organizationId:t,csrfToken:s})}),r=m.z.object({success:m.z.boolean(),promotionCode:m.z.string(),error:m.z.string()}),a=await e.json(),l=r.parse(a);if(l.error){u(l.error),i(!1);return}o(l.promotionCode),i(!1)}catch(e){console.error(e),u("An error occurred, please try again later or contact us"),i(!1)}};return((0,d.useEffect)(()=>{if(l){i(!1);return}h()},[]),n)?(0,r.jsxs)("li",{className:"text-left text-title",children:["â
Your Bricks Addon promotion code has been redeemed. You can now use the promotion code ",c?(0,r.jsx)("p",{style:{color:"red"},children:c}):null,a?"...":null,l&&!c?(0,r.jsx)("strong",{className:"text-secondary font-bold",children:l}):null," ","to get the bricks add-on with a discount."]}):null};function N(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{type:"hidden",name:"csrfToken",defaultValue:e.csrfToken}),(0,r.jsx)("input",{type:"hidden",name:"organizationId",defaultValue:e.organizationId}),(0,r.jsx)("input",{type:"hidden",name:"customerEmail",defaultValue:e.customerEmail})]})}var C=!0;n.default=e=>{let{user:n,csrfToken:t,organization:s}=e,i=(0,o.useRouter)(),C=(0,c.aC)(),[v,_]=(0,d.useState)(!1),[k,S]=(0,d.useState)(),[I,z]=(0,d.useState)(s?.coupons?.find(e=>"oxyninja-redeem"===e.type)??null),[E,T]=(0,d.useState)(s?.addons?.oxygen?.licenseKey??""),[O,Z]=(0,d.useState)(!1),[R,P]=(0,d.useState)(!1),F=function(){let e=(0,f.G)();return(0,u.ZP)(p.default.paths.api.renewCheck,n=>e({method:"POST",path:n}))}(),D=F.data?.didRedeemCore,U=F.data?.didRedeemWooCore,L=(0,f.G)(),K=(0,f.G)(),W=async e=>{e.preventDefault();try{S(void 0);let n=new FormData(e.currentTarget),t=n.get("oxyninjaLicenseKey")?.toString(),r=n.get("email")?.toString(),s=n.get("csrfToken")?.toString();if(!r){S("invalid_email");return}if(!t||t?.length!==32){S("invalid_license_key");return}let a=await K({path:p.default.paths.api.redeemCore,method:"POST",body:{email:r,oxyNinjaLicenseKey:t,csrfToken:s}}),i=m.z.object({didRedeemCore:m.z.boolean(),didRedeemWooCore:m.z.boolean(),error:m.z.string().optional()}).safeParse(a);if(!i.success||i.data.error){S("error");return}i.data.didRedeemCore&&Z(!0),i.data.didRedeemWooCore&&P(!0)}catch(e){if(e?.error==="invalid_license_key"){S("invalid_license_key");return}S("error")}},A=async e=>{if(e.preventDefault(),!I||!E)try{S(void 0);let n=new FormData(e.currentTarget),t=n.get("organizationId")?.toString(),r=n.get("oxyninjaLicenseKey")?.toString().trim(),s=n.get("csrfToken")?.toString(),a=n.get("email")?.toString();if([t,r,s].some(e=>!e)){S("error");return}if(r?.length!==32){S("invalid_license_key");return}let i=await L({path:p.default.paths.api.redeem,method:"POST",body:{organizationId:t,licenseKey:r,csrfToken:s,oxyninjaLicenseKey:r,email:a}}),l=m.z.object({oxygen:m.z.object({success:m.z.boolean(),licenseKey:m.z.string()}).optional(),success:m.z.boolean(),message:m.z.string().optional()}).safeParse(i);if(!l.success){S("error");return}S(""),l?.data?.oxygen?.success&&T(l.data.oxygen.licenseKey),"invalid_license_key"===l.data.message&&S("invalid_license_key")}catch(e){console.error(e),S("error"),_(!1)}},Y=async e=>{_(!0),await Promise.allSettled([A(e),W(e)]),_(!1)},$=`${p.default.paths.signIn}?returnUrl=${encodeURIComponent(i.asPath)}`,G=`${p.default.paths.signUp}?returnUrl=${encodeURIComponent(i.asPath)}`,H=O||R||I||E;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a(),{children:[(0,r.jsx)("title",{children:"Redeem"}),(0,r.jsx)("meta",{name:"robots",content:"noindex"}),(0,r.jsx)("meta",{name:"description",content:"Redeem your Oxygen add-on license key"})]}),(0,r.jsx)(b,{}),n?(0,r.jsxs)(r.Fragment,{children:[H?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"padding-top-l padding-bottom-l column gap-m items-center text-center max-width-60 self-center padding-horizontal-m",children:[(0,r.jsx)("h3",{className:"text-light",children:"Success! \uD83C\uDF89"}),(0,r.jsxs)("ul",{className:"column gap-s",children:[(0,r.jsx)(w,{coupon:I,organizationId:s?.id,customerEmail:C?.currentUser?.email||"",csrfToken:t}),E?(0,r.jsxs)("li",{className:"text-left text-title",children:["â
Your Oxygen Addon has been redeemed. You can now use the license key"," ",(0,r.jsx)("strong",{className:"text-secondary font-bold",children:E})," ","to activate the Oxygen add-on."]}):null,(D||O||U||R)&&(0,r.jsxs)("li",{className:"text-left text-title",children:["â
Your Core"," ",D||R?"and WooCore":""," ","UI Kit for Core Framework has been redeemed."]})]})]}),(0,r.jsx)("div",{className:"padding-top-xs padding-bottom-xl column gap-m items-center text-center max-width-60 self-center padding-horizontal-m",children:(0,r.jsx)(l(),{className:"btn secondary self-center",href:p.default.paths.appHome,children:"View in Dashboard"})})]}):null,(0,r.jsx)(h.U,{id:"hero",children:(0,r.jsx)("div",{className:"padding-l bg-light-5 radius-l max-width-50 self-center",children:(0,r.jsxs)("form",{className:"column gap-s items-center text-center ",onSubmit:Y,children:[(0,r.jsxs)(j.Z,{children:[(0,r.jsxs)(j.Z.Label,{children:[(0,r.jsxs)(j.Z.Hint,{children:["Oxyninja License key ","(Core, WooCore or bundle)"]}),(0,r.jsx)(j.Z.Input,{required:!0,placeholder:"Oxyninja License key",name:"oxyninjaLicenseKey",className:"full-width"})]}),(0,r.jsxs)(j.Z.Label,{children:[(0,r.jsx)(j.Z.Hint,{children:"Email used for purchase"}
1),(0,r.jsx)(j.Z.Input,{required:!0,placeholder:"Email",name:"email",className:"full-width",type:"email"})]}),k?y[k]:null]}),(0,r.jsx)(N,{organizationId:s?.id,customerEmail:C?.currentUser?.email||"",csrfToken:t}),(0,r.jsx)("button",{className:"btn full-width",type:"submit",children:v?(0,r.jsx)(g.Z,{}):"Redeem"})]})})})]}):(0,r.jsxs)("div",{className:"column gap-s items-center text-center padding-l bg-light-5 radius-l max-width-50 self-center",children:[(0,r.jsx)("p",{className:"text-light",children:"In order to claim your lifetime license, or a promo code, create an account or sign in first."}),(0,r.jsxs)("div",{className:"row gap-s",children:[(0,r.jsx)(x.Q,{className:"btn slight",href:$,children:"Sign In"}),(0,r.jsx)(x.Q,{href:G,children:"Create an account"})]})]})]})}}},function(e){e.O(0,[9820,2888,9774,179],function(){return e(e.s=70739)}),_N_E=e.O()}]);
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.