1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7331],{6095:(e,t,n)=>{"use strict";let s;n.r(t),n.d(t,{__N_SSG:()=>p,default:()=>m});var l=n(3359),i=n(4847),a=n(3754);let r=()=>{let{t:e,lang:t}=(0,a.A)();return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100vh"},children:[(0,l.jsx)("img",{style:{width:"120px",height:"120px",marginBottom:"15px"},src:"/assets-img/images/error_logo.png"}),"ar"===t?(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("h3",{children:"ÙØ´Ù Ù٠عÙ
ÙÙØ© Ø§ÙØ¯Ùع"})}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("h3",{children:"Payment failed!"})})]})},c=()=>{let{t:e,lang:t}=(0,a.A)();return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"100vh"},children:[(0,l.jsx)("img",{style:{width:"120px",height:"120px",marginBottom:"15px"},src:"/assets-img/images/confirmed.svg"}),"ar"===t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h3",{children:"Ø´ÙØ±Ùا ÙÙ"}),(0,l.jsx)("p",{children:"تÙ
ت عÙ
ÙÙØ© Ø§ÙØ¯Ùع Ø¨ÙØ¬Ø§Ø"})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h3",{children:"Thank You"}),(0,l.jsx)("p",{children:"Payment completed successfully"})]})]})},o=e=>{let{show:t}=e;return t?(0,l.jsx)("div",{className:"loading",children:"Loadingâ¦"}):null};var u=n(3931);let h=u.A.CancelToken,d=function(){let{apiVersion:e="1.0",applyCancelToken:t=!1,callAtBuildTime:n=!1,unAuthorized:l=!1,language:i="arabic"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i,r="";n?r="":!n&&l?(r="",a=document.getElementsByTagName("html")[0].getAttribute("lang")):(a=document.getElementsByTagName("html")[0].getAttribute("lang"),r=window.localStorage.getItem("access_token"));let c={headers:{"api-version":e,"Accept-Language":"arabic"===a?"AR":"EN","app-version":"1.0","Content-Type":"application/json",Accept:"application/json"}};u.A.defaults.baseURL="https://admin.nana.sa/api/web_app",r&&(c.headers.Authorization=r),t&&(c.cancelToken=new h(function(e){s=e}));let o=e=>(u.A.isCancel(e)?console.log("Request canceled",e.message):e.response&&404===e.response.status&&window.dispatchEvent(new CustomEvent("api-error",{detail:{status:404,url:e.config.url}})),Promise.reject(e));return{get:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u.A.get(e,{...c,...t}).catch(o)},post:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.A.post(e,t,{...c,...n}).catch(o)},put:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return u.A.put(e,t,{...c,...n}).catch(o)},delete:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u.A.delete(e,{...c,...t}).catch(o)},cancel:s}};var g=n(4104),p=!0;let m=()=>{let[e,t]=(0,i.useState)(!0),[n,s]=(0,i.useState)(null),{query:a}=(0,g.useRouter)(),u=async()=>{t(!0);let e={session_id:a["cko-session-id"]},l=await d({apiVersion:"2.0",unAuthorized:!0}).post("/pay_subscription",e);try{var i;if(null==l||null==(i=l.data)?void 0:i.result){if(Object.keys(l.data.result).length){let{url:e}=l.data.result;s(e),console.log({responseUrl:n}),setTimeout(()=>{e&&(console.log("The url is => ",{url:e}),window.location.href=e)},0),t(!1)}}else t(!1)}catch(e){console.log(e),t(!1)}};return((0,i.useEffect)(()=>{Object.keys(a).length&&!n&&u()},[a,n]),n)?(0,l.jsx)(c,{}):n||e?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",flexDirection:"column"},children:e&&(0,l.jsx)(o,{show:e})}):(0,l.jsx)(r,{})}},8228:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/success-page",function(){return n(6095)}])}},e=>{var t=t=>e(e.s=t);e.O(0,[3931,636,6593,8792],()=>t(8228)),_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.