1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5165],{14572:(e,l,a)=>{a.d(l,{A:()=>s});var n=a(14232);function s(e,l){(0,n.useEffect)(()=>{function a(a){e.current&&!e.current.contains(null==a?void 0:a.target)&&l()}return document.addEventListener("mousedown",a),()=>{document.removeEventListener("mousedown",a)}},[e,l])}},15165:(e,l,a)=>{a.d(l,{A:()=>_});var n=a(37876),s=a(57610),t=a(11701),r=a(34650),o=a(85278);let c=(0,a(13740).Ay)({baseURL:"".concat("https://myeraspace.eraspace.com","/api/v1")}),i=async(e,l)=>c.post("/external/transaction-claim",l,{headers:{"Content-type":"Application/json",Authorization:"Bearer ".concat(e)}});var d=a(98804),u=a(59641),m=a(7052),x=a(57871),h=a(28720),p=a(53652),f=a(58827),b=a(77092),g=a(37968),j=a(14232),v=a(88992),N=a(29573);function A(e){var l,a,t,c;let A=(0,o.md)(r.bV),{onSuccess:w}=e,[y,k]=(0,j.useState)(!1),[C,P]=(0,j.useState)(""),{register:O,handleSubmit:E,reset:S,setValue:Q,setError:z,watch:T,control:_,resetField:L,formState:{errors:K,isValid:I,isDirty:H}}=(0,v.mN)({mode:"all"}),M=(0,b.bJ)(),R=async e=>{P("");try{if(k(!0),(await i(M,e)).data){w(),P(""),S();return}}catch(e){var l,a;if(!e.response)return void P(e.message);(e=>{let l=e?e.toLowerCase():"";return l.includes("pesanan salah")||l.includes("klaim order")?z("order_number",{type:"manual",message:e}):l.includes("order")?z("order_number",{type:"manual",message:"Nomor pesanan tidak ditemukan"}):l.includes("handphone")?z("phone",{type:"manual",message:e}):P(e)})(null==(a=e.response)||null==(l=a.data)?void 0:l.error_message)}finally{k(!1)}},D=(0,j.useMemo)(()=>[{id:0,label:"Pilih toko",value:"",className:"hidden"},{id:1,label:"Shopee",value:"SHOPEE"},{id:2,label:"Tokopedia",value:"TOKOPEDIA"},{id:3,label:"Lazada",value:"LAZADA"},{id:4,label:"TikTok",value:"TIKTOK"}],[A]),F=T("store");return(0,n.jsxs)(s.so,{dir:"column",items:"start",gap:A?5:10,className:"w-full max-w-[726px] mx-auto",children:[(0,n.jsx)(u.A,{className:(0,N.QP)(A?"text-2xl":"text-[36px]","font-semibold"),children:"Klaim Transaksi"}),(0,n.jsxs)("form",{className:"w-full h-full",onSubmit:E(R),children:[(0,n.jsxs)(u.A,{className:(0,N.QP)(A?"pb-5":"pb-10","flex flex-col gap-5"),children:[(0,n.jsx)(v.xI,{control:_,...O("store",{required:{value:!0,message:f.Ok},onChange:e=>{Q("store",e.target.value),L("order_number")}}),defaultValue:"",render:e=>{let{field:{value:l,onChange:a,name:s}}=e;return(0,n.jsx)(x.A,{className:"w-full !h-12",placeholderClassName:"!text-sm",arrowPosition:"right",label:"Pilih toko",mobileHeader:"Pilih toko",name:s,options:D,value:l,onChange:a,isMobile:A,noBottomSheet:!0})}}),(0,n.jsx)(h.A,{id:"order_number",type:"text",placeholder:"Nomor pesanan ".concat((0,g.ZH)(F)),bottomElement:""!==F&&(0,n.jsxs)(s.so,{dir:"row",gap:1,items:"center",children:[(0,n.jsx)(p.A,{name:"warning-info"}),(0,n.jsx)(s.EY,{className:"leading-none",children:{SHOPEE:"Contoh no. pesanan Shopee: 123456AB7CD890",TOKOPEDIA:"Contoh no. invoice Tokopedia: 578123456789000000",LAZADA:"Contoh no. pesanan Lazada: 123456789012345",TIKTOK:"Contoh no. pesanan Tiktok: 580418761137161840"}[F]})]}),isRequired:!0,isInvalid:!!(null==K?void 0:K.order_number),className:"!h-12",label:"Nomor pesanan ".concat((0,g.ZH)(F)),...O("order_number",{required:{value:!0,message:f.Ok}}),error:"".concat((null==K||null==(l=K.order_number)?void 0:l.message)?null==K||null==(a=K.order_number)?void 0:a.message:"")}),(0,n.jsx)(h.A,{id:"phone",type:"number",placeholder:"No. handphone pembeli",isInvalid:!!(null==K?void 0:K.phone),label:"Nomor handphone pembeli",className:"!h-12 [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",...O("phone",{pattern:{value:f.ph,message:"Masukkan no handphone Anda dengan benar"}}),error:"".concat((null==K||null==(t=K.phone)?void 0:t.message)?null==K||null==(c=K.phone)?void 0:c.message:"")}),C&&(0,n.jsx)(u.A,{className:"py-2",children:(0,n.jsx)(d.A,{variant:"danger",children:C})})]}),(0,n.jsx)(s.so,{className:"w-full",justify:"center",children:(0,n.jsx)(m.A,{disabled:y||!I||!H,size:"x-large",className:A?"w-full !h-12":"w-[396px]",type:"submit",isLoading:y,children:"Klaim"})})]})]})}var w=a(90176),y=a(61419),k=a(53589),C=a(13780),P=a(36629),O=a(48230),E=a.n(O),S=a(89099);let Q=function(e){let{isOpen:l,onClose:a}=e,s=(0,S.useRouter)();return(0,n.jsx)(k.A,{isOpen:l,onClose:a,closeOnOverlayClick:!0,header:(0,n.jsx)(u.A,{className:"flex items-center content-end justify-end -mx-5
1-mt-3",children:(0,n.jsx)(y.A,{ariaLabel:"Close",variant:"ghost",size:"large",onClick:a,icon:(0,n.jsx)(p.A,{size:"large",name:"close"})})}),children:(0,n.jsxs)(u.A,{className:"flex flex-col items-center gap-8 pb-6",children:[(0,n.jsx)(C.A,{src:"/illustration/claim-transaction/verification.svg",width:182,height:182}),(0,n.jsxs)(u.A,{className:"flex flex-col items-center gap-4",children:[(0,n.jsx)(w.A,{className:"text-[20px] font-bold text-center",children:f.H7}),(0,n.jsx)(P.A,{className:"text-sm font-normal text-center",children:f.Ss})]}),(0,n.jsx)(u.A,{className:"flex w-full",children:(0,n.jsx)(E(),{href:"/myeraspace/point-history",className:"flex-grow flex justify-center",children:(0,n.jsx)(m.A,{className:"text-sm font-bold py-3 px-7 w-full",onClick:()=>s.push(f.R7.dashboard),children:"Cek akun"})})})]})})};var z=a(10230),T=a(39530);function _(){var e,l,a;let c=(0,t.A)(!1),i=(0,o.md)(r.bV),d=(0,z.q)("erafone-tnc-retro-klaim",!1),u=(0,j.useMemo)(()=>{var e,l,a;return null==d||null==(a=d.data)||null==(l=a.data)||null==(e=l.items)?void 0:e.content},[null==d||null==(a=d.data)||null==(l=a.data)||null==(e=l.items)?void 0:e.content]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(A,{onSuccess:c.onOpen}),(0,n.jsx)(s.az,{className:"opacity-80 w-full border-b-[1px] border-gray-300"}),(0,n.jsxs)(s.az,{className:(0,N.QP)("flex flex-col w-full items-start justify-evenly",i?"gap-5":"gap-8"),children:[(0,n.jsx)(s.az,{className:(0,N.QP)("flex w-full font-semibold justify-center",i?"text-2xl":"text-[36px]"),children:"Syarat & Ketentuan"}),(0,n.jsx)(s.az,{dangerouslySetInnerHTML:(0,T.BW)(u||"")})]}),(0,n.jsx)(Q,{onClose:c.onClose,isOpen:c.isOpen})]})}},57871:(e,l,a)=>{a.d(l,{A:()=>f});var n=a(37876),s=a(11701),t=a(14232),r=a(29573),o=a(59641),c=a(7052),i=a(31802),d=a(90176),u=a(53652),m=a(13780),x=a(36629),h=a(14572),p=a(13685);function f(e){let{name:l,options:a,className:f,value:b,checkValue:g,defaultValue:j,placeholder:v,label:N,onChange:A,onCheckChange:w,isMobile:y,mobileHeader:k="Select",mobileIcon:C="close",withReset:P,withComplete:O,arrowPosition:E="left",error:S,placeholderClassName:Q,noBottomSheet:z=!1}=e,{isOpen:T,onOpen:_,onClose:L}=(0,s.A)(),[K,I]=(0,t.useState)(),[H,M]=(0,t.useState)(g||[]),R=(0,t.useRef)(null),D=(0,t.useMemo)(()=>{var e;return(null==a?void 0:a.filter(e=>e.value===b))&&(null==a?void 0:a.filter(e=>e.value===b).length)>0&&(null==a||null==(e=a.filter(e=>e.value===b)[0])?void 0:e.label)},[a,b]),F=S&&""!==S&&"border-red-500";(0,h.A)(R,()=>{y||L()}),(0,t.useEffect)(()=>{if(A){var e;j?A(j):A(a&&a.length>0&&(null==(e=a[0])?void 0:e.value)||"")}},[j]),(0,t.useEffect)(()=>{I(b),O||L(),y||L()},[b]),(0,t.useEffect)(()=>{g&&M(g)},[g]),(0,t.useEffect)(()=>{w&&w(H)},[H]);let q=e=>{let{value:a,label:s,className:t,image:c,type:i}=e;return(0,n.jsx)("button",{onClick:()=>{A&&A(a)},className:(0,r.QP)("w-full hover:bg-gray-100 py-1 pr-8",t),name:"".concat(l,"-").concat(i),children:(0,n.jsxs)(o.A,{className:"flex gap-[5px]",children:[(0,n.jsx)(o.A,{className:(0,r.QP)("w-[3px] h-auto bg-primary rounded-r-sm z-10",a===K?"visible":"invisible")}),(0,n.jsxs)(o.A,{className:"flex items-center",children:[c&&(0,n.jsx)(m.A,{src:c,width:24,height:24}),(0,n.jsx)(x.A,{className:"text-sm p-2 gap-2 whitespace-nowrap",children:s})]})]})})},B=(e,l)=>{let{id:a,type:s,value:t,label:c,className:i}=e;return(0,n.jsxs)(o.A,{className:"flex items-center py-2 px-4 gap-2 w-full",children:[(0,n.jsx)("input",{type:s,id:"".concat(a,"-").concat(s,"-").concat(t),onChange:()=>{M(H.map((e,a)=>a===l?""!==e?"":t:e))},value:t,checked:H.indexOf(t)>-1,className:"rounded-sm outline-none outline-0 appearance-none checked:bg-primary-darker checked:hover:bg-primary-lighter checked:focus:bg-primary focus:outline-none focus:outline-0 focus:ring-0 focus:ring-offset-0"}),(0,n.jsx)("label",{htmlFor:"".concat(a,"-").concat(s,"-").concat(t),className:(0,r.QP)("w-full whitespace-nowrap",i),children:c})]})};return(0,n.jsxs)(o.A,{className:"flex flex-col gap-1",children:[(0,n.jsx)(x.A,{className:"font-semibold text-sm",children:N}),(0,n.jsxs)("section",{className:(0,r.QP)("group relative inline-block",f),ref:R,children:[(0,n.jsxs)("button",{id:l,name:l,className:(0,r.QP)("gap-3 text-black pointer-events-auto border-[1px] border-gray-200 bg-white hover:bg-gray-100 focus:ring-2 focus:ring-gray-300 font-medium rounded-lg text-sm px-3 sm:px-4 py-2 sm:py-2.5 text-center inline-flex items-center w-full",F),type:"button",onClick:()=>{T?L():_()},children:["left"===E&&(0,n.jsx)(u.A,{name:T?"chevron-up":"chevron-down",size:y?"x-small":"small",className:"text-gray-500"}),(0,n.jsx)(x.A,{className:(0,r.QP)(Q,""===b?"text-gray font-normal":"text-black","whitespace-nowrap text-xs"),children:v||D}),"right"===E&&(0,n.jsx)(u.A,{name:T?"chevron-up":"chevron-down",size:y?"x-small":"small",className:"text-gray-500 ml-auto"})]}),y&&!z?(0,n.jsxs)(p.A,{header:{label:k,icon:C,iconOnClick:L},isOpen:T,onClose:L,children:[(0,n.jsx)("ul",{className:"flex flex-col gap-4",children:a.map((e,s)=>{var c,i;let{id:u,className:h,label:p,type:f="button",header:b}=e,g=null==(i=a[s])||null==(c=i.className)?void 0:c.includes("hidden"),j=s<a.length-1&&!g?"border-b-[1px] border-gray-100":"";return(0,n.jsxs)(t.Fragment,{children:[b&&(0,n.jsx)(d.A,{className:"text-sm font-bold px-4",children:b}),(0,n.jsx)("li",{className:(0,r.QP)("flex flex-row",j),children:"button"===f?q(e):"radio"===f?(e=>{let{id:a,type:s,value:t,label:c,subLabel:i,className:d,bottomElement:u,image:h}=e;return(0,n.jsxs)("button",{className:"flex flex-col w-full",onClick:()=>{A&&A(t)},children:[(0,n.jsxs)(o.A,{className:(0,r.QP)("flex items-center w-full px-1",d),children:[(0,n.jsxs)("label",{htmlFor:"".concat(a,"-").concat(s,"-").concat(t),className:"w-full flex flex-col gap-1 py-2",children:[(0,n.jsxs)(o.A,{className:"flex items-center gap-2",children:[h&&(0,n.jsx)(m.A,{src:h,width:24,height:24}),(0,n.jsx)(x.A,{className:"text-base font-semibold text-left whitespace-nowrap",children:c})]}),(0,n.jsx)(x.A,{className:"text-left whitespace-nowrap",children:i})]}),(0,n.jsx)("input",{type:s,id:"".concat(a,"-").concat(s,"-").concat(t),value:t,name:"".concat(l,"-").concat(s),checked:K===t,className:"rounded-lg outline-none outline-0 appearance-none checked:bg-primary-darker checked:hover:bg-primary-lighter checked:focus:bg-primary focus:outline-none focus:outline-0 focus:ring-0 focus:ring-offset-0"})]}),u]})})(e):"checkbox"===f?B(e,s):(0,n.jsx)("div",{role:f,className:h,children:p})})]},u)})}),(0,n.jsxs)(o.A,{className:"flex items-center justify-evenly w-full gap-2 pt-2",children:[P&&(0,n.jsx)(c.A,{className:"!flex-grow text-primary",variant:"ghost",onClick:()=>{M(a.map(e=>e.value))},children:"Reset"}),O&&(0,n.jsx)(c.A,{className:"!flex-grow",onClick:L,children:"Terapkan"})]})]}):(0,n.jsx)(i.A,{id:l,className:(0,r.QP)("w-full min-w-fit absolute bg-white text-base z-10 list-none divide-y divide-gray-100 rounded shadow-md drop-shadow-md",T?"block":"hidden"),children:(0,n.jsx)("ul",{className:"flex flex-col rounded-lg py-2",children:a.map((e,l)=>{let{id:a,className:s="whitespace-nowrap flex gap-2 p-2",label:o,type:c="button",header:i}=e;return(0,n.jsxs)(t.Fragment,{children:[i&&(0,n.jsx)(d.A,{className:"text-sm font-bold p-2",children:i}),(0,n.jsx)("li",{className:(0,r.QP)("flex flex-row gap-[5px]"),children:"button"===c?q(e):"checkbox"===c?B(e,l):(0,n.jsx)("div",{role:c,className:(0,r.QP)("px-4 py-2",s),children:o})})]},a)})})})]}),S&&""!==S&&(0,n.jsx)(x.A,{className:"text-red-500",children:S})]})}}}]);
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.