try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="175b658a-67ab-4b61-81e5-d8799af2c1aa",e._sentryDebugIdIdentifier="sentry-dbid-175b658a-67ab-4b61-81e5-d8799af2c1aa")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5507],{45507:function(e,t,r){Promise.resolve().then(r.bind(r,62667)),Promise.resolve().then(r.bind(r,52040)),Promise.resolve().then(r.bind(r,73922)),Promise.resolve().then(r.bind(r,84778)),Promise.resolve().then(r.bind(r,79941)),Promise.resolve().then(r.bind(r,61907)),Promise.resolve().then(r.t.bind(r,38173,23))},26969:function(e,t,r){"use strict";r.d(t,{C:function(){return a}});var n=r(57437),s=r(66648);let i=e=>{var t;let{iconPath:r,iconAlt:i,text:a,onClick:o,className:l,iconWidth:c=30,iconHeight:d=30,label:u}=e;return(0,n.jsxs)("button",{className:"flex items-center ".concat(l),onClick:o,role:"button","aria-label":u,children:[(0,n.jsx)(s.default,{src:r,alt:null!==(t=null!=i?i:a)&&void 0!==t?t:"",width:c,height:d,className:"min-w-[".concat(c,"px]")}),a&&(0,n.jsx)("span",{className:"hidden md:flex",children:a})]})},a=e=>{let{onClick:t}=e;return(0,n.jsx)(i,{iconPath:"/assets/icons/icon_delete.svg",onClick:t,iconAlt:"Delete"})};t.Z=i},24109:function(e,t,r){"use strict";var n=r(57437),s=r(36428);t.Z=e=>{let{onClick:t,text:r,icon:i,backgroundColor:a,className:o,textColor:l,type:c,disabled:d=!1,ref:u}=e;return(0,n.jsxs)("button",{ref:u,type:c,onClick:t,className:"flex items-center justify-center bg-primary text-secondary py-1 px-2 ".concat(d?"cursor-not-allowed":"cursor-pointer"," ").concat(o),style:{backgroundColor:d?s.zb:a,color:l},disabled:d,children:[r,i]})}},61589:function(e,t,r){"use strict";var n=r(57437),s=r(2265),i=r(24109);t.Z=e=>{let{sendVerifiedCode:t,className:r="",disabled:a,defaultTime:o=0}=e,[l,c]=(0,s.useState)({sent:o>0,time:null!=o?o:0}),[d,u]=(0,s.useState)(!1),p=(0,s.useCallback)(async()=>{d||(u(!0),await t()&&c(e=>({...e,sent:!0,time:60})),u(!1))},[d,t]);return(0,s.useEffect)(()=>{let e;return l.time>0&&(e=setTimeout(()=>{c({...l,time:l.time-1})},1e3)),()=>clearTimeout(e)},[l]),(0,s.useEffect)(()=>{o<0&&l.sent&&c({sent:!1,time:0})},[o,l.sent]),(0,n.jsx)(i.Z,{className:r,text:d?"驗證碼發送中...":l.sent?"再次發送驗證碼".concat(l.time>0?"(".concat(l.time,"s)"):""):"發送驗證碼",disabled:l.time>0||a||d,onClick:p,type:"button"})}},62667:function(e,t,r){"use strict";r.d(t,{default:function(){return U}});var n=r(57437),s=r(66648),i=r(73922),a=r(2265),o=r(58851),l=r(16463),c=r(36428),d=r(41717),u=()=>{let[e,t]=(0,a.useState)("");return(0,n.jsx)(d.Z,{defaultValue:e,onChange:e=>{t(e.target.value)},inputBackground:"transparent",className:"border-0 border-b border-neutral",leading:(0,n.jsx)("div",{children:(0,n.jsx)(s.default,{src:"/assets/icons/icon_search_light.svg",width:24,height:24,alt:"search"})}),trailing:(0,n.jsx)(i.default,{prefetch:!1,href:"/search?q=".concat(e),className:"text-secondary cursor-pointer",children:"搜尋"}),textColor:c.dY,label:"搜尋"})};let p=e=>{let{categories:t,show:r,selected:s,onClick:a}=e;return(0,n.jsx)(h,{$show:r,children:t.map(e=>(0,n.jsx)("li",{className:"px-7 py-2 ".concat(s===e.id?"text-fontLight":""),children:(0,n.jsx)(i.default,{href:e.path||"/",scroll:!1,onClick:()=>a(),children:e.name})},e.id))})},m=o.ZP.div.withConfig({componentId:"sc-67ce741a-0"})(["position:fixed;top:",";left:0;height:100%;width:60%;transform:",";transition:transform 0.3s ease;z-index:1000;"],e=>"".concat(e.$top,"px"),e=>e.$open?"translateX(0)":"translateX(-100%)"),h=o.ZP.ul.withConfig({componentId:"sc-67ce741a-1"})(["margin-top:",";max-height:",";overflow:hidden;transition:max-height 0.3s ease;background-color:",";color:",";> li{&:last-child{margin-bottom:0.75rem;}&:first-child{margin-top:0.75rem;}}a:visited{color:",";}"],e=>e.$show?"0.5rem":"0",e=>e.$show?"400px":"0",c.lr,c.dY,c.dY);var x=e=>{let{open:t,top:r,onRequestClose:o,navs:d}=e,[h,x]=(0,a.useState)(),f=(0,l.useParams)(),v=e=>{x(t=>t===e?void 0:e)};return(0,n.jsxs)(m,{$open:t,$top:r,className:"flex flex-col bg-secondary",children:[(0,n.jsx)("div",{className:"bg-primary px-4 py-2 opacity-50",children:(0,n.jsx)(u,{})}),(0,n.jsx)("div",{className:"flex flex-col",children:d.map(e=>{var t;return e.path?(0,n.jsx)(i.default,{className:"px-7 py-2",href:e.path,onClick:o,children:e.name},e.name):(0,n.jsxs)("div",{className:"py-2",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("a",{className:"px-7 cursor-pointer w-full block",onClick:()=>v(e.id),style:{color:e.id===h?c.zb:c.zP},children:e.name}),(0,n.jsx)(s.default,{className:"mr-4 ".concat(e.id===h?"rotate-180":""),src:"/assets/icons/icon_dropdown.svg",width:16,height:16,alt:"Dropdown"})]}),(0,n.jsx)(p,{show:e.id===h,categories:(null===(t=d.find(e=>e.id===h))||void 0===t?void 0:t.children)||[],selected:f.id,onClick:()=>{o&&o()}})]},e.name)})})]})};let f=()=>{document.body.style.overflow="hidden"},v=()=>{document.body.style.overflow="scroll"};var g=e=>{let{navs:t}=e,r=(0,l.usePathname)(),i=(0,l.useSearchParams)(),[o,c]=(0,a.useState)(!1),[d,u]=(0,a.useState)(0),p=e=>{let t;let r=document.querySelector("header");t=r?r.getClientRects():e.currentTarget.getClientRects(),c(e=>!e),u(t[0].top+t[0].height)};return(0,a.useEffect)(()=>{o?f():v()},[o]),(0,a.useEffect)(()=>{c(!1)},[r,i]),(0,n.jsxs)("div",{className:"flex lg:hidden",children:[(0,n.jsx)(b,{className:"px-2",onClick:p,role:"button","aria-label":"選單",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{}),(0,n.jsx)("span",{}),(0,n.jsx)("span",{}),(0,n.jsx)("span",{})]})}),o&&(0,n.jsx)(j,{top:d,children:(0,n.jsx)("button",{onClick:p,children:(0,n.jsx)(s.default,{className:"dark:invert",src:"/assets/icons/icon_close_light.svg",alt:"Close",width:30,height:30})})}),(0,n.jsx)(x,{navs:t,open:o,top:d,onRequestClose:()=>c(!1)})]})};let b=o.ZP.button.withConfig({componentId:"sc-182a5181-0"})(["> div{position:relative;width:2rem;height:1.5rem;> span{position:absolute;display:block;width:100%;background-color:black;height:2px;left:0;&:nth-child(1){top:0;width:80%;left:20%;}&:nth-child(2){top:50%;transform:translateY(-50%);}&:nth-child(3){bottom:0;}&:nth-child(4){top:0;left:0;width:2px;height:2px;border-radius:50%;}}}"]),j=o.ZP.div.withConfig({componentId:"sc-182a5181-1"})(["position:fixed;top:",";left:0;height:100%;width:100%;z-index:1;background-color:rgba(0,0,0,0.3);> button{position:absolute;top:1rem;right:1rem;}"],e=>"".concat(e.top,"px"));var y=r(26969);let w=o.ZP.span.withConfig({componentId:"sc-68c889b-0"})(["display:flex;justify-content:center;align-items:center;border-radius:50%;background-color:",";position:relative;font-size:.75rem;color:",';min-width:1.125rem;max-height:1.125rem;margin-left:0.25rem;&:before{position:absolute;content:"";top:50%;transform:translateY(-50%);right:90%;border-right:5px solid ',";border-bottom:1.5px solid transparent;border-top:1.5px solid transparent;}"],c.lr,c.dY,c.lr);var C=e=>{let{quantity:t}=e;return(0,n.jsx)(w,{children:t})},k=r(11444),N=r(19930),S=r(22736),Z=r(43849);let P=o.ZP.ul.withConfig({componentId:"sc-81094fd1-0"})(["background-color:",";width:150px;position:absolute;left:50%;top:calc(100% + 1.125rem);transform:translateX(-50%);overflow:hidden;max-height:",";z-index:100;border-bottom:"," solid ",";box-shadow:rgba(149,157,165,0.2) 0px 8px 24px;> li{margin-bottom:0.75rem;text-align:center;&:hover{color:",";}&:first-child{margin-top:1.5rem;}}a{cursor:pointer;}"],c.dY,e=>e.$show?"1000px":"0",e=>e.$show?"3px":"0",c.lr,c.lr);var _=e=>{let{show:t,onClose:r}=e,{handleLogout:s}=(0,S.Z)(),a=(0,k.v9)(e=>e.account.user),o=e=>{"logout"===e.id&&s()};return(0,n.jsx)(P,{$show:t,children:N.y2.filter(e=>"report"!==e.id||(null==a?void 0:a.role)===Z.X.group_buying_master).map(e=>(0,n.jsx)("li",{children:e.path?(0,n.jsx)(i.default,{href:e.path,onClick:r,target:"consolidation"===e.id?"_blank":"",children:e.name}):(0,n.jsx)("a",{onClick:()=>o(e),children:e.name})},e.name))})},M=r(94610),E=r(27266),q=()=>{let[e,t]=(0,a.useState)(!1),{replace:r}=(0,l.useRouter)(),i=(0,l.useSearchParams)(),o=()=>{t(!e)},c=(0,E.y1)(e=>{let t=new URLSearchParams(i),{value:n}=e.target;n?t.set("q",n):t.delete("q");let s=t.get("q");s?r("/search?q=".concat(s)):r("/")},300);return(0,n.jsxs)("div",{className:"hidden md:flex items-center justify-end px-3 min-w-[180px]",children:[(0,n.jsx)("button",{onClick:o,children:(0,n.jsx)(s.default,{src:"/assets/icons/icon_search.svg",height:24,width:24,alt:"Search"})}),(0,n.jsx)("div",{className:"max-w-[0] overflow-hidden transition-all duration-300 ease-in-out",style:{maxWidth:e?"120px":"0"},id:"search",children:(0,n.jsx)("input",{type:"text",placeholder:"搜尋",className:"w-full text-right border-b border-neutralDark outline-none",onChange:c,onBlur:o,name:"search"})})]})},O=e=>{let{disabledSearch:t=!1}=e,[r,s]=(0,a.useState)(!1),{openLoginModal:o}=(0,M.Z)(),l=(0,k.v9)(e=>e.cart.count),c=(0,k.v9)(e=>e.account),d=()=>{s(!r)};if(c.loading)return(0,n.jsx)("div",{});let u=!!c.user;return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"flex",children:[!t&&(0,n.jsx)(a.Suspense,{children:(0,n.jsx)(q,{})}),(0,n.jsxs)("div",{className:"px-3 relative border-l border-neutral",children:[(0,n.jsx)(y.Z,{text:u?"我的帳戶":"會員登入",className:"text-sm text-neutralDark md:min-w-[90px]",iconPath:"/assets/icons/icon_member.svg",onClick:()=>{u?d():o()}}),(0,n.jsx)(_,{show:r,onClose:()=>s(!1)})]}),(0,n.jsxs)("div",{className:"pl-3 flex items-center border-l border-neutral",children:[(0,n.jsx)(i.default,{href:"/cart",scroll:!0,"aria-label":"cart",children:(0,n.jsx)(y.Z,{label:"購物車",className:"min-w-[30px]",text:"",iconPath:"/assets/icons/icon_cart.svg",onClick:()=>{}})}),l>0&&(0,n.jsx)(C,{quantity:l})]})]})})},R=r(87138);let I=o.ZP.div.withConfig({componentId:"sc-a8b0aa9-0"})(["overflow:hidden;transition:0.3s;max-height:",";background-color:","ea;position:absolute;width:100%;top:100%;left:0;z-index:100;display:flex;flex-direction:column;align-items:center;> a{color:",";margin-bottom:0.5rem;&:first-child{margin-top:1rem;}&:last-child{margin-bottom:1rem;}}"],e=>e.$open?"400px":"0",c.lr,c.dY);var T=e=>{let{open:t,categories:r,onClick:s}=e,i=(0,l.useParams)();return(0,n.jsx)(I,{$open:t,children:r.map(e=>(0,n.jsx)(R.default,{prefetch:!1,className:"hover:text-fontLight ".concat(i.id===e.id?"text-fontLight":""),href:e.path||"/",scroll:!1,onClick:()=>{s()},children:e.name},e.id))})};r(74590);var L=r(58064);(0,L.$)("cf2eb8c81ca63b5e16325394f4d471d573d1a3e0"),(0,L.$)("c3b189c360053f422258009e0f7d49db62ca5794"),(0,L.$)("747d32d0cdb1f536d036cbea0b42139fc144b766"),(0,L.$)("97bc0ac1d73835c65e1ff81349888e79212d75f8");var $=(0,L.$)("4279b36cfec1e5602a007f13acd25b65a4a83ad8"),z=(0,L.$)("c070c0ddd24c908d9780e50f994d1154a7cc44dd");let D=o.ZP.div.withConfig({componentId:"sc-4e640171-0"})(["overflow:hidden;.text-item{animation:slide-down 0.5s ease-in-out;}@keyframes slide-down{0%{transform:translateY(-100%);opacity:0;}100%{transform:translateY(0);opacity:1;}}"]);var A=e=>{var t,r;let{isInvisible:s}=e,i=(0,l.useSearchParams)(),[o,c]=(0,a.useState)(0),[d,u]=(0,a.useState)([]);return(0,a.useEffect)(()=>{var e;let t=null!==(e=i.get("shop_id"))&&void 0!==e?e:"1";s||(s?()=>z(t):()=>$(Number(t)))().then(e=>{if(e.success&&e.data&&e.data.length>0){u(e.data.map(e=>({text:e.title,url:e.url})));return}document.getElementById("announcement")})},[s,i]),(0,a.useEffect)(()=>{if(d.length>0){let e=setInterval(()=>{c(e=>(e+1)%(null==d?void 0:d.length))},5e3);return()=>clearInterval(e)}},[d]),(0,n.jsx)(D,{className:"h-[45px] bg-primary text-center flex items-center justify-center",children:0===d.length?(0,n.jsx)("div",{}):(0,n.jsx)("div",{className:"text-item",children:(0,n.jsx)("a",{href:null===(t=d[o])||void 0===t?void 0:t.url,target:"_blank",referrerPolicy:"no-referrer",children:(0,n.jsx)("h2",{className:"text-secondary line-clamp-2",children:null===(r=d[o])||void 0===r?void 0:r.text})})},o)})};o.ZP.nav.withConfig({componentId:"sc-799dafbe-0"})(["> a:hover{}"]);var U=e=>{var t;let{disableNav:r=!1,navs:o,isInvisible:l}=e,[c,d]=(0,a.useState)(!1),[u,p]=(0,a.useState)(),m=(0,a.useRef)(null),h=(0,a.useCallback)(e=>{m.current&&clearTimeout(m.current),p(e),d(!0)},[]),x=(0,a.useCallback)(e=>{m.current=setTimeout(()=>{d(!1)},e||0)},[]),f=(0,n.jsx)("div",{className:"max-w-[150px] md:max-w-[238px]",children:(0,n.jsxs)("picture",{children:[(0,n.jsx)("source",{media:"(max-width: 767px)",srcSet:"/assets/images/logo_mobile.jpg"}),(0,n.jsx)(s.default,{style:{width:"100%",height:"auto"},src:"/assets/images/logo.jpg",width:600,height:149,alt:"髮基因 頭皮調理專家"})]})});return(0,n.jsxs)("header",{className:"fixed top-0 left-0 right-0 z-50 bg-secondary",children:[(0,n.jsx)(a.Suspense,{fallback:null,children:(0,n.jsx)(A,{isInvisible:l})}),(0,n.jsxs)("div",{className:"h-[45px] relative py-1 px-2 border-b flex ".concat(r?"justify-center":"justify-between"," items-center md:h-[60px] md:items-center md:px-10 md:py-0"),children:[(0,n.jsx)(a.Suspense,{children:r?(0,n.jsx)("div",{}):(0,n.jsx)(g,{navs:o})}),r?f:(0,n.jsx)(i.default,{href:"/",className:"md:ml-0 ld:ml-0",children:f}),!r&&(0,n.jsxs)("nav",{className:"hidden lg:flex items-center self-center",children:[o.map(e=>e.path?(0,n.jsx)(i.default,{className:"px-4",href:e.path,children:e.name},e.path):(0,n.jsxs)("a",{className:"px-4 flex items-center cursor-pointer",onClick:()=>{h(e.id)},onMouseEnter:()=>h(e.id),onMouseLeave:()=>x(500),children:[e.name,(0,n.jsx)("span",{className:"max-w-[12px]",children:(0,n.jsx)(s.default,{src:"/assets/icons/icon_dropdown.svg",width:12,height:12,alt:"Dropdown"})})]},e.name)),(0,n.jsx)("div",{onMouseEnter:()=>h(u),onMouseLeave:()=>x(),children:(0,n.jsx)(T,{open:c,categories:(null===(t=o.find(e=>e.id===u))||void 0===t?void 0:t.children)||[],onClick:h})})]}),r?(0,n.jsx)("div",{className:"absolute right-1 md:right-10",children:(0,n.jsx)(O,{disabledSearch:!0})}):(0,n.jsx)(O,{})]})]})}},44105:function(e,t,r){"use strict";var n=r(57437),s=r(66648),i=r(30112),a=r(2265);let o="/assets/images/misspic.jpg";t.Z=e=>{let{aspectRatio:t,src:r,width:l,height:c,alt:d,fill:u,style:p,objectFit:m="contain",className:h,sizes:x="100vw"}=e,[f,v]=(0,a.useState)(r||o);return t?(0,n.jsx)(i.Z,{className:h,mobileUrl:f,desktopUrl:f,aspectRatio:t,alt:d,objectFit:m,onError:()=>v(o),sizes:x}):(0,n.jsx)(s.default,{className:h,src:f,alt:d,width:l,height:c,style:p,fill:u,onError:()=>v(o),sizes:x})}},30112:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(57437),s=r(66648);function i(e){let{mobileUrl:t,desktopUrl:r,aspectRatio:i,alt:a,className:o="",objectFit:l="cover",onError:c,sizes:d="100vw"}=e;return(0,n.jsx)("div",{className:"w-full".concat(o?" ".concat(o):""),children:(0,n.jsx)("div",{className:"relative",style:{aspectRatio:i},children:(0,n.jsxs)("picture",{className:"absolute inset-0",children:[(0,n.jsx)("source",{media:"(min-width: 768px)",srcSet:r}),(0,n.jsx)("source",{media:"(max-width: 767px)",srcSet:t}),(0,n.jsx)(s.default,{alt:a,src:t,fill:!0,style:{objectFit:l},sizes:d,onError:c})]})})})}},88241:function(e,t,r){"use strict";var n=r(57437),s=r(2265),i=r(58851),a=r(36428),o=r(71130);let l=i.ZP.div.withConfig({componentId:"sc-2004225d-0"})(["border:1px solid ",";display:flex;align-items:center;justify-content:space-between;padding:4px 0;border-radius:4px;input{width:100%;border:none;outline:none;text-align:center;-moz-appearance:textfield;&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}}> button{padding:0 8px;color:",";&:first-child{border-right:1px solid ",";}&:last-child{border-left:1px solid ",";}}"],a.zb,a.zb,a.zb,a.zb);t.Z=e=>{let{onChanged:t,defaultValue:r,className:i,max:a,maxCallback:c}=e,[d,u]=(0,s.useState)(null==r?void 0:r.toString()),{openInfoModal:p}=(0,o.Z)();return(0,s.useEffect)(()=>{r&&u(null==r?void 0:r.toString())},[r]),(0,n.jsxs)(l,{className:i,children:[(0,n.jsx)("button",{onClick:e=>{var r;e.preventDefault();let n=Math.max((null!==(r=Number(d))&&void 0!==r?r:0)-1,1);u(n.toString()),Number(n)!==Number(d)&&t(n)},children:"-"}),(0,n.jsx)("input",{type:"number",value:d,onChange:e=>{let r=Number(e.target.value);return 0===r?u(""):a&&r>a?(c?c():p("已達加價購上限"),u(a.toString())):void(u(r.toString()),t(r))},onClick:e=>e.preventDefault()}),(0,n.jsx)("button",{onClick:e=>{var r;e.preventDefault();let n=(null!==(r=Number(d))&&void 0!==r?r:0)+1;if(a&&n>a){c?c():p("已達加價購上限");return}u(n.toString()),t(n)},children:"+"})]})}},87293:function(e,t,r){"use strict";var n=r(57437),s=r(36428),i=r(58851);t.Z=e=>{let{onChange:t,name:r,checked:s,className:i}=e;return(0,n.jsxs)(a,{className:"rounded border border-neutralDark block w-[1em] h-[1em] overflow-hidden".concat(i?" ".concat(i):""),children:[(0,n.jsx)("input",{type:"checkbox",checked:s,onChange:t,name:r}),(0,n.jsx)("span",{className:"custom-checkbox"})]})};let a=i.ZP.label.withConfig({componentId:"sc-a750223f-0"})(['input[type="checkbox"]{display:none;}.custom-checkbox{display:block;width:100%;height:100%;position:relative;cursor:pointer;background-color:',';}input[type="checkbox"]:checked + .custom-checkbox{background-color:',';}input[type="checkbox"]:checked + .custom-checkbox::after{content:"✔";color:',";font-size:0.875em;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);}"],s.dY,s.dY,s.zb)},25773:function(e,t,r){"use strict";var n=r(57437),s=r(58851),i=r(41717),a=r(2265),o=r(66648);let l=s.ZP.div.withConfig({componentId:"sc-bd0c2e89-0"})(["position:relative;& > button{position:absolute;right:10px;top:50%;transform:translateY(-50%);cursor:pointer;}"]);t.Z=e=>{let{...t}=e,[r,s]=(0,a.useState)(!1);return(0,n.jsxs)(l,{children:[(0,n.jsx)(i.Z,{...t,type:r?"text":"password",className:"pr-6"}),(0,n.jsx)("button",{type:"button",onClick:()=>s(!r),children:(0,n.jsx)(o.default,{src:r?"/assets/icons/icon_password_show.svg":"/assets/icons/icon_password_hide.svg",alt:"eye",width:20,height:20})})]})}},41717:function(e,t,r){"use strict";var n=r(57437),s=r(58851);t.Z=e=>{let{type:t="text",leading:r,trailing:s,defaultValue:a,placeholder:o,onChange:l,className:c,textAlign:d,inputBackground:u,textColor:p,name:m,disabled:h=!1,value:x,label:f}=e;return(0,n.jsxs)("div",{className:"".concat(null!=c?c:""," border border-neutral flex"),children:[r&&(0,n.jsx)("div",{children:r}),(0,n.jsx)(i,{className:"px-2 py-1 outline-none border-0 flex-1",type:t,defaultValue:a,value:x,onChange:l,placeholder:o,$textAlign:d,$inputBackground:u,$textColor:p,name:m,disabled:h,"aria-label":f}),s&&(0,n.jsx)("div",{className:"flex",children:s})]})};let i=s.ZP.input.withConfig({componentId:"sc-d612f764-0"})(["width:100%;text-align:",";background-color:",";color:",";&::placeholder{color:",";}"],e=>{var t;return null!==(t=e.$textAlign)&&void 0!==t?t:"left"},e=>{var t;return null!==(t=e.$inputBackground)&&void 0!==t?t:"inherit"},e=>e.$textColor,e=>e.$textColor)},51064:function(e,t,r){"use strict";var n=r(57437),s=r(36428);let i=r(58851).ZP.div.withConfig({componentId:"sc-ca9db8e0-0"})(["width:","px;height:","px;border-radius:50%;display:block;margin:auto;position:relative;background:#fff;box-shadow:-","px 0 #fff,","px 0 #fff;box-sizing:border-box;animation:shadowPulse 1s linear infinite;@keyframes shadowPulse{33%{background:#fff;box-shadow:-","px 0 ",",","px 0 #fff;}66%{background:",";box-shadow:-","px 0 #fff,","px 0 #fff;}100%{background:#fff;box-shadow:-","px 0 #fff,","px 0 ",";}}"],e=>e.$width,e=>e.$width,e=>e.$d,e=>e.$d,e=>e.$d,s.lr,e=>e.$d,s.lr,e=>e.$d,e=>e.$d,e=>e.$d,e=>e.$d,s.lr);t.Z=e=>{let{width:t=16}=e;return(0,n.jsx)("div",{style:{width:4*t,alignSelf:"center"},children:(0,n.jsx)(i,{$width:t,$d:1.5*t})})}},42088:function(e,t,r){"use strict";r.d(t,{DF:function(){return c},fe:function(){return d}});var n=r(57437);r(2265);var s=r(7583),i=r.n(s),a=r(66648),o=r(58851),l=r(36428);let c=e=>{let{onRequestClose:t}=e;return(0,n.jsx)("div",{className:"text-right",children:(0,n.jsx)("button",{onClick:t,children:(0,n.jsx)(a.default,{src:"/assets/icons/icon_close.svg",width:24,height:24,alt:"Close"})})})},d=e=>{let{children:t}=e;return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(m,{children:t})})};t.ZP=e=>{let{isOpen:t,onRequestClose:r,contentLabel:s,children:a,overlayClass:o}=e;return(0,n.jsx)(i(),{isOpen:t,onRequestClose:r,contentLabel:s,ariaHideApp:!1,className:u,overlayClassName:p+" "+o,children:(0,n.jsx)("div",{className:"bg-secondary min-w-[300px] md:min-w-[500px]",children:a})})};let u="fixed inset-0 flex items-center justify-center z-[100]",p="fixed inset-0 bg-black bg-opacity-50 z-[100]",m=o.ZP.div.withConfig({componentId:"sc-d12963f0-0"})(['display:flex;flex-direction:column;align-items:center;position:relative;padding-bottom:1.5rem;&:after{content:"";position:absolute;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:10px solid ',";top:100%;}"],l.dY)},52040:function(e,t,r){"use strict";r.d(t,{default:function(){return eo}});var n=r(57437),s=r(2265),i=r(58851),a=r(66648),o=r(42088),l=r(36428),c=r(24109);let d=i.ZP.div.withConfig({componentId:"sc-638759fb-0"})(['display:flex;flex-direction:column;align-items:center;position:relative;padding-bottom:1.5rem;&:after{content:"";position:absolute;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:10px solid ',";top:100%;}"],l.dY);var u=e=>{let{isOpen:t,onRequestClose:r,message:s,onConfirm:i}=e;return(0,n.jsxs)(o.ZP,{isOpen:t,onRequestClose:r,overlayClass:"z-[200]",children:[(0,n.jsxs)("div",{className:"flex items-center border-b pt-4 pb-2 mb-4 mx-2",children:[(0,n.jsx)("div",{className:"mr-3",children:(0,n.jsx)(a.default,{src:"/assets/icons/logo.svg",width:32,height:32,alt:"Logo"})}),(0,n.jsx)("p",{children:"髮基因提醒"})]}),(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(a.default,{src:"/assets/icons/icon_feedback_info.svg",width:50,height:50,alt:"Info"})}),(0,n.jsx)(d,{children:(0,n.jsx)("p",{className:"px-4 whitespace-pre text-center",children:s})}),(0,n.jsx)("div",{className:"bg-primary pt-10 pb-7",children:(0,n.jsx)(c.Z,{className:"min-w-[100px] py-0 justify-center mx-auto",text:"確定",backgroundColor:l.zP,textColor:l.dY,onClick:()=>{null==i||i(),r()}})})]})},p=r(81422);let m=i.ZP.div.withConfig({componentId:"sc-9e6212b1-0"})(['display:flex;flex-direction:column;align-items:center;position:relative;padding-bottom:1.5rem;&:after{content:"";position:absolute;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:10px solid ',";top:100%;}"],l.dY);var h=e=>{let{isOpen:t,onRequestClose:r,message:s,onConfirm:i,confirmText:d,title:u,description:p,cancelText:h,onCancel:x}=e;return(0,n.jsxs)(o.ZP,{isOpen:t,onRequestClose:r,children:[(0,n.jsxs)("div",{className:"flex items-center border-b pt-4 pb-2 mb-4 mx-2",children:[(0,n.jsx)("div",{className:"mr-3",children:(0,n.jsx)(a.default,{src:"/assets/icons/logo.svg",width:32,height:32,alt:"Logo"})}),(0,n.jsx)("p",{children:"髮基因提醒"})]}),(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(a.default,{src:"/assets/icons/icon_feedback_question.svg",width:50,height:50,alt:"Question Mark"})}),(0,n.jsxs)(m,{children:[(0,n.jsx)("h4",{className:"text-lg",children:u}),(0,n.jsx)("p",{className:"text-sm text-fontLight",children:s}),p&&(0,n.jsx)("p",{className:"mt-2 text-sm text-fontLight whitespace-pre-wrap text-center",children:p})]}),(0,n.jsxs)("div",{className:"bg-primary pt-10 pb-7 flex justify-center gap-3",children:[(0,n.jsx)(c.Z,{className:"border border-secondary min-w-[100px] py-0 lg:min-w-[150px]",text:d||"確認",backgroundColor:l.lr,textColor:l.dY,onClick:()=>{null==i||i(),r()}}),(0,n.jsx)(c.Z,{className:"min-w-[100px] py-0 lg:min-w-[150px]",text:h||"按錯了",backgroundColor:l.zP,textColor:l.dY,onClick:()=>{r(),null==x||x()}})]})]})},x=r(87293),f=r(41717),v=r(73922),g=r(25773),b=r(22736),j=r(71130),y=r(55547);let{useLoginMutation:w}=r(62376).gk.injectEndpoints({endpoints:e=>({login:e.mutation({query:e=>{let{account:t,password:r}=e;return{url:"/login",method:"POST",body:{account:t,password:r.toLowerCase()}}},transformErrorResponse:e=>({success:!1,data:e.data.data,message:e.data.message})})})});var C=r(44785),k=e=>{let{onLogin:t,onRegister:r}=e,[i,o]=(0,s.useState)(""),[d,u]=(0,s.useState)(""),[m,h]=(0,s.useState)(),[k,N]=(0,s.useState)(!1),[S,Z]=(0,s.useState)(!1),[P,{isError:_}]=w(),{state:M,dispatch:E}=(0,s.useContext)(p.t),{handleLoginSuceess:q}=(0,b.Z)(),O=(0,s.useRef)(0),R=(0,s.useRef)(""),{openInfoModal:I}=(0,j.Z)(),T=async e=>{if(e.preventDefault(),!k){N(!0),h(void 0),i!==R.current&&(R.current=i,O.current=0);try{let e=await P({account:i,password:d}).unwrap();if(e.success){let{user:r,access_token:n}=e.data;C.Z.set("token",n),await q(r),N(!1),t()}}catch(r){N(!1);let{data:e,message:t}=r;"Unauthorized"===t||(null==e?void 0:e.code)===2008?(h("帳號或密碼錯誤"),O.current+=1,O.current>=5?I("帳號被鎖定，請聯繫客服人員"):O.current>=3&&I("帳號密碼錯誤3次，超過5次將鎖定帳號")):h(t||"發生錯誤")}}};return(0,n.jsxs)("div",{className:"flex flex-col items-stretch text-fontLight md:px-[50px]",children:[(0,n.jsx)("h4",{className:"text-2xl text-center mb-4 text-font",children:"會員登入"}),(0,n.jsx)(c.Z,{text:"快速登入",backgroundColor:"#00ba00",className:"justify-center",icon:(0,n.jsx)(a.default,{src:"/assets/icons/icon_line.svg",width:32,height:32,className:"ml-1",alt:"Line Login"}),type:"button",onClick:()=>{let e=y.Z.localStorageGet("loginRedirectPath"),r=encodeURIComponent(JSON.stringify({redirect:e,guest:y.Z.localStorageGet("guest_token"),cart:y.Z.localStorageGet("current_cart"),params:{key:Date.now()}})),n="https://access.line.me/oauth2/v2.1/authorize?response_type=code&client_id=".concat("2006427973","&redirect_uri=").concat("https://www.scalprecovery.com/oauth","&state=").concat(r,"&scope=profile%20openid%20email");window.location.href=n,t()}}),(0,n.jsxs)("div",{className:"w-full relative my-7",children:[(0,n.jsx)("hr",{className:"border-neutralDark"}),(0,n.jsx)("div",{className:"absolute bg-secondary text-neutralDark px-2 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:"or"})]}),(0,n.jsx)("div",{className:"mb-5",children:(0,n.jsx)(f.Z,{className:"py-1",placeholder:"帳號(手機號碼 or Email)",textColor:l.uK,defaultValue:i,onChange:e=>o(e.target.value),name:"account"})}),(0,n.jsxs)("div",{className:"mb-10",children:[(0,n.jsx)(g.Z,{className:"py-1",placeholder:"密碼 (8~12 碼英數字混合)",textColor:l.uK,defaultValue:d,onChange:e=>u(e.target.value)}),(0,n.jsx)("div",{children:_&&(0,n.jsx)("p",{className:"text-warning",children:m})})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)(x.Z,{checked:S,onChange:()=>{let e=!S;Z(e),y.Z.localStorageSet("remember_account",e)}}),(0,n.jsx)("div",{className:"ml-1",children:"記住登入帳號"})]}),(0,n.jsx)(v.default,{prefetch:!1,href:"/forget",onClick:()=>{r()},className:"text-primary underline",children:"忘記密碼?"})]}),(0,n.jsx)("div",{className:"my-5",children:(0,n.jsx)(c.Z,{disabled:!i||!d||k,className:"w-full justify-center",text:k?"登入中...":"登入",onClick:T,type:"button"})}),(0,n.jsxs)("div",{className:"flex justify-center mb-10",children:[(0,n.jsx)("p",{children:"加入會員享受獨享優惠"}),(0,n.jsx)("a",{className:"text-primary underline ml-5 cursor-pointer",onClick:()=>{r(),E({type:p.U.openOverseaModal,payload:{source:"register"}})},children:"立即註冊"})]})]})},N=e=>{let{isOpen:t,onRequestClose:r}=e;return(0,n.jsx)(o.ZP,{isOpen:t,onRequestClose:r,children:(0,n.jsxs)("div",{className:"p-2",children:[(0,n.jsx)(o.DF,{onRequestClose:r}),(0,n.jsx)(k,{onLogin:r,onRegister:r})]})})},S=r(59772),Z=r(61589),P=r(99480),_=r(16450),M=e=>{let{onPhoneChanged:t,phone:r,errors:s,allowBeUsed:i=!1,skipCheck:a=!1}=e,[o]=(0,_.C1)(),{openInfoModal:l,openQuestionModal:c}=(0,j.Z)(),d=async()=>{var e;if(a)return(0,P.lF)(r,"phone","update_member_info"),!0;let t=await o(r);return(null===(e=t.data)||void 0===e?void 0:e.success)&&t.data.data.isRegistered?i?await new Promise(e=>{c({title:"此手機號碼已註冊過,是否合併會員",callback:async()=>{l("請再次驗證手機號碼"),(0,P.lF)(r,"phone","register"),e(!0)},onCancel:()=>{e(!1)},confirmText:"是",cancelText:"否"})}):(l("此手機號碼已被使用"),!1):((0,P.lF)(r,"phone","register"),!0)},u=!s.phone&&""!==r.trim();return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex mt-2",children:[(0,n.jsx)("div",{children:(0,n.jsx)(f.Z,{className:"flex-1 mr-4",name:"phone",placeholder:"手機號碼",onChange:e=>{t(e.target.value)}})}),(0,n.jsx)(Z.Z,{sendVerifiedCode:d,disabled:!u})]}),(0,n.jsx)("div",{children:s.phone&&(0,n.jsx)("p",{className:"text-warning text-sm",children:s.phone})})]})},E=r(51680),q=r(43849),O=r(9946),R=r(89669),I=r(11444),T=r(44487);let L=S.z.object({phone:R.tH});var $=e=>{let{isOpen:t,onRequestClose:r,source:i,purpose:a}=e,[l,c]=(0,s.useState)(""),[d,u]=(0,s.useState)(""),[p,m]=(0,s.useState)({}),[h,x]=(0,s.useState)(!1),[f,v]=(0,s.useState)(!1),{handleLineRegister:g,handleLoginFail:j}=(0,b.Z)(),y=(0,I.I0)(),w=async()=>{if(f)return;v(!0);let e=await (0,P.VP)({target:l,code:d,type:"phone",source:i});if(v(!1),e.success){r();let{token:t}=e.data;if(a===O.h.lineRegister&&g({token:t,value:l,source:"phone"}),a===O.h.updateAccount){let e=await (0,P.sG)({},{phoneToken:t});if(e.success){let{data:t}=e;return t&&y((0,T.av)((0,q.O)(t))),!0}}}else m({verificationCode:e.message})};return(0,n.jsx)(o.ZP,{isOpen:t,onRequestClose:r,children:(0,n.jsxs)("div",{className:"p-2 text-fontLight",children:[(0,n.jsx)(o.DF,{onRequestClose:r}),(0,n.jsxs)("div",{className:"px-10 pb-5",children:[(0,n.jsx)("h4",{className:"text-center text-xl",children:"會員手機驗證"}),(0,n.jsx)("p",{className:"mt-7 mb-5 text-center",children:"輸入手機號碼以獲得更完整的商家活動資訊"}),(0,n.jsx)(M,{phone:l,onPhoneChanged:e=>{c(e);let t=L.safeParse({phone:e});if(t.success)m({});else{let e=t.error.flatten().fieldErrors;m({phone:e.phone?e.phone[0]:void 0})}},errors:p,allowBeUsed:a===O.h.lineRegister,skipCheck:a===O.h.updateAccount}),(0,n.jsx)(E.Z,{verificationCode:d,errors:p,onVerificationCodeChanged:e=>{u(e)},onVerifyCode:w,isVerified:h})]})]})})},z=r(36583),D=r(19930),A=e=>{let{email:t,onEmailChanged:r,emailSubfix:s,onEmailSubfixChanged:i,errors:a,allowBeUsed:o=!1,skipCheck:l=!1}=e,[c]=(0,_.C1)(),{openInfoModal:d,openQuestionModal:u}=(0,j.Z)(),p=async()=>{var e;let r=t+s.value;if(l)return(0,P.lF)(r,"email","update_member_info"),!0;let n=await c(r);return(null===(e=n.data)||void 0===e?void 0:e.success)&&n.data.data.isRegistered?o?await new Promise((e,t)=>{u({title:"此信箱已註冊過，是否合併會員",callback:async()=>{d("請再次驗證信箱"),(0,P.lF)(r,"email","register"),e(!0)},onCancel:()=>{e(!1)},confirmText:"是",cancelText:"否"})}):(d("此信箱已被使用"),!1):((0,P.lF)(r,"email","register"),!0)};return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"flex mt-2",children:[(0,n.jsx)(f.Z,{defaultValue:t,className:"mr-4 flex-1",name:"email",placeholder:"Email",onChange:e=>{r(e.target.value)}}),(0,n.jsx)(z.Z,{theme:"normal",defaultValue:s,onChange:e=>{i(e)},options:D.VP})]}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsx)("div",{children:a.email&&(0,n.jsx)("p",{className:"text-warning text-sm",children:a.email})}),(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(Z.Z,{sendVerifiedCode:p,disabled:!!a.email||0===t.trim().length})})]})]})};let U=S.z.object({email:R.Le});var V=e=>{let{isOpen:t,onRequestClose:r,source:i,purpose:a}=e,[l,c]=(0,s.useState)(""),[d,u]=(0,s.useState)(D.VP[0]),[p,m]=(0,s.useState)(""),[h,x]=(0,s.useState)({}),[f,v]=(0,s.useState)(!1),[g,j]=(0,s.useState)(!1),{handleLineRegister:y,handleLoginFail:w}=(0,b.Z)(),C=(0,I.I0)(),k=(0,s.useCallback)(e=>{let t=U.safeParse({email:e});if(t.success)x({});else{let e=t.error.flatten().fieldErrors;x({email:e.email?e.email[0]:void 0})}},[]),N=async()=>{if(g)return;j(!0);let e={target:l+d.value,code:p,type:"email",source:i},t=await (0,P.VP)(e);j(!1);let{token:n}=t.data;if(t.success){if(r(),a===O.h.lineRegister&&y({token:n,value:l+d.value,source:"email"}),a===O.h.updateAccount){let e=await (0,P.sG)({},{emailToken:t.data.token});if(e.success){let{data:t}=e;return t&&C((0,T.av)((0,q.O)(e.data))),!0}}}else x({verificationCode:t.message})};return(0,n.jsx)(o.ZP,{isOpen:t,onRequestClose:r,children:(0,n.jsxs)("div",{className:"p-2 text-fontLight",children:[(0,n.jsx)(o.DF,{onRequestClose:r}),(0,n.jsxs)("div",{className:"px-10 pb-5",children:[(0,n.jsx)("h4",{className:"text-center text-xl",children:"會員Email驗證"}),(0,n.jsx)("p",{className:"mt-7 mb-5 text-center",children:"輸入Email以獲得更完整的商家活動資訊"}),(0,n.jsx)(A,{email:l,onEmailChanged:e=>{c(e),k(e+d.value)},emailSubfix:d,onEmailSubfixChanged:e=>{e&&(u(e),k(l+e.value))},errors:h,allowBeUsed:a===O.h.lineRegister,skipCheck:a===O.h.updateAccount}),(0,n.jsx)(E.Z,{verificationCode:p,errors:h,onVerificationCodeChanged:e=>{m(e)},onVerifyCode:N,isVerified:f})]})]})})},F=r(16463),Y=e=>{let{isOpen:t,onRequestClose:r,source:i}=e,[a,l]=(0,s.useState)(),{push:d}=(0,F.useRouter)(),{dispatch:u}=(0,s.useContext)(p.t),m=e=>{l(e)},h=void 0===a;return(0,n.jsx)(o.ZP,{isOpen:t,onRequestClose:r,children:(0,n.jsxs)("div",{className:"p-2",children:[(0,n.jsx)(o.DF,{onRequestClose:r}),(0,n.jsxs)("div",{className:"max-w-[400px] mx-auto text-fontLight md:max-w-[460px]",children:[(0,n.jsx)("h2",{className:"text-xl text-center mt-4 mb-7",children:"是否為海外會員"}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"mb-5 flex items-center justify-center",children:[(0,n.jsx)(x.Z,{onChange:()=>m(0),checked:0===a}),(0,n.jsx)("span",{className:"ml-1",children:"否，現居台灣"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-center",children:[(0,n.jsx)(x.Z,{onChange:()=>m(1),checked:1===a}),(0,n.jsx)("span",{className:"ml-1",children:"是，現居國外"})]}),(0,n.jsxs)("div",{className:"w-[220px] mx-auto my-7 md:w-auto",children:[(0,n.jsx)("p",{className:"text-primary mb-2",children:"＊若您有個人使用的台灣手機，請務必勾選「否」，避免無法配送"}),(0,n.jsx)("p",{className:"text-primary",children:"＊髮基因官網上無配送海外地區"})]})]}),(0,n.jsx)("div",{className:"mb-8",children:(0,n.jsx)(c.Z,{className:"w-full ".concat(h&&"bg-neutral"),text:"確定",onClick:()=>{"line_register"===i?(r(),0===a?u({type:p.U.openVerifyPhoneModal,payload:{source:"register",purpose:O.h.lineRegister}}):u({type:p.U.openVerifyEmailModal,payload:{source:"register",purpose:O.h.lineRegister}})):"register"===i&&(r(),d("/register?overseas=".concat(1===a)))},disabled:h})})]})]})})},B=r(88241),G=r(51752),H=r(44105),W=r(37009),X=r(13501),K=r(61907),Q=e=>{var t;let{product:r,onAdd:i,defaultQuantity:a}=e,[o,l]=(0,s.useState)(a||1),c=(0,I.v9)(e=>e.cart),{addToCart:d,updateCartLoading:u}=(0,W.Z)(r.shopId),{openInfoModal:p}=(0,j.Z)(),m=async()=>{if(u)return;if(r.maxAmount){let e=c.carts.find(e=>e.shopId===r.shopId);if(e){let t=e.items.find(e=>e.id===r.id);if(t&&t.quantity+o>=r.maxAmount)return p("購物車已有".concat(t.quantity,"件，達").concat(r.maxAmount,"件上限，無法加入商品"))}}let{success:e,msg:t}=await d(r,o,[{type:"CartItems",id:r.shopId}]);e?(null==i||i(r,o),(0,X.Oe)({name:r.name,price:r.price}),(0,K.Ux)(r,o)):t&&p(t)},h=r.priceBeforeDiscount&&Number(r.price)!==Number(r.priceBeforeDiscount);return(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsxs)("div",{className:"flex mb-6 w-[300px] md:w-[500px]",children:[(0,n.jsx)("div",{className:"w-[100px] border mr-4 md:w-[200px]",children:(0,n.jsx)(H.Z,{src:r.imageUrl,alt:r.name,width:300,height:300,className:"w-[100px] md:w-[200px]"})}),(0,n.jsxs)("div",{className:"flex-1 flex flex-col justify-between",children:[(0,n.jsx)("p",{className:"font-light",children:r.name}),(0,n.jsxs)("p",{className:"self-end text-lg ".concat(h?"text-primary":""),children:[h&&(0,n.jsxs)("span",{className:"text-fontLight text-sm mr-3 line-through",children:["$",null===(t=r.priceBeforeDiscount)||void 0===t?void 0:t.toLocaleString()]}),"$",r.price.toLocaleString()]})]})]}),(0,n.jsx)("div",{className:"mb-4 w-full max-w-[240px]",children:(0,n.jsx)(B.Z,{defaultValue:o,onChanged:e=>{l(e)},max:r.maxAmount})}),(0,n.jsx)("div",{className:"w-full max-w-[240px]",children:(0,n.jsx)(G.Z,{className:"w-full",onClick:m,loading:u})})]})},J=r(26969),ee=e=>{let{isOpen:t,onRequestClose:r,product:i}=e,{state:l,dispatch:c}=(0,s.useContext)(p.t),d=(0,s.useCallback)(()=>{c({type:p.U.closeAddCartModal}),c({type:p.U.openAddCartSuccessModal,payload:{text:"加入成功"}})},[c]);return(0,n.jsx)(o.ZP,{isOpen:t,onRequestClose:r,children:(0,n.jsxs)("div",{className:"p-4 md:p-5",children:[(0,n.jsxs)("div",{className:"flex justify-between border-b pb-3 mb-4",children:[(0,n.jsx)("div",{children:(0,n.jsx)(a.default,{src:"/assets/icons/logo.svg",width:32,height:32,alt:"Logo"})}),(0,n.jsx)(J.Z,{iconPath:"/assets/icons/icon_close.svg",onClick:r})]}),i&&(0,n.jsx)(Q,{product:i,onAdd:d,defaultQuantity:l.cartModalState.quantity})]})})};let et=i.ZP.div.withConfig({componentId:"sc-19004504-0"})(['display:flex;flex-direction:column;align-items:center;position:relative;padding-bottom:1.5rem;&:after{content:"";position:absolute;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:10px solid ',";top:100%;}"],l.dY);var er=e=>{let{isOpen:t,contentLabel:r,onRequestClose:s}=e;return(0,n.jsxs)(o.ZP,{isOpen:t,onRequestClose:s,children:[(0,n.jsxs)("div",{className:"flex items-center border-b pt-4 pb-2 mb-4 mx-2",children:[(0,n.jsx)("div",{className:"mr-3",children:(0,n.jsx)(a.default,{src:"/assets/icons/logo.svg",width:32,height:32,alt:"Logo"})}),(0,n.jsx)("p",{children:"髮基因提醒"})]}),(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(a.default,{src:"/assets/icons/icon_feedback_success.svg",width:50,height:50,alt:"Success"})}),(0,n.jsx)(et,{children:(0,n.jsx)("p",{children:r})}),(0,n.jsx)("div",{className:"bg-primary pt-10 pb-7",children:(0,n.jsx)(c.Z,{className:"min-w-[100px] py-0 justify-center mx-auto",text:"確定",backgroundColor:l.zP,textColor:l.dY,onClick:s})})]})},en=r(51064);let es=i.ZP.div.withConfig({componentId:"sc-1052e605-0"})(['display:flex;flex-direction:column;align-items:center;position:relative;padding-bottom:1.5rem;&:after{content:"";position:absolute;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:10px solid ',";top:100%;}"],l.dY);var ei=e=>{let{isOpen:t,onRequestClose:r,message:i}=e,[d,u]=(0,s.useState)(""),[m,h]=(0,s.useState)(),{state:x,dispatch:v}=(0,s.useContext)(p.t),{openInfoModal:g}=(0,j.Z)(),b=(0,I.v9)(e=>e.account.user),{isLoading:y,data:w,error:C}=(0,_.wA)(void 0,{skip:!b}),[k]=(0,_.et)(),N=e=>e?m?g(m):void(k({productId:x.cartModalState.product.id,email:e}),v({type:p.U.closePreorderModal}),v({type:p.U.openInfoModal,payload:{message:"髮基因已收到，到貨時再mail通知您"}}),r()):g("請輸入電子信箱"),S=(null==w?void 0:w.data.findIndex(e=>{var t;return e.copied_product_id===(null===(t=x.cartModalState.product)||void 0===t?void 0:t.id)}))>-1;return(0,s.useEffect)(()=>{var e;(null===(e=x.cartModalState.product)||void 0===e?void 0:e.id)&&b&&x.cartModalState.preorderModalOpen&&b&&k({productId:x.cartModalState.product.id})},[b,x.cartModalState.product,k,x.cartModalState.preorderModalOpen]),(0,n.jsx)(o.ZP,{isOpen:t,onRequestClose:r,children:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center border-b pt-4 pb-2 mb-4 mx-2",children:[(0,n.jsx)("div",{className:"mr-3",children:(0,n.jsx)(a.default,{width:32,height:32,alt:"Logo",src:"/assets/icons/logo.svg"})}),(0,n.jsx)("p",{children:"預購商品通知"}),(0,n.jsx)(J.Z,{className:"ml-auto",iconPath:"/assets/icons/icon_close.svg",onClick:r,iconWidth:24,iconHeight:24})]}),(0,n.jsx)("div",{className:"flex justify-center",children:(0,n.jsx)(a.default,{src:"/assets/icons/icon_feedback_info.svg",width:50,height:50,alt:"Info"})}),y?(0,n.jsx)("div",{className:"flex justify-center p-5",children:(0,n.jsx)(en.Z,{})}):(0,n.jsxs)(n.Fragment,{children:[S||b?(0,n.jsx)("div",{className:"py-4",children:(0,n.jsx)("p",{className:"text-center",children:"髮基因已收到，到貨時將已Mail通知你"})}):(0,n.jsxs)(es,{className:"w-[80%] mx-auto text-center",children:[(0,n.jsx)("p",{className:"text-fontLight",children:i}),(0,n.jsx)(f.Z,{className:"mt-10 w-full",placeholder:"請輸入您的電子信箱",onChange:e=>{let{value:t}=e.target;u(t);let r=R.Le.safeParse(t);r.success?h(void 0):r.error.issues.length>0&&h(r.error.issues[0].message)}}),m&&(0,n.jsx)("p",{className:"text-error text-sm mt-2 text-warning",children:m})]}),(0,n.jsx)("div",{className:"bg-primary pt-10 pb-7",children:(0,n.jsx)(c.Z,{className:"min-w-[100px] py-0 justify-center mx-auto",text:"確定",backgroundColor:l.zP,textColor:l.dY,onClick:()=>{S||b?r():N(d)}})})]})]})})},ea=e=>{let{isOpen:t,onRequestClose:r,content:s,closeHeader:i=!0,title:l}=e;return(0,n.jsxs)(o.ZP,{isOpen:t,onRequestClose:r,children:[(0,n.jsx)("div",{className:"p-2 pb-0",children:i?(0,n.jsx)(o.DF,{onRequestClose:r}):(0,n.jsxs)("div",{className:"flex items-center border-b pt-4 pb-2 mb-4 mx-2",children:[(0,n.jsx)("div",{className:"mr-3",children:(0,n.jsx)(a.default,{src:"/assets/icons/logo.svg",width:32,height:32,alt:"Logo"})}),(0,n.jsx)("p",{children:l})]})}),s]})},eo=()=>{let{state:e,dispatch:t}=(0,s.useContext)(p.t);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N,{isOpen:e.loginModalOpen,onRequestClose:()=>t({type:p.U.closeLoginModal})}),(0,n.jsx)(Y,{isOpen:e.overseaModalState.overseaModalOpen,source:e.overseaModalState.source,onRequestClose:()=>t({type:p.U.closeOverseaModal})}),(0,n.jsx)($,{isOpen:e.verifyPhoneModalState.verifyPhoneModalOpen,source:e.verifyPhoneModalState.source,purpose:e.verifyPhoneModalState.purpose,onRequestClose:()=>t({type:p.U.closeVerifyPhoneModal})}),(0,n.jsx)(V,{isOpen:e.verifyEmailModalState.verifyEmailModalOpen,source:e.verifyEmailModalState.source,purpose:e.verifyEmailModalState.purpose,onRequestClose:()=>t({type:p.U.closeVerifyEmailModal})}),(0,n.jsx)(ee,{isOpen:e.cartModalState.cartModalOpen,onRequestClose:()=>{t({type:p.U.closeAddCartModal})},product:e.cartModalState.product}),(0,n.jsx)(ei,{message:"您有興趣的商品為預購商品，到貨時會以mail通知您",isOpen:e.cartModalState.preorderModalOpen,onRequestClose:()=>{t({type:p.U.closePreorderModal})}}),(0,n.jsx)(h,{isOpen:e.questionModal.questionModalOpen,title:e.questionModal.title||"",message:e.questionModal.message,description:e.questionModal.description,confirmText:e.questionModal.confirmText,onRequestClose:()=>{t({type:p.U.closeQuestionModal})},onConfirm:()=>{e.questionModal.callback&&e.questionModal.callback()},cancelText:e.questionModal.cancelText,onCancel:e.questionModal.onCancel}),(0,n.jsx)(ea,{isOpen:e.customModalState.customModalOpen,onRequestClose:()=>{t({type:p.U.closeCustomModal})},content:e.customModalState.content,closeHeader:e.customModalState.closeHeader,title:e.customModalState.title}),(0,n.jsx)(er,{isOpen:e.cartModalState.successModalOpen,contentLabel:e.cartModalState.text,onRequestClose:()=>{t({type:p.U.closeAddCartSuccessModal})}}),(0,n.jsx)(u,{isOpen:e.infoModalOpen,message:e.infoMessage||"",onRequestClose:()=>{t({type:p.U.closeInfoModal})},onConfirm:()=>{e.infoCallback&&e.infoCallback()}})]})}},73922:function(e,t,r){"use strict";r.d(t,{default:function(){return l}});var n=r(57437),s=r(2265),i=r(87138),a=r(16463),o=r(47418);function l(e){let{href:t,children:r,replace:l,...c}=e,d=(0,a.useRouter)(),[u]=(0,o.i$)(),[p]=(0,o.O4)(),[m,h]=(0,s.useTransition)();return(0,n.jsx)(i.default,{href:t,onClick:e=>{e.preventDefault();let r=()=>{h(()=>{let e=t.toString();l?d.replace(e):d.push(e)})};if(u){if(p){null==p||p(r);return}if(!window.confirm("Do you really want to leave?"))return}r()},...c,children:r})}},47418:function(e,t,r){"use strict";r.d(t,{I:function(){return d},NavigationBlockerProvider:function(){return o},O4:function(){return c},_q:function(){return u},i$:function(){return l}});var n=r(57437),s=r(16463),i=r(2265);let a=(0,i.createContext)({isBlocked:!1,setBlocked:()=>{},blockedCallback:void 0,setBlockedCallback:()=>{}});function o(e){let{children:t}=e,r=(0,i.useState)(!1),s=(0,i.useState)(void 0);return(0,n.jsx)(a.Provider,{value:{isBlocked:r[0],setBlocked:r[1],blockedCallback:s[0],setBlockedCallback:s[1]},children:t})}function l(){let{isBlocked:e,setBlocked:t}=(0,i.useContext)(a);return[e,t]}function c(){let{blockedCallback:e,setBlockedCallback:t}=(0,i.useContext)(a);return[e,t]}function d(){let{isBlocked:e,setBlocked:t}=(0,i.useContext)(a);return(0,i.useEffect)(()=>(t(()=>!0),()=>{t(()=>!1)}),[e,t]),null}function u(){let[e,t]=l(),[r,n]=c(),a=(0,s.useRouter)(),o=(0,i.useRef)(!1),d=(0,i.useCallback)(t=>{e&&(null==r||r(()=>{n(void 0),a.back()}))},[r,e,a,n]);return(0,i.useEffect)(()=>(window.addEventListener("popstate",d),()=>{window.removeEventListener("popstate",d)}),[d]),(0,i.useEffect)(()=>{e&&!1===o.current&&window.history.pushState(null,"",window.location.href)},[e]),null}},84778:function(e,t,r){"use strict";r.d(t,{default:function(){return j}});var n=r(57437),s=r(2265),i=r(11444),a=r(99480),o=r(44487),l=r(93375),c=r(71337),d=r(43849),u=r(16450),p=r(55547),m=r(71130),h=r(22736),x=r(40934),f=r(20276),v=e=>{let t=(0,i.v9)(e=>e.account.user),r=(0,i.I0)(),{data:n}=(0,x._C)(void 0,{skip:!t||e}),{data:a}=(0,x.HP)(void 0,{skip:!t}),{data:o}=(0,x.d7)(void 0,{skip:!!t||e}),{data:l}=(0,x._v)(void 0,{skip:!!t||e});return(0,s.useEffect)(()=>{t&&r((0,f.tx)(n))},[n,r,t]),(0,s.useEffect)(()=>{t&&r((0,f.ZC)(a||[]))},[a,r]),(0,s.useEffect)(()=>{t||r((0,f.tx)(o))},[o,r,t]),(0,s.useEffect)(()=>{t||r((0,f.ZC)(l||[]))},[l,r,,t]),{cartItems:a,count:n}},g=r(81422),b=r(9946);function j(){let e=(0,i.I0)(),{user:t,loading:r}=(0,i.v9)(e=>e.account),{openInfoModal:c}=(0,m.Z)(),{handleLogout:u}=(0,h.Z)(),{dispatch:x}=(0,s.useContext)(g.t),f=(0,s.useRef)(!1);return((0,s.useEffect)(()=>{(0,l.getCookie)("token")?(0,a.PR)().then(t=>{t.data?e((0,o.av)((0,d.O)(t.data))):(e((0,o.Us)(!1)),(0,l.deleteCookie)("token"))}):e((0,o.Us)(!1))},[e]),(0,s.useEffect)(()=>{f.current||!t||(f.current=!0,t.isOverseas&&!t.emailVerifiedAt?x({type:g.U.openVerifyEmailModal,payload:{source:"update_member_info",purpose:b.h.updateAccount}}):t.isOverseas||t.phoneVerifiedAt||x({type:g.U.openVerifyPhoneModal,payload:{source:"update_member_info",purpose:b.h.updateAccount}}))},[x,t]),(0,s.useEffect)(()=>{let e;let r=p.Z.localStorageGet("remember_account");if("true"===r)return;let n=()=>{clearTimeout(e),e=setTimeout(()=>{s()},18e5)},s=()=>{u(!1),c("登入逾時,請重新登入",()=>{window.location.reload()})};return t&&"true"!==r&&(window.addEventListener("mousemove",n),window.addEventListener("keypress",n),window.addEventListener("click",n),window.addEventListener("scroll",n),n()),()=>{clearTimeout(e),window.removeEventListener("mousemove",n),window.removeEventListener("keypress",n),window.removeEventListener("click",n),window.removeEventListener("scroll",n)}},[u,c,t]),t)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y,{}),r?null:(0,n.jsx)(w,{})]}):(0,n.jsx)(n.Fragment,{children:r?null:(0,n.jsx)(w,{})})}let y=()=>{let e=(0,i.I0)(),{data:t}=(0,u.zs)();return(0,s.useEffect)(()=>{if(t){let r=t.data.reduce((e,t)=>(e[t.product_id]=t.product_id,e),{});e((0,c.hv)(r))}},[e,t]),null},w=()=>{let{cartItems:e,count:t}=v();return null}},51680:function(e,t,r){"use strict";var n=r(57437),s=r(24109),i=r(41717);t.Z=e=>{let{verificationCode:t,onVerificationCodeChanged:r,errors:a,onVerifyCode:o,isVerified:l}=e,c=""!==t.trim();return(0,n.jsxs)("div",{className:"my-4",children:[(0,n.jsx)(i.Z,{name:"verification",placeholder:"請輸入驗證碼",onChange:e=>{r(e.target.value)}}),a.verificationCode&&(0,n.jsx)("p",{className:"text-warning text-sm",children:"驗證碼錯誤"}),(0,n.jsx)(s.Z,{type:"button",disabled:!c||l,className:"w-full mt-2",text:l?"驗證成功":"完成驗證",onClick:o})]})}},79941:function(e,t,r){"use strict";var n=r(57437),s=r(71130),i=r(66648),a=r(2265),o=r(55547),l=r(16463);t.default=()=>{let{openCustomModal:e}=(0,s.Z)(),t=(0,l.usePathname)();return(0,a.useEffect)(()=>{let r=o.Z.localStorageGet("announce_time");r&&Date.now()-r<3e5||"/"!==t&&"/group-buying"!==t||(e({content:(0,n.jsx)("div",{className:"rounded-2xl",children:(0,n.jsxs)("picture",{children:[(0,n.jsx)("source",{media:"(min-width: 768px)",srcSet:"/assets/images/announce_desktop.jpg"}),(0,n.jsx)("source",{media:"(max-width: 767px)",srcSet:"/assets/images/announce_mobile.jpg"}),(0,n.jsx)(i.default,{className:"max-w-[300px] md:max-w-[600px] lg:max-w-[800px]",src:"/assets/images/announce_mobile.jpg",alt:"新官網正式上線囉",width:1920,height:850,sizes:"(max-width: 768px) 300px, (max-width: 1200px) 800px"})]})})}),o.Z.localStorageSet("announce_time",Date.now()))},[]),null}},94610:function(e,t,r){"use strict";var n=r(2265),s=r(55547),i=r(81422);t.Z=()=>{let{state:e,dispatch:t}=(0,n.useContext)(i.t);return{openLoginModal:(0,n.useCallback)(()=>{let e=window.location.pathname,r=window.location.search;s.Z.localStorageSet("loginRedirectPath",e+r),t({type:i.U.openLoginModal})},[t]),setLoginCallback:(0,n.useCallback)(e=>{if(e){let{callback:t,params:r}=e;s.Z.localStorageSet("loginCallback",{callback:t,params:r})}},[])}}},51752:function(e,t,r){"use strict";var n=r(57437),s=r(66648),i=r(51064);t.Z=e=>{let{onClick:t,className:r="",text:a,loading:o,preorder:l}=e;return(0,n.jsxs)("button",{onClick:t,className:"flex items-end ".concat(l?"bg-accent":"bg-primary"," justify-center text-secondary py-1 px-2 pl-1 rounded ").concat(r),children:[(0,n.jsx)(s.default,{src:"/assets/icons/".concat(l?"icon_preorder":"icon_cart_light",".svg"),width:24,height:24,alt:"Add to cart",className:"max-w-[24px]"}),o?(0,n.jsx)(i.Z,{width:10}):l?"預購商品":a||"加入購物車"]})}},36583:function(e,t,r){"use strict";var n=r(57437),s=r(36428),i=r(66648),a=r(35161),o=r(67397);let l=e=>(0,n.jsx)(a.c.DropdownIndicator,{...e,children:(0,n.jsx)(i.default,{className:"transition-transform ".concat(e.selectProps.menuIsOpen?"rotate-180":""),src:"/assets/icons/icon_arrow.svg",width:24,height:24,alt:"Dropdown"})});t.Z=e=>{let{options:t=[],onChange:r,defaultValue:i,placeholder:a,className:c="",theme:d="primary"}=e,u="primary"===d?s.lr:s.uK,p="primary"===d?s.j0:s.z4;return(0,n.jsx)(o.ZP,{placeholder:a,isSearchable:!1,theme:e=>({...e,borderRadius:0}),styles:{singleValue:e=>({...e,color:u}),control:(e,t)=>({...e,borderColor:u,boxShadow:"none",cursor:"pointer","&:hover":{borderColor:u},borderRadius:"4px"}),menu:e=>({...e,marginTop:6,marginBottom:0,border:"1px solid ".concat(u),borderRadius:"4px",padding:4}),menuList:e=>({...e,padding:0,borderRadius:"4px"}),option:(e,t)=>{let{data:r,isDisabled:n,isFocused:i,isSelected:a}=t;return{...e,backgroundColor:a?p:s.dY,color:a?s.zP:s.zb,cursor:n?"not-allowed":"pointer","&:hover":{backgroundColor:a?p:"#f8f8f8",color:s.zP}}}},options:t,components:{IndicatorSeparator:()=>null,DropdownIndicator:l},defaultValue:i,onChange:r,className:c,value:i})}},71337:function(e,t,r){"use strict";r.d(t,{Ni:function(){return o},hv:function(){return i}});var n=r(82351);let s=(0,n.oM)({name:"favorite",initialState:{favorites:{},loading:!0,error:null},reducers:{fetchFavoritesSuccess:(e,t)=>{e.loading=!1,e.favorites=t.payload},fetchFavoritesFailure:(e,t)=>{e.error=t.payload},removeFavorite:(e,t)=>{delete e.favorites[t.payload]}}}),{fetchFavoritesSuccess:i,fetchFavoritesFailure:a,removeFavorite:o}=s.actions;(0,n.PH)("account/login"),t.ZP=s.reducer},13501:function(e,t,r){"use strict";r.d(t,{AZ:function(){return o},Ae:function(){return l},Oe:function(){return i},di:function(){return a},fG:function(){return c},mS:function(){return s}});var n=r(9881);let s=e=>{(0,n.sendGTMEvent)({event:"add_to_wishlist",value:e.price,items:[{item_name:e.name,price:e.price}]})},i=e=>{(0,n.sendGTMEvent)({event:"add_to_cart",value:e.price,items:[{item_name:e.name,price:e.price}]})},a=e=>{(0,n.sendGTMEvent)({event:"view_cart",currency:"TWD",value:e.reduce((e,t)=>e+t.price*t.quantity,0),items:e.map(e=>({item_id:e.sn,item_name:e.name,price:e.price,quantity:e.quantity}))})},o=e=>{(0,n.sendGTMEvent)({event:"begin_checkout",coupon:e.coupon,currency:"TWD",value:e.products.reduce((e,t)=>e+t.price*t.quantity,0),items:e.products.map(e=>({id:e.sn,item_name:e.name,price:e.price,quantity:e.quantity}))})},l=e=>{(0,n.sendGTMEvent)({event:"purchase",coupon:e.coupon,transaction_id:e.transaction_id,shipping:e.shipping,currency:"TWD",value:e.value,items:e.products.map(e=>({id:e.sn,item_name:e.name,price:e.price,quantity:e.quantity}))})},c=e=>{(0,n.sendGTMEvent)({event:"refund",coupon:e.coupon,transaction_id:e.transaction_id,shipping:e.shipping,currency:"TWD",value:e.value,items:e.products.map(e=>({id:e.sn,item_name:e.name,price:e.price,quantity:e.quantity}))})}},61907:function(e,t,r){"use strict";r.d(t,{DC:function(){return d},OmnichatTracker:function(){return i},Ux:function(){return o},Vp:function(){return c},lg:function(){return a},op:function(){return l}});var n=r(11444),s=r(2265);let i=()=>{let e=(0,n.v9)(e=>e.account),t=(0,s.useRef)(!1),{user:r,loading:i}=e;return(0,s.useEffect)(()=>{var e,n,s,a,o;i||t.current||(window.omnichatTracker=window.omnichatTracker||[],window.omnichatTracker.push(["init","config",{memberId:null!==(e=null==r?void 0:r.id)&&void 0!==e?e:"",memberEmail:null!==(n=null==r?void 0:r.email)&&void 0!==n?n:"",memberPhone:null!==(s=null==r?void 0:r.phone)&&void 0!==s?s:"",memberName:null!==(a=null==r?void 0:r.name)&&void 0!==a?a:"",memberProfilePic:null!==(o=null==r?void 0:r.avatar)&&void 0!==o?o:""}]),t.current=!0)},[r,i]),null},a=e=>{try{var t;null===(t=window)||void 0===t||t.omnichatTracker.push(["event","view_product",{id:e.productSn,name:e.name,brand:"",category:"",variant:"",price:"".concat(e.price)}])}catch(e){console.error(e)}},o=(e,t)=>{try{var r;null===(r=window)||void 0===r||r.omnichatTracker.push(["event","add_to_cart",{items:[{id:e.productSn,name:e.name,brand:"",category:"",variant:"",quantity:t,price:"".concat(e.price)}]}])}catch(e){console.error(e)}},l=e=>{try{var t;null===(t=window)||void 0===t||t.omnichatTracker.push(["event","remove_from_cart",{items:[{id:e.productSn,name:e.name,brand:"",category:"",variant:"",quantity:e.quantity,price:"".concat(e.price)}]}])}catch(e){console.error(e)}},c=e=>{try{var t;null===(t=window)||void 0===t||t.omnichatTracker.push(["event","checkout",{items:e.map(e=>({id:e.productSn,name:e.name,brand:"",category:"",variant:"",quantity:e.quantity,price:"".concat(e.price)}))}])}catch(e){console.error(e)}},d=(e,t,r)=>{try{var n;null===(n=window)||void 0===n||n.omnichatTracker.push(["event","purchase",{transaction_id:e,amount:r,currency:"TWD",items:t.map(e=>({id:e.productSn,name:e.name,brand:"",category:"",variant:"",quantity:e.quantity,price:"".concat(e.price)}))}])}catch(e){console.error(e)}}},89669:function(e,t,r){"use strict";r.d(t,{Le:function(){return i},aF:function(){return c},fV:function(){return o},nF:function(){return d},qg:function(){return s},tH:function(){return a},ym:function(){return l}});var n=r(59772);let s=n.z.string().min(1,"姓名不能為空").trim().regex(/^[^\d]*$/,"姓名不能包含數字"),i=n.z.string().email("請輸入正確的 Email 格式"),a=n.z.string().regex(/^\d+$/,"請輸入正確的手機號碼").min(10,"手機號碼不得少於 10 位數").max(10,"手機號碼不得超過 10 位數").startsWith("09","請輸入台灣10位碼手機格式").trim(),o=n.z.string().regex(/^\d+$/,"請輸入正確的手機號碼").trim(),l=n.z.string().min(8,"密碼不得少於 8 個字元").max(12,"密碼不得超過 12 個字元").regex(/^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z\d]{8,12}$/,"8~12碼英數字混合"),c=n.z.string().min(8,"統一編號不得少於 8 個字元").max(8,"統一編號不得超過 8 個字元").regex(/^\d+$/,"請輸入正確的統一編號").trim();function d(e){return 3===e.length&&/^[\u4e00-\u9fff]+$/.test(e)}},91449:function(e,t){"use strict";t.parse=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var r={},n=(t||{}).decode||s,i=0;i<e.length;){var a=e.indexOf("=",i);if(-1===a)break;var o=e.indexOf(";",i);if(-1===o)o=e.length;else if(o<a){i=e.lastIndexOf(";",a-1)+1;continue}var l=e.slice(i,a).trim();if(void 0===r[l]){var c=e.slice(a+1,o).trim();34===c.charCodeAt(0)&&(c=c.slice(1,-1)),r[l]=function(e,t){try{return t(e)}catch(t){return e}}(c,n)}i=o+1}return r},t.serialize=function(e,t,s){var a=s||{},o=a.encode||i;if("function"!=typeof o)throw TypeError("option encode is invalid");if(!n.test(e))throw TypeError("argument name is invalid");var l=o(t);if(l&&!n.test(l))throw TypeError("argument val is invalid");var c=e+"="+l;if(null!=a.maxAge){var d=a.maxAge-0;if(isNaN(d)||!isFinite(d))throw TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(d)}if(a.domain){if(!n.test(a.domain))throw TypeError("option domain is invalid");c+="; Domain="+a.domain}if(a.path){if(!n.test(a.path))throw TypeError("option path is invalid");c+="; Path="+a.path}if(a.expires){var u=a.expires;if("[object Date]"!==r.call(u)&&!(u instanceof Date)||isNaN(u.valueOf()))throw TypeError("option expires is invalid");c+="; Expires="+u.toUTCString()}if(a.httpOnly&&(c+="; HttpOnly"),a.secure&&(c+="; Secure"),a.partitioned&&(c+="; Partitioned"),a.priority)switch("string"==typeof a.priority?a.priority.toLowerCase():a.priority){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; Priority=High";break;default:throw TypeError("option priority is invalid")}if(a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:case"strict":c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"none":c+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return c};var r=Object.prototype.toString,n=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function s(e){return -1!==e.indexOf("%")?decodeURIComponent(e):e}function i(e){return encodeURIComponent(e)}},93375:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},s=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)0>t.indexOf(n[s])&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r};Object.defineProperty(t,"__esModule",{value:!0}),t.hasCookie=t.deleteCookie=t.setCookie=t.getCookie=t.getCookies=void 0;var i=r(91449),a=function(){return"undefined"!=typeof window},o=function(e){return!!e&&"getAll"in e&&"set"in e&&"function"==typeof e.getAll&&"function"==typeof e.set},l=function(e){return!!(null==e?void 0:e.req)&&"cookies"in e.req&&o(null==e?void 0:e.req.cookies)||!!(null==e?void 0:e.res)&&"cookies"in e.res&&o(null==e?void 0:e.res.cookies)||!!(null==e?void 0:e.cookies)&&o(e.cookies())},c=function(e){var t={};return e.getAll().forEach(function(e){var r=e.name,n=e.value;t[r]=n}),t},d=function(e){try{if("string"==typeof e)return e;return JSON.stringify(e)}catch(t){return e}};t.getCookies=function(e){if(l(e)){if(null==e?void 0:e.req)return c(e.req.cookies);if(null==e?void 0:e.cookies)return c(e.cookies())}if(e&&(t=e.req),!a())return t&&t.cookies?t.cookies:t&&t.headers.cookie?(0,i.parse)(t.headers.cookie):{};for(var t,r={},n=document.cookie?document.cookie.split("; "):[],s=0,o=n.length;s<o;s++){var d=n[s].split("="),u=d.slice(1).join("=");r[d[0]]=u}return r},t.getCookie=function(e,r){var n=(0,t.getCookies)(r)[e];if(void 0!==n)return n?n.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent):n},t.setCookie=function(e,t,r){if(l(r)){var o,c,u,p=r.req,m=r.res,h=r.cookies,x=s(r,["req","res","cookies"]),f=n({name:e,value:d(t)},x);p&&p.cookies.set(f),m&&m.cookies.set(f),h&&h().set(f);return}if(r){var p=r.req,m=r.res,v=s(r,["req","res"]);c=p,u=m,o=v}var g=(0,i.serialize)(e,d(t),n({path:"/"},o));if(a())document.cookie=g;else if(u&&c){var b=u.getHeader("Set-Cookie");if(Array.isArray(b)||(b=b?[String(b)]:[]),u.setHeader("Set-Cookie",b.concat(g)),c&&c.cookies){var j=c.cookies;""===t?delete j[e]:j[e]=d(t)}if(c&&c.headers&&c.headers.cookie){var j=(0,i.parse)(c.headers.cookie);""===t?delete j[e]:j[e]=d(t),c.headers.cookie=Object.entries(j).reduce(function(e,t){return e.concat("".concat(t[0],"=").concat(t[1],";"))},"")}}},t.deleteCookie=function(e,r){return(0,t.setCookie)(e,"",n(n({},r),{maxAge:-1}))},t.hasCookie=function(e,r){return!!e&&(0,t.getCookies)(r).hasOwnProperty(e)}},58064:function(e,t,r){"use strict";Object.defineProperty(t,"$",{enumerable:!0,get:function(){return s}});let n=r(74590);function s(e){let{createServerReference:t}=r(6671);return t(e,n.callServer)}},27266:function(e,t,r){"use strict";r.d(t,{y1:function(){return s}});var n=r(2265);function s(e,t,r){var s=this,i=(0,n.useRef)(null),a=(0,n.useRef)(0),o=(0,n.useRef)(null),l=(0,n.useRef)([]),c=(0,n.useRef)(),d=(0,n.useRef)(),u=(0,n.useRef)(e),p=(0,n.useRef)(!0);u.current=e;var m="undefined"!=typeof window,h=!t&&0!==t&&m;if("function"!=typeof e)throw TypeError("Expected a function");t=+t||0;var x=!!(r=r||{}).leading,f=!("trailing"in r)||!!r.trailing,v="maxWait"in r,g="debounceOnServer"in r&&!!r.debounceOnServer,b=v?Math.max(+r.maxWait||0,t):null;return(0,n.useEffect)(function(){return p.current=!0,function(){p.current=!1}},[]),(0,n.useMemo)(function(){var e=function(e){var t=l.current,r=c.current;return l.current=c.current=null,a.current=e,d.current=u.current.apply(r,t)},r=function(e,t){h&&cancelAnimationFrame(o.current),o.current=h?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!p.current)return!1;var r=e-i.current;return!i.current||r>=t||r<0||v&&e-a.current>=b},j=function(t){return o.current=null,f&&l.current?e(t):(l.current=c.current=null,d.current)},y=function e(){var s=Date.now();if(n(s))return j(s);if(p.current){var o=t-(s-i.current);r(e,v?Math.min(o,b-(s-a.current)):o)}},w=function(){if(m||g){var u=Date.now(),h=n(u);if(l.current=[].slice.call(arguments),c.current=s,i.current=u,h){if(!o.current&&p.current)return a.current=i.current,r(y,t),x?e(i.current):d.current;if(v)return r(y,t),e(i.current)}return o.current||r(y,t),d.current}};return w.cancel=function(){o.current&&(h?cancelAnimationFrame(o.current):clearTimeout(o.current)),a.current=0,l.current=i.current=c.current=o.current=null},w.isPending=function(){return!!o.current},w.flush=function(){return o.current?j(Date.now()):d.current},w},[x,v,t,b,f,h,m,g])}}}]);