{"version":3,"file":"static/chunks/864-a24c87c8c57c1213.js","mappings":"uJASO,MAAMA,EAAoC,I,IAAA,KAC/CC,EAAO,GAAE,aACTC,GAAe,EAAK,OACpBC,EAAM,MACNC,EAAQ,WACT,EACC,OACE,UAACC,MAAAA,CACCC,MAAOL,EACPE,OAAQD,EAAeD,EAAOE,GAAkB,KAChDI,QAAQ,YACRC,KAAK,OACLC,MAAM,6B,WAEN,UAACC,IAAAA,CAAEC,OAAO,6B,WACR,SAACC,OAAAA,CAAKC,EAAE,MAAMC,EAAE,IAAIR,MAAM,KAAKH,OAAO,KAAKY,GAAG,KAAKP,KAAMJ,KACzD,SAACY,OAAAA,CACCC,SAAS,UACTC,SAAS,UACTC,EAAE,iUACFX,KAAK,cAGT,SAACY,OAAAA,C,UACC,UAACT,SAAAA,CACCU,GAAG,uBACHR,EAAE,MACFC,EAAE,IACFR,MAAM,KACNH,OAAO,KACPmB,YAAY,iBACZC,0BAA0B,O,WAE1B,SAACC,UAAAA,CAAQC,aAAa,IAAIC,OAAO,wBACjC,SAACC,gBAAAA,CACCC,GAAG,cACHC,KAAK,SACLC,OAAO,4CACPJ,OAAO,eAET,SAACK,WAAAA,CAASC,GAAG,OACb,SAACC,iBAAAA,CAAeC,aAAa,OAC7B,SAACP,gBAAAA,CACCE,KAAK,SACLC,OAAO,+CAET,SAACK,UAAAA,CACCC,KAAK,SACLC,IAAI,qBACJX,OAAO,kCAET,SAACC,gBAAAA,CACCC,GAAG,cACHC,KAAK,SACLC,OAAO,4CACPJ,OAAO,eAET,SAACK,WAAAA,CAASC,GAAG,OACb,SAACC,iBAAAA,CAAeC,aAAa,OAC7B,SAACP,gBAAAA,CACCE,KAAK,SACLC,OAAO,gDAET,SAACK,UAAAA,CACCC,KAAK,SACLC,IAAI,+BACJX,OAAO,kCAET,SAACS,UAAAA,CACCC,KAAK,SACLR,GAAG,gBACHS,IAAI,+BACJX,OAAO,oB,wFCrEZ,MAAMY,EAAoBC,IAC/B,MAAMC,EAAW,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,KAAyBC,IAAS,CAEtEC,QAAQ,EACRC,gBAAiB,GACjBC,oBAAoB,EAGpBC,mBAAmBC,GACjBL,EAAI,CAAEC,QAAQ,EAAMC,gBAAiBG,KAEvCC,sBACEN,EAAI,CAAEC,QAAQ,KAEhBM,mBACEP,EAAI,CAAEG,oBAAoB,KAE5BK,oBACER,EAAI,CAAEG,oBAAoB,U","sources":["webpack://_N_E/./src/components/Icon/IconCheckCircle.tsx","webpack://_N_E/./src/lib/cloudflareImageResize.ts","webpack://_N_E/./src/components/Image/Image.tsx","webpack://_N_E/./src/lib/gtag.ts","webpack://_N_E/./src/modules/Home/popupStore.ts"],"sourcesContent":["import React from \"react\";\n\ntype Props = {\n size?: number;\n isSameHeight?: boolean;\n height?: number;\n color?: string;\n};\n\nexport const IconCheckCircle: React.FC<Props> = ({\n size = 49,\n isSameHeight = false,\n height,\n color = \"#46CA6B\",\n}) => {\n return (\n <svg\n width={size}\n height={isSameHeight ? size : height ? height : \"48\"}\n viewBox=\"0 0 49 48\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <g filter=\"url(#filter0_dd_2137_7411)\">\n <rect x=\"6.5\" y=\"2\" width=\"36\" height=\"36\" rx=\"18\" fill={color} />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M31.7559 15.2443C32.0814 15.5699 32.0814 16.098 31.7559 16.4237L22.5974 25.5891C22.2722 25.9145 21.745 25.9148 21.4195 25.5896L17.2447 21.4198C16.9189 21.0945 16.9184 20.5664 17.2435 20.2404C17.5686 19.9144 18.0963 19.9139 18.422 20.2393L22.0076 23.8205L30.5774 15.2443C30.9028 14.9186 31.4305 14.9186 31.7559 15.2443Z\"\n fill=\"white\"\n />\n </g>\n <defs>\n <filter\n id=\"filter0_dd_2137_7411\"\n x=\"0.5\"\n y=\"0\"\n width=\"48\"\n height=\"48\"\n filterUnits=\"userSpaceOnUse\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feFlood floodOpacity=\"0\" result=\"BackgroundImageFix\" />\n <feColorMatrix\n in=\"SourceAlpha\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\n result=\"hardAlpha\"\n />\n <feOffset dy=\"4\" />\n <feGaussianBlur stdDeviation=\"3\" />\n <feColorMatrix\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0\"\n />\n <feBlend\n mode=\"normal\"\n in2=\"BackgroundImageFix\"\n result=\"effect1_dropShadow_2137_7411\"\n />\n <feColorMatrix\n in=\"SourceAlpha\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\"\n result=\"hardAlpha\"\n />\n <feOffset dy=\"2\" />\n <feGaussianBlur stdDeviation=\"2\" />\n <feColorMatrix\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0\"\n />\n <feBlend\n mode=\"normal\"\n in2=\"effect1_dropShadow_2137_7411\"\n result=\"effect2_dropShadow_2137_7411\"\n />\n <feBlend\n mode=\"normal\"\n in=\"SourceGraphic\"\n in2=\"effect2_dropShadow_2137_7411\"\n result=\"shape\"\n />\n </filter>\n </defs>\n </svg>\n );\n};\n","// import Const from \"../helpers/const\"\n\nimport { CONST } from \"./const\";\n\nexport type CloudflareOptions = {\n width?: number;\n height?: number;\n quality?: number;\n // more options\n //https://developers.cloudflare.com/images/image-resizing/url-format/#options\n};\n\nexport const isImageResizable = (sourceImage: string) => {\n const imageUrl = new URL(sourceImage);\n const imageHosts = CONST.IMAGE_HOSTS.split(\",\");\n\n return imageHosts.includes(imageUrl.host);\n};\n\nexport const resizeImageUrl = (\n sourceImage: string,\n options: CloudflareOptions\n) => {\n try {\n const imageUrl = new URL(sourceImage);\n\n if (isImageResizable(sourceImage)) {\n const pathname = imageUrl.pathname + imageUrl.search;\n\n const { width, height, quality } = options;\n\n let optionsText = width ? `width=${width}` : \"\";\n if (height) {\n optionsText += `,height=${height}`;\n }\n if (quality) {\n optionsText += `,quality=${quality}`;\n } else {\n optionsText += `,quality=75`;\n }\n if (width && height) {\n optionsText += `,fit=cover`;\n }\n if (width || height) {\n optionsText += `,format=auto`;\n }\n return `${imageUrl.origin}/cdn-cgi/image/${optionsText}${pathname}`;\n } else {\n return sourceImage;\n }\n } catch {\n return sourceImage;\n }\n};\n","import {\n CloudflareOptions,\n isImageResizable,\n resizeImageUrl,\n} from \"lib/cloudflareImageResize\";\n\nexport const Image: React.FC<\n CloudflareOptions & React.HTMLProps<HTMLImageElement>\n> = (props) => {\n const srcSet =\n props.src && isImageResizable(props.src)\n ? [1, 2, 3]\n .map(\n (i) =>\n `${resizeImageUrl(props.src, {\n width: props.width * i,\n height: props.height * i,\n })} ${i}x`\n )\n .join(\", \")\n : null;\n if (!props.src) return <div {...props} />;\n\n return (\n // @ts-ignore\n <img\n loading=\"lazy\"\n {...props}\n srcSet={srcSet}\n src={\n props.src && (props.width || props.height)\n ? resizeImageUrl(props.src, {\n width: props.width,\n height: props.height,\n })\n : // Allow non gokampus link to be shown for business image\n props.src\n }\n />\n );\n};\n","import { CONST } from \"lib/const\";\nimport type { Route } from \"nextjs-routes\";\nimport { isBrowser } from \"./ssr\";\n\nconst gaId = CONST.GA_ID;\nconst gtmId = CONST.GTM_ID;\n\n// https://morganfeeney.com/how-to/integrate-google-tag-manager-with-next-js\nexport const pushEvent = (stateLogin: string, currUser: any, rest: any) => {\n let dataPush = {\n user_id: rest.user_id ?? null,\n referral_code: rest?.referral_code ?? null,\n event: rest?.event ?? \"user_identity\",\n ...rest,\n };\n\n if (stateLogin == \"LOGIN\") {\n dataPush.user_id = currUser?.id;\n dataPush.referral_code =\n currUser?.referral !== \"\" ? currUser?.referral : null;\n } else {\n dataPush.referral_code = null;\n dataPush.user_id = null;\n dataPush.event = \"user_identity\";\n }\n\n if (typeof window !== \"undefined\") {\n console.log(\"push to GA ~~\", {\n ...dataPush,\n ...rest,\n });\n\n // @ts-ignore\n window.dataLayer.push({\n ...dataPush,\n ...rest,\n });\n }\n};\n\n// https://developers.google.com/analytics/devguides/collection/gtagjs/pages\nexport const pageview = (url: Route): void => {\n //@ts-ignore\n window.gtag(\"config\", gaId, {\n page_path: url,\n });\n};\n\nexport const pushDataLayer = ({ ...rest }) => {\n if (isBrowser()) {\n //@ts-ignore\n return window.dataLayer.push({\n ...rest,\n });\n }\n};\n","import createStore from \"zustand\";\n\nexport type PopupStore = {\n // state\n isShow: boolean | false;\n currentCtaEvent: string;\n isShowYoutubeModal: boolean;\n\n // actions\n showPopupFormSales: (event: string) => void;\n closePopupFormSales: () => void;\n showPopupYoutube: () => void;\n closePopupYoutube: () =>void;\n};\n\nexport const usePopupStoreFormSales = createStore<PopupStore>((set) => ({\n // state\n isShow: false,\n currentCtaEvent: '',\n isShowYoutubeModal: false,\n\n // actions\n showPopupFormSales(event) {\n set({ isShow: true, currentCtaEvent: event });\n },\n closePopupFormSales() {\n set({ isShow: false });\n },\n showPopupYoutube() {\n set({ isShowYoutubeModal: true });\n },\n closePopupYoutube(){\n set({ isShowYoutubeModal: false });\n }\n}));\n"],"names":["IconCheckCircle","size","isSameHeight","height","color","svg","width","viewBox","fill","xmlns","g","filter","rect","x","y","rx","path","fillRule","clipRule","d","defs","id","filterUnits","colorInterpolationFilters","feFlood","floodOpacity","result","feColorMatrix","in","type","values","feOffset","dy","feGaussianBlur","stdDeviation","feBlend","mode","in2","isImageResizable","sourceImage","imageUrl","URL","CONST","includes","host","resizeImageUrl","options","pathname","search","quality","optionsText","origin","Image","props","srcSet","src","map","i","join","img","loading","div","pushDataLayer","rest","isBrowser","window","dataLayer","push","usePopupStoreFormSales","createStore","set","isShow","currentCtaEvent","isShowYoutubeModal","showPopupFormSales","event","closePopupFormSales","showPopupYoutube","closePopupYoutube"],"sourceRoot":""}