(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6629],{yxV4:function(e,t,n){"use strict";n.d(t,{Z:function(){return PollCard_PollCard}});var o=n("BGKE"),a=n("q1tI"),r=n("NXxl"),l=n("abax"),i=n("W3Sf"),s=n("8vDj"),d=n("LES+"),c=n("TIp3"),u=n("20a2"),p=n("dDsW"),m=n("Q7Fe"),f=n("raAP"),h=n("rEaw"),g=n("5nj8"),x=n("AeFk"),v=n("iuhU"),b=n("/Ds5"),C=n("VHY4"),Z=n.n(C);let RenderWatermark=e=>{let{opacity:t,color:n,svgContent:a,...r}=e;return(0,o.tZ)("div",{style:{opacity:t,color:n},dangerouslySetInnerHTML:{__html:a},...r})},FlipOption=e=>{let{color:t,option:n,isSelected:a,showResults:r,hasWatermarkLogo:l,watermarkContent:i,onClick:d,isTaiwanPollTypography:c=!1,className:u="",...p}=e,m=(0,s.rZ)(),f=m.colors[t]||m.colors.blue,h=f[6],g=f[6],C=f[0],w=f[1],k="radial-gradient(55.8% 157.95% at 6.7% -24.87%, ".concat(f[3]," 0%, ").concat(h," 100%)"),_="absolute inset-0 border-2 rounded-2xl flex flex-col items-center justify-center transition-all duration-500 overflow-hidden backdrop-blur-[12px] [backface-visibility:hidden] ".concat("shadow-[0px_0px_1px_0px_#0000000A,0px_0px_2px_0px_#0000000F,0px_4px_8px_0px_#0000000A]").replace(/\s+/g," "),y={svgContent:i,"data-with-watermask":l,className:"".concat(Z().watermarkContainer," absolute inset-0 pointer-events-none")};return(0,o.tZ)("a",{...p,href:"#",className:"".concat(u," ").concat(Z().flipCard," rounded-2xl h-[196px] md:h-[204px] [perspective:1000px] no-underline text-inherit block ").concat(r?"":"cursor-pointer"),onClick:e=>{e.preventDefault(),d()},children:(0,o.BX)(b.E.div,{initial:!1,animate:{rotateY:r?180:0},transition:{duration:.6,type:"spring",stiffness:200,damping:20},className:"w-full h-full relative [transform-style:preserve-3d]",children:[(0,o.BX)("div",{className:(0,v.default)("card-inner border-[--border-color] border border-solid ".concat(_),"bg-[var(--bg-color)]","".concat(r?"":"can-hover:hover:border-[--border-hover-color]")),style:{"--hover-color":t,"--border-color":"transparent","--border-hover-color":f[6],"--hover-bg":f[0],"--bg-color":r?C:a?"transparent":"#ffffff",backgroundImage:a&&!r?k:"none"},children:[(0,x.az)(RenderWatermark,{...y,key:i+a?"selected":"normal",opacity:a&&!r?.1:.6,color:a&&!r?"#ffffff":f[0]}),(0,o.tZ)("span",{className:c?"relative font-medium text-[16px] md:text-[18px] leading-[1.7] text-center transition-colors duration-400":"relative font-medium text-[17px] leading-[24px] tracking-[-0.4px] text-center transition-colors duration-400",style:{color:a&&!r?"#ffffff":"#1f2937"},children:n.text})]}),(0,o.BX)("div",{className:"".concat(_," [transform:rotateY(180deg)]"),style:{color:a?"#ffffff":g,backgroundColor:a?"transparent":C,backgroundImage:a?k:"none",borderColor:a?"transparent":w},children:[(0,x.az)(RenderWatermark,{...y,key:i+"result",opacity:a?.1:.5,color:a?"#fff":f[1]}),(0,o.BX)("div",{className:"flex flex-col gap-[16px] relative p-[10px]",children:[(0,o.BX)("span",{className:"font-bold text-[28px] leading-[34px] tracking-[-1px] text-center",children:[n.percentage,"%"]}),(0,o.tZ)("span",{className:c?"font-medium text-[16px] md:text-[18px] leading-[1.7] text-center":"font-medium text-[13px] leading-[20px] tracking-[-0.3px] text-center",children:n.text})]})]})]})})};var w=n("09QT"),k=n("unRb"),_=n("oQBk"),y=n("csLd");let B="voted_polls_data",getVotedPolls=()=>{let e=localStorage.getItem(B);if(!e)return{};try{let t=JSON.parse(e),n=Date.now(),o={};return Object.keys(t).forEach(e=>{let a=t[e],r="object"==typeof a&&"timestamp"in a?a.timestamp:a;n-r<864e5&&("object"==typeof a?"optionIds"in a&&Array.isArray(a.optionIds)?o[Number(e)]={timestamp:r,optionIds:a.optionIds.map(e=>String(e))}:"optionId"in a&&(o[Number(e)]={timestamp:r,optionIds:a.optionId?[String(a.optionId)]:[]}):o[Number(e)]={timestamp:r,optionIds:[]})}),o}catch(e){return{}}},saveVotedPoll=(e,t)=>{let n=getVotedPolls();n[e]={timestamp:Date.now(),optionIds:t.map(String)},localStorage.setItem(B,JSON.stringify(n))},N=(0,a.createContext)(null),PollProvider=e=>{var t,n,r,l,i,s,d,c;let{pollId:u,articleId:p,color:m="blue",initialData:f,children:h}=e,{state:g}=(0,y.b)(),{userInfo:x,isLoggedIn:v}=g||{},[b,C]=(0,a.useState)((null==f?void 0:f.id)?f:null),[Z,B]=(0,a.useState)(null),[S,I]=(0,a.useState)([]),[T,A]=(0,a.useState)(!1),[D,E]=(0,a.useState)(!1),[X,L]=(0,a.useState)(!1),[R,P]=(0,a.useState)(!1),[W,M]=(0,a.useState)(null),z=(0,a.useCallback)(async()=>{let e={id:String(u)};v&&(null==x?void 0:x.id)&&(e.userId=x.id);try{var t,n;let o=await (0,w.callApiNew)(_.PATHS.POLL_WIDGET.GET_RESULT,{params:e}),a=null!==(t=null==o?void 0:o.data)&&void 0!==t?t:o;if(!a)return;let r=(0,k.D)(a);if((null==r?void 0:r.id)&&C(r),v){if((null===(n=a.user_voted_options)||void 0===n?void 0:n.length)>0){A(!0),L(!0);let e=a.user_voted_options.map(e=>String(e));B(e[0]||null),I(e)}}else{let e=getVotedPolls()[u];if(e){let t=Array.isArray(e.optionIds)?e.optionIds.map(e=>String(e)):[];t.length>0&&(A(!0),L(!0),B(t[0]||null),I(t))}}}catch(e){console.error("Failed to fetch poll data",e)}},[u,v,null==x?void 0:x.id]);(0,a.useEffect)(()=>{(null==f?void 0:f.id)&&C(f),z()},[z]);let O={question:(null==b?void 0:b.question)||"",description:(null==b?void 0:b.description)||"",options:(null==b?void 0:b.options)||[],displayType:(null==b?void 0:null===(t=b.ui)||void 0===t?void 0:t.displayType)||"flip-card",hideTotalCount:null!==(c=null==b?void 0:null===(n=b.ui)||void 0===n?void 0:n.hideTotalCount)&&void 0!==c&&c,watermarkLogo:(null==b?void 0:null===(r=b.ui)||void 0===r?void 0:r.watermarkLogo)||"",totalVotes:(null==b?void 0:null===(l=b.results)||void 0===l?void 0:l.total_votes)||0,selectedOption:Z,selectedOptions:S,isMulti:(null==b?void 0:null===(i=b.ui)||void 0===i?void 0:i.isMulti)||!1,isVoted:T,isSubmitting:D,isShowingResults:X,isShaking:R,error:W,color:(null==b?void 0:null===(s=b.ui)||void 0===s?void 0:s.theme)||m,ctaBtn:null==b?void 0:null===(d=b.ui)||void 0===d?void 0:d.ctaBtn,toggleResults:()=>L(!X),setOption:e=>{if(!T){var t;(null==b?void 0:null===(t=b.ui)||void 0===t?void 0:t.isMulti)?I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]):B(e),M(null)}},submitVote:async()=>{var e,t,n,o;let a=(null==b?void 0:null===(e=b.ui)||void 0===e?void 0:e.isMulti)||!1,r=a?S:Z?[Z]:[];if(!r.length){P(!0),setTimeout(()=>P(!1),3e3);return}E(!0),M(null);try{await (0,w.callApiNew)(_.PATHS.POLL_WIDGET.POST_VOTE,{method:"POST",data:{poll_id:u,user_id:v?String((null==x?void 0:x.id)||""):"",option_ids:r,article_id:p}}),A(!0),L(!0),v||saveVotedPoll(u,r),await z()}catch(a){let e=(null==a?void 0:null===(n=a.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message)||"C\xf3 lỗi xảy ra, vui l\xf2ng thử lại.";M(e),(null==a?void 0:null===(o=a.response)||void 0===o?void 0:o.status)===400&&(A(!0),L(!0))}finally{E(!1)}}};return(0,o.tZ)(N.Provider,{value:O,children:h})},usePoll=()=>{let e=(0,a.useContext)(N);if(!e)throw Error("usePoll must be used within a PollProvider");return e};var S=n("Eso5");let ProgressOption=e=>{let{color:t,option:n,isSelected:a,showResults:r,onClick:l,isTaiwanPollTypography:i=!1,className:d="",...c}=e,u=(0,s.rZ)(),p=u.colors[t]||u.colors.blue,m=p[1],f=p[6],h=p[7];return(0,o.BX)("a",{...c,href:"#",onClick:e=>{e.preventDefault(),l()},className:"".concat(d," rounded-2xl no-underline text-inherit ").concat(a?"bg-white border-[--border-selected-color]":"hover:bg-[var(--hover-bg)] hover:border-[--border-hover-color]"," relative border-[--border-color] border border-solid p-[12px] w-full rounded-2xl overflow-hidden cursor-pointer flex items-center transition-colors duration-200 shadow-[0px_0px_1px_0px_#0000000A,0px_0px_2px_0px_#0000000F,0px_4px_8px_0px_#0000000A] backdrop-blur-[12px]"),style:{"--hover-bg":p[0],"--border-color":p[0],"--border-hover-color":p[6],"--border-selected-color":p[2]},children:[(0,o.tZ)(b.E.div,{initial:{width:0},animate:{width:r?"".concat(n.percentage,"%"):0},transition:{duration:1,ease:"easeOut"},style:{backgroundColor:m,position:"absolute",top:0,bottom:0,left:0}}),(0,o.BX)("div",{className:"relative z-10 flex w-full justify-between items-center gap-5",children:[(0,o.BX)("div",{className:"flex items-center gap-3",children:[!r&&(0,o.tZ)("div",{children:(0,o.tZ)(S.x,{sx:{width:16,height:16,borderRadius:"100%",border:"1px solid ".concat(a?f:u.colors.neutral[4]),backgroundColor:"#fff",...a&&{display:"flex",justifyContent:"center",alignItems:"center","&:before":{content:'""',display:"block",width:8,height:8,borderRadius:"100%",backgroundColor:f}}}})}),(0,o.tZ)("span",{className:i?"text-[16px] md:text-[18px] leading-[1.7] text-[#000] ".concat(a?"font-medium":""):"text-[15px] leading-[24px] tracking-[-0.3px] text-[#000] ".concat(a?"font-medium":""),children:n.text})]}),r&&(0,o.BX)("span",{className:"".concat(a?"font-bold text-[17px]":"font-medium text-[15px]"," leading-[24px] tracking-[-0.3px]"),style:{color:a?h:"#000"},children:[n.percentage,"%"]})]})]})},useInlineSvg=e=>{let[t,n]=(0,a.useState)("");return(0,a.useEffect)(()=>{if(!e)return;let t=!0,o=new AbortController,a=e.includes("?")?"".concat(e,"&t=").concat(Date.now()):"".concat(e,"?t=").concat(Date.now());return fetch(a,{signal:o.signal}).then(t=>{let n=t.headers.get("content-type");return n&&!n.includes("svg")&&console.warn("URL ".concat(e," kh\xf4ng trả về file SVG. Content-Type: ").concat(n)),t.text()}).then(o=>{if(!t)return;let a=new DOMParser,r=a.parseFromString(o,"image/svg+xml"),l=r.querySelector("svg");if(l){let e=l.querySelectorAll("script");e.forEach(e=>e.remove()),l.setAttribute("class","w-full h-full");let t=l.querySelectorAll("path, circle, rect, polygon, ellipse, g");t.forEach(e=>{e.setAttribute("fill","currentColor")}),n(l.outerHTML)}else console.error("Kh\xf4ng t\xecm thấy thẻ trong nội dung fetch được từ:",e)}).catch(e=>{"AbortError"!==e.name&&console.error("Lỗi khi fetch SVG:",e)}),()=>{t=!1,o.abort()}},[e]),t},PollCardUI=e=>{let{prefix:t,eventCategory:n}=e,{formatMessage:x}=(0,p.Z)(),{locale:v}=(0,u.useRouter)(),b=v===h.MV.Taiwan,C=(0,s.rZ)(),{question:w,description:k,options:_,isMulti:y,displayType:B,hideTotalCount:N,totalVotes:S,selectedOption:I,selectedOptions:T,setOption:A,submitVote:D,isVoted:E,isSubmitting:X,isShowingResults:L,ctaBtn:R,isShaking:P,color:W,watermarkLogo:M}=usePoll(),z=!!M,O=useInlineSvg(M),Y=z?O:'',H=(0,f.U)(),U=n||"Article Poll",trackingAction=e=>t?"".concat(t," - ").concat(e):e,j={"data-event-category":U,"data-event-action":trackingAction("Select Option"),"data-event-label":H},[G,V]=(0,a.useState)(!1),F=E||L;(0,a.useEffect)(()=>{V(P)},[P]);let handleOptionClick=e=>{A(e),V(!1)};if(!_||0===_.length)return null;let q={size:"md",color:W,styles:{label:{fontSize:"15px"}}},K=C.colors[W][0],J=(0,g.oo)(K,!0);return(0,o.tZ)(r.T,{variant:r.C.LEADGEN,children:(0,o.BX)("div",{className:"relative w-full bg-white rounded-xl p-[8px] border poll-fade-in shadow-[0px_0px_1px_0px_#0000000A,0px_2px_8px_0px_#0000000A,0px_10px_16px_0px_#0000000A]",children:[(0,o.BX)("div",{className:"relative rounded-xl p-3 md:p-6",style:{background:"linear-gradient(180deg, rgba(".concat(J.r,",").concat(J.g,",").concat(J.b,", 0.75) 0%, rgba(").concat(J.r,",").concat(J.g,",").concat(J.b,", 0.35) 50%, ").concat(C.colors.neutral[0]," 100%)")},children:[(0,o.tZ)(RenderWatermark,{opacity:.5,color:"#fff",svgContent:Y,className:"".concat(Z().pollCard," absolute top-6 right-6")}),(0,o.BX)("div",{className:"relative flex flex-col gap-3 md:gap-6",children:[(0,o.BX)("div",{className:"flex flex-col gap-[4px]",children:[(0,o.tZ)("h2",{className:b?"text-[16px] md:text-[18px] font-medium text-gray-800 leading-[1.7]":"text-[20px] font-medium text-gray-800 leading-[24px] md:leading-[28px]",children:w}),k&&(0,o.tZ)(m.GK,{content:k,className:b?"text-[14px] leading-[1.7] text-[#404040] [&_p]:text-[14px] [&_p]:leading-[1.7] [&_p]:text-[#404040]":"text-[13px] text-[#404040] leading-[16px] md:leading-[20px] [&_p]:text-[13px] [&_p]:text-[#404040] [&_p]:leading-[16px] md:[&_p]:leading-[20px]"})]}),"flip-card"===B?(0,o.tZ)("div",{className:"flex flex-wrap gap-2 justify-center",children:_.map(e=>(0,o.tZ)("div",{className:"\n flex-shrink-0 min-w-[140px] \n ".concat(_.length<=2?"w-full":"w-[calc(50%-4px)]","\n ").concat(_.length<=4?"md:flex-grow md:basis-0":"md:w-[calc(25%-6px)] md:max-w-[calc(25%-6px)]","\n "),children:(0,o.tZ)(FlipOption,{hasWatermarkLogo:z,watermarkContent:Y,color:W,option:e,isTaiwanPollTypography:b,isSelected:y?T.includes(e.id):I===e.id,showResults:F,onClick:()=>handleOptionClick(e.id),...j})},e.id))}):(0,o.tZ)("div",{className:"space-y-2",children:_.map(e=>(0,o.tZ)(ProgressOption,{color:W,option:e,isTaiwanPollTypography:b,isSelected:y?T.includes(e.id):I===e.id,showResults:F,onClick:()=>handleOptionClick(e.id),...j},e.id))})]})]}),(0,o.BX)("div",{className:"flex items-center justify-between p-[4px] mt-2",children:[(0,o.tZ)("span",{className:"text-[13px] leading-[20px] tracking-[-0.3px] text-[#8C8C8C] pl-3 md:pl-6",children:!N&&(0,o.tZ)(o.HY,{children:x({id:"pollWidget.voteNumber"},{number:S})})}),(0,o.tZ)("div",{className:"flex items-center gap-3",children:E?(null==R?void 0:R.label)&&(null==R?void 0:R.link)?(0,o.tZ)(l.B,{component:"a",href:null==R?void 0:R.link,target:"_blank",...q,variant:"primary",rightIcon:(0,o.tZ)(i.Z,{className:"arrow-jump",size:20,color:"#fff"}),"data-event-category":U,"data-event-action":trackingAction("CTA Click"),"data-event-label":R.link,children:R.label}):null:(0,o.BX)(d.J,{opened:G,onClose:()=>V(!1),position:"top",withArrow:!0,shadow:"md",children:[(0,o.tZ)(d.J.Target,{children:(0,o.tZ)(l.B,{...q,"data-event-category":U,"data-event-action":trackingAction("Vote Click"),"data-event-label":H,variant:"primary",className:P?"shake-trigger":"",onClick:D,rightIcon:!X&&(0,o.tZ)(i.Z,{className:"arrow-jump",size:20,color:"#fff"}),children:x({id:X?"pollWidget.voting":"pollWidget.vote"})})}),(0,o.tZ)(d.J.Dropdown,{children:(0,o.tZ)(c.x,{size:"sm",children:x({id:"pollWidget.errMess.requireSelectAnswer"})})})]})})]})]})})};var PollCard_PollCard=e=>{let{prefix:t,eventCategory:n,...a}=e;return(0,o.tZ)(PollProvider,{...a,children:(0,o.tZ)(PollCardUI,{prefix:t,eventCategory:n})})}},QiCV:function(e,t,n){"use strict";n.d(t,{Vy:function(){return getRamadanStatus}}),n("Wgwc"),n("q0An"),n("H+I9");var o=n("llb7");function getRamadanStatus(e){let{toDate:t,imsakDate:n,maghribDate:a,nextImsakDate:r}=e;return n||a||!r?t.isBefore(n)?o.I.COUNT_DOWN_TO_PRAY_TIME:t.isBefore(a)?o.I.COUNT_DOWN_TO_BREAKING_TIME:t.isBefore(r)?o.I.COUNT_DOWN_TO_PRAY_TIME:o.I.IDLE:o.I.IDLE}},fx93:function(e,t,n){"use strict";n.d(t,{Z:function(){return F}});var o=n("BGKE"),a=n("q1tI"),r=n("a5vB"),l=n("I07S"),i=n("Wbba"),s=n("/npG"),d=(0,s.k)((e,t)=>{let{colorShade:n,withSmallPattern:o}=t,{mainColor:a,secondColor:r,thirdColor:l,bgFillColor:s}=n||{};return{root:{position:"relative",color:e.colors.indigo[0],background:"radial-gradient(77.54% 111.71% at 50.1% -1.4%, ".concat(a," 0%,").concat(r," 67%, ").concat(l," 100%)"),[e.fn.largerThan("sm")]:{background:"radial-gradient(77.54% 111.71% at 50.1% -1.4%, ".concat(a," 0%,").concat(r," 67%, ").concat(l," 100%)")},"&:before":{content:'""',position:"absolute",inset:0,maskImage:"url(".concat(i.C.getAssetPath("ramadan/pattern.svg"),")"),WebkitMaskImage:"url(".concat(i.C.getAssetPath("ramadan/pattern.svg"),")"),maskRepeat:"repeat",WebkitMaskRepeat:"repeat",maskPosition:"20px 50%",WebkitMaskPosition:"20px 50%",backgroundColor:s,mixBlendMode:"soft-light",opacity:"0.34",borderRadius:"inherit",...o&&{maskSize:"50px",WebkitMaskSize:"50px"},[e.fn.smallerThan("sm")]:{maskSize:"50px",WebkitMaskSize:"50px"}}},inner:{position:"relative",borderRadius:"inherit"}}}),c=n("pdCJ");let u=(0,a.createContext)(null),BoxWrapper=e=>{let{children:t,className:n,withSmallPattern:i,...s}=e,c=(0,a.useContext)(u),{colorShade:p}=(0,l.Y)(c,e=>({colorShade:e.colorShade}),r.X),{classes:m,cx:f}=d({colorShade:p,withSmallPattern:i},{name:"RamadanWidget__BoxWrapper"});return(0,o.tZ)("div",{...s,className:f(m.root,n),children:(0,o.tZ)("div",{className:f(m.inner),children:t})})};var p=n("q9DY"),m=n("kfjY"),f=n("Eso5"),h=n("iuhU"),g=n("raAP"),x=n("hXNO"),v=n("dDsW"),b=n("yv45"),C=n("H+I9"),Z=n("//Af"),w=n.n(Z);let GoldText=e=>{let{children:t,className:n,sx:i,gradient:s="linear-gradient(90deg,#D5A561 0%,#E8BD84 14%,#F8D2A4 29%,#FFDBB0 37%,#D5A561 52%,#FFDBB0 67%,#D5A561 100%)",...d}=e,c=(0,a.useContext)(u),{colorShade:p}=(0,l.Y)(c,e=>({colorShade:e.colorShade}),r.X);return(0,o.tZ)(f.x,{...d,className:(0,h.default)(w().className,n),sx:{display:"inline-block",backgroundImage:s,WebkitBackgroundClip:"text",backgroundClip:"text",color:"transparent",filter:"\n drop-shadow(1px 0 0 ".concat(p.mainColor,") \n drop-shadow(-1px 0 0 ").concat(p.mainColor,") \n drop-shadow(0 1px 0 ").concat(p.mainColor,") \n drop-shadow(0 -1px 0 ").concat(p.mainColor,")\n "),...i},children:t})};var k=n("llb7");let CountDownTitle=e=>{let{className:t}=e,{formatMessage:n}=(0,v.Z)(),i=(0,a.useContext)(u),{status:s}=(0,l.Y)(i,e=>({status:e.status}),r.X);return(0,o.tZ)(GoldText,{className:(0,h.default)(t,"uppercase","font-bold","text-[16.67px]","leading-[120%]","tracking-[-0.22px]"),children:n({id:s===k.I.COUNT_DOWN_TO_BREAKING_TIME?"ramadanWidget.countdownToIftar":"ramadanWidget.countdownToNextImsak"})})},StatusBarBackground=e=>{let{width:t=293,...n}=e,i=(0,a.useContext)(u),{colorShade:s}=(0,l.Y)(i,e=>({colorShade:e.colorShade}),r.X),{mainColor:d,secondColor:c,thirdColor:p}=s;return(0,o.BX)("svg",{width:t,viewBox:"0 0 293 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[(0,o.BX)("g",{"clip-path":"url(#clip0_4055_102851)",children:[(0,o.tZ)("path",{d:"M29.64 47.99C25.46 47.79 18.34 46.6 13.74 41.14C11.13 38.04 9.9 35.58 8.82 33.42C7.47 30.72 6.49 28.77 3.04 26.23L0 24L3.04 21.77C6.49 19.23 7.47 17.28 8.82 14.58C9.91 12.41 11.14 9.95 13.74 6.85C18.34 1.39 25.46 0.2 29.64 0H262.63C266.81 0.2 273.93 1.39 278.53 6.85C281.14 9.95 282.37 12.41 283.45 14.58C284.8 17.28 285.78 19.23 289.23 21.77L292.27 24L289.23 26.23C285.78 28.77 284.8 30.72 283.45 33.42C282.36 35.59 281.13 38.05 278.53 41.15C273.93 46.61 266.81 47.8 262.63 48H29.64V47.99Z",fill:"url(#paint0_linear_4055_102851)"}),(0,o.tZ)("path",{d:"M30.2101 46.9098C25.9401 46.7898 19.0201 45.6898 14.5801 40.4298C12.0601 37.4298 10.8601 35.0398 9.80012 32.9198C8.43012 30.1898 7.35012 28.0298 3.69012 25.3398L1.87012 23.9998L3.69012 22.6598C7.35012 19.9698 8.44012 17.8098 9.80012 15.0798C10.8601 12.9598 12.0601 10.5698 14.5801 7.56984C19.0201 2.29984 25.9501 1.20984 30.2101 1.08984H262.06C266.32 1.20984 273.25 2.30984 277.68 7.56984C280.2 10.5698 281.4 12.9598 282.46 15.0798C283.83 17.8098 284.91 19.9698 288.57 22.6598L290.39 23.9998L288.57 25.3398C284.91 28.0298 283.82 30.1898 282.46 32.9198C281.4 35.0398 280.2 37.4298 277.68 40.4298C273.25 45.6898 266.32 46.7798 262.06 46.9098H30.2101Z",fill:"url(#paint1_linear_4055_102851)"}),(0,o.tZ)("path",{d:"M30.6503 46.0902C26.5803 46.0302 19.5903 45.0902 15.2203 39.9002C12.7603 36.9802 11.5903 34.6302 10.5503 32.5602C9.13027 29.7302 8.01027 27.4902 4.19027 24.6802L3.28027 24.0102L4.19027 23.3402C8.02027 20.5302 9.14027 18.2902 10.5503 15.4602C11.5903 13.3902 12.7603 11.0402 15.2203 8.12016C19.6003 2.91016 26.5903 1.97016 30.6503 1.91016H261.62C265.69 1.97016 272.68 2.91016 277.05 8.10016C279.51 11.0202 280.68 13.3702 281.72 15.4402C283.14 18.2702 284.26 20.5102 288.09 23.3202L289 23.9902L288.09 24.6602C284.26 27.4702 283.14 29.7102 281.72 32.5402C280.68 34.6102 279.51 36.9602 277.05 39.8802C272.68 45.0702 265.69 46.0102 261.62 46.0702H30.6503V46.0902Z",fill:"url(#paint2_linear_4055_102851)"}),(0,o.tZ)("path",{d:"M276.42 8.64023C272.51 4.00024 266.22 2.74023 261.17 2.74023H103.03C103.03 2.74023 31.3297 2.74023 31.1097 2.74023C26.0597 2.74023 19.7697 4.00024 15.8597 8.64023C10.1697 15.3902 11.5697 18.9402 4.67969 24.0002C11.5697 29.0602 10.1697 32.6102 15.8597 39.3602C19.7697 44.0002 26.0597 45.2602 31.1097 45.2602H261.17C266.22 45.2602 272.51 44.0002 276.42 39.3602C282.11 32.6102 280.71 29.0602 287.6 24.0002C280.71 18.9402 282.11 15.3902 276.42 8.64023Z",fill:"url(#paint3_radial_4055_102851)"})]}),(0,o.BX)("defs",{children:[(0,o.BX)("linearGradient",{id:"paint0_linear_4055_102851",x1:"0",y1:"24",x2:"292.28",y2:"24",gradientUnits:"userSpaceOnUse",children:[(0,o.tZ)("stop",{"stop-color":"#AA9257"}),(0,o.tZ)("stop",{offset:"0.43","stop-color":"#D8BD8E"}),(0,o.tZ)("stop",{offset:"0.57","stop-color":"#D0B685"}),(0,o.tZ)("stop",{offset:"0.8","stop-color":"#BEA46F"}),(0,o.tZ)("stop",{offset:"1","stop-color":"#AA9257"})]}),(0,o.BX)("linearGradient",{id:"paint1_linear_4055_102851",x1:"1.87012",y1:"23.9999",x2:"290.41",y2:"23.9999",gradientUnits:"userSpaceOnUse",children:[(0,o.tZ)("stop",{"stop-color":"#816735"}),(0,o.tZ)("stop",{offset:"0.18","stop-color":"#BDA05F"}),(0,o.tZ)("stop",{offset:"0.5","stop-color":"#816735"}),(0,o.tZ)("stop",{offset:"0.56","stop-color":"#886E3A"}),(0,o.tZ)("stop",{offset:"0.65","stop-color":"#9D8149"}),(0,o.tZ)("stop",{offset:"0.76","stop-color":"#BDA05F"}),(0,o.tZ)("stop",{offset:"0.82","stop-color":"#B59859"}),(0,o.tZ)("stop",{offset:"0.9","stop-color":"#A0834A"}),(0,o.tZ)("stop",{offset:"1","stop-color":"#816735"})]}),(0,o.BX)("linearGradient",{id:"paint2_linear_4055_102851",x1:"3.28027",y1:"24.0002",x2:"289",y2:"24.0002",gradientUnits:"userSpaceOnUse",children:[(0,o.tZ)("stop",{"stop-color":"#C7A265"}),(0,o.tZ)("stop",{offset:"0.14","stop-color":"#DBBB85"}),(0,o.tZ)("stop",{offset:"0.29","stop-color":"#ECD0A4"}),(0,o.tZ)("stop",{offset:"0.37","stop-color":"#F4D9B0"}),(0,o.tZ)("stop",{offset:"0.52","stop-color":"#C7A265"}),(0,o.tZ)("stop",{offset:"0.67","stop-color":"#F4D9B0"}),(0,o.tZ)("stop",{offset:"1","stop-color":"#C7A265"})]}),(0,o.BX)("radialGradient",{id:"paint3_radial_4055_102851",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(145.783 20.1314) scale(163.112 76.6652)",children:[(0,o.tZ)("stop",{"stop-color":d}),(0,o.tZ)("stop",{offset:"0.67","stop-color":c}),(0,o.tZ)("stop",{offset:"1","stop-color":p})]}),(0,o.tZ)("clipPath",{id:"clip0_4055_102851",children:(0,o.tZ)("rect",{width:"292.28",height:"48",fill:"white"})})]})]})},CountDownTimer=e=>{let{hideTitle:t,width:n,valueClass:i,unitClass:s,...d}=e,{formatMessage:c}=(0,v.Z)(),p=(0,a.useContext)(u),{imsakDate:m,maghribDate:g,status:x}=(0,l.Y)(p,e=>({imsakDate:e.imsakDate,maghribDate:e.maghribDate,toDate:e.toDate,status:e.status}),r.X),Z="flex items-center",w=i||"font-bold text-[32px] leading-[42px] tracking-[-1px] w-[30px]",k=s||"font-normal text-[20px] leading-[120%] tracking-[-0.2px]",_=(0,b.dD)({imsakDate:m,maghribDate:g,toDate:p.getState().toDate,status:x});return(0,o.tZ)("div",{...d,children:(0,o.BX)(f.x,{className:"relative flex items-center",children:[(0,o.tZ)(StatusBarBackground,{width:n,style:{display:"block",margin:"0 auto"}}),!t&&(0,o.tZ)("div",{className:(0,h.default)("absolute top-0 left-0 w-full text-center"),style:{transform:"translateY(-53%)"},children:(0,o.tZ)(CountDownTitle,{})}),(0,o.BX)("div",{className:"absolute inset-0 flex justify-between px-6",children:[(0,o.BX)("div",{className:Z,children:[(0,o.tZ)(GoldText,{className:w,children:(0,C.yu)(_.hour)}),(0,o.tZ)(GoldText,{className:k,children:c({id:"common.unitHours",defaultMessage:"hours"})})]}),(0,o.BX)("div",{className:Z,children:[(0,o.tZ)(GoldText,{className:w,children:(0,C.yu)(_.minute)}),(0,o.tZ)(GoldText,{className:k,children:c({id:"common.unitMins",defaultMessage:"mins"})})]}),(0,o.BX)("div",{className:Z,children:[(0,o.tZ)(GoldText,{className:w,children:(0,C.yu)(_.second)}),(0,o.tZ)(GoldText,{className:k,children:c({id:"common.unitSeconds",defaultMessage:"seconds"})})]})]})]})})},GregorianDate=e=>{let t=(0,a.useContext)(u),{ramadanEvent:n}=(0,l.Y)(t,e=>({ramadanEvent:e.ramadanEvent}),r.X);return(null==n?void 0:n.gregorianDate)?(0,o.tZ)("div",{...e,children:null==n?void 0:n.gregorianDate}):null},ImsakDate=e=>{let t=(0,a.useContext)(u),{ramadanEvent:n}=(0,l.Y)(t,e=>({ramadanEvent:e.ramadanEvent}),r.X),{formatMessage:i}=(0,v.Z)();return(null==n?void 0:n.prayerTimes.imsak.time)?(0,o.BX)("div",{...e,children:[i({id:"ramadanWidget.fastingTimeStarts",defaultMessage:"Fasting time starts"}),": ",n.prayerTimes.imsak.time]}):null},MaghribTime=e=>{let t=(0,a.useContext)(u),{ramadanEvent:n}=(0,l.Y)(t,e=>({ramadanEvent:e.ramadanEvent}),r.X),{formatMessage:i}=(0,v.Z)();return(null==n?void 0:n.prayerTimes.maghrib.time)?(0,o.BX)("div",{...e,children:[i({id:"ramadanWidget.breakingFastTime",defaultMessage:"Breaking fast time"}),": ",n.prayerTimes.maghrib.time]}):null},EventTime=()=>(0,o.BX)("div",{className:"flex flex-col gap-2",children:[(0,o.tZ)(GregorianDate,{className:(0,h.default)("font-inter font-medium","text-[14px] leading-[110%] tracking-[-0.2px]")}),(0,o.BX)("div",{className:(0,h.default)("font-inter font-normal","text-[12px] leading-[110%] tracking-[-0.2px]"),children:[(0,o.tZ)(ImsakDate,{}),(0,o.tZ)(MaghribTime,{})]})]});var _=(0,s.k)(()=>({root:{},inner:{backgroundImage:"url(".concat(i.C.getAssetPath("ramadan/pattern.svg"),")")}}));let IdleHeading=e=>{let{styles:t,classNames:n,className:a}=e,{formatMessage:r}=(0,v.Z)(),{cx:l}=_(void 0,{name:"RamadanWidget__IdleHeading",styles:t,classNames:n});return(0,o.BX)(f.x,{className:l(a,"flex items-center gap-2"),children:[(0,o.tZ)("img",{loading:"lazy",src:i.C.getAssetPath("ramadan/clock.png"),alt:"clock",className:"ramadan-clock w-16 h-16"}),(0,o.tZ)(GoldText,{className:l("ramadan-heading","uppercase","font-display","font-bold","text-[26px]","leading-[1.2]","tracking-[-0.22px]"),children:r({id:"ramadanWidget.fastingTime"})})]})};var y=n("uzh1"),B=n("1Hbx"),N=n("fEsb"),S=n("8vDj"),I=n("mYVa"),T=n("XRSF"),A=n("ChHM"),D=n("m0Nu"),E=(0,s.k)(e=>({root:{position:"relative"},locator:{},locatorValue:{position:"relative",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:4,".loading-icon":{padding:8,svg:{width:16,height:16}}},selectTarget:{position:"absolute",left:0,bottom:0,right:0,[e.fn.smallerThan("sm")]:{left:"50%",right:"auto"}}})),X=n("aHnw"),L=n("VZtU"),R=n("IEKS"),P=n("TD78"),W=n("vaps"),M=n("LES+"),z=n("SPK5"),O=n("Dmus"),Y=(0,s.k)(e=>({root:{display:"flex",flexDirection:"column",gap:8,background:"#fff",border:"1px solid ".concat(e.colors.gray[1]),padding:4,borderRadius:12,width:"100%",boxShadow:"0px 0px 1px 0px #0000000A, 0px 2px 8px 0px #0000000A, 0px 10px 16px 0px #0000000A",[e.fn.largerThan("sm")]:{width:300}},input:{input:{paddingLeft:32,[e.fn.largerThan("sm")]:{paddingLeft:35},"&,&::placeholder":{fontSize:(0,I.h)(12),[e.fn.largerThan("sm")]:{fontSize:(0,I.h)(14)}}}},inputWrapper:{position:"relative"},searchIcon:{position:"absolute",top:10,left:8},item:{padding:"".concat((0,I.h)(6)," ").concat((0,I.h)(8)),transition:"background .2s ease",cursor:"pointer",'&[data-is-current-loc="true"]':{position:"relative",marginBottom:8,"&:before":{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,content:'""',borderBottom:"1px solid ".concat(e.colors.neutral[1])}},'&[data-selected="true"]':{cursor:"default",backgroundColor:e.colors.blue[0],borderRadius:8},"&:hover":{backgroundColor:e.colors.gray[1],borderRadius:8}}}));let Select=e=>{let{data:t=[],onClickItem:n,styles:i,classNames:s}=e,{formatMessage:d}=(0,v.Z)(),{classes:c,theme:p}=Y(void 0,{name:"AirPopulation__Select",styles:i,classNames:s}),m=(0,a.useContext)(u),[g,b]=(0,a.useState)(!1),{selectedZone:C,errorCurrentLocation:Z,setErrorCurrentLocation:w,loadingCurrentLocation:k}=(0,l.Y)(m,e=>({loadingCurrentLocation:e.loadingCurrentLocation,errorCurrentLocation:e.errorCurrentLocation,setErrorCurrentLocation:e.setErrorCurrentLocation,selectedZone:e.selectedZone}),r.X),_=(0,x.d)(),B=_?16:20,[S,A]=(0,a.useState)(""),D=(0,a.useMemo)(()=>{let e=(0,O.bG)(S),n=t.filter(t=>(0,O.bG)(t.label).includes((0,O.bG)(e)));return n.length>0?n:t},[S,t]);return(0,a.useEffect)(()=>{Z&&b(!0)},[Z]),(0,a.useEffect)(()=>{let e;return g?e=setTimeout(()=>{b(!1)},5e3):w(!1),()=>clearTimeout(e)},[g]),(0,o.BX)(f.x,{className:c.root,children:[(0,o.BX)(f.x,{className:c.inputWrapper,children:[(0,o.tZ)(X.I,{className:c.input,value:S,onChange:A,placeholder:d({id:"navigation.search.input.placeholder",defaultMessage:"Search for city"})}),(0,o.tZ)(L.Z,{size:18,color:p.colors.gray[3],className:c.searchIcon})]}),(0,o.tZ)(W.x.Autosize,{mah:320,type:"auto",scrollbarSize:6,children:D.map((e,t)=>{let a=!e.isUseCurrentLocation&&(null==C?void 0:C.value)===e.value;return e.isUseCurrentLocation?(0,o.BX)(M.J,{width:200,position:"bottom",withArrow:!0,shadow:"md",opened:g,children:[(0,o.tZ)(M.J.Target,{children:(0,o.BX)(z.k,{"data-is-current-loc":e.isUseCurrentLocation,"data-selected":a,className:(0,h.default)(c.item,"select-none"),align:"top",gap:8,onClick:()=>!a&&n(e.value),"data-event-category":"Header Banner","data-event-action":"Ramadan Widget Location Combobox","data-event-label":"current location",children:[(0,o.tZ)("div",{className:"shrink-0 pt-[2px]",children:e.isUseCurrentLocation?k?(0,o.tZ)(T.a,{size:B}):(0,o.tZ)(R.Z,{size:B}):(0,o.tZ)(N.Z,{size:B})}),(0,o.tZ)(y.T,{sx:()=>({fontSize:(0,I.h)(12),[p.fn.largerThan("sm")]:{fontSize:(0,I.h)(14)}}),children:e.label})]})}),(0,o.BX)(M.J.Dropdown,{children:[(0,o.tZ)(P.Z,{color:"red",size:B,className:"inline-block mr-1 align-middle mb-[3px]"}),(0,o.tZ)(y.T,{size:"p4",as:"span",variant:"error",children:d({id:"clinicLocator.plsAllowAccess"})})]})]},String(t)):(0,o.BX)(z.k,{"data-is-current-loc":e.isUseCurrentLocation,"data-selected":a,className:c.item,align:"top",gap:8,onClick:()=>!a&&n(e.value),"data-event-category":"Header Banner","data-event-action":"Ramadan Widget Location Combobox","data-event-label":e.label,children:[(0,o.tZ)("div",{className:"shrink-0 pt-[2px]",children:e.isUseCurrentLocation?(0,o.tZ)(R.Z,{size:B}):(0,o.tZ)(N.Z,{size:B})}),(0,o.tZ)(y.T,{sx:()=>({fontSize:(0,I.h)(12),[p.fn.largerThan("sm")]:{fontSize:(0,I.h)(14)}}),children:e.label})]},String(t))})})]})},LocationSelector=e=>{let{styles:t,className:n,classNames:i}=e,{formatMessage:s}=(0,v.Z)(),d=(0,a.useContext)(u),{ramadanEvent:c,currentLocation:p,listZone:h,selectedZone:g,loading:b,colorShade:C,handleChangeLocation:Z,handleChangeZone:w,handleCloseLocatorDropdown:k}=(0,l.Y)(d,e=>({colorShade:e.colorShade,ramadanEvent:e.ramadanEvent,currentLocation:e.currentLocation,currentZone:e.currentZone,listZone:e.listZone,loading:e.loading,selectedZone:e.selectedZone,setSelectedZone:e.setSelectedZone,handleChangeZone:e.handleChangeZone,handleChangeLocation:e.handleChangeLocation,handleCloseLocatorDropdown:e.handleCloseLocatorDropdown}),r.X),_=(0,S.rZ)(),X=_.colors.indigo[1],{mainColor:L,secondColor:R,thirdColor:P}=C,[W,M]=(0,a.useState)(!1),z=(0,A.O)(()=>M(!1)),{classes:O,cx:Y}=E(void 0,{name:"AirPopulation__LocationSelector",styles:t,classNames:i}),H=(0,x.d)(),U=[{label:s({id:D.eD}),value:D.Zn,isUseCurrentLocation:!0},...h||[]];return(0,a.useEffect)(()=>{W||k()},[W]),(0,a.useEffect)(()=>{M(!1)},[H]),(0,o.tZ)(f.x,{className:Y(n,O.root),children:(0,o.BX)(f.x,{className:O.locator,ref:z,children:[(0,o.BX)(f.x,{className:"cursor-pointer relative w-full h-[40px]",onClick:()=>{b||M(e=>!e)},sx:()=>({background:"radial-gradient(57.65% 180.3% at 49.87% 40.9%, ".concat(L," 0%, ").concat(R," 67%, ").concat(P," 100%)"),borderColor:L,border:"1px solid ".concat(L),borderRadius:8,padding:"8px 30px 8px 36px",color:X}),children:[(0,o.tZ)(y.T,{className:"select-none tracking-[-0.3px] break-all",lineClamp:1,color:X,sx:()=>({fontSize:(0,I.h)(12),lineHeight:(0,I.h)(22),[_.fn.largerThan("sm")]:{fontSize:(0,I.h)(14)}}),children:p&&!c?s({id:D.eD}):null==g?void 0:g.label}),(0,o.tZ)("div",{className:"absolute right-0 top-0 z-[0] w-[40px] h-[40px] flex items-center justify-center",children:b?(0,o.tZ)(T.a,{size:18,color:"yellow",className:"loading-icon"}):(0,o.tZ)(B.Z,{size:24,color:X,style:{transform:"rotate(".concat(W?"180deg":0,")")}})}),(0,o.tZ)("div",{className:"absolute left-0 top-0 z-[0] w-[40px] h-[40px] flex items-center justify-center",children:(0,o.tZ)(N.Z,{color:X,size:H?18:20})})]}),(0,o.tZ)(m.u,{mounted:!!W,keepMounted:!0,transition:"fade",children:e=>(0,o.tZ)(f.x,{sx:{position:"absolute",top:"calc(100% + 8px)",...e,borderColor:L,[_.fn.smallerThan("sm")]:{right:0,width:"calc(100vw - 24px)"},[_.fn.largerThan("sm")]:{right:0}},children:(0,o.tZ)(Select,{data:U,onClickItem:e=>{e===D.Zn?Z(()=>{M(!1)}):(w(e),M(!1))}})})})]})})},Logo=()=>(0,o.tZ)(GoldText,{className:(0,h.default)("font-display","font-semibold","text-[32px] md:text-[44px]","leading-[110%]","tracking-[0px]"),children:"Ramadan"}),SponsorLogo=e=>{let{className:t=""}=e,n=(0,a.useContext)(u),{shouldRender:i,ramadanEvent:s}=(0,l.Y)(n,e=>({shouldRender:e.shouldRender,ramadanEvent:e.ramadanEvent}),r.X),d=null==s?void 0:s.sponsorItem;return i&&(null==d?void 0:d.logo)?(0,o.tZ)("img",{className:(0,h.default)(t,"h-[40px] w-auto object-contain"),loading:"lazy",src:d.logo,alt:d.name||"sponsor"}):null},SponsorText=e=>{let{className:t,...n}=e,i=(0,a.useContext)(u),{ramadanEvent:s}=(0,l.Y)(i,e=>({ramadanEvent:e.ramadanEvent}),r.X),d=null==s?void 0:s.sponsorItem;return(null==d?void 0:d.content)?(0,o.tZ)("div",{className:(0,h.default)("font-inter","font-normal","text-[14px]","leading-[110%]","tracking-[-0.2px]","[&_a]:text-[#e8bd84]","[&_a]:underline",t),...n,dangerouslySetInnerHTML:{__html:d.content}}):null},Sponsor=()=>{let e=(0,a.useContext)(u),{shouldRender:t,ramadanEvent:n}=(0,l.Y)(e,e=>({shouldRender:e.shouldRender,ramadanEvent:e.ramadanEvent}),r.X),i=null==n?void 0:n.sponsorItem;return t&&((null==i?void 0:i.logo)||(null==i?void 0:i.content))?(0,o.BX)("div",{className:"flex flex-col gap-0 items-center",children:[(0,o.tZ)(SponsorLogo,{}),(0,o.tZ)(SponsorText,{className:"text-center"})]}):null},DesktopView=()=>{let e=(0,a.useContext)(u),{shouldRender:t,status:n}=(0,l.Y)(e,e=>({shouldRender:e.shouldRender,status:e.status}),r.X);return t?(0,o.BX)("div",{className:(0,h.default)("h-full","relative z-[1]","flex flex-col gap-3","grid grid-cols-[1fr_292px_1fr] items-center gap-0"),children:[(0,o.BX)("div",{className:"flex gap-3 items-center ",children:[(0,o.tZ)("img",{className:" h-[81px] w-[103px] ",loading:"lazy",src:i.C.getAssetPath("ramadan/moon.png"),alt:"moon"}),(0,o.BX)(f.x,{className:"flex gap-[16px]",children:[(0,o.tZ)(Logo,{}),(0,o.tZ)(EventTime,{})]})]}),(0,o.tZ)("div",{className:(0,h.default)("flex justify-center w-[292px]"),children:n===k.I.IDLE?(0,o.tZ)(IdleHeading,{}):(0,o.tZ)(CountDownTimer,{className:"pt-[10px]"})}),(0,o.tZ)("div",{children:(0,o.BX)("div",{className:(0,h.default)("max-w-[550px]","flex items-center gap-1 justify-between"),children:[(0,o.tZ)("div",{className:"w-full",children:(0,o.tZ)(Sponsor,{})}),(0,o.BX)("div",{className:"flex items-center gap-7 flex-shrink-0",children:[(0,o.tZ)("div",{className:"w-[200px]",children:(0,o.tZ)(LocationSelector,{})}),(0,o.tZ)("img",{loading:"lazy",className:"h-[80px] w-auto object-contain [transform:rotateY(-180deg)]",src:i.C.getAssetPath("ramadan/sparkle-star.png"),alt:"sparkle star"})]})]})})]}):null};var H=(0,s.k)(e=>({inner:{position:"relative",[e.fn.largerThan("sm")]:{"&:before,&:after":{content:'""',position:"absolute",top:0,backgroundImage:"url(".concat(i.C.getAssetPath("ramadan/sparkle.png"),")"),backgroundSize:"cover",width:421,height:80},"&:before":{left:-242},"&:after":{right:-242}}}}));let MobileView=()=>{var e;let t=(0,a.useContext)(u),{shouldRender:n,status:s,ramadanEvent:d}=(0,l.Y)(t,e=>({shouldRender:e.shouldRender,status:e.status,ramadanEvent:e.ramadanEvent}),r.X),c="text-[10px] leading-[1.2] tracking-[-0.2px] text-gray-800",p=s!==k.I.IDLE||(null==d?void 0:null===(e=d.sponsorItem)||void 0===e?void 0:e.logo);return n?(0,o.BX)("div",{className:(0,h.default)("p-[12px]","h-full","relative z-[1]","flex flex-col gap-[9px]"),children:[(0,o.BX)("div",{className:"flex flex-col gap-2 items-center ",children:[p&&(0,o.BX)("div",{className:"flex flex-col w-full",children:[(0,o.BX)("div",{className:"flex gap-[4px]",children:[(0,o.tZ)(Logo,{}),(0,o.BX)("div",{className:"pt-[8px]",children:[(0,o.tZ)(ImsakDate,{className:c}),(0,o.tZ)(MaghribTime,{className:c})]})]}),(0,o.tZ)(GregorianDate,{className:c})]}),s===k.I.IDLE?(0,o.tZ)(IdleHeading,{}):(0,o.tZ)(CountDownTimer,{className:"pt-[10px]"}),(0,o.BX)("div",{className:"flex gap-1 items-center w-full",children:[(0,o.tZ)(SponsorText,{className:"shrink-0 w-[50%] !text-[12px] leading-[1.1] tracking-[-0.2px] "}),(0,o.tZ)(LocationSelector,{className:"w-full"})]})]}),(0,o.tZ)(SponsorLogo,{className:"absolute top-0 right-[32px]"}),(0,o.tZ)("img",{loading:"lazy",className:"absolute right-5 top-0 h-[83px] w-auto object-contain",src:i.C.getAssetPath("ramadan/sparkle-star-mobile.png"),alt:"sparkle star"})]}):null},RamadanWidgetComponent=e=>{let t=(0,a.useContext)(u),{shouldRender:n}=(0,l.Y)(t,e=>({shouldRender:e.shouldRender}),r.X),i=(0,x.d)(),{classes:s,cx:d}=H(void 0,{name:"RamadanWidget"});return n?(0,o.tZ)(BoxWrapper,{...e,children:(0,o.tZ)("div",{className:d(s.inner,"max-w-[1440px] mx-auto h-auto md:h-[81px]"),children:i?(0,o.tZ)(MobileView,{}):(0,o.tZ)(DesktopView,{})})}):null};var U=n("nCpW"),j=n("P5LW"),G=n("CF0j"),V=n("0EDw");let WidgetView=e=>{let{className:t,...n}=e,i=(0,a.useContext)(u),{status:s}=(0,l.Y)(i,e=>({status:e.status}),r.X);return s===k.I.IDLE?null:(0,o.tZ)(BoxWrapper,{withSmallPattern:!0,...n,children:(0,o.BX)("div",{className:"flex gap-1 justify-between p-2",children:[(0,o.BX)("div",{className:"flex flex-col gap-[1px] justify-center",children:[(0,o.tZ)(CountDownTitle,{className:"font-bold text-[16.84px] leading-[120%]"}),(0,o.tZ)(SponsorText,{className:"text-[9px]"})]}),(0,o.tZ)(CountDownTimer,{hideTitle:!0,width:192,unitClass:"text-[13.33px] leading-[120%] tracking-[-0.13px]",valueClass:"text-[21.33px] leading-[28px] w-[20px]"})]})})};var F={Provider:e=>{let{children:t,initialState:n}=e,r=(0,a.useRef)();return r.current||(r.current=(0,c.P)(n)),(0,o.tZ)(u.Provider,{value:r.current,children:t})},Container:e=>{let{children:t}=e,n=(0,a.useContext)(u),{locale:i}=(0,j.h)(),{ramadanEvent:s,fetchInitData:d,updateTime:c,status:p}=(0,l.Y)(n,e=>({ramadanEvent:e.ramadanEvent,fetchInitData:e.fetchInitData,updateTime:e.updateTime,status:e.status}),r.X);(0,a.useEffect)(()=>{G.rV.includes(i)&&d()},[d]);let m=(0,U.Y)(()=>{let e=n.getState().toDate;e&&c(e.add(1,"second"))},1e3);return(0,a.useEffect)(()=>(p!==k.I.IDLE?m.start():m.stop(),m.stop),[s,p]),(0,o.tZ)(o.HY,{children:t})},CloseBannerWrapper:()=>{let e=(0,a.useContext)(u),{shouldRender:t}=(0,l.Y)(e,e=>({shouldRender:e.shouldRender}),r.X),n=(0,g.U)(),[i,s]=(0,a.useState)(!1);return(0,o.tZ)(m.u,{mounted:t&&!i,transition:"fade",children:e=>(0,o.BX)(f.x,{className:"relative z-[2]",sx:e=>({".close-btn":{[e.fn.largerThan("sm")]:{transform:"translateY(-50%)"}}}),children:[(0,o.tZ)(RamadanWidgetComponent,{style:e}),(0,o.tZ)(p.Z,{size:24,color:"#fff",className:(0,h.default)("close-btn","cursor-pointer absolute z-[1]","top-[8px] md:top-1/2 right-[8px] md:right-3"),"data-event-category":"Header Banner","data-event-action":"Ramadan Widget Close","data-event-label":n,onClick:()=>s(!0)})]})})},ShortcutWidget:()=>{let e=(0,a.useContext)(u),{status:t,shouldRender:n}=(0,l.Y)(e,e=>({status:e.status,shouldRender:e.shouldRender}),r.X);return n?(0,o.tZ)(BoxWrapper,{withSmallPattern:!0,className:"px-3 py-3 rounded-lg",children:(0,o.tZ)("div",{className:"flex flex-col gap-1",children:t===k.I.IDLE?(0,o.tZ)(IdleHeading,{}):(0,o.BX)(o.HY,{children:[(0,o.tZ)(CountDownTimer,{className:"pt-[10px]"}),(0,o.tZ)(SponsorText,{className:"!text-[12px] text-center"})]})})}):null},CountDownTimer:CountDownTimer,BoxWrapper:BoxWrapper,SponsorText:SponsorText,StickyMobileWidget:()=>{let e=(0,x.d)(),t=(0,a.useContext)(u),{shouldRender:n}=(0,l.Y)(t,e=>({shouldRender:e.shouldRender}),r.X),[i]=(0,V.b)(),s=i.y>=window.innerHeight;return e&&n?(0,o.tZ)(m.u,{transition:"fade",mounted:s,children:e=>(0,o.tZ)(WidgetView,{style:e})}):null}}},llb7:function(e,t,n){"use strict";var o,a;n.d(t,{I:function(){return o}}),(a=o||(o={})).IDLE="idle",a.COUNT_DOWN_TO_PRAY_TIME="count_down_to_pray_time",a.COUNT_DOWN_TO_BREAKING_TIME="count_down_to_breaking_time"},CBW8:function(e,t,n){"use strict";n.d(t,{L:function(){return HideAdsProvider},o:function(){return AdBlockContainer}});var o=n("BGKE"),a=n("q1tI"),r=n("P5LW"),l=n("N2Lg");let i=(0,a.createContext)(!1),HideAdsProvider=e=>{let{hideAds:t,children:n}=e;return(0,o.tZ)(i.Provider,{value:t,children:n})},AdBlockContainer=e=>{let{children:t,hidden:n=!1}=e,{locale:s}=(0,r.h)(),d=(0,a.useContext)(i),c=null===l.Zr||void 0===l.Zr?void 0:l.Zr.includes(s);return c||n||d?null:(0,o.tZ)(o.HY,{children:t})}},LplW:function(e,t,n){"use strict";n.d(t,{E:function(){return FixedBottomAdBlock}});var o=n("BGKE"),a=n("q1tI"),r=n("Vvt1"),l=n.n(r);let i=l()(()=>Promise.all([n.e(4846),n.e(2233),n.e(1058),n.e(5638),n.e(3295),n.e(1538),n.e(6629),n.e(7152),n.e(5684),n.e(2574),n.e(2513),n.e(5238),n.e(2039),n.e(6962),n.e(8680),n.e(4050),n.e(5465),n.e(6638),n.e(7741),n.e(1137),n.e(2433),n.e(9689),n.e(5385),n.e(3564),n.e(3158),n.e(8320),n.e(5641),n.e(7454),n.e(7004),n.e(4758),n.e(6219),n.e(17),n.e(8990),n.e(4067),n.e(9487),n.e(5297),n.e(9931),n.e(9083),n.e(1520),n.e(270),n.e(7596),n.e(8217),n.e(7543),n.e(2835),n.e(2507),n.e(6885),n.e(7859),n.e(5970),n.e(2730),n.e(2399),n.e(5530),n.e(4385),n.e(2840),n.e(4870),n.e(9922),n.e(3133),n.e(612),n.e(2002),n.e(1880),n.e(7471),n.e(7165),n.e(8854),n.e(5451),n.e(8612)]).then(n.bind(n,"lXMY")).then(e=>e.FixedBottomAdBlock),{loadableGenerated:{webpack:()=>["lXMY"]},ssr:!1}),FixedBottomAdBlock=e=>{let[t,n]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{setTimeout(()=>{n(!0)},500)},[]),t)?(0,o.tZ)(i,{...e}):null}},lXMY:function(e,t,n){"use strict";n.r(t),n.d(t,{FixedBottomAdBlock:function(){return FixedBottomAdBlock}});var o=n("BGKE"),a=n("q1tI"),r=n("4BRW"),l=n("Q6jF"),i=n("P5LW"),s=n("1LUM"),d=n("xJ6s");let FixedBottomAdBlock=e=>{let{className:t="",adUnitPath:n,divId:c,isMobile:u,contentId:p,ignoreRefreshAd:m=!1,customTargetings:f,...h}=e,{locale:g}=(0,i.h)(),[x,v]=(0,a.useState)(!0),[b,C]=(0,a.useState)(!1),[Z,w]=(0,a.useState)(!0),k=(0,a.useRef)(null),_=(0,a.useRef)((0,l.Z)()),y=(0,a.useRef)(null),B=(0,a.useRef)(),N=(0,a.useRef)();return((0,a.useEffect)(()=>{let checkAdShowing=()=>{N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{if(document.getElementById("subot--container"))v(!0);else{var e;v(!1),(null===(e=k.current)||void 0===e?void 0:e.clientHeight)?w(!1):w(!0)}checkAdShowing()},4e3)};return checkAdShowing(),()=>{B.current&&clearTimeout(B.current),N.current&&clearTimeout(N.current)}},[]),x||b)?null:(0,o.tZ)(d.nE,{ref:y,className:"".concat(t," sticky-bottom-ad"),"data-visible":!Z,...h,children:n&&(0,o.tZ)(s.AdBlock,{wrapperProps:{m:0},ref:k,adUnitPath:n,size:u?[[320,50],[320,100],[1,1]]:[[728,90],[1,1]],divId:(c||"div-gpt-ad-sticky")+(u?"-mobile":"")+p+String(_.current),pos:["Sticky"],contentId:p,hideIfHasSubot:u,customTargetings:f,adDefaultSize:u?[320,50]:[728,90],showCloseBtn:!0,onCloseAd:()=>C(!0),refreshInterval:g===r.L.Vietnam?30:60,ignoreRefreshAd:m})},u?"mobile":"desktop")}},xJ6s:function(e,t,n){"use strict";n.d(t,{On:function(){return s},R7:function(){return d},nE:function(){return i},o$:function(){return c}});var o=n("rBCA"),a=n("CL9C"),r=n("iBNF"),l=n("rIrU");let i=(0,o.Z)("div",{target:"e1q29jt0"})("position:fixed;z-index:",l.kg.adBlock,";bottom:0;left:0;right:0;max-width:100%;background:none;transition:transform 0.3s ease-in-out;",a.M.mbUp,"{left:50%;width:fit-content;transform:translateX(-50%);}.close-sticky-button{position:absolute;display:flex;width:16px;height:16px;align-items:center;justify-content:center;background:#bfbfbf;border-radius:50%;color:white;cursor:pointer;font-size:12px;line-height:12px;transform:translate(50%,-50%);top:0;right:0;}opacity:0;pointer-events:none;&[data-visible='true']{opacity:1;pointer-events:auto;}"),s=(0,o.Z)("div",{target:"e1q29jt1"})("display:flex;justify-content:center;align-items:center;flex-direction:column;max-width:100%;",a.M.mbUp,"{width:fit-content;height:fit-content;}margin-inline:auto;/* margin:1rem auto;*/\n &[data-no-wrapper='false']{border:1px solid ",r.r.colors.neutral50,";background:",r.r.colors.neutral50,";}&[data-no-wrapper='true']{line-height:0;}&[data-header-bottom='true']{flex-direction:column-reverse;background:none;border:none;}",a.M.mbDown,"{[data-video='true'] [data-gc-instream-floating='true']{height:100px !important;div[class^='InstreamDom_player']{&[data-arb-resize-mode='compute-height']:not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_):not(#_){height:100px !important;}div:last-child{width:180px !important;}}div[class^='InstreamDom_videoTitle']{position:absolute !important;left:180px !important;top:50%;transform:translate(0,-50%);z-index:999 !important;color:white !important;display:block !important;white-space:normal !important;text-align:left !important;font-size:14px !important;line-height:22px !important;font-weight:normal !important;padding:0 16px !important;width:auto !important;height:auto !important;max-height:66px !important;}div[class^='CloseButton']{top:23px !important;color:white !important;border-color:transparent !important;}}}"),d=(0,o.Z)("div",{target:"e1q29jt2"})("/* background:",r.r.colors.neutral50,";*/\n width:100%;padding:0 5px 1.5px;display:flex;align-items:center;justify-content:center;gap:5px;text-transform:capitalize;img{height:12px;width:12px;max-width:12px;max-height:12px;}&[data-header-bottom='true']{background:",r.r.colors.neutral50,";}span{font-size:10px;line-height:12px;color:",r.r.colors.gray400,";font-weight:400;}"),c=(0,o.Z)("div",{target:"e1q29jt3"})("background-color:white;background-image:url('/images/close-blue.svg');background-repeat:no-repeat;background-size:contain;background-position:center;width:14px;height:14px;position:absolute;top:0;right:0;z-index:1;cursor:pointer;")},"1LUM":function(e,t,n){"use strict";n.r(t),n.d(t,{AdBlock:function(){return v}});var o=n("BGKE"),a=n("q1tI"),r=n("4BRW"),l=n("Eso5"),i=n("O/o9"),s=n("dDsW"),d=n("P5LW"),c=n("N2Lg"),u=n("VIdu");window.pbjs=window.pbjs||{que:[]},(0,u.oQ)();var p=n("xJ6s");let m={},f=["TopBanner","MidBanner1","MidBanner2","masthead","Sticky"],_getForceRefreshConfig=(e,t)=>{if(e===r.L.Vietnam&&f.some(e=>t.includes(e)))return!0},displayAd=e=>{let{contentId:t,adUnitPath:n,size:o,divId:a,pos:r,sizeMapping:l,hideIfHasSubot:i,customTargetings:s,onSuccess:d}=e;if(!a||!document.getElementById(a))return console.error("divId is required");destroyAdSlot(a),(0,u.an)(function(){let{googletag:e}=window;if(!(null==e?void 0:e.defineSlot))return;let c=document.querySelector('meta[name="content_id"]'),p="string"==typeof t?t:null==c?void 0:c.content,f=e.defineSlot(n,o,a);if(document.querySelector("script[src*='https://micro.rubiconproject.com/prebid/dynamic']")&&function(e){var t;let n;let o=(t=e=>{try{var t,n;null===(n=window.googletag)||void 0===n||null===(t=n.pubads)||void 0===t||t.call(n).refresh(e)}catch(e){console.error(e)}},n=!1,o=>{n||(n=!0,t(o||e))});window.pbjs.que.push(function(){window.pbjs.rp.requestBids({callback:o,gptSlotObjects:e})}),setTimeout(o,3500)}([f]),f){let t={};try{s&&Object.keys(s).forEach(e=>{e&&(t[e]=s[e])})}catch(e){console.error(e)}m[a]=f;let n=window.location.pathname.split(/[-/]/).filter(Boolean);n.length>0&&(t.Keyword_URL=n),t.Pos=r,p&&(t.Content_ID=p),i&&document.getElementById("subot--container")&&(t.chatbot="true"),(0,u.BB)(f,t),f.addService(e.pubads()),l&&f.defineSizeMapping(l),e.display(a),e.pubads().isInitialLoadDisabled()&&e.pubads().refresh([f]),null==d||d()}})},destroyAdSlot=e=>{m[e]&&(0,u.an)(function(){let{googletag:t}=window;(null==t?void 0:t.destroySlots)&&(t.destroySlots([m[e]]),delete m[e])})},h=["Sticky"],g=(0,a.forwardRef)(function(e,t){let{asPath:n,locale:a}=(0,d.h)();return(c.Rk[a]||[]).find(e=>n.startsWith(e))||n.startsWith("/health-tools/")&&!(c.rd[a]||[]).find(e=>encodeURIComponent(decodeURIComponent(n)).startsWith(encodeURIComponent(e)))||n.startsWith("/bot/")&&!(c.Iu[a]||[]).find(e=>encodeURIComponent(decodeURIComponent(n)).startsWith(encodeURIComponent(e)))?(0,o.tZ)("div",{ref:t}):(0,o.tZ)(x,{...e,ref:t})}),x=(0,a.forwardRef)(function(e,t){let{className:n,adUnitPath:c,size:f,divId:g,pos:x,sizeMapping:v,contentId:b,isHidden:C,hideIfHasSubot:Z,isSticky:w,refreshInterval:k,customTargetings:_,style:y,adDefaultSize:B,noWrapper:N,showCloseBtn:S,onCloseAd:I,headerBottom:T,wrapperProps:A,onlyRefreshInview:D,ignoreRefreshAd:E=!1,adWrapperStyle:X,adStyle:L,isVideo:R}=e,{locale:P}=(0,d.h)(),W=k||(P===r.L.Vietnam&&x.some(e=>h.includes(e))?30:void 0),{formatMessage:M}=(0,s.Z)(),{ref:z,inView:O}=(0,i.YD)(),Y=(0,a.useRef)(null),H=(0,a.useRef)(W);H.current=_getForceRefreshConfig(P,x)?15:W;let U=_getForceRefreshConfig(P,x)||D,[j,G]=(0,a.useState)(!1),setupRefreshAd=e=>{null!==Y.current&&clearInterval(Y.current),Y.current=window.setInterval(()=>{(0,u.an)(function(){let{googletag:e}=window;m[g]&&(null==e?void 0:e.pubads)&&e.pubads().refresh([m[g]])})},1e3*e)};if((0,a.useEffect)(()=>{O&&U&&H.current&&!E?setupRefreshAd(H.current):!O&&U&&null!==Y.current&&clearInterval(Y.current)},[O,U,E]),(0,a.useEffect)(()=>()=>{destroyAdSlot(g),Y.current&&clearInterval(Y.current)},[]),(0,a.useEffect)(()=>{C||displayAd({contentId:b,adUnitPath:c,size:f,divId:g,pos:x,sizeMapping:v,hideIfHasSubot:Z,customTargetings:_,onSuccess:()=>{!H.current||U||E||setupRefreshAd(H.current);let e=document.getElementById(g);e&&R&&e.setAttribute("data-video",String(!!R))}})},[C]),j)return null;let V=(0,o.tZ)("div",{style:{position:"relative",width:"fit-content",height:"fit-content",overflow:"hidden",maxWidth:"100%",display:"flex",alignItems:"center",justifyContent:"center",...X},children:(0,o.tZ)("div",{ref:t,id:g,style:L})});if(w)return V;let F=B?B[0]:f?Array.isArray(f[0])?f[0][0]:f[0]:void 0,q=B?B[1]:f?Array.isArray(f[0])?f[0][1]:f[1]:void 0;return(0,o.BX)(l.x,{...A,className:n,children:[S&&(0,o.tZ)(p.o$,{onClick:()=>{null==I||I(),G(!0)}}),(0,o.tZ)(p.On,{ref:z,className:n,style:y,"data-no-wrapper":!!N,"data-header-bottom":!!T,children:N?(0,o.BX)(o.HY,{children:[S&&(0,o.tZ)(p.o$,{onClick:()=>{null==I||I(),G(!0)}}),V]}):(0,o.BX)(o.HY,{children:[(0,o.BX)(p.R7,{"data-header-bottom":!!T,children:[(0,o.tZ)("img",{loading:"lazy",src:"/svg/adsIcon.svg",alt:"ad icon"}),(0,o.tZ)("span",{"data-ads-type":!0,children:M({id:"adBanner.title",defaultMessage:"Advertisement"})}),S&&(0,o.tZ)(p.o$,{onClick:()=>{null==I||I(),G(!0)}})]}),(0,o.tZ)("div",{style:{minWidth:F||"100%",minHeight:q||"100%",position:"relative"},children:V})]})})]})}),v=(0,a.memo)(g,(e,t)=>e.adUnitPath===t.adUnitPath&&e.divId===t.divId&&e.className===t.className&&e.isHidden===t.isHidden)},VHY4:function(e){e.exports={watermarkContainer:"PollWidget_watermarkContainer__hYFXF",flipCard:"PollWidget_flipCard__ikppG","card-inner":"PollWidget_card-inner__nLnh9",pollCard:"PollWidget_pollCard__SXidA"}}}]);