PageSourceSearch

https://www.gap.at/_next/static/chunks/pages/online-return/[emailHash]/[orderNumberHash]-442197183cacc55b.js

js gap.at collected 2026-10-06 13:18:17 UTC 16,182 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5005],{621:(e,t,r)=>{"use strict";r.d(t,{Y:()=>n});let n=(e,t=!1,r=null,n,l)=>{if(!e)return"";let a=new Date(e),s="";return a&&(s=a.toLocaleDateString(n,{timeZone:l})),a&&t&&(s+=`${r||" "}${a.toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit",timeZone:l})}`),s}},18451:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>F,default:()=>D});var n,l,a=r(26514);r(54532);var s=r(97053);r(29305);var i=r(41246),o=r(60269),u=r(33862),d=r(55047);let c=e=>{if(!e)return;let t=e.replace(/<[^>]*>?/gm,"");if(t=(t=t.replace(/&nbsp;/g," ")).trim())return t};var m=r(46225),p=r(75834),h=r(81586),x=((n={}).Return="return",n.Complaint="complaint",n);let _=(0,p.createContext)({isBankAccountRequired:!1,updateReturnOption:()=>{},removeReturnOption:()=>{}}),f=(e,t)=>{switch(t.type){case"update":return{...e,[t.key]:t.value};case"remove":let r={...e};return delete r[t.key],r;default:return e}},g=({children:e,bankAccountRequired:t})=>{let[r,n]=(0,p.useReducer)(f,{}),[l,s]=(0,p.useState)(!1);(0,p.useEffect)(()=>{s(!0===t||Object.values(r).some(e=>e===x.Complaint))},[r,t]);let i=(0,p.useCallback)(({key:e,value:t})=>{n({type:"update",key:e,value:t})},[]),o=(0,p.useCallback)(e=>{n({type:"remove",key:e})},[]),u=(0,p.useMemo)(()=>({isBankAccountRequired:l,updateReturnOption:i,removeReturnOption:o}),[l,i,o]);return(0,a.jsx)(_.Provider,{value:u,children:e})},b=()=>{let{alert:e}=(0,h.Pj)(),{t}=(0,d.Bd)(),[r,n]=(0,p.useState)(!1),l=(0,m.useRouter)(),{isBankAccountRequired:a,updateReturnOption:i,removeReturnOption:o}=(0,p.useContext)(_);return{isPending:r,handleOnSubmit:({emailHash:i,orderNumberHash:o})=>async u=>{if(u.preventDefault(),r)return;n(!0);let d=new FormData(u.target),m=(e=>{let t=[];for(let[r,n]of e.entries())if(r.startsWith("items.")){let e=r.split(".");t[e[1]]={...t[e[1]]||{},[e[2]]:n}}return t.filter(e=>void 0!==e.return).filter(e=>e.reasonType).map(e=>({orderItemProductEcomId:Number(e.orderItemProductEcomId),reasonType:e.reasonType,reasonText:c(e.reasonText)||null}))})(d),p=c(d.get("accountNumber"));if(a&&!p){e.handleError([{message:t("online-return-error__missing-bank-account-number")}]),n(!1);return}if(!m.length){e.handleError([{message:t("online-return-error__missing-item-to-return")}]),n(!1);return}let[h,x]=await (0,s.bl)({accountNumber:p||null,items:m},i,o);if(x){Array.isArray(x)&&x.length>0?e.handleError(x):console.log(x),n(!1);return}h&&h.redirectTo?l.push(h.redirectTo):e.handleError([{message:t("online-return-error__failed-to-redirect")}]),n(!1)},updateReturnOption:i,removeReturnOption:o,isBankAccountRequired:a}},v=({children:e,emailHash:t,orderNumberHash:r})=>{let{t:n}=(0,d.Bd)("common"),{handleOnSubmit:l,isPending:s,isBankAccountRequired:i}=b();return(0,a.jsxs)("form",{onSubmit:l({emailHash:t,orderNumberHash:r}),className:"text-base",children:[e,(0,a.jsxs)("div",{className:"mx-auto max-w-[400px] text-center mb-24 mt-8",children:[i&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h2",{className:"font-bold text-2xl mb-2",children:n("online-return-submit-form__title")}),(0,a.jsx)("p",{children:n("online-return-submit-form__text")}),(0,a.jsx)(u.g,{label:n("online-return__submit-form__acc-num"),type:"text",required:!0,register:()=>({name:"accountNumber"}),className:"sm:max-w-[400px]",inputClassname:"uppercase",name:"accountNumber"})]}),(0,a.jsx)(o.S,{type:"submit",disabled:s,className:"max-[400px] !h-[50px] w-full focus:bg-gray-800",children:n("online-return-submit-form__submit")})]})]})};var y=r(86750),j=r(77066);let w=({index:e,children:t,label:r})=>{let[n,l]=(0,p.useState)(!1),s=()=>{l(!n)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.g,{variant:"checkbox",type:"checkbox",name:`items.${e}.return`,register:()=>({name:`items.${e}.return`,onChange:s}),label:r,className:"hover:no-underline"}),n&&t]})};var N=r(21058),k=((l={}).Complaint="complaint",l.Broken="broken",l.SizeChange="size_change",l.BadMaterialQuality="bad_material_quality",l.WrongItem="wrong_item",l.NoReasonGiven="no_reason_given",l.SizeDoesntFit="size_doesnt_fit",l.LooksDifferent="looks_different",l);let $=e=>e.returnAllowed&&e.returnReasons?.length>0,C=({index:e,item:t})=>{var r;let{t:n}=(0,d.Bd)("common"),{updateReturnOption:l,removeReturnOption:s}=b(),[i,o]=(0,p.useState)($(r=t)?x.Return:r.complaintAllowed?x.Complaint:""),c=$(t),m=t.complaintAllowed,h=`items.${e}.returnOption`,_=[{label:`${n("online-return__return-reasons-return")}`,value:x.Return,disabled:!c},{label:`${n("online-return__return-reasons-complaint")}`,value:x.Complaint,disabled:!m}];(0,p.useEffect)(()=>c||m?(c&&!m?l({key:h,value:x.Return}):m&&!c&&l({key:h,value:x.Complaint}),()=>{s(h)}):void s(h),[c,m,h,s,l]);let f=(0,p.useMemo)(()=>0===t.returnReasons.length?[]:[{value:"",label:n("online-return__return-reason-placeholder"),disabled:!0},...t.returnReasons.map(e=>({value:e.type,label:e.text}))],[t.returnReasons,n]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"flex gap-x-8 flex-wrap",children:_.map(e=>(0,a.jsx)(u.g,{variant:"radio",defaultValue:e.value,type:"radio",name:h,register:()=>({name:h,onChange:e=>{var t;o(t=e.target.value),l({key:h,value:t})}}),disabled:e.disabled,required:!0,label:e.label,className:"hover:no-underline !border-0 pt-0",defaultChecked:i===e.value},e.value))}),i===x.Return&&(0,a.jsx)(N.W,{options:f,label:`${n("online-return__return-reason")}`,className:"w-full max-w-[237px]",name:`items.${e}.reasonType`,labelClassName:"text-xs",disabled:!c,required:!0}),i===x.Complaint&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{type:"hidden",name:`items.${e}.reasonType`,value:k.Complaint}),(0,a.jsx)("div",{children:(0,a.jsx)(u.g,{label:`${n("note")}`,name:`items.${e}.reasonText`,register:()=>({name:`items.${e}.reasonText`,required:!0,placeholder:n("online-return__return-item-reason__textarea-placeholder")}),className:"!mt-1 !mb-0 max-w-[498px]",variant:"textarea",disabled:!m})})]})]})};var R=r(14366),S=r(75406);let z=({children:e,icon:t="/images/icons/online-return-tooltip.svg",className:r,...n})=>(0,a.jsxs)("div",{className:(0,S.cn)({"rounded bg-gray-400 flex p-4 gap-2 items-center":!0,[`${r}`]:r}),...n,children:[(0,a.jsx)(R.I,{icon:t,className:"w-4 h-4"}),e]});var P=r(33194);let E=({item:e,index:t})=>{let{t:r}=(0,d.Bd)("common"),{settings:n}=(0,h.Pj)(),l=(0,p.useRef)(null),s=!e.isGift&&(!1!==e.returnAllowed||!1!==e.complaintAllowed),i=e.tags?.length>0,o=e.complaintAllowed&&!e.returnAllowed,u=!e.complaintAllowed&&!e.returnAllowed,c=!e.isGift&&!i;(0,p.useEffect)(()=>{let e=l.current;if(e)return e.style.setProperty("--return-form-img-width",`${n.productMediaSizes.returnFormItem.width}px`),e.style.setProperty("--return-form-img-height",`${n.productMediaSizes.returnFormItem.height}px`),e.style.setProperty("--return-form-img-desktop-width",`${n.productMediaSizes.returnFormItemDesktop.width}px`),e.style.setProperty("--return-form-img-desktop-height",`${n.productMediaSizes.returnFormItemDesktop.height}px`),()=>{e.style.removeProperty("--return-form-img-width"),e.style.removeProperty("--return-form-img-height"),e.style.removeProperty("--return-form-img-desktop-width"),e.style.removeProperty("--return-form-img-desktop-height")}},[n.productMediaSizes]);let m=r("online-return__checkbox-complaint");return!e.isGift&&(!0===e.returnAllowed&&!0===e.complaintAllowed||
10)&&(m=r("online-return__checkbox_return-or-complaint")),(0,a.jsxs)("article",{ref:l,className:"py-4 border-t border-gray-500",children:[e.isGift&&(0,a.jsx)(z,{className:"mb-4",children:r("online-return__order-section__tooltip")}),c&&o&&(0,a.jsx)(z,{className:"mb-4",children:r("online-return__return-item__complaint-only-info")}),c&&u&&(0,a.jsx)(z,{className:"mb-4",children:r("online-return__return-item__no-return-no-complaint-info")}),(0,a.jsxs)("div",{className:"grid grid-cols-[var(--return-form-img-width)_1fr] md:grid-cols-[var(--return-form-img-desktop-width)_1fr] gap-4",children:[(0,a.jsx)(y.$,{alt:`Return item image-${t+1}`,width:n.productMediaSizes.returnFormItemDesktop.width,height:n.productMediaSizes.returnFormItemDesktop.height,src:e.media[0]?.path,className:"w-[var(--return-form-img-width)] h-[var(--return-form-img-height)] md:w-[var(--return-form-img-desktop-width)] md:h-[var(--return-form-img-desktop-height)] object-cover"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"mb-2",children:e.name}),(0,a.jsxs)("div",{className:"flex flex-col items-start",children:[(0,a.jsxs)("span",{className:"text-gray-700",children:[(0,P.R)(r("size"))," ",e.size]}),(0,a.jsxs)("span",{className:"text-gray-700",children:[(0,P.R)(r("product-code"))," ",e.code]}),i&&(0,a.jsx)(j.f,{variant:e.tags[0]?.status,className:"mt-2",children:e.tags[0]?.text})]}),(0,a.jsx)("input",{type:"hidden",name:`items.${t}.orderItemProductEcomId`,value:e.sizeVariantId}),s&&(0,a.jsx)(w,{index:t,label:m,children:(0,a.jsx)(C,{index:t,item:e})})]})]})]})};var A=r(621);let I=({orderNumber:e,orderDateCreated:t,locale:r})=>{let{t:n}=(0,d.Bd)("common"),[l,s]=(0,p.useState)((0,A.Y)(t,!1,null,r,"UTC"));return(0,p.useEffect)(()=>{s((0,A.Y)(t,!1,null,r))},[]),(0,a.jsx)("div",{className:"bg-gray-300 border-b border-gray-500 p-4 mb-8",dangerouslySetInnerHTML:{__html:n("order-return__order-number__order-date",{orderNumber:e,orderCreatedDate:l})}})};var T=r(78471);let M=({orderNumber:e,className:t,...r})=>{let{t:n}=(0,d.Bd)("common"),l=e=>(0,T.k)(n(e),e);return l("online-return__message__header")||l("online-return__message__text")?(0,a.jsxs)("div",{className:(0,S.cn)({"px-10 py-6 bg-danger-600 text-white space-y-2":!0,[`${t}`]:t}),...r,children:[l("online-return__message__header")&&(0,a.jsx)("p",{className:"text-lg",children:(0,a.jsx)("strong",{dangerouslySetInnerHTML:{__html:n("online-return__message__header")}})}),l("online-return__message__text")&&(0,a.jsx)("p",{dangerouslySetInnerHTML:{__html:n("online-return__message__text",{orderNumber:e})}})]}):null},O=({children:e})=>(0,a.jsx)(i.m,{className:"max-w-[825px] pt-16",children:e});var F=!0;let D=({initialData:{orderReturnData:e,currentLocale:t}})=>{let r=e.orderNumber;return(0,a.jsx)(g,{bankAccountRequired:e.bankAccountRequired,children:(0,a.jsx)(O,{children:(0,a.jsxs)(v,{emailHash:e.emailHash,orderNumberHash:e.orderNumberHash,children:[(0,a.jsx)(I,{orderNumber:r,orderDateCreated:e.orderCreatedAt,locale:t}),e?.items?.map((e,t)=>(0,a.jsx)(E,{item:e,index:t},`${t}-${e.sizeVariantId}`)),(0,a.jsx)(M,{className:"my-12",orderNumber:r})]})})})}},21058:(e,t,r)=>{"use strict";r.d(t,{W:()=>u});var n=r(26514),l=r(14366),a=r(75406),s=r(55047),i=r(75834);let o=(e,t)=>{let r=e.find(e=>e.value===t),n=e.find(e=>e.selected);return r||n||e[0]},u=({required:e,options:t,name:r,value:u,onChange:d,label:c,labelClassName:m,className:p,buttonClassName:h="h-[50px]",iconClassName:x,disabled:_,form:f,invalid:g,...b})=>{let{t:v}=(0,s.Bd)("common"),[y,j]=(0,i.useState)(o(t,u));return(0,i.useEffect)(()=>{j(o(t,u))},[u,t]),(0,n.jsxs)("label",{className:(0,a.cn)({"c-listbox relative mt-1 z-50 block":!0,[`${p}`]:p}),...b,children:[(0,n.jsx)("select",{title:y?.label?v(y.label):void 0,required:e,value:y?.value,className:"c-listbox__select focus:outline-none outline-none absolute top-0 h-full w-full text-base cursor-pointer opacity-0 z-10 peer disabled:cursor-auto",onChange:e=>{let r=t.find(t=>`${t.value}`===e.target.value)||t[0];j(r),d&&d(r)},disabled:_||void 0===y,form:f,name:r,children:t.map(({value:e,label:t,selected:r,...l})=>(0,n.jsx)("option",{value:e,"data-selected":r||e===y?.value,...l,children:v(t)},`key-${e}`))}),c&&(0,n.jsx)("span",{className:(0,a.cn)({"c-listbox__label absolute pl-1 pr-1 bg-white block left-3 top-0 translate-y-[-50%] z-50 peer-disabled:text-black/50":!0,[`${m}`]:m,"text-red-500":g}),children:v(c)}),(0,n.jsx)("div",{className:(0,a.cn)({"c-listbox__button w-full grid relative rounded-input text-input text-left pl-4 pr-4 font-semibold border border-gray-500 bg-white z-1 peer-focus:outline peer-focus:outline-2 peer-disabled:opacity-50":!0,[`${h}`]:h,"border-red-500 border-2":g}),children:(0,n.jsxs)("div",{className:"flex justify-between items-center gap-2 overflow-hidden",children:[(0,n.jsx)("span",{className:(0,a.cn)({"c-listbox__button-label truncate":!0,"text-red-500":g}),children:y?.label?v(y.label):null}),(0,n.jsx)(l.I,{icon:"/images/icons/chevron-up.svg",className:(0,a.cn)({"c-listbox__button-icon stroke-black fill-none h-3 w-3 transform rotate-180":!0,[`${x}`]:x})})]})})]})}},28860:(e,t,r)=>{"use strict";r(17260),r(96968)},29305:(e,t,r)=>{"use strict";var n=r(88304);n.env.DEFAULT_LOCALE&&n.env.DEFAULT_LOCALE},33194:(e,t,r)=>{"use strict";r.d(t,{R:()=>n});let n=e=>{let t=(null==e?"":String(e)).trim();return""===t||t.endsWith(":")?t:`${t}:`}},39285:(e,t,r)=>{"use strict";r.d(t,{H:()=>l});var n=r(81586);let l=({base:e="",celio:t,gap:r,geox:l,orsay:a,ua:s})=>{let{settings:i}=(0,n.Pj)(),o=e;return i.isCelio()&&"string"==typeof t&&(o=t),i.isGap()&&"string"==typeof r&&(o=r),i.isGeox()&&"string"==typeof l&&(o=l),i.isOrsay()&&"string"==typeof a&&(o=a),i.isUa()&&"string"==typeof s&&(o=s),{[o.trim()]:!!o.trim()}}},54532:(e,t,r)=>{"use strict";r(29305),r(28860)},74595:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return l}});let n=r(75834);function l(e,t){let r=(0,n.useRef)(null),l=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=l.current;t&&(l.current=null,t())}else e&&(r.current=a(e,n)),t&&(l.current=a(t,n))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77066:(e,t,r)=>{"use strict";r.d(t,{f:()=>a});var n=r(26514),l=r(75406);let a=({className:e,children:t,variant:r="new",...a})=>{let s;return(0,n.jsx)("div",{className:(0,l.cn)({[`${!(s={new:"text-[color:--return-item-badge__color--new,var(--white)] bg-[--return-item-badge__bg-color--new,var(--green-600)] text-[length:--return-item-badge__font-size--new,var(--font-size__sm)] py-1 px-2 inline-block",waiting:"text-[color:--return-item-badge__color--waiting,var(--white)] bg-[--return-item-badge__bg-color--waiting,var(--green-600)] text-[length:--return-item-badge__font-size--waiting,var(--font-size__sm)] py-1 px-2 inline-block"})[r]?s.new:s[r]}`]:!0,[`${e}`]:!!e}),...a,children:t})}},78471:(e,t,r)=>{"use strict";r.d(t,{k:()=>n});let n=(e,t)=>!!e&&""!==e&&e!==t},78831:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/online-return/[emailHash]/[orderNumberHash]",function(){return r(18451)}])},86750:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,C:()=>d});var n=r(26514),l=r(58245),a=r.n(l),s=r(41179),i=r(81586);let o=({alt:e,aspectRatio:t=null,className:r,height:l,placeholder:i,sizes:o,src:d,unoptimized:c,width:m,onClick:p,style:h,priority:x,..._})=>{let f=u(o);return(null===t&&m&&l&&(t=m/l),d)?(0,n.jsx)("div",{className:"c-media max-w-full",onClick:p,children:(0,n.jsx)(a(),{loader:({src:e,width:r,quality:n})=>(0,s.T)({src:e,width:r,quality:n,height:t?Math.round(r/t):0}),sizes:f,width:m,height:l,src:d,placeholder:i,className:r,unoptimized:c,style:h,priority:x,alt:e||"",..._})}):(0,n.jsx)("div",{className:"c-media max-w-full",children:(0,n.jsx)("div",{className:r,style:{aspectRatio:t||void 0,...h}})})},u=e=>{let{screens:t}=(0,i.Pj)();if(!e)return;if(e.custom)return e.custom;let r="";return Object.entries(t).forEach(t=>{let[n,l]=t;e[n]&&(r+=`(max-width: ${l}) ${e[n]},`)}),e.default&&(r+=`${e.default}`),r||void 0},d=({src:e,autoPlay:t=!0,width:r,controls:l=!1,ref:a,...i})=>e?(0,n.jsx)("video",{ref:a,preload:"metadata",autoPlay:t,loop:!0,muted:!0,controls:l,playsInline:!0,width:r,...i,children:(0,n.jsx)("source",{src:(0,s.f)(e),type:"video/mp4"})},e):null},97053:(e,t,r)=>{"use strict";r.d(t,{bl:()=>a,dJ:()=>l});var n=r(25110);r(17260);let l=async e=>await (0,n.g)("postFindOrderReturn",e),a=async(e,t,r)=>await (0,n.g)("postOrderReturnForm",e,`/${t}/${r}`)}},e=>{e.O(0,[8245,5777,3862,636,6593,8792],()=>e(e.s=78831)),_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.