1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[13454],{13454:(e,s,l)=>{l.r(s),l.d(s,{default:()=>F});var t=l(95155),a=l(47875),r=l(12115),n=l(64269),d=l(3998),i=l(86948),c=l(41052),x=l(65142),o=l(91708),m=l(86091),p=l(13744),u=l(66280),h=l(66710),j=l(15239),f=l(73457),b=l(61145);function g(e){var s,l,a,n,g,N,y;let{product:w}=e,[v,_]=(0,r.useState)("1"),[E,C]=(0,r.useState)("1"),{form:D,isSubmitting:k,wIsAutoRotate:S,totalPrice:I,originTotalPrice:T,openLogin:F,payload:A,paymentModal:V,setPaymentModal:M,onSubmit:U}=(0,h.r)({product:w}),z=D.watch("dayOfUse"),{rulesByCategory:R}=(0,u.S1)(),B=(null==(s=w.category)?void 0:s.id)?R[w.category.id]:void 0,q=null==B?void 0:B.find(e=>{let s="Infinity"===e.maxDay?1/0:Number(e.maxDay);return z>=e.minDay&&z<=s}),O=Math.round(Number(null!=(n=w.price)?n:0)*(null!=(g=null==q?void 0:q.discount)?g:1)),J=!!q&&O<Number(null!=(N=w.price)?N:0);return(0,t.jsxs)(i.Zp,{className:"relative w-full gap-0 overflow-hidden rounded-lg border-none pt-0",children:[(0,t.jsx)(i.Wu,{className:"px-0",children:(0,t.jsx)(c.lV,{...D,children:(0,t.jsx)("form",{onSubmit:D.handleSubmit(U),children:(0,t.jsxs)("div",{className:"grid grid-cols-1",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsx)("p",{className:"text-xl font-semibold",children:null==(l=w.category)?void 0:l.name}),(0,t.jsxs)("p",{className:"text-primary flex items-baseline gap-2 text-3xl font-semibold",children:[p.A.formatNum(O),"Ä",(0,t.jsxs)("span",{className:"text-base",children:["/",null==w||null==(a=w.category)?void 0:a.unit]}),J?(0,t.jsxs)("span",{className:"text-sm font-bold text-[#9C9C9C] line-through",children:[p.A.formatNum(Number(null!=(y=null==w?void 0:w.price)?y:0)),"Ä"]}):null]})]}),(0,t.jsx)("span",{className:"mt-2 text-sm font-normal",children:null==w?void 0:w.description})]}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsx)("p",{className:"text-base font-semibold",children:"Tá»ng quan"})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"flex w-full justify-between",children:[(0,t.jsx)("span",{className:"block",children:"Kiá»u mạng:"}),(0,t.jsx)("span",{className:"text-primary block",children:"C\xe1p quang"})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"flex w-full justify-between",children:[(0,t.jsx)("span",{className:"text-text-blur block",children:"IPv4 sạch"}),(0,t.jsx)("span",{className:"block",children:"Unlimited Bandwidth"})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("div",{className:"flex w-full justify-between",children:[(0,t.jsx)("p",{className:"text-text-blur my-auto flex-none",children:"Nh\xe0 mạng:"}),(0,t.jsxs)("div",{className:"grid grid-cols-3",children:[(0,t.jsx)(j.default,{src:"/images/viettel.png",width:0,height:0,sizes:"100vw",className:"my-auto w-full max-w-12",alt:""}),(0,t.jsx)(j.default,{src:"/images/fpt.png",width:0,height:0,sizes:"100vw",className:"my-auto w-full max-w-12",alt:""}),(0,t.jsx)(j.default,{src:"/images/vnpt.png",width:0,height:0,sizes:"100vw",className:"my-auto w-full max-w-12",alt:""})]})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"flex w-full justify-between",children:[(0,t.jsxs)("span",{className:"text-text-blur block",children:["Thá»i gian Äá»i IP tá»i thiá»u"," "]}),(0,t.jsxs)("span",{className:"block",children:[(0,t.jsx)("span",{className:"text-primary",children:"60"})," gi\xe2y / lần"]})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"flex w-full justify-between",children:[(0,t.jsx)("span",{className:"text-text-blur block",children:"Giữ IP tá»i Äa"}),(0,t.jsxs)("span",{className:"block",children:[(0,t.jsx)("span",{className:"text-primary",children:"30"}),"ph\xfat"]})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("p",{className:"text-text-blur flex w-full justify-between",children:["Vá» tr\xed ",(0,t.jsx)("span",{className:"text-blue-500",children:"Ngẫu nhi\xean"})]})}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsx)("p",{className:"text-base font-semibold",children:"T\xf9y chá»nh"})}),(0,t.jsx)(c.zB,{control:D.control,name:"dayOfUse",render:e=>{var s,l;let{field:a}=e;return(0,t.jsxs)(c.eI,{className:"grid grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(c.lR,{className:"text-text-blur flex items-center gap-2",children:"Sá» dụng theo"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.MJ,{children:(0,t.jsx)(x.p,{step:1,min:1,type:"number",placeholder:"Ng\xe0y sá» dụng",...a,value:v,onKeyDown:m.Y$,onChange:e=>(0,m.Wj)({form:D,name:"dayOfUse",nextValue:e.target.value,setInputValue:_,onValueChange:a.onChange})})}),(0,t.jsx)("span",{children:(null!=(l=null==(s=w.category)?void 0:s.unit)?l:"ng\xe0y").replace(/^./,e=>e.toUpperCase())})]}),(0,t.jsx)(c.C5,{className:"col-start-2"})]})}}),(0,t.jsx)(c.zB,{control:D.control,name:"quantity",render:e=>{let{field:s}=e;return(0,t.jsxs)(c.eI,{className:"grid grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(c.lR,{className:"text-text-blur flex items-center gap-2",children:"Sá» lượng"}),(0,t.jsx)(c.MJ,{children:(0,t.jsx)(x.p,{type:"number",step:1,min:1,placeholder:"Sá» lượng",...s,value:E,onKeyDown:m.Y$,onChange:e=>(0,m.Wj)({form:D,name:"quantity",nextValue:e.target.value,setInputValue:C,onValueChange:s.onChange})})}),(0,t.jsx)(c.C5,{className:"col-start-2"})]})}}),(0,t.jsx)(c.zB,{control:D.control,name:"user",render:e=>{let{field:s}=e;return(0,t.jsxs)(c.eI,{className:"grid grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(c.lR,{className:"text-text-blur flex items-center gap-2",children:"T\xe0i khoản"}),(0,t.jsx)(c.MJ,{children:(0,t.jsx)(x.p,{disabled:!0,placeholder:"T\xe0i khoản",...s})}),(0,t.jsx)(c.C5,{className:"col-start-2"})]})}}),(0,t.jsx)(c.zB,{control:D.control,name:"password",render:e=>{let{field:s}=e;return(0,t.jsxs)(c.eI,{className:"grid grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(c.lR,{className:"text-text-blur flex items-center gap-2",children:"Máºt khẩu"}),(0,t.jsx)(c.MJ,{children:(0,t.jsx)(x.p,{placeholder:"random",...s})}),(0,t.jsx)(c.C5,{className:"col-start-2"})]})}}),(0,t.jsx)(c.zB,{control:D.control,name:"isAutoRotate",render:e=>{let{field:s}=e;return(0,t.jsxs)(c.eI,{className:"grid grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(c.lR,{className:"text-text-blur flex items-center gap-2",children:"Tá»± Äá»ng xoay"}),(0,t.jsx)(c.MJ,{children:(0,t.jsx)(f.S,{checked:s.value,onCheckedChange:s.onChange,className:"border-black"})}),(0,t.jsx)(c.C5,{className:"col-start-2"})]})}}),(0,t.jsx)(c.zB,{control:D.control,name:"rotateInterval",render:e=>{let{field:s}=e;return(0,t.jsxs)(c.eI,{className:"px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsxs)("div",{className:"grid grid-flow-col grid-cols-[180px_1fr] gap-4 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(c.lR,{className:"text-text-blur flex items-center gap-2",children:"Thá»i gian (ph\xfat)"}),(0,t.jsx)(c.MJ,{children:(0,t.jsx)(x.p,{step:1,min:0,disabled:!S,type:"number",placeholder:"1",...s,onChange:e=>s.onChange(e.target.value?+e.target.value:"")}
1)})]}),(0,t.jsx)(c.C5,{})]})}}),(0,t.jsxs)("div",{className:"flex flex-1 flex-row justify-between gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)("p",{children:"Th\xe0nh tiá»n:"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsxs)("p",{className:"text-primary font-bold",children:[p.A.formatNum(null!=I?I:""),"Ä"]}),T&&I&&Number(T)>Number(I)?(0,t.jsxs)("span",{className:"text-sm font-bold text-[#9C9C9C] line-through",children:[p.A.formatNum(T),"Ä"]}):null]})]}),(0,t.jsx)(d.$,{type:"submit",disabled:k,className:"mx-2 mt-5 h-12 cursor-pointer",children:"Mua h\xe0ng"})]})})})}),F&&(0,t.jsx)(o.A,{}),(0,t.jsx)(b.A,{open:V,onClose:()=>M(!1),payload:A,formParent:D,redirect:"/proxies-xoay"})]})}var N=l(23117),y=l(10951),w=l(75507),v=l(22544),_=l(96199),E=l(66942);function C(e){let{products:s}=e,{data:l,status:a}=(0,_.wV)(),[n,i]=(0,r.useState)(!1),[x,h]=(0,r.useState)({}),[g,C]=(0,r.useState)(!1),[D,k]=(0,r.useState)({}),[S,I]=(0,r.useState)({});(0,r.useEffect)(()=>{"authenticated"===a&&i(!1)},[a]),(0,r.useEffect)(()=>{k(e=>(0,m.UU)(s.map(e=>e.id),e)),I(e=>(0,m.UU)(s.map(e=>e.id),e))},[s]);let T={dayOfUse:{},quantity:{},protocolType:{},user:{},password:{},rotateInterval:{},isAutoRotate:{},isCdk:{}};s.forEach(e=>{T.dayOfUse[e.id]=1,T.quantity[e.id]=1,T.protocolType[e.id]="HTTP",T.user[e.id]="random",T.password[e.id]="",T.isAutoRotate[e.id]=!1,T.rotateInterval[e.id]=1,T.isCdk[e.id]=!1});let F=(0,v.mN)({resolver:(0,E.u)(m.EC),defaultValues:T,mode:"onChange",reValidateMode:"onChange"}),{formState:{isSubmitting:A}}=F,V=F.watch("dayOfUse"),M=F.watch("isAutoRotate"),{rulesByCategory:U}=(0,u.S1)();async function z(e,s){var t,a,r,n;if(!(null==l||null==(t=l.user)?void 0:t.accessToken))return void i(!0);let d=null!=(r=e.quantity[s.id])?r:1,c=null!=(n=e.dayOfUse[s.id])?n:1;for(let s in e.password)e.password[s]&&"random"!==e.password[s].toLowerCase()||(e.password[s]=btoa(Math.random().toString()).substring(12).toLowerCase());let x=(null==(a=s.category)?void 0:a.id)?U[s.category.id]:void 0,o=(0,w.Zz)({price:s.price,quantity:d,days:c,discountRules:x});h({products:[{provider:s.provider,product:{id:s.id},protocolType:e.protocolType[s.id],user:e.user[s.id],password:e.password[s.id],rotateInterval:e.rotateInterval[s.id],isAutoRotate:e.isAutoRotate[s.id],isCdk:e.isCdk[s.id],quantity:d,dayOfUse:c,total:o}],total:o}),C(!0)}return(0,r.useEffect)(()=>{s.forEach(e=>{(null==M?void 0:M[e.id])===!0?F.setValue("rotateInterval.".concat(e.id),1):F.setValue("rotateInterval.".concat(e.id),0)})},[JSON.stringify(M),s,F]),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"hidden w-full xl:block",children:[(0,t.jsx)("p",{className:"sr-only",children:"Proxy xoay"}),(0,t.jsx)(c.lV,{...F,children:(0,t.jsx)("form",{children:(0,t.jsx)("div",{className:"flex w-full justify-center",children:(0,t.jsx)("div",{className:"mx-auto w-full overflow-x-auto rounded-xl bg-(--background) px-5 py-3 shadow-sm xl:max-w-[1232px]",children:(0,t.jsxs)("table",{className:"w-full min-w-[1040px] table-fixed border-collapse text-sm",children:[(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{className:"w-[240px]"}),s.map(e=>(0,t.jsx)("col",{style:{width:"calc((100% - 240px) / ".concat(s.length,")")}},e.id))]}),(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"w-[280px] p-3 text-left font-medium"}),s.map(e=>{var s,l,a,r,n,d;let i=(null==(s=e.category)?void 0:s.id)?U[e.category.id]:void 0,c=null!=(r=null==V?void 0:V[e.id])?r:1,x=null==i?void 0:i.find(e=>{let s="Infinity"===e.maxDay?1/0:Number(e.maxDay);return c>=e.minDay&&c<=s}),o=Math.round(Number(null!=(n=null==e?void 0:e.price)?n:0)*(null!=(d=null==x?void 0:x.discount)?d:1));return(0,t.jsx)("th",{className:"bg-(--background) px-3 py-4 text-center",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[260px] flex-col items-start justify-start",children:[(0,t.jsx)("div",{className:"flex w-full justify-start text-base font-semibold text-(--text-normal)",children:null==e||null==(l=e.category)?void 0:l.name}),(0,t.jsxs)("div",{className:"text-primary flex w-full flex-wrap items-baseline justify-start gap-1 text-3xl font-semibold",children:[p.A.formatNum
1(o),"Ä",(0,t.jsxs)("span",{className:"text-base font-normal",children:["/",null==e||null==(a=e.category)?void 0:a.unit]})]})]})},null==e?void 0:e.id)})]})}),(0,t.jsxs)("tbody",{children:[(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:(null==s?void 0:s.length)+1,className:"bg-(--background) px-3 py-3 text-left text-base font-semibold",children:"Tá»ng quan"})}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t-2 border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Kiá»u mạng"}),s.map(e=>(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-start text-(--primary)",children:"C\xe1p quang"},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"IPv4 sạch"}),s.map(e=>(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-start",children:"Unlimited Bandwidth"},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Nh\xe0 mạng"}),s.map(e=>(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-start",children:(0,t.jsxs)("div",{className:"flex items-center gap-5",children:[(0,t.jsx)(j.default,{src:"/images/viettelTemplate.png",width:59,height:32,alt:"viettel",className:"h-5 w-auto object-contain"}),(0,t.jsx)(j.default,{src:"/images/fptTemplate.png",width:59,height:32,alt:"fpt",className:"h-5 w-auto object-contain"}),(0,t.jsx)(j.default,{src:"/images/vnptTemplate.png",width:59,height:32,alt:"vnpt",className:"h-5 w-auto object-contain"})]})},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Thá»i gian Äá»i IP tá»i thiá»u"}),s.map(e=>(0,t.jsxs)("td",{className:"border-t border-b px-3 py-3 text-start",children:[(0,t.jsx)("span",{className:"text-(--primary)",children:"60"})," gi\xe2y / lần"]},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Thá»i gian giữ IP tá»i Äa"}),s.map(e=>(0,t.jsxs)("td",{className:"border-t border-b px-3 py-3 text-start",children:[(0,t.jsx)("span",{className:"text-(--primary)",children:"30"})," ph\xfat"]},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Vá» tr\xed"}),s.map(e=>(0,t.jsx)("td",{className:"border-t border-b px-3 py-3 text-start text-(--success)",children:"Ngẫu nhi\xean"},e.id))]}),(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:s.length+1,className:"bg-(--background) px-3 py-4 pt-6 text-left text-base font-semibold",children:"T\xf9y chá»nh"})}),(0,t.jsxs)("tr",{className:"border-t border-b",children:[(0,t.jsx)("td",{className:"px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Sá» dụng theo"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-center",children:(0,t.jsx)(c.zB,{control:F.control,name:"dayOfUse.".concat(e.id),render:s=>{var l,a;let{field:r,fieldState:n}=s;return(0,t.jsx)(c.eI,{children:(0,t.jsx)(c.MJ,{children:(0,t.jsxs)("div",{className:"space-y-1 text-start",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(N.p,{step:1,min:1,type:"number",useCustomStepper:!0,className:"focus-visible:ring-primary/50 h-10 w-28 border pl-3 text-black focus-visible:ring-[3px]",placeholder:"Ng\xe0y sá» dụng",...r,value:null!=(a=D[e.id])?a:"",onKeyDown:m.Y$,onChange:s=>{(0,m.Av)({form:F,name:"dayOfUse.".concat(e.id),nextValue:s.target.value,rowId:e.id,setInputValues:k,onValueChange:r.onChange})}}),(0,t.jsx)("span",{children:null==e||null==(l=e.category)?void 0:l.unit})]}),n.error?(0,t.jsx)(c.C5,{}):null]})})})}})},e.id))]}),(0,t.jsxs)("tr",{className:"border-b",children:[(0,t.jsx)("td",{className:"px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Sá» lượng"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-center",children:(0,t.jsx)(c.zB,{control:F.control,name:"quantity.".concat(e.id),render:s=>{var l;let{field:a,fieldState:r}=s;return(0,t.jsx)(c.eI,{children:(0,t.jsx)(c.MJ,{children:(0,t.jsxs)("div",{className:"space-y-1 text-start",children:[(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsx)(N.p,{step:1,min:1,type:"number",useCustomStepper:!0,className:"focus-visible:ring-primary/50 h-10 w-28 border pl-3 text-black focus-visible:ring-[3px]",placeholder:"Sá» lượng",...a,value:null!=(l=S[e.id])?l:"",onKeyDown:m.Y$,onChange:s=>{(0,m.Av)({form:F,name:"quantity.".concat(e.id),nextValue:s.target.value,rowId:e.id,setInputValues:I,onValueChange:a.onChange})}})}),r.error?(0,t.jsx)(c.C5,{}):null]})})})}})},e.id))]}),(0,t.jsxs)("tr",{className:"border-b",children:[(0,t.jsx)("td",{className:"px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"T\xe0i khoản"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-center",children:(0,t.jsx)(c.zB,{control:F.control,name:"user.".concat(e.id),render:e=>{let{field:s}=e;return(0,t.jsx)(c.eI,{children:(0,t.jsx)(c.MJ,{children:(0,t.jsx)(N.p,{disabled:!0,placeholder:"T\xean t\xe0i khoản",className:"focus-visible:border-ring focus-visible:ring-ring/50 h-10 w-full max-w-[270px] border pl-3 text-[#3C3C43]/60 focus-visible:ring-[3px]",...s,value:"string"==typeof s.value?s.value:""})})})}})},e.id))]}),(0,t.jsxs)("tr",{className:"border-b",children:[(0,t.jsx)("td",{className:"px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Máºt khẩu"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-center",children:(0,t.jsx)(c.zB,{control:F.control,name:"password.".concat(e.id),render:e=>{let{field:s}=e;return(0,t.jsx)(c.eI,{children:(0,t.jsx)(c.MJ,{children:(0,t.jsx)(N.p,{placeholder:"random",className:"focus-visible:ring-primary/50 placeholder:text-text-blur h-10 w-full max-w-[270px] border pl-3 focus-visible:ring-[3px]",...s,value:"string"==typeof s.value?s.value:""})})})}})},e.id))]}),(0,t.jsxs)("tr",{className:"border-b",children:[(0,t.jsx)("td",{className:"px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Tá»± Äá»ng xoay"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-start",children:(0,t.jsx)(c.zB,{control:F.control,name:"isAutoRotate.".concat(e.id),render:e=>{let{field:s}=e;return(0,t.jsx)(c.eI,{children:(0,t.jsx)(c.MJ,{children:(0,t.jsx)(f.S,{className:"accent-primary h-4 w-4",checked:!!s.value,onCheckedChange:s.onChange})})})}})},e.id))]}),(0,t.jsxs)("tr",{className:"border-b",children:[(0,t.jsx)("td",{className:"px-3 py-3 text-sm font-semibold text-(--text-blur)",children:"Thá»i gian (ph\xfat)"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-center",children:(0,t.jsx)(c.zB,{control:F.control,name:"rotateInterval.".concat(e.id),render:s=>{var l;let{field:a}=s;return(0,t.jsx)(c.eI,{children:(0,t.jsx)(c.MJ,{children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(N.p,{...a,step:1,min:0,type:"number",useCustomStepper:!0,placeholder:"0",className:"focus-visible:ring-primary/50 h-10 w-28 border pl-3 text-black focus-visible:ring-[3px]",value:void 0===a.value?"":String(null!=(l=a.value)?l:1),disabled:!(null==M?void 0:M[e.id]),onChange:e=>a.onChange(e.target.value?+e.target.value:" ")}),(0,t.jsx)(c.C5,{})]})})})}})},e.id))]}),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"w-full px-3 py-3 font-medium"}),s.map(e=>(0,t.jsx)("td",{className:"px-3 py-3 text-start",children:(0,t.jsxs)(d.$,{type:"button",onClick:()=>F.handleSubmit(s=>z(s,e))(),disabled:A,className:"group/menubutton bg-background border-primary h-12 w-full max-w-[288px] curs
1or-pointer border",children:[(0,t.jsx)(y.F.CartIcon,{className:"text-primary group-hover/menubutton:text-primary-foreground mr-2 h-5 w-5"}),(0,t.jsx)("div",{className:"group-hover/menubutton:text-primary-foreground text-primary font-semibold",children:"Mua h\xe0ng"})]})},e.id))]})]})]})})})})}),n&&(0,t.jsx)(o.A,{onCallBack:()=>i(!1)}),(0,t.jsx)(b.A,{open:g,onClose:()=>C(!1),payload:x,formParent:F,redirect:"/proxies-xoay"})]})})}let D=[{id:"day",label:"G\xf3i 1 ng\xe0y"},{id:"week",label:"G\xf3i 1 tuần"},{id:"month",label:"G\xf3i 1 th\xe1ng"}];function k(e){let{products:s}=e,[l,a]=(0,r.useState)("day"),d={day:s[0],week:s[1],month:s[2]};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(C,{products:s}),(0,t.jsxs)("div",{className:"mx-auto flex w-full min-w-0 max-w-[480px] flex-col items-center gap-4 py-2 sm:gap-5 sm:py-4 xl:hidden",children:[(0,t.jsx)("p",{className:"text-text-normal w-full text-center text-xl font-semibold sm:text-2xl",children:"Proxy xoay"}),(0,t.jsx)("div",{className:"flex w-full min-w-0 justify-center gap-2 overflow-x-auto rounded-lg bg-[color-mix(in_oklab,var(--primary),white_94%)] p-2 sm:max-w-[400px] sm:gap-3 sm:px-3 sm:py-2.5",children:D.map(e=>(0,t.jsx)("button",{type:"button",onClick:()=>a(e.id),className:(0,n.cn)("flex min-w-0 flex-1 items-center justify-center whitespace-nowrap rounded-sm px-2 py-2 text-xs hover:cursor-pointer sm:px-3 sm:py-2.5 sm:text-sm",l===e.id?"bg-primary text-primary-foreground font-semibold":"text-text-normal font-normal"),children:e.label},e.id))}),(0,t.jsx)("div",{className:"flex w-full justify-center",children:(0,t.jsx)(g,{product:d[l]})})]})]})}var S=l(49008),I=l(25597);let T="flex w-full min-w-0 max-w-full flex-col gap-3 px-3 sm:gap-4 sm:px-4 md:px-6";function F(e){let{searchParams:s,appConfig:l,initialProducts:r}=e,{products:n,isLoading:d}=(0,a.B)(void 0!==r||null==l?void 0:l.merchantId),i=null!=r?r:n;return d?(0,t.jsx)(S.A,{className:"over-table bg-background-blur",children:(0,t.jsx)("div",{className:T,children:(0,t.jsx)(I.A,{})})}):0===i.length?(0,t.jsx)(S.A,{className:"over-table bg-background-blur",children:(0,t.jsx)("div",{className:T,children:(0,t.jsx)("p",{className:"text-center",children:"Kh\xf4ng c\xf3 sản phẩm"})})}):(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(S.A,{className:"over-table bg-background-blur",children:(0,t.jsx)("div",{className:T,children:(0,t.jsx)(k,{products:i})})})})}},25597:(e,s,l)=>{l.d(s,{A:()=>i});var t=l(95155),a=l(20243);function r(){return(0,t.jsxs)("div",{className:"mx-auto hidden w-full min-w-0 max-w-full px-3 sm:px-4 md:px-6 xl:block",children:[(0,t.jsx)(a.E,{className:"mb-4 h-8 w-32"}),(0,t.jsx)("div",{className:"overflow-x-auto bg-(--background) px-6",children:(0,t.jsxs)("table",{className:"w-full border-collapse text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{className:"w-[180px] p-4 text-left font-medium"}),[1,2,3].map(e=>(0,t.jsx)("th",{className:"bg-(--background) p-4 text-center",children:(0,t.jsxs)("div",{className:"mx-auto flex max-w-[200px] flex-col items-center justify-start gap-2",children:[(0,t.jsx)(a.E,{className:"h-6 w-24"}),(0,t.jsx)(a.E,{className:"h-9 w-32"}),(0,t.jsx)(a.E,{className:"h-12 w-full"})]})},e))]})}),(0,t.jsxs)("tbody",{children:[(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:4,className:"bg-(--background) p-3 text-left text-base font-semibold",children:(0,t.jsx)(a.E,{className:"h-6 w-24"})})}),[1,2,3,4,5,6].map(e=>(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"border-t border-b p-4",children:(0,t.jsx)(a.E,{className:"h-5 w-32"})}),[1,2,3].map(e=>(0,t.jsx)("td",{className:"border-t border-b p-4 text-start",children:(0,t.jsx)(a.E,{className:"h-5 w-full"})},e))]},e)),(0,t.jsx)("tr",{children:(0,t.jsx)("td",{colSpan:4,className:"bg-(--background) p-4 pt-6 text-left text-base font-semibold",children:(0,t.jsx)(a.E,{className:"h-6 w-20"})})}),[1,2,3,4,5,6].map(e=>(0,t.jsxs)("tr",{className:"border-t border-b",children:[(0,t.jsx)("td",{className:"p-4",children:(0,t.jsx)(a.E,{className:"h-5 w-28"})}),[1,2,3].map(e=>(0,t.jsx)("td",{className:"p-4 text-center",children:(0,t.jsx)(a.E,{className:"mx-auto h-10 w-24"})},e))]},e)),(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"p-4"}),[1,2,3].map(e=>(0,t.jsx)("td",{className:"p-4 text-start",children:(0,t.jsx)(a.E,{className:"mx-2 mt-5 h-10 w-[254px]"})},e))]})]})]})})]})}var n=l(86948);function d(){return(0,t.jsx)(n.Zp,{className:"relative w-full gap-0 overflow-hidden rounded-lg border-none pt-0",children:(0,t.jsx)(n.Wu,{className:"px-0",children:(0,t.jsxs)("div",{className:"grid grid-cols-1",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[(0,t.jsx)(a.E,{className:"h-7 w-32"}),(0,t.jsx)(a.E,{className:"h-9 w-28"})]}),(0,t.jsx)(a.E,{className:"mt-2 h-10 w-full"})]}),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsx)(a.E,{className:"h-6 w-24"})}),[1,2,3,4,5,6].map(e=>(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsxs)("div",{className:"flex w-full justify-between",children:[(0,t.jsx)(a.E,{className:"h-5 w-32"}),(0,t.jsx)(a.E,{className:"h-5 w-40"})]})},e)),(0,t.jsx)("div",{className:"flex flex-1 flex-row gap-2 px-2 py-5 shadow-[0_1px_0_0_#EDEDF4]",children:(0,t.jsx)(a.E,{className:"h-6 w-20"})}),[1,2,3,4,5,6].map(e=>(0,t.jsxs)("div",{className:"grid grid-flow-col grid-cols-[180px_1fr] gap-4 px-2 py-[14px] shadow-[0_1px_0_0_#EDEDF4]",children:[(0,t.jsx)(a.E,{className:"h-5 w-28"}),(0,t.jsx)(a.E,{className:"h-10 w-full"})]},e)),(0,t.jsx)(a.E,{className:"mx-2 mt-5 h-10 w-full"})]})})})}function i(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r,{}),(0,t.jsxs)("div",{className:"mx-auto flex w-full min-w-0 max-w-[480px] flex-col items-center gap-4 py-2 sm:gap-5 sm:py-4 xl:hidden",children:[(0,t.jsx)(a.E,{className:"h-8 w-32"}),(0,t.jsxs)("div",{className:"flex w-full min-w-0 justify-center gap-2 rounded-lg bg-[color-mix(in_oklab,var(--primary),white_94%)] p-2 sm:max-w-[400px] sm:gap-3 sm:px-3 sm:py-2.5",children:[(0,t.jsx)(a.E,{className:"h-9 flex-1"}),(0,t.jsx)(a.E,{className:"h-9 flex-1"}),(0,t.jsx)(a.E,{className:"h-9 flex-1"})]}),(0,t.jsx)("div",{className:"flex w-full justify-center",children:(0,t.jsx)(d,{})})]})]})}},47875:(e,s,l)=>{l.d(s,{B:()=>n});var t=l(35389),a=l(85400);let r={revalidateOnFocus:!1,revalidateOnReconnect:!1,dedupingInterval:3e5,revalidateIfStale:!1};function n(e){let{data:s,isLoading:l}=(0,a.Ay)(e?["products-rotate",e]:null,e=>{let[,s]=e;return(0,t.UF)(s)},r);return{products:null!=s?s:[],isLoading:null!=l&&l}}},66710:(e,s,l)=>{l.d(s,{r:()=>o});
1var t=l(66280),a=l(86091),r=l(75507),n=l(66942),d=l(96199),i=l(12115),c=l(22544);let x={dayOfUse:1,quantity:1,protocolType:"HTTP",user:"random",password:"",rotateInterval:0,isAutoRotate:!1,isCdk:!1};function o(e){var s,l,o;let{product:m,form:p}=e,{data:u,status:h}=(0,d.wV)(),[j,f]=(0,i.useState)("1"),[b,g]=(0,i.useState)("1"),[N,y]=(0,i.useState)("0"),w=(0,c.mN)({resolver:(0,n.u)(a._m),values:x,mode:"onChange",reValidateMode:"onChange"}),v=null!=p?p:w,{formState:{isSubmitting:_}}=v,E=v.watch("quantity"),C=v.watch("dayOfUse"),D=v.watch("isAutoRotate");(0,i.useEffect)(()=>{D?(y("1"),v.setValue("rotateInterval",1,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})):(y("0"),v.setValue("rotateInterval",0,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}))},[D,v]);let{rulesByCategory:k}=(0,t.S1)(),S=(null==m||null==(s=m.category)?void 0:s.id)?k[m.category.id]:void 0,I=Number(E),T=Number(C),F=Number.isFinite(I)&&Number.isFinite(T)&&I>=1&&T>=1,A=F?I:0,V=F?T:0,M=(0,r.Zz)({price:Number(null!=(l=null==m?void 0:m.price)?l:0),quantity:A,days:V,discountRules:S}),U=(0,r.Zz)({price:Number(null!=(o=null==m?void 0:m.originPrice)?o:0),quantity:A,days:V,hasDiscountConfig:!1}),[z,R]=(0,i.useState)(!1),[B,q]=(0,i.useState)({}),[O,J]=(0,i.useState)(!1),P=async e=>{var s;if(!(null==u||null==(s=u.user)?void 0:s.accessToken)||!(null==m?void 0:m.id))return void R(!0);let l={...e};l.password&&"random"!==l.password.toLowerCase()||(l.password=btoa(Math.random().toString()).substring(12).toLowerCase()),q({products:[{...l,provider:null==m?void 0:m.provider,product:{id:null==m?void 0:m.id}}],total:M}),J(!0)};return(0,i.useEffect)(()=>{"authenticated"===h&&R(!1)},[h,R]),{form:v,isSubmitting:_,dayOfUseInputValue:j,setDayOfUseInputValue:f,quantityInputValue:b,setQuantityInputValue:g,rotateIntervalInputValue:N,setRotateIntervalInputValue:y,wIsAutoRotate:D,totalPrice:M,originTotalPrice:U,openLogin:z,setOpenLogin:R,payload:B,paymentModal:O,setPaymentModal:J,onSubmit:P}}}}]);
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.