PageSourceSearch

https://www.1x.tech/_next/static/chunks/pages/process-refund-64ea0dc36829e126.js

js 1x.tech collected 2026-10-02 03:14:06 UTC 14,655 bytes, 1 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="269108d4-4a54-4ab1-8662-ab2cad03d4d7",e._sentryDebugIdIdentifier="sentry-dbid-269108d4-4a54-4ab1-8662-ab2cad03d4d7")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5560],{30715:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/process-refund",function(){return r(53847)}])},93751:function(e,t,r){"use strict";r.d(t,{X:function(){return l}});var n=r(85893),a=r(67294),o=r(73557),s=r(13742),i=r(18090);let l=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(o.fC,{ref:t,className:(0,i.cn)("peer h-4 w-4 shrink-0 rounded-[2px] border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r),...a,children:(0,n.jsx)(o.z$,{className:(0,i.cn)("flex items-center justify-center text-current"),children:(0,n.jsx)(s.Z,{className:"h-4 w-4"})})})});l.displayName=o.fC.displayName},43125:function(e,t,r){"use strict";r.d(t,{g:function(){return s}});var n=r(85893),a=r(67294),o=r(18090);let s=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("textarea",{style:{resize:"none"},className:(0,o.cn)(r,"border-[1px]  border-gammaGrey/60","focus:ring-black focus:border-gammaGrey focus:outline-none focus:border-[1px] text-[12px] leading-[19.2px] text-gammaGrey"),ref:t,...a,rows:5})});s.displayName="Textarea"},53847:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSG:function(){return h},default:function(){return v}});var n=r(85893),a=r(11163),o=r(90512),s=r(87536),i=r(56312),l=r(1604),u=r(11085),c=r(43125),d=r(93751),f=r(67294);let m=l.z.object({reason:l.z.string().min(1,"Please select a reason"),notes:l.z.string().optional(),confirmation:l.z.boolean().refine(e=>!0===e,{message:"You must confirm your refund request"})}),p=[{value:"Change of mind / no longer interested",label:"Change of mind / no longer interested"},{value:"Found a different product or service",label:"Found a different product or service"},{value:"Financial reasons",label:"Financial reasons"},{value:"Order placed by mistake",label:"Order placed by mistake"},{value:"Delay in delivery or production timeline",label:"Delay in delivery or production timeline"},{value:"Duplicate payment or order",label:"Duplicate payment or order"},{value:"Other",label:"Other"}];function x(e){let{submitStatus:t,setSubmitStatus:r,reservationNumber:a,paymentId:l}=e,{control:x,handleSubmit:g,reset:y,watch:b,formState:{errors:h}}=(0,s.cI)({resolver:(0,i.F)(m),defaultValues:{confirmation:!1}}),v=b("reason"),[N,w]=(0,f.useState)(null),[j,k]=(0,f.useState)(0),E=async e=>{r("loading"),w(null);try{let t=await fetch("/api/process-refund",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reservationNumber:a,paymentId:l,reason:e.reason,notes:e.notes||""})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to submit refund request")}r("success"),y(),k(e=>e+1),setTimeout(()=>{r("idle")},5e3)}catch(e){r("error"),setTimeout(()=>{r("idle")},5e3),w(e instanceof Error?e.message:"An unknown error occurred")}};return(0,n.jsxs)("form",{onSubmit:g(E,e=>{console.error("Form validation failed:",e)}),className:"flex flex-col gap-y-[20px]",children:[(0,n.jsxs)("div",{className:"w-full relative",children:[(0,n.jsx)(s.Qr,{name:"reason",control:x,render:e=>{let{field:t}=e;return(0,n.jsxs)(u.Ph,{onValueChange:t.onChange,defaultValue:t.value,children:[(0,n.jsx)(u.i4,{className:(0,o.W)("w-full text-[16px] leading-[24px] p-[0px] border-[0px] !border-b-[1px] rounded-[0px] text-[12px] leading-[19.2px] border-b-gammaGrey/60 shadow-[0px] bodyRegular font-regular py-[12px] h-fit text-gammaGrey placeholder:text-gammaGrey/60",h.reason&&"!border-errorAccent",!v&&"!text-gammaGrey/60"),children:(0,n.jsx)(u.ki,{placeholder:"Reason for cancellation"})}),(0,n.jsx)(u.Bw,{children:p.map(e=>(0,n.jsx)(u.Ql,{value:e.value,className:"text-[#142929]",children:e.label},e.value))})]})}},j),h.reason&&(0,n.jsx)("p",{className:"text-errorAccent absolute bottom-[-22px] text-[12px] leading-[19.2px]",children:h.reason.message})]}),(0,n.jsxs)("div",{className:"font-regular bodyRegular text-gammaGrey/60",children:[(0,n.jsx)("label",{className:"inline-block py-[12px] text-[12px] leading-[19.2px]",children:"Additional Notes (Optional)"}),(0,n.jsx)(s.Qr,{name:"notes",control:x,render:e=>{let{field:t}=e;return(0,n.jsx)(c.g,{...t,className:"bg-[#F8F8F8] w-full p-[16px] text-[12px] leading-[19.2px]",placeholder:"Please provide any additional details about your refund request..."})}})]}),(0,n.jsxs)("div",{className:"w-full relative",children:[(0,n.jsxs)("div",{className:"flex gap-x-[12px] items-start",children:[(0,n.jsx)(s.Qr,{name:"confirmation",control:x,defaultValue:!1,render:e=>{let{field:t}=e;return(0,n.jsx)(d.X,{id:"confirmation",checked:t.value,onCheckedChange:t.onChange,className:"mt-[2px]"})}},j),(0,n.jsx)("label",{htmlFor:"confirmation",className:"pb-[0px] bodyRegular font-normal cursor-pointer text-gammaGrey/60 text-[12px] leading-[19.2px]",children:"I confirm I want to request a refund for this order"})]}
1),h.confirmation&&(0,n.jsx)("p",{className:"text-errorAccent mt-[8px] text-[12px] leading-[19.2px]",children:h.confirmation.message})]}),(0,n.jsx)("button",{type:"submit",disabled:"loading"===t||"success"===t,className:"bg-gammaGrey/5 text-gammaGrey text-[12px] leading-[19.2px] py-[8px] hover:opacity-70 transition-opacity duration-200 disabled:opacity-50 disabled:hover:opacity-50",children:"success"===t?"Success!":"loading"===t?"Submitting...":"error"===t?N||"An error occurred. Please try again.":"Submit Refund Request"})]})}var g=r(26038),y=e=>{let{reservationNumber:t,paymentId:r}=e,a=(0,f.useRef)(null),s=(0,f.useRef)(null),[i,l]=(0,f.useState)("idle"),[u,c]=(0,f.useState)(!1),[d,m]=(0,f.useState)(!1);return(0,f.useEffect)(()=>{c(!t||!r||""===t.trim()||""===r.trim()),m(!0)},[t,r]),(0,f.useEffect)(()=>{"success"===i?g.p8.timeline().to(a.current,{opacity:0,duration:.3,ease:"power2.out"}).to(s.current,{opacity:1,duration:.3,ease:"power2.in"}):g.p8.timeline().to(s.current,{opacity:0,duration:.3,ease:"power2.out"}).to(a.current,{opacity:1,duration:.3,ease:"power2.in"})},[i]),(0,n.jsx)("main",{className:(0,o.W)("font-regular bg-[#222] overflow-x-hidden"),children:(0,n.jsx)("div",{className:(0,o.W)("bg-[#f7f7f7] w-screen relative z-[1] overflow-x-hidden"),children:(0,n.jsx)("section",{className:(0,o.W)("bg-[#f7f7f7] px-[32px] pt-[140px] pb-[356px] flex justify-center min-h-screen","lg:max-w-[1440px] lg:mx-auto"),children:(0,n.jsxs)("div",{className:(0,o.W)("max-w-[438px] mx-auto"),children:[(0,n.jsxs)("article",{className:(0,o.W)("lg:col-start-2 lg:col-span-3"),children:[(0,n.jsx)("h2",{className:(0,o.W)("font-medium text-[32px] leading-[32px] tracking-[-0.03em] text-gammaGrey",d?"opacity-100":"opacity-0",u?"text-center":"text-left"),children:"Refund Request"}),u&&d&&(0,n.jsx)("p",{className:(0,o.W)("mt-[16px] text-gammaGrey/60 text-[12px] leading-[19.2px] max-w-[353px] text-center"),children:"To cancel your pre-order and request a refund, please email [email protected] using the same e-mail address with which the pre-order was made. Refunds will be processed in 5-10 business days from the confirmation of your request."})]}),!u&&d&&(0,n.jsxs)("div",{className:(0,o.W)("mt-[24px]","lg:col-start-5 lg:col-span-3"),children:[(0,n.jsx)(x,{submitStatus:i,setSubmitStatus:l,reservationNumber:t,paymentId:r}),(0,n.jsxs)("div",{className:(0,o.W)("relative"),children:[(0,n.jsxs)("p",{ref:a,className:(0,o.W)("text-[12px] leading-[19.2px] text-center text-gammaGrey/60 mt-[20px]"),children:["By submitting this form, you acknowledge that your refund request will be reviewed and processed according to our"," ",(0,n.jsx)("a",{href:"/legal",className:(0,o.W)("underline hover:text-gammaGrey"),target:"_blank",rel:"noopener noreferrer",children:"terms and conditions"}),"."]}),(0,n.jsx)("p",{ref:s,className:(0,o.W)("text-[12px] leading-[19.2px] text-center text-gammaGrey absolute top-[0px] left-[50%] translate-x-[-50%] w-full opacity-0 pointer-events-none"),children:"Your refund request has been submitted successfully."})]})]})]})})})})},b=r(50894),h=!0,v=e=>{let{reservationNumber:t,paymentId:r}=(0,a.useRouter)().query;return(0,n.jsx)(b.A,{seo:e.seo,globalSettings:e.globalSettings,children:(0,n.jsx)(y,{reservationNumber:t,paymentId:r})})}},73557:function(e,t,r){"use strict";r.d(t,{z$:function(){return O},fC:function(){return _}});var n=r(67294);function a(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function o(...e){return n.useCallback(function(...e){return t=>{let r=!1,n=e.map(e=>{let n=a(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){let r=n[t];"function"==typeof r?r():a(e[t],null)}}}}(...e),e)}var s=r(85893);function i(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}var l=r(79698),u=r(57898),c=r(56060),d=globalThis?.document?n.useLayoutEffect:()=>{},f=e=>{let t,r;let{present:a,children:s}=e,i=function(e){var t,r;let[a,o]=n.useState(),s=n.useRef({}),i=n.useRef(e),l=n.useRef("none"),[u,c]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>
1r[e][t]??e,t));return n.useEffect(()=>{let e=m(s.current);l.current="mounted"===u?e:"none"},[u]),d(()=>{let t=s.current,r=i.current;if(r!==e){let n=l.current,a=m(t);e?c("MOUNT"):"none"===a||t?.display==="none"?c("UNMOUNT"):r&&n!==a?c("ANIMATION_OUT"):c("UNMOUNT"),i.current=e}},[e,c]),d(()=>{if(a){let e;let t=a.ownerDocument.defaultView??window,r=r=>{let n=m(s.current).includes(r.animationName);if(r.target===a&&n&&(c("ANIMATION_END"),!i.current)){let r=a.style.animationFillMode;a.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===a.style.animationFillMode&&(a.style.animationFillMode=r)})}},n=e=>{e.target===a&&(l.current=m(s.current))};return a.addEventListener("animationstart",n),a.addEventListener("animationcancel",r),a.addEventListener("animationend",r),()=>{t.clearTimeout(e),a.removeEventListener("animationstart",n),a.removeEventListener("animationcancel",r),a.removeEventListener("animationend",r)}}c("ANIMATION_END")},[a,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:n.useCallback(e=>{e&&(s.current=getComputedStyle(e)),o(e)},[])}}(a),l="function"==typeof s?s({present:i.isPresent}):n.Children.only(s),u=o(i.ref,(t=Object.getOwnPropertyDescriptor(l.props,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning?l.ref:(t=Object.getOwnPropertyDescriptor(l,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning?l.props.ref:l.props.ref||l.ref);return"function"==typeof s||i.isPresent?n.cloneElement(l,{ref:u}):null};function m(e){return e?.animationName||"none"}f.displayName="Presence";var p=r(75320),x="Checkbox",[g,y]=function(e,t=[]){let r=[],a=()=>{let t=r.map(e=>n.createContext(e));return function(r){let a=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:a}}),[r,a])}};return a.scopeName=e,[function(t,a){let o=n.createContext(a),i=r.length;r=[...r,a];let l=t=>{let{scope:r,children:a,...l}=t,u=r?.[e]?.[i]||o,c=n.useMemo(()=>l,Object.values(l));return(0,s.jsx)(u.Provider,{value:c,children:a})};return l.displayName=t+"Provider",[l,function(r,s){let l=s?.[e]?.[i]||o,u=n.useContext(l);if(u)return u;if(void 0!==a)return a;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let a=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return r.scopeName=t.scopeName,r}(a,...t)]}(x),[b,h]=g(x),v=n.forwardRef((e,t)=>{let{__scopeCheckbox:r,name:a,checked:u,defaultChecked:c,required:d,disabled:f,value:m="on",onCheckedChange:x,form:g,...y}=e,[h,v]=n.useState(null),N=o(t,e=>v(e)),w=n.useRef(!1),_=!h||g||!!h.closest("form"),[O=!1,R]=function({prop:e,defaultProp:t,onChange:r=()=>{}}){let[a,o]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[a]=r,o=n.useRef(a),s=(0,l.W)(t);return n.useEffect(()=>{o.current!==a&&(s(a),o.current=a)},[a,o,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,i=s?e:a,u=(0,l.W)(r);return[i,n.useCallback(t=>{if(s){let r="function"==typeof t?t(e):t;r!==e&&u(r)}else o(t)},[s,e,o,u])]}({prop:u,defaultProp:c,onChange:x}),S=n.useRef(O);return n.useEffect(()=>{let e=h?.form;if(e){let t=()=>R(S.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[h,R]),(0,s.jsxs)(b,{scope:r,state:O,disabled:f,children:[(0,s.jsx)(p.WV.button,{type:"button",role:"checkbox","aria-checked":k(O)?"mixed":O,"aria-required":d,"data-state":E(O),"data-disabled":f?"":void 0,disabled:f,value:m,...y,ref:N,onKeyDown:i(e.onKeyDown,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:i(e.onClick,e=>{R(e=>!!k(e)||!e),_&&(w.current=e.isPropagationStopped(),w.current||e.stopPropagation())})}),_&&(0,s.jsx)(j,{control:h,bubbles:!w.current,name:a,value:m,checked:O,required:d,disabled:f,form:g,style:{transform:"translateX(-100%)"},defaultChecked:!k(c)&&c})]})});v.displayName=x;var N="CheckboxIndicator",w=n.forwardRef((e,t)=>{let{__scopeCheckbox:r,forceMount:n,...a}=e,o=h(N,r);return(0,s.jsx)(f,{present:n||k(o.state)||!0===o.state,children:(0,s.jsx)(p.WV.span,{"data-state":E(o.state),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});w.displayName=N;var j=e=>{let{control:t,checked:r,bubbles:a=!0,defaultChecked:o,...i}=e,l=n.useRef(null),d=(0,u.D)(r),f=(0,c.t)(t);n.useEffect(()=>{let e=l.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(d!==r&&t){let n=new Event("click",{bubbles:a});e.indeterminate=k(r),t.call(e,!k(r)&&r),e.dispatchEvent(n)}},[d,r,a]);let m=n.useRef(!k(r)&&r);return(0,s.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??m.current,...i,tabIndex:-1,ref:l,style:{...e.style,...f,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function k(e){return"indeterminate"===e}function E(e){return k(e)?"indeterminate":e?"checked":"unchecked"}var _=v,O=w}},function(e){e.O(0,[2962,8388,6885,7536,9432,3760,5873,2888,9774,179],function(){return e(e.s=30715)}),_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.