1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5857],{5857:function(e,a,t){t.r(a),t.d(a,{default:function(){return w}});var o=t(85893),r=t(34599),l=t(67294),i=t(98778),n=t(94929),s=t(86250),d=t(82618),c=t(46139);t(88767);let u=async e=>{let{data:a}=await c.Z.get("/games/promotions/ongoing-free-round",{params:{game_id:e}});return a};var m=t(94684),p=t(77230),x=t(24697),h=t(40645),v=t.n(h),f=t(56399),g=t(25675),y=t.n(g),b=e=>{let{label:a,value:t,checked:r,title:i,image:n,game_name:s,provider_name:d,setChecked:c}=e;return(0,o.jsxs)(l.Fragment,{children:[(0,o.jsxs)("label",{id:a,className:"jsx-767c808991717d17 "+((0,f.cn)("flex items-center justify-between bg-lx-background-600 border border-lx-outline/10 rounded-md p-2 text-sm leading-4 font-normal text-lx-text-color/50 capitalize md:hover:bg-lx-background-600/50 md:cursor-pointer transition-colors")||""),children:[(0,o.jsxs)("div",{className:"jsx-767c808991717d17 flex items-center gap-x-3",children:[(0,o.jsx)(y(),{alt:"",src:n,width:68,height:60,style:{borderRadius:"4px"}}),(0,o.jsxs)("div",{className:"jsx-767c808991717d17 flex flex-col gap-y-1",children:[(0,o.jsx)("span",{className:"jsx-767c808991717d17 text-sm font-medium text-lx-text-color",children:s}),(0,o.jsx)("span",{className:"jsx-767c808991717d17 text-[10px] font-normal text-lx-text-color/50",children:d})]})]}),(0,o.jsxs)("div",{className:"jsx-767c808991717d17 rounded-full w-4 h-4 flex flex-shrink-0 justify-center items-center relative checked:bg-gradient-to-b from-lx-primary-gradient-from via-lx-primary-gradient-via to-lx-primary-gradient-to",children:[(0,o.jsx)("input",{"aria-labelledby":a,type:"radio",name:"radio",checked:r===t,onChange:()=>{c(t)},className:"jsx-767c808991717d17 checkbox appearance-none focus:opacity-100 ring-offset-1 bg-lx-natural-black/40 ring-lx-outline/10 focus:ring-[rgba(154,109,66,1)] focus:outline-none border rounded-full border-lx-outline/10 absolute cursor-pointer w-full h-full checked:border-none checked:bg-gradient-to-b from-lx-primary-gradient-from via-lx-primary-gradient-via to-lx-primary-gradient-to"}),(0,o.jsx)("div",{className:"jsx-767c808991717d17 absolute top-0 bottom-0 left-0 right-0 m-auto check-icon border-[2px] border-lx-background-600 rounded-full w-[10px] h-[10px] z-1 bg-white"})]})]}),(0,o.jsx)(v(),{id:"767c808991717d17",children:".checkbox.jsx-767c808991717d17+.check-icon.jsx-767c808991717d17{display:none}.checkbox.jsx-767c808991717d17:checked+.check-icon.jsx-767c808991717d17{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}"})]})},j=t(19453),k=e=>{let{options:a,checked:t,hasNextPage:r,loadingMore:s,fetchNextPage:d,setChecked:c}=e,{t:u}=(0,n.$G)();return(0,o.jsxs)("div",{className:"flex flex-col gap-y-1",children:[a&&a.map((e,a)=>(0,o.jsx)(l.Fragment,{children:(0,o.jsx)("div",{className:"flex flex-col gap-y-2 mt-1",children:null==e?void 0:e.data.map(e=>(0,o.jsx)(b,{label:null==e?void 0:e.game_name,value:null==e?void 0:e._id,title:null==e?void 0:e.game_name,image:null==e?void 0:e.image,checked:t,game_name:null==e?void 0:e.game_name,provider_name:null==e?void 0:e.provider_display,setChecked:c},e._id))})},a)),s&&[1,2,3].map(e=>(0,o.jsxs)("div",{className:"card_games_promo",children:[(0,o.jsx)("div",{className:"flex-shrink-0 relative rounded overflow-hidden w-[92px] h-[62px]",children:(0,o.jsx)(j.Z,{uniqueKey:"key-".concat(e),width:"92",height:"62"})}),(0,o.jsxs)("div",{className:"flex flex-col text-sm",children:[(0,o.jsx)("div",{className:"game_name",children:(0,o.jsx)(j.Z,{uniqueKey:"key-".concat(e),width:"120",height:"15"})}),(0,o.jsx)("div",{className:"provider_name",children:(0,o.jsx)(j.Z,{uniqueKey:"key-".concat(e),width:"92",height:"15"})})]})]})),r&&(0,o.jsx)(i.Z,{type:"button",variant:"revamp-lx-secondary",disabled:s,onClick:()=>d(),className:"w-fit h-8 mx-auto mt-2 px-5",children:u(s?"text-loading":"common:text-load-more")})]})},w=()=>{var e,a;let{t}=(0,n.$G)(["common","deposit"]),{selectedPromotionDeposit:c,setSelectedPromotionDeposit:h,closeBottomSheet:v,modalData:f}=(0,r.l8)(),[g,b]=(0,l.useState)(""),[j]=(0,x.Nr)(g,300),[w,_]=(0,l.useState)(!0),[N,P]=(0,l.useState)(""),[S,Z]=(0,l.useState)(!1),[R,A]=(0,l.useState)(!1),{promotionId:E,promotionName:C,amount:T,promotionProvider:I}=null!==(a=null==f?void 0:f.deposit)&&void 0!==a?a:[],[q,O]=(0,l.useState)({}),{isFetching:K,isFetchingNextPage:F,fetchNextPage:L,hasNextPage:Y,data:z}=(0,p.Z)({limit:10,q:j,provider:I}),G=async e=>{Z(!0),A(!1);try{let a=await u(null==e?void 0:e._id);if((null==a?void 0:a.data)&&a.data.length>0&&a.data.find(a=>a.gameIDList===(null==e?void 0:e.provider_game_id))){A(!0),Z(!1);return}}catch(e){Z(!1);return}let a={deposit_amount:null!=T?T:0,game:{game_ids:[null==e?void 0:e._id],provider:null==e?void 0:e.provider,type:null==e?void 0:e.type}};await (0,d.uR)(E,a).then(a=>{var t,r,l,i;(null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.data)&&(null==a?void 0:null===(l=a.data)||void 0===l?void 0:null===(r=l.data)||void 0===r?void 0:r.can_activate)?(Z(!1),O({...q,promotionName:C,promo_id:E,game_id:null==e?void 0:e._id,game_name:null==e?void 0:e.game_name,game_image:null==e?void 0:e.image,game_provider:null==e?void 0:e.provider,game_provider_name:null==e?void 0:e.provider_name,game_type:null==e?void 0:e.type})):(_(!1),Z(!1),null===(i=(0,m.Am)())||void 0===i||i.error((0,o.jsx)("span",{className:"text-sm text-red-500 font-semibold",children:a.data.data.message})))}).catch(e=>{var a;_(!1),null===(a=(0,m.Am)())||void 0===a||a.error(e)}).finally(()=>{Z(!1)})};return(0,l.useEffect)(()=>{!function(e){if(z)for(let a of z.pages)for(let t of a.data)t._id===e&&G(t)}(N)},[N]),(0,l.useEffect)(()=>{P(null==c?void 0:c.game_id)},[]),(0,o.jsx)("div",{className:"z-[140]",children:(0,o.jsxs)("div",{className:"flex flex-col rounded-t-[20px] max-h-[calc(100vh-120px)] min-h-[calc(100vh-120px)] bg-lx-bg-layer-2 py-[20px] relative bg-lx-background-500",children:[(0,o.jsxs)("div",{className:"relative w-full flex flex-col gap-y-3 flex-shrink-0 items-center px-[18px] mb-3 border-b border-lx-outline/10",children:[(0,o.jsx)("span",{className:"text-base font-medium text-lx-text-color/50 text-center capitalize mb-3",children:null==f?void 0:null===(e=f.data)||void 0===e?void 0:e.modalTitle}),(0,o.jsx)("div",{className:"absolute right-[18px] p-[2px] rounded-full w-6 h-6 flex items-center justify-center",onClick:()=>{h(null),v()},children:(0,o.jsx)(s.R5A,{className:"w-6 h-6 text-lx-natural-white/30 active:scale-90"})})]}),(0,o.jsxs)("div",{className:"flex flex-col gap-y-2 overflow-y-auto px-[18px]",children:[(0,o.jsx)("div",{className:"flex gap-3",children:(0,o.jsxs)("div",{className:"w-full web:w-[260px] relative",children:[(0,o.jsx)("div",{className:"absolute top-3 left-3 w-5 h-5",children:(0,o.jsx)(y(),{alt:"icon search",src:"/icons/search.svg",fill:!0})}),(0,o.jsx)("input",{name:"searchgame",type:"text",placeholder:"Cari game",className:"input_primary pl-10",autoComplete:"off",spellCheck:"false",onChange:e=>b(e.target.value)})]})}),(0,o.jsx)("div",{className:"min-h-[calc(100% - 140px)] overflow-y-auto scrollbar-hide","data-body-scroll-lock-ignore":!0,children:(0,o.jsx)(k,{options:null==z?void 0:z.pages,checked:N,setChecked:P,hasNextPage:Y,fetchNextPage:L,loadingMore:F})}),(0,o.jsx)("div",{className:"flex w-full mt-8 space-x-5",children:w&&!S?(0,o.jsx)(i.Z,{type:"submit",variant:"revamp-lx-primary",className:"flex flex-row h-11 font-extrabold text-sm px-5",onClick:()=>{!function(){if(R){var e;null===(e=(0,m.Am)())||void 0===e||e.error((0,o.jsx)("span",{className:"text-sm text-lx-danger-main font-semibold",children:t("deposit:text-ongoing-freeroun
1d-error")}),{toastId:"ongoing-freeround-error"});return}h({...q}),v()}()},children:t("common:text-choose")}):(0,o.jsx)(i.Z,{type:"button",variant:"revamp-lx-secondary",className:"flex flex-row h-11 font-extrabold text-sm px-5",onClick:()=>{O({}),h(null),v()},children:S?"Loading..":t("common:text-cancel")})})]})]})})}},19453:function(e,a,t){var o=t(85893),r=t(24561);a.Z=e=>(0,o.jsx)(r.ZP,{backgroundColor:"#5c5c5c1f",foregroundColor:"#7e7e7e1f",width:e.width,height:e.height,uniqueKey:e.uniqueKey,children:(0,o.jsx)("rect",{width:e.width,height:e.height})})},77230:function(e,a,t){var o=t(76554),r=t(46139),l=t(88767);let i=async e=>{let{pageParam:a=1,queryKey:t}=e,[l,i]=t;(null==i?void 0:i.q)===null&&delete i.q;let{data:n}=await r.Z.get("".concat(o.P.GAMES,"?free-round-injectable=true&page=").concat(a),{params:i});return{data:n.data,paginatorInfo:{nextPageUrl:"",totalPage:n.total_page,totalItems:n.total_items,page:a}}};a.Z=e=>(0,l.useInfiniteQuery)([o.P.GAMES,e],i,{getNextPageParam:e=>e.paginatorInfo.page<e.paginatorInfo.totalPage&&e.paginatorInfo.page+1,keepPreviousData:!1})},82618:function(e,a,t){t.d(a,{hQ:function(){return u},ll:function(){return s},pi:function(){return c},uR:function(){return d}});var o=t(76554),r=t(46139),l=t(78444),i=t(88767);let n=e=>((null==e?void 0:e.category)==""&&delete e.category,r.Z.get("/promotions/promotions",{params:{...e,api_key:(0,l.Pi)()}})),s=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return r.Z.post("/promotions/promotions/".concat(e,"/check"),{deposit_amount:a})},d=(e,a)=>r.Z.post("/promotions/promotions/".concat(e,"/check"),a),c=()=>r.Z.post(o.P.USER_PROMOTIONS_UPDATE),u=()=>(0,i.useMutation)({mutationKey:["useQueryCheckPromo"],mutationFn:e=>{let{id:a,amount:t}=e;return s(a,t)}});a.ZP=(e,a)=>{let t=[],{isLoading:o,data:r,error:l}=(0,i.useQuery)(["GET_PROMO",e],()=>n(e),{keepPreviousData:!0,onError:e=>{a&&a(e)}});if(!o&&!l&&(null==r?void 0:r.data)){let{data:{data:e}}=r;t=e}return{isLoading:o,promotions:t,error:l}}},46139:function(e,a,t){var o=t(87066),r=t(11453),l=t(22779),i=t(55762),n=t(94684),s=t(78444),d=t(76554),c=t(96245),u=t(23845);let m=o.Z.create({timeout:3e4,headers:{Accept:"application/json","Content-Type":"application/json"}});m.interceptors.request.use(async e=>{u.Z.refreshTokenPromise&&e.url!=d.P.REFRESH_TOKEN&&await u.Z.refreshTokenPromise;let a=(0,r.L)();if(a&&e.url!=d.P.REFRESH_TOKEN&&1e3*(0,c.Z)(a).exp<Date.now()){u.Z.refreshTokenPromise=new Promise(async(e,t)=>{var o,r,s;try{let e=await m.post(d.P.REFRESH_TOKEN,{token:a}),t=null===(r=e.data)||void 0===r?void 0:null===(o=r.data)||void 0===o?void 0:o.token;if(!t)throw Error("Token not found!");l.e.set(i.RY.AuthToken,t)}catch(a){return l.e.remove(i.RY.AuthToken),location.pathname="/",null===(s=(0,n.Am)())||void 0===s||s.error("Silahkan untuk login terlebih dahulu!",{bodyStyle:{whiteSpace:"pre-wrap"},toastId:"error-response"}),e(!1)}return e(!0)});let e=await u.Z.refreshTokenPromise;if(u.Z.refreshTokenPromise=null,!e)throw new o.Z.Cancel("Operation canceled by the user.")}return a=(0,r.L)(),e.baseURL=(0,s.Lq)(),e.headers={...e.headers,Authorization:"Bearer ".concat(a||""),"x-api-key":(0,s.Pi)()},e},e=>Promise.reject(e)),m.interceptors.response.use(e=>({...e}),async e=>{var a,t,o,r,s,d,c,u,m,p,x,h,v,f;return(null==e?void 0:null===(t=e.response)||void 0===t?void 0:null===(a=t.data)||void 0===a?void 0:a.errors)&&Array.isArray(null==e?void 0:null===(r=e.response)||void 0===r?void 0:null===(o=r.data)||void 0===o?void 0:o.errors)&&(e.response.data.errorsObject=e.response.data.errors.reduce((e,a)=>(e[a.field]=a,e),{})),(null==e?void 0:null===(s=e.response)||void 0===s?void 0:s.status)===400?(location.pathname="/",null===(h=(0,n.Am)())||void 0===h||h.error("Bad Request",{bodyStyle:{whiteSpace:"pre-wrap"},toastId:"error-response"})):(null==e?void 0:null===(d=e.response)||void 0===d?void 0:d.status)===401?(l.e.remove(i.RY.AuthToken),l.e.remove(i.RY.AuthPin),l.e.remove(i.RY.User),l.e.remove(i.RY.SelectedGame),l.e.remove(i.RY.hasPin),location.pathname="/",null===(v=(0,n.Am)())||void 0===v||v.error("Silahkan untuk login terlebih dahulu!",{bodyStyle:{whiteSpace:"pre-wrap"},toastId:"error-response"})):(null==e?void 0:null===(c=e.response)||void 0===c?void 0:c.status)===503&&(location.pathname="/",null===(f=(0,n.Am)())||void 0===f||f.error("Layanan tidak tersedia",{bodyStyle:{whiteSpace:"pre-wrap"},toastId:"error-response"})),null===(x=(0,n.Am)())||void 0===x||x.error((null==e?void 0:null===(p=e.response)||void 0===p?void 0:null===(m=p.data)||void 0===m?void 0:null===(u=m.errors)||void 0===u?void 0:u._error)||"Terjadi kesalahan",{bodyStyle:{whiteSpace:"pre-wrap"},toastId:"error-response"}),Promise.reject(e.response)}),a.Z=m}}]);
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.