@hhgtech/hhg-components 1.19.13 → 1.19.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/babyGrowth.js +1 -1
- package/build/care.js +1 -1
- package/build/components.js +1 -1
- package/build/core.js +1 -1
- package/build/ecom.js +1 -1
- package/build/esm/babyGrowth.js +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/core.js +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/{index-77b7d1fa.js → index-31251631.js} +1 -1
- package/build/esm/{index-fd5aeb00.js → index-34fd4ca2.js} +1 -1
- package/build/esm/index-3eb382c4.js +1 -0
- package/build/esm/{index-c080f2c3.js → index-854bfede.js} +1 -1
- package/build/esm/{index-6f5fe0f0.js → index-913475f3.js} +1 -1
- package/build/esm/{index-a94a59f8.js → index-ca8a65c8.js} +1 -1
- package/build/esm/index-ea077d6c.js +1 -0
- package/build/esm/index.js +1 -1
- package/build/esm/index.styled-4e2d45c1.js +1 -0
- package/build/esm/index.styled-6ceb1ffe.js +1 -0
- package/build/esm/{index.styled-9e28ffc0.js → index.styled-9275ccf5.js} +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/number-3cb24023.js +1 -0
- package/build/esm/routing-d6ceeffd.js +1 -0
- package/build/esm/{constants-17d17987.js → theme-886d0d2f.js} +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/types-209a2b6c.js +1 -0
- package/build/esm/types-35f3d422.js +1 -0
- package/build/esm/types-87f32571.js +1 -0
- package/build/esm/useFbDataLayer-e9860653.js +1 -0
- package/build/esm/useTranslations-443c50f3.js +1 -0
- package/build/{index-15a8d752.js → index-0df9a517.js} +1 -1
- package/build/index-13c2c714.js +1 -0
- package/build/index-7debe933.js +1 -0
- package/build/{index-eba0ccfd.js → index-906c77a2.js} +1 -1
- package/build/{index-a42bf49e.js → index-a0e1567e.js} +1 -1
- package/build/{index-a9dac361.js → index-a8e54837.js} +1 -1
- package/build/index-d551cf10.js +1 -0
- package/build/index.js +1 -1
- package/build/index.styled-04f94566.js +1 -0
- package/build/index.styled-0b580017.js +1 -0
- package/build/index.styled-80cb4d3a.js +1 -0
- package/build/misc/theme.d.ts +1 -0
- package/build/navigation.js +1 -1
- package/build/number-87b13133.js +1 -0
- package/build/routing-1865523f.js +1 -0
- package/build/{constants-d4ec4195.js → theme-7830aadf.js} +1 -1
- package/build/together.js +1 -1
- package/build/types-18923efa.js +1 -0
- package/build/types-b528f9ad.js +1 -0
- package/build/types-cc6f9312.js +1 -0
- package/build/{ageGenerate-ab2ee426.js → useFbDataLayer-49119223.js} +1 -1
- package/build/useTranslations-3a6e3bef.js +1 -0
- package/package.json +1 -1
- package/build/esm/ageGenerate-479027f2.js +0 -1
- package/build/esm/index-3741f100.js +0 -1
- package/build/esm/index-aa913db3.js +0 -1
- package/build/esm/index.styled-5c6564ec.js +0 -1
- package/build/esm/index.styled-f044c8b2.js +0 -1
- package/build/esm/number-126ee62e.js +0 -1
- package/build/esm/routing-93ed4dbc.js +0 -1
- package/build/esm/theme-ed3b5e70.js +0 -1
- package/build/esm/types-26e71aa2.js +0 -1
- package/build/esm/types-55b8733c.js +0 -1
- package/build/esm/types-a158a9d8.js +0 -1
- package/build/esm/useTranslations-5c58aaf7.js +0 -1
- package/build/index-a7a67901.js +0 -1
- package/build/index-c49191c2.js +0 -1
- package/build/index-cb4f4283.js +0 -1
- package/build/index.styled-31c53cd9.js +0 -1
- package/build/index.styled-9b06e721.js +0 -1
- package/build/index.styled-df62f800.js +0 -1
- package/build/number-95704111.js +0 -1
- package/build/routing-3fb6d350.js +0 -1
- package/build/theme-da70da1e.js +0 -1
- package/build/types-18cefca9.js +0 -1
- package/build/types-b129e43d.js +0 -1
- package/build/types-cfe2f3a5.js +0 -1
- package/build/useTranslations-f5815b25.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-f7929e76.js"),n=require("./theme-da70da1e.js"),t=require("react"),l=require("./index.styled-31c53cd9.js");require("./useTranslations-f5815b25.js"),require("react-range");var a=require("react-dom");require("./translationsContext-d7c8e0a0.js"),require("date-fns");var i=require("styled-components");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o,d,p,s,u=r(t),c=r(i),f=function(e){var n=e.open,t=void 0!==n&&n,a=e.onClickOutside;return u.default.createElement(l.StyledBackdrop,{open:t,onClick:a})},x=function(e){var n=e.children,i=e.title,r=e.onClose,o=e.open,d=void 0!==o&&o,p=e.placement,s=void 0===p?"left":p,c=e.destroyOnClose,x=void 0!==c&&c,m=e.className,C=t.useRef(),g=function(){C.current.classList.add("slideOut"),setTimeout((function(){r()}),1e3)};return!d&&x?null:a.createPortal(u.default.createElement(u.default.Fragment,null,d&&u.default.createElement(l.StyledDrawer,{className:m},u.default.createElement(f,{open:d,onClickOutside:g}),u.default.createElement(l.StyledDrawerPanel,{open:d,placement:s,ref:C,hasTitle:Boolean(i)},u.default.createElement("div",{className:"title"},i&&u.default.createElement(l.Text,{size:"s2",type:"semiBold"},i),u.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"close-button",onClick:g},u.default.createElement("path",{d:"M5.99007 4.99067C5.79114 4.99072 5.59674 5.0501 5.43173 5.16121C5.26672 5.27233 5.1386 5.43013 5.06374 5.61444C4.98889 5.79875 4.9707 6.0012 5.0115 6.1959C5.05231 6.39061 5.15025 6.56872 5.29281 6.70747L10.5858 12.0004L5.29281 17.2934C5.19684 17.3855 5.12021 17.4959 5.06743 17.618C5.01464 17.7402 4.98676 17.8716 4.9854 18.0046C4.98405 18.1377 5.00926 18.2697 5.05954 18.3928C5.10983 18.516 5.1842 18.6279 5.27827 18.722C5.37235 18.8161 5.48426 18.8904 5.60743 18.9407C5.73061 18.991 5.86259 19.0162 5.99563 19.0149C6.12867 19.0135 6.2601 18.9856 6.38223 18.9328C6.50436 18.8801 6.61473 18.8034 6.70687 18.7075L11.9998 13.4145L17.2928 18.7075C17.385 18.8034 17.4953 18.8801 17.6175 18.9328C17.7396 18.9856 17.871 19.0135 18.0041 19.0149C18.1371 19.0162 18.2691 18.991 18.3922 18.9407C18.5154 18.8904 18.6273 18.8161 18.7214 18.722C18.8155 18.6279 18.8899 18.516 18.9401 18.3928C18.9904 18.2697 19.0156 18.1377 19.0143 18.0047C19.0129 17.8716 18.985 17.7402 18.9323 17.618C18.8795 17.4959 18.8028 17.3855 18.7069 17.2934L13.4139 12.0004L18.7069 6.70747C18.8514 6.567 18.9501 6.38616 18.99 6.18864C19.03 5.99112 19.0093 5.78614 18.9308 5.60055C18.8523 5.41497 18.7195 5.25744 18.5499 5.14861C18.3803 5.03978 18.1817 4.98473 17.9803 4.99067C17.7205 4.99841 17.4739 5.10699 17.2928 5.2934L11.9998 10.5864L6.70687 5.2934C6.61368 5.19761 6.50224 5.12146 6.37912 5.06947C6.25601 5.01747 6.12372 4.99068 5.99007 4.99067Z",fill:"#595959"}))),u.default.createElement(l.StyledDrawerContent,{onClick:function(e){return e.stopPropagation()}},n&&(u.default.isValidElement(n)?n:"function"==typeof n?n({internalClose:g}):null))))),document.body)},m=c.default.div(o||(o=e.__makeTemplateObject(["\n /* Auto layout */\n position: relative;\n display: flex;\n align-items: flex-start;\n padding: 16px;\n gap: 16px;\n background: ",";\n border: 1px solid ",";\n border-radius: 6px;\n .information {\n display: flex;\n flex-direction: column;\n gap: 8px;\n h5:first-letter {\n text-transform: uppercase;\n }\n .detail {\n display: flex;\n gap: 16px;\n div {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n }\n }\n"],["\n /* Auto layout */\n position: relative;\n display: flex;\n align-items: flex-start;\n padding: 16px;\n gap: 16px;\n background: ",";\n border: 1px solid ",";\n border-radius: 6px;\n .information {\n display: flex;\n flex-direction: column;\n gap: 8px;\n h5:first-letter {\n text-transform: uppercase;\n }\n .detail {\n display: flex;\n gap: 16px;\n div {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n }\n }\n"])),n.theme.colors.white,n.theme.colors.gray100),C=c.default.div(d||(d=e.__makeTemplateObject(["\n position: absolute;\n top: 18px;\n right: 16px;\n cursor: pointer;\n"],["\n position: absolute;\n top: 18px;\n right: 16px;\n cursor: pointer;\n"]))),g=c.default(l.Menu)(p||(p=e.__makeTemplateObject(["\n position: absolute;\n right: 0;\n z-index: 1;\n"],["\n position: absolute;\n right: 0;\n z-index: 1;\n"]))),y=c.default(x)(s||(s=e.__makeTemplateObject(["\n .add-profile-container {\n display: flex;\n flex-direction: column;\n gap: 24px;\n }\n .profile-container {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n .button-group {\n display: flex;\n flex-direction: column;\n gap: 8px;\n button {\n width: 100%;\n }\n }\n"],["\n .add-profile-container {\n display: flex;\n flex-direction: column;\n gap: 24px;\n }\n .profile-container {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n .button-group {\n display: flex;\n flex-direction: column;\n gap: 8px;\n button {\n width: 100%;\n }\n }\n"])));exports.Drawer=x,exports.StyledBabyGrowthChooseProfileDrawer=y,exports.StyledChildCard=m,exports.StyledChildCardMenu=g,exports.StyledOption=C;
|
package/build/number-95704111.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e="undefined"!=typeof window,t=e&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),a=e&&"IntersectionObserver"in window,s=e&&"classList"in document.createElement("p"),l=e&&window.devicePixelRatio>1,n={elements_selector:".lazy",container:t||e?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},r=e=>Object.assign({},n,e),o=function(e,t){let a;const s="LazyLoad::Initialized",l=new e(t);try{a=new CustomEvent(s,{detail:{instance:l}})}catch(e){a=document.createEvent("CustomEvent"),a.initCustomEvent(s,!1,!1,{instance:l})}window.dispatchEvent(a)},i="src",c="llOriginalAttrs",d=(e,t)=>e.getAttribute("data-"+t),u=e=>d(e,"ll-status"),_=(e,t)=>((e,t,a)=>{var s="data-"+t;null!==a?e.setAttribute(s,a):e.removeAttribute(s)})(e,"ll-status",t),g=e=>_(e,null),b=e=>null===u(e),p=e=>"native"===u(e),h=["loading","loaded","applied","error"],m=(e,t,a,s)=>{e&&(void 0===s?void 0===a?e(t):e(t,a):e(t,a,s))},v=(e,t)=>{s?e.classList.add(t):e.className+=(e.className?" ":"")+t},f=(e,t)=>{s?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},E=e=>e.llTempImage,I=(e,t)=>{if(!t)return;const a=t._observer;a&&a.unobserve(e)},k=(e,t)=>{e&&(e.loadingCount+=t)},A=(e,t)=>{e&&(e.toLoadCount=t)},w=e=>{let t=[];for(let a,s=0;a=e.children[s];s+=1)"SOURCE"===a.tagName&&t.push(a);return t},L=(e,t)=>{const a=e.parentNode;if(!a||"PICTURE"!==a.tagName)return;w(a).forEach(t)},y=(e,t)=>{w(e).forEach(t)},x=[i],O=[i,"poster"],C=[i,"srcset","sizes"],z=["data"],N=e=>!!e[c],M=e=>e[c],R=e=>delete e[c],T=(e,t)=>{if(N(e))return;const a={};t.forEach((t=>{a[t]=e.getAttribute(t)})),e[c]=a},F=(e,t)=>{if(!N(e))return;const a=M(e);t.forEach((t=>{((e,t,a)=>{a?e.setAttribute(t,a):e.removeAttribute(t)})(e,t,a[t])}))},G=(e,t,a)=>{v(e,t.class_loading),_(e,"loading"),a&&(k(a,1),m(t.callback_loading,e,a))},D=(e,t,a)=>{a&&e.setAttribute(t,a)},V=(e,t)=>{D(e,"sizes",d(e,t.data_sizes)),D(e,"srcset",d(e,t.data_srcset)),D(e,i,d(e,t.data_src))},S=(e,t,a)=>{const s=d(e,t.data_bg_multi),n=d(e,t.data_bg_multi_hidpi),r=l&&n?n:s;r&&(e.style.backgroundImage=r,((e,t,a)=>{v(e,t.class_applied),_(e,"applied"),a&&(t.unobserve_completed&&I(e,t),m(t.callback_applied,e,a))})(e,t,a))},B={IMG:(e,t)=>{L(e,(e=>{T(e,C),V(e,t)})),T(e,C),V(e,t)},IFRAME:(e,t)=>{T(e,x),D(e,i,d(e,t.data_src))},VIDEO:(e,t)=>{y(e,(e=>{T(e,x),D(e,i,d(e,t.data_src))})),T(e,O),D(e,"poster",d(e,t.data_poster)),D(e,i,d(e,t.data_src)),e.load()},OBJECT:(e,t)=>{T(e,z),D(e,"data",d(e,t.data_src))}},J=["IMG","IFRAME","VIDEO","OBJECT"],P=(e,t)=>{!t||(e=>e.loadingCount>0)(t)||(e=>e.toLoadCount>0)(t)||m(e.callback_finish,t)},$=(e,t,a)=>{e.addEventListener(t,a),e.llEvLisnrs[t]=a},U=(e,t,a)=>{e.removeEventListener(t,a)},j=e=>!!e.llEvLisnrs,q=e=>{if(!j(e))return;const t=e.llEvLisnrs;for(let a in t){const s=t[a];U(e,a,s)}delete e.llEvLisnrs},H=(e,t,a)=>{(e=>{delete e.llTempImage})(e),k(a,-1),(e=>{e&&(e.toLoadCount-=1)})(a),f(e,t.class_loading),t.unobserve_completed&&I(e,a)},Z=(e,t,a)=>{const s=E(e)||e;if(j(s))return;((e,t,a)=>{j(e)||(e.llEvLisnrs={});const s="VIDEO"===e.tagName?"loadeddata":"load";$(e,s,t),$(e,"error",a)})(s,(l=>{((e,t,a,s)=>{const l=p(t);H(t,a,s),v(t,a.class_loaded),_(t,"loaded"),m(a.callback_loaded,t,s),l||P(a,s)})(0,e,t,a),q(s)}),(l=>{((e,t,a,s)=>{const l=p(t);H(t,a,s),v(t,a.class_error),_(t,"error"),m(a.callback_error,t,s),l||P(a,s)})(0,e,t,a),q(s)}))},K=(e,t,a)=>{(e=>{e.llTempImage=document.createElement("IMG")})(e),Z(e,t,a),(e=>{N(e)||(e[c]={backgroundImage:e.style.backgroundImage})})(e),((e,t,a)=>{const s=d(e,t.data_bg),n=d(e,t.data_bg_hidpi),r=l&&n?n:s;r&&(e.style.backgroundImage=`url("${r}")`,E(e).setAttribute(i,r),G(e,t,a))})(e,t,a),S(e,t,a)},Q=(e,t,a)=>{Z(e,t,a),((e,t,a)=>{const s=B[e.tagName];s&&(s(e,t),G(e,t,a))})(e,t,a)},W=(e,t,a)=>{(e=>J.indexOf(e.tagName)>-1)(e)?Q(e,t,a):K(e,t,a)},X=(e,t,a)=>{e.setAttribute("loading","lazy"),Z(e,t,a),((e,t)=>{const a=B[e.tagName];a&&a(e,t)})(e,t),_(e,"native")},Y=e=>{e.removeAttribute(i),e.removeAttribute("srcset"),e.removeAttribute("sizes")},ee=e=>{L(e,(e=>{F(e,C)})),F(e,C)},te={IMG:ee,IFRAME:e=>{F(e,x)},VIDEO:e=>{y(e,(e=>{F(e,x)})),F(e,O),e.load()},OBJECT:e=>{F(e,z)}},ae=e=>{const t=te[e.tagName];t?t(e):(e=>{if(!N(e))return;const t=M(e);e.style.backgroundImage=t.backgroundImage})(e)},se=(e,t)=>{ae(e),((e,t)=>{b(e)||p(e)||(f(e,t.class_entered),f(e,t.class_exited),f(e,t.class_applied),f(e,t.class_loading),f(e,t.class_loaded),f(e,t.class_error))})(e,t),g(e),R(e)},le=(e,t,a,s)=>{a.cancel_on_exit&&(e=>"loading"===u(e))(e)&&"IMG"===e.tagName&&(q(e),(e=>{L(e,(e=>{Y(e)})),Y(e)})(e),ee(e),f(e,a.class_loading),k(s,-1),g(e),m(a.callback_cancel,e,t,s))},ne=(e,t,a,s)=>{const l=(e=>h.indexOf(u(e))>=0)(e);_(e,"entered"),v(e,a.class_entered),f(e,a.class_exited),((e,t,a)=>{t.unobserve_entered&&I(e,a)})(e,a,s),m(a.callback_enter,e,t,s),l||W(e,a,s)},re=["IMG","IFRAME","VIDEO"],oe=e=>e.use_native&&"loading"in HTMLImageElement.prototype,ie=(e,t,a)=>{e.forEach((e=>(e=>e.isIntersecting||e.intersectionRatio>0)(e)?ne(e.target,e,t,a):((e,t,a,s)=>{b(e)||(v(e,a.class_exited),le(e,t,a,s),m(a.callback_exit,e,t,s))})(e.target,e,t,a)))},ce=(e,t)=>{a&&!oe(e)&&(t._observer=new IntersectionObserver((a=>{ie(a,e,t)}),(e=>({root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}))(e)))},de=e=>Array.prototype.slice.call(e),ue=e=>e.container.querySelectorAll(e.elements_selector),_e=e=>(e=>"error"===u(e))(e),ge=(e,t)=>(e=>de(e).filter(b))(e||ue(t)),be=(e,t)=>{var a;(a=ue(e),de(a).filter(_e)).forEach((t=>{f(t,e.class_error),g(t)})),t.update()},pe=function(t,a){const s=r(t);this._settings=s,this.loadingCount=0,ce(s,this),((t,a)=>{e&&window.addEventListener("online",(()=>{be(t,a)}))})(s,this),this.update(a)};pe.prototype={update:function(e){const s=this._settings,l=ge(e,s);var n,r;(A(this,l.length),!t&&a)?oe(s)?((e,t,a)=>{e.forEach((e=>{-1!==re.indexOf(e.tagName)&&X(e,t,a)})),A(a,0)})(l,s,this):(n=this._observer,r=l,(e=>{e.disconnect()})(n),((e,t)=>{t.forEach((t=>{e.observe(t)}))})(n,r)):this.loadAll(l)},destroy:function(){this._observer&&this._observer.disconnect(),ue(this._settings).forEach((e=>{R(e)})),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){const t=this._settings;ge(e,t).forEach((e=>{I(e,this),W(e,t,this)}))},restoreAll:function(){const e=this._settings;ue(e).forEach((t=>{se(t,e)}))}},pe.load=(e,t)=>{const a=r(t);W(e,a)},pe.resetStatus=e=>{g(e)},e&&((e,t)=>{if(t)if(t.length)for(let a,s=0;a=t[s];s+=1)o(e,a);else o(e,t)})(pe,window.lazyLoadOptions),exports.lazyLoadInstance=null,"undefined"==typeof window||exports.lazyLoadInstance||(exports.lazyLoadInstance=new pe);exports.abbreviateNumber=function(e){var t=String(e);if(e>=1e3){for(var a=Math.floor((""+e).length/3),s=void 0,l=2;l>=1;l--){if(((s=parseFloat((0!=a?e/Math.pow(1e3,a):e).toPrecision(l)))+"").replace(/[^a-zA-Z 0-9]+/g,"").length<=2)break}s&&s%1!=0&&(s=s.toFixed(1)),t=s+["","k","m","b","t"][a]}return t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=require("./constants-d4ec4195.js");exports.getCareApiDomain=function(){return"https://".concat(t.isProduction?"health-care.":"service-health-care.","hellohealthgroup.com")},exports.getCurrentBaseUrl=function(o,e){void 0===e&&(e="helloSites");var r="marryBaby"===e,n="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV,c=!n&&!t.isProduction;return n?"http://localhost:3000":"https://".concat(c?r?"fe.":"discover.":r?"www.":"").concat(t.domainLocales[o])},exports.getCurrentSsoUrl=function(o){return"https://".concat(t.isProduction?"id.":"staging-id.").concat(t.domainLocales[o])},exports.getDiscoverApiDomain=function(o){return"https://".concat(t.isProduction?"wp.":"staging.").concat(t.domainLocales[o])},exports.getTogetherApiDomain=function(){return"https://".concat(t.isProduction?"together.":"staging-together.","hellohealthgroup.com")};
|
package/build/theme-da70da1e.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";exports.theme={colors:{primaryBase:"#2d87f3",primaryHover:"#2c74df",primaryActive:"#2b62cd",primaryVisited:"#5e38ba",secondaryBase:"#284a75",secondaryDark:"#1b3250",accentLight:"#b1ebf8",accentMain:"#00AECD",success:"#00b16a",error:"#f71210",gray100:"#f2f2f2",gray200:"#d9d9d9",gray300:"#bfbfbf",gray400:"#8c8c8c",gray500:"#737373",gray600:"#595959",gray800:"#262626",blue50:"#e3f2ff",blue100:"#bcdeff",blue200:"#91caff",blue300:"#65b5ff",blue400:"#45a4ff",blue500:"#2b94ff",blue600:"#2d87f3",blue700:"#2c74df",blue800:"#2b62cd",blue900:"#2743ad",alertWarning:"#fe921d",green50:"#e0f8ee",green100:"#b3eed5",green200:"#7ce2b9",green300:"#2ed69e",green400:"#00CB8A",green500:"#00C076",green600:"#00B16A",green700:"#009E5C",green800:"#008C50",green900:"#006C39",yellow50:"#fff8e2",yellow100:"#ffecb6",yellow200:"#ffe187",yellow300:"#ffd658",yellow400:"#ffc326",yellow500:"#fe921d",yellow600:"#ffb521",yellow700:"#fea21e",yellow800:"#fe921d",yellow900:"#fc7419",red50:"#fae9e8",red100:"#feccbf",red200:"#ff5331",red300:"#f44d2c",red400:"#ff6f4d",red500:"#ff5331",red600:"#f44d2c",red700:"#e64728",red800:"#d84023",red900:"#bf331b",neutral50:"#f8f9fc",neutral100:"#e4e8ec",neutral150:"#fafafa",neutral200:"#d2d6dc",neutral300:"#bfc5cc",neutral400:"#adb3bc",neutral500:"#9aa2ac",neutral600:"#87909c",neutral700:"#757f8c",neutral800:"#626d7c",teal50:"#e0f7fc",teal100:"#b1ebf8",teal200:"#7ddff3",teal300:"#44d1ec",teal400:"#00c7e6",teal500:"#00bee0",teal600:"#00aecd",teal700:"#0099b2",teal800:"#008599",teal900:"#00626c",pink50:"#fff1f6",pink100:"#fec7dc",pink200:"#fec7dc",pink300:"#fec2cf",pink400:"#fe9dc2",pink500:"#fd87b4",pink600:"#fd72a7",pink700:"#fc5d9a",pink800:"#fc488d",violet50:"#f5edff",violet100:"#e7d2f7",violet200:"#d8b7f0",violet300:"#ca9ce8",violet400:"#bb82e1",violet500:"#ad67d9",violet600:"#9e4cd1",violet700:"#9031ca",violet800:"#8116c2",indigo700:"#35639c",indigo800:"#284a75",indigo900:"#1b3250",brown50:"#faecde",brown100:"#ecd8c5",brown200:"#dec5ab",brown300:"#d0b192",brown400:"#c39d79",brown500:"#b5895f",brown600:"#a77646",brown700:"#99622c",brown800:"#8b4e13",white:"#fff"},mbColors:{pink:"#e85388",cobalt:"#2661ad",dark:"#202135",gray:"#3e3f58",midGray:"#9495a0",lightGray:"#f3f3f3",lightMint:"#f2fcf8",lightPink:"#ffeaf1",lightOrange:"#fffaeb",lightBlue:"#e0e9fc",mint:"#5ec08f",peach:"#ffaaa9",orange:"#fb8c00",ceruleanBlue:"#b6ceff",red:"#eb5757",lightRed:"#fdeeee",yellow:"#ff8a2b",green:"#f2fcf7",blue:"#4096fe",toneYellow:"#fff9eb",toneGreen:"#f2fcf7",toneBlue:"#e0e9fb",tonePink:"#ffeaf1"},sizes:{fwBold:"700",fwSemiBold:"600",fsCaption2:"13px",fsHeading1:"40px",fsHeading2:"28px",fsHeading4:"24px",fsHeading5:"18px",fsHeading6:"16px",fsParagraph3:"16px",fsParagraph4:"14px",fwRegular:"400"},zIndexes:{belowHeader:"1",zIndex100:"100",onTop:"1000"},defaultColor:""};
|
package/build/types-18cefca9.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e,o=require("./tslib.es6-f7929e76.js"),t=require("./theme-da70da1e.js"),i=require("./constants-d4ec4195.js"),l=Object.freeze({__proto__:null}),n=Object.freeze({__proto__:null}),a="development"===process.env.NEXT_PUBLIC_DEPLOY_ENV,r="undefined"==typeof window,s=process.env.NEXT_PUBLIC_DEPLOY_LOCALE?process.env.NEXT_PUBLIC_DEPLOY_LOCALE:"vi-VN",u=process.env.NEXT_PUBLIC_GOOGLE_MAP_KEY||"",c=process.env.NEXT_PUBLIC_ADMIN_GOOGLE_LOCATION_KEY,d=process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID||"289442006438-cihobuq1h3r4426pur7u0e43fqdnep59.apps.googleusercontent.com",m={"vi-VN":"hellobacsi.com","id-ID":"hellosehat.com","ms-MY":"hellodoktor.com","km-KH":"hellokrupet.com","en-PH":"hellodoctor.com.ph","th-TH":"hellokhunmor.com","my-MM":"hellosayarwon.com","zh-TW":"helloyishi.com.tw","hi-IN":"helloswasthya.com"},p=a?"http://localhost:3001":i.isProduction?"https://".concat(m[s]):"https://discover.".concat(m[s]),_=i.isProduction?"https://wp.".concat(m[s],"/"):"https://staging.".concat(m[s],"/"),h=process.env.NEXT_PUBLIC_TOGETHER_API_URL&&""!==process.env.NEXT_PUBLIC_TOGETHER_API_URL?process.env.NEXT_PUBLIC_TOGETHER_API_URL:"https://together.".concat(m[s],"/"),E="".concat(p,"/community"),v=process.env.NEXT_PUBLIC_SSO_URL||"http://staging-id.hellobacsi.com/";!function(e){e[e.FEMALE=0]="FEMALE",e[e.MALE=1]="MALE",e[e.ANY=2]="ANY"}(e||(e={}));var I={"vi-VN":{HOME:function(){return JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#website","@type":"WebSite",description:"Hello Bacsi - Health Information",inLanguage:"vi-VN",name:"Hello Bacsi",potentialAction:[{"@type":"SearchAction","query-input":"required name=search_term_string",target:"https://hellobacsi.com/shop/tim-kiem/?keyword={search_term_string}"}],url:"https://hellobacsi.com/shop/"}]})},CATEGORY:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),void 0===t&&(t=[]),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#breadcrumb","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/","@type":"WebPage",name:"Hello Bacsi",url:"https://hellobacsi.com/shop/"}},{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/danh-muc","@type":"WebPage",name:"Hello Bacsi - Danh Muc",url:"https://hellobacsi.com/shop/danh-muc"}}]},{"@type":"ItemList",url:e,numberOfItems:o,itemListElement:t}]})},BRAND:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),void 0===t&&(t=[]),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/#breadcrumb","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/","@type":"WebPage",name:"Hello Bacsi",url:"https://hellobacsi.com/shop/"}},{"@type":"ListItem",item:{"@id":"https://hellobacsi.com/shop/thuong-hieu","@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop/thuong-hieu"}}]},{"@type":"ItemList",url:e,numberOfItems:o,itemListElement:t}]})},BRAND_DETAIL:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/thuong-hieu/#brand","@type":"BrandDetail",itemListElement:[{"@type":"Item",item:{"@id":"https://hellobacsi.com/shop".concat(e),"@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop".concat(e)}}]},{"@type":"BrandDetail",url:"https://hellobacsi.com/shop".concat(e),numberOfItems:o,itemListElement:null!=t?t:{}}]})},PRODUCT_DETAIL:function(e,o,t){return void 0===e&&(e=""),void 0===o&&(o=0),JSON.stringify({"@context":"https://schema.org","@graph":[{"@id":"https://hellobacsi.com/shop/san-pham/#product","@type":"ProductDetail",itemListElement:[{"@type":"Item",item:{"@id":"https://hellobacsi.com/shop/san-pham/".concat(e),"@type":"WebPage",name:"Hello Bacsi - Thuong Hieu",url:"https://hellobacsi.com/shop/san-pham/".concat(e)}}]},{"@type":"BrandDetail",url:e,numberOfItems:o,itemListElement:null!=t?t:{}}]})}}},T=Object.freeze({__proto__:null,isDevelopment:a,IS_SSR:r,locale:s,BEARER_TOKEN_COOKIE:"hhg_user_token",BEARER_ADMIN_TOKEN_COOKIE:"hhg_admin_token",GUEST_CART_ID_COOKIE:"hhg_guest_cart_id",GOOGLE_MAP_KEY:u,GOOGLE_ADMIN_LOCATION_KEY:c,GOOGLE_CLIENT_ID:d,GOOGLE_CALENDAR_API_KEY:"",basePath:"shop",SSO_USER_BASE_PATH:"user",CARE_BASE_PATH:"care",COMMUNITY_BASE_PATH:"community",HEALTH_TOOLs_BASE_PATH:"health-tools",NOTIFICATION_TIME_OUT:3e3,DOMAIN_LOCALES:m,DISCOVER_URL_FE:p,DISCOVER_URL_BE:_,TOGETHER_URL_BE:h,TOGETHER_URL_FE:E,SSO_URL:v,DISCOVERY_FOOTER_URL:"#",HEALTH_CARE_FOOTER_URL:"#",HEALTH_TOOLS_FOOTER_URL:"#",HEALTH_TOGETHER_FOOTER_URL:"#",POLICIES_FOOTER_URL:"#",FAQ_FOOTER_URL:"#",SITEMAP_FOOTER_URL:"#",ABOUT_US_FOOTER_URL:"#",EXECUTIVE_BIOS_FOOTER_URL:"#",ADVERTISING_FOOTER_URL:"#",CONTACT_US_FOOTER_URL:"#",ABOUT_GO_CARE_FOOTER_URL:"#",get Gender(){return e},EMAIL_REGEX:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,COUNTRY_SITENAME:{ID:"Hello Sehat",TH:"Hello Khunmor",MY:"Hello Doktor",KH:"Hello Krupet",TW:"Hello Yishi",MM:"Hello Sayarwon",IN:"Hello Swasthya",VN:"Hello Bacsi",PH:"Hello Doctor"},LOCALE_SPECS:{"vi-VN":{LOGO_TYPE:"hellobacsi",SITE_NAME:"HelloBacsi",SITE_NAME_FORMATTED:"Hello Bacsi",HOMEPAGE_IMAGE:"https://hellobacsi.com/images/country-thumbnails/VN.png",SITE_ID:"1",INSIDER_TAG:"//hellobacsivn.api.useinsider.com/ins.js?id=10003798",TOOLTIP_IMAGE:"/images/tooltips-vn.png"},"en-PH":{LOGO_TYPE:"hellodoctor",SITE_NAME:"HelloDoctor",HOMEPAGE_IMAGE:"https://hellodoctor.com.ph/images/country-thumbnails/PH.png",SITE_NAME_FORMATTED:"Hello Doctor",SITE_ID:"9",CATEGORIES_TYPE:"short",INSIDER_TAG:"//hellodoctorph.api.useinsider.com/ins.js?id=10004527",TOOLTIP_IMAGE:"/images/tooltips-ph.png"},"th-TH":{LOGO_TYPE:"hellokhunmor",SITE_NAME:"HelloKhunmor",HOMEPAGE_IMAGE:"https://hellokhunmor.com/images/country-thumbnails/TH.png",SITE_NAME_FORMATTED:"Hello Khunmor",SITE_ID:"3",CATEGORIES_TYPE:"long",INSIDER_TAG:"//hellokhunmor.api.useinsider.com/ins.js?id=10004524",TOOLTIP_IMAGE:"/images/tooltips-th.png"},"km-KH":{LOGO_TYPE:"hellokrupet",SITE_NAME:"HelloKrupet",HOMEPAGE_IMAGE:"https://hellokrupet.com/images/country-thumbnails/KH.JPG",SITE_NAME_FORMATTED:"Hello Krupet",SITE_ID:"4",CATEGORIES_TYPE:"long",INSIDER_TAG:"//hellokrupet.api.useinsider.com/ins.js?id=10004523",TOOLTIP_IMAGE:"/images/tooltips-kh.png"},"my-MM":{LOGO_TYPE:"hellosayarwon",SITE_NAME:"HelloSayarwon",HOMEPAGE_IMAGE:"https://hellosayarwon.com/images/country-thumbnails/PH.png",SITE_NAME_FORMATTED:"Hello Sayarwon",SITE_ID:"7",INSIDER_TAG:"//hellosayarwon.api.useinsider.com/ins.js?id=10004522"},"zh-TW":{LOGO_TYPE:"helloyishi",SITE_NAME:"HelloYishi",HOMEPAGE_IMAGE:"https://helloyishi.com.tw/images/country-thumbnails/TW.png",SITE_NAME_FORMATTED:"Hello Yishi",SITE_ID:"6",INSIDER_TAG:"//helloyishi.api.useinsider.com/ins.js?id=10004526",TOOLTIP_IMAGE:"/images/tooltips-tw.png"},"id-ID":{LOGO_TYPE:"hellosehat",SITE_NAME:"HelloSehat",HOMEPAGE_IMAGE:"https://hellosehat.com/images/country-thumbnails/ID.png",SITE_NAME_FORMATTED:"Hello Sehat",SITE_ID:"2",INSIDER_TAG:"//hellosehat.api.useinsider.com/ins.js?id=10003799",TOOLTIP_IMAGE:"/images/tooltips-id.png"},"hi-IN":{LOGO_TYPE:"helloswasthya",SITE_NAME:"HelloSwasthya",HOMEPAGE_IMAGE:"https://helloswasthya.com/images/country-thumbnails/IN.png",SITE_NAME_FORMATTED:"हैलो स्वास्थ्य",SITE_ID:"8",CATEGORIES_TYPE:"long",INSIDER_TAG:"//helloswasthya.api.useinsider.com/ins.js?id=10004498",TOOLTIP_IMAGE:"/images/tooltips-in.png"},"ms-MY":{LOGO_TYPE:"hellodoktor",SITE_NAME:"HelloDoktor",HOMEPAGE_IMAGE:"https://hellodoktor.com/images/country-thumbnails/MY.png",SITE_NAME_FORMATTED:"Hello Doktor",SITE_ID:"5",INSIDER_TAG:"//hellodoktor.api.useinsider.com/ins.js?id=10004525",TOOLTIP_IMAGE:"/images/tooltips-my.png"}},SOCIAL_MEDIA:{"vi-VN":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellobacsi/",INSTAGRAM:"https://www.instagram.com/hellobacsi/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCYHzHDXngnB7jkmcQgXwE0w"},"en-PH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloDoctorPH/",INSTAGRAM:"https://www.instagram.com/hellodoctor_ph/",TWITTER:null},"km-KH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellokrupet/",INSTAGRAM:"https://www.instagram.com/hellokrupetofficial/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCVK4p9YPIMkmoerk3X-y-TQ"},"ms-MY":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloDoktorMY/",INSTAGRAM:"https://www.instagram.com/_hellodoktor_/",TWITTER:null},"id-ID":{LINKEDIN:"https://www.linkedin.com/company/hello-sehat/",FACEBOOK:"https://www.facebook.com/hellosehat",INSTAGRAM:"https://www.instagram.com/hellosehat/",TWITTER:"https://twitter.com/HelloSehat"},"my-MM":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellosayarwon/",INSTAGRAM:"https://www.facebook.com/hellosayarwon/",TWITTER:null},"zh-TW":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/helloyishi/",INSTAGRAM:"https://www.instagram.com/helloyishi/",TWITTER:null},"hi-IN":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/HelloSwasthya/",INSTAGRAM:"https://www.instagram.com/hello_swasthya/",TWITTER:null},"th-TH":{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/hellokhunmor/",INSTAGRAM:"https://www.instagram.com/hellokhunmor/",TWITTER:null,YOUTUBE:"https://www.youtube.com/channel/UCbdbow4UhKfa7rqIhclNPIQ/"}},FLAG_LINKS:{ID:"https://hellosehat.com/",TH:"https://hellokhunmor.com/",MY:"https://hellodoktor.com/",KH:"https://hellokrupet.com/",TW:"https://helloyishi.com.tw/",MM:"https://hellosayarwon.com/",IN:"https://helloswasthya.com/",VN:"https://hellobacsi.com/",PH:"https://hellodoctor.com.ph/"},STATIC_PAGES:{"vi-VN":{PRIVACY:"/privacy",TERM_OF_USE:"/dieu-khoan-su-dung",PRIVACY_POLICY:"/chinh-sach-quyen-rieng-tu",EDITORIAL_CORRECTIONS_POLICY:"/chinh-sach-bien-tap-chinh-sua",ADVERTISING_SPONSOR_POLICY:"/chinh-sach-quang-cao-tai-tro",POLICIES:"/chinh-sach",FAQS:"/thong-tin-quan-trong",SITEMAP:"/sitemap",ABOUT_US:"/about-us",ADVERTISEMENT:"/quang-cao-voi-chung-toi",CONTACT_US:"/lien-he",ABOUT_GO_CARE:"/about-go-care",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/hello-bacsi/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"km-KH":{POLICIES:"/policies",TERM_OF_USE:"/ខនិងលក្ខខណ្ឌ",PRIVACY_POLICY:"/គោលការណ៍ឯកជនភាព",EDITORIAL_CORRECTIONS_POLICY:"/គោលការណ៍ខ្លឹមសារមាតិកា",ADVERTISING_SPONSOR_POLICY:"/គោលការណ៍ផ្សាយពាណិជ្ជកម",FAQS:"/faqs",SITEMAP:"/sitemap",ABOUT_US:"/about-us",ADVERTISEMENT:"/advertisement",CONTACT_US:"/contact-us",ABOUT_GO_CARE:"/about-go-care",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"/#",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"en-PH":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"my-MM":{POLICIES:"/polisi-terma-syarat",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/pengiklanan",CONTACT_US:"/hubungi-kami",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:" https://hellohealthgroup.com/hello-doktor/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"zh-TW":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/advertising",CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,FACILITY:"/facility",HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"id-ID":{POLICIES_EN:"/policies",TERM_OF_USE:"/kebijakan-pengguna",PRIVACY_POLICY:"/kebijakan-privasi",EDITORIAL_CORRECTIONS_POLICY:"/kebijakan-editorial",ADVERTISING_SPONSOR_POLICY:"/kebijakan-iklan",POLICIES:"/kebijakan",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/kontak-kami",CONTACT_EN:"/contact",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/hello-sehat/",RECRUITMENT:"https://hellohealthgroup.com/careers/",EDITORIAL_POLICY:"/edit-id",EDITORIAL_POLICY_EN:"/edit-en"},"hi-IN":{POLICIES:"/policies",TERM_OF_USE:"/terms-of-use",PRIVACY_POLICY:"/privacy-policy",EDITORIAL_CORRECTIONS_POLICY:"/editorial-and-corrections-policy",ADVERTISING_SPONSOR_POLICY:"/advertising-and-sponsor-policy",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:null,CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"ms-MY":{POLICIES:"/polisi-terma-syarat",TERM_OF_USE:"/terma-dan-syarat",PRIVACY_POLICY:"/polisi-privasi",EDITORIAL_CORRECTIONS_POLICY:"/polisi-editorial",ADVERTISING_SPONSOR_POLICY:"/polisi-pengiklanan",FAQS:null,SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/pengiklanan",CONTACT_US:"/hubungi-kami",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:" https://hellohealthgroup.com/hello-doktor/",RECRUITMENT:"https://hellohealthgroup.com/careers/"},"th-TH":{POLICIES_EN:"/policies",TERM_OF_USE:"/เงื่อนใขการใช้งาน",PRIVACY_POLICY:"/นโยบายความเป็นส่วนตัว",EDITORIAL_CORRECTIONS_POLICY:"/นโยบายบรรณธิการ",ADVERTISING_SPONSOR_POLICY:"/นโยบายการโฆษณาและผู้สนับสนุน",POLICIES:"/นโยบาย",FAQS:"/คำถามที่พบบ่อย",SITEMAP:null,ABOUT_US:"/about-us",ADVERTISEMENT:"/ลงโฆษณากับเรา",CONTACT_US:"/contact-us",ABOUT_GO_CARE:null,HEALTH_TOOLS:"/health-tools",EXECUTIVE_BIOS:"https://hellohealthgroup.com/management-team/",RECRUITMENT:"https://hellohealthgroup.com/careers/"}},FAVICONS:{"vi-VN":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"km-KH":[{type:"link",rel:"icon",href:"/by-locales/km-KH/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/km-KH/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/km-KH/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/km-KH/icon-270x270.png"}],"en-PH":[{type:"link",rel:"icon",href:"/by-locales/en-PH/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/en-PH/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon",href:"/by-locales/en-PH/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/en-PH/icon-270x270.png"}],"id-ID":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"ms-MY":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"th-TH":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"my-MM":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"zh-TW":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}],"hi-IN":[{type:"link",rel:"shortcut icon",href:"/by-locales/vi-VN/favicon.ico"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-32x32.png",sizes:"32x32"},{type:"link",rel:"icon",href:"/by-locales/vi-VN/icon-192x192.png",sizes:"192x192"},{type:"link",rel:"apple-touch-icon-precomposed",href:"/by-locales/vi-VN/icon-180x180.png"},{type:"meta",name:"msapplication-TileImage",content:"/by-locales/vi-VN/icon-270x270.png"}]},LOCALE_COUNTRY:{"vi-VN":{id:1,name:"Vietnam"},"id-ID":{id:2,name:"Indonesia"},"ms-MY":{id:3,name:"Malaysia"},"km-KH":{id:4,name:"Cambodia"},"en-PH":{id:5,name:"Philippines"},"th-TH":{id:6,name:"Thai Lan"},"my-MM":{id:7,name:"Myanmar"},"zh-TW":{id:8,name:"Taiwan"},"hi-IN":{id:9,name:"India"}},MAX_ALLOWED_IMG_SIZE:20971520,COUNTRY_CODE_BY_LOCALE:{"vi-VN":"vn","id-ID":"id","ms-MY":"my","km-KH":"kh","en-PH":"ph","th-TH":"th","my-MM":"mm","zh-TW":"tw","hi-IN":"in"},COUNTRY_CURRENCY_SYMBOL:{"vi-VN":"₫","id-ID":"Rp","ms-MY":"RM","km-KH":"៛","en-PH":"₱","th-TH":"฿","my-MM":"K","zh-TW":"$","hi-IN":"₹"},CURRENCY_PREFIX:{IDR:"Dimulai dari"},LOCALISED_SLUGS:{"en-PH":{PRODUCT:"product",CATEGORY:"category",BRAND:"brand",SEARCH:"search",PROFILE:"profile",PROFILE_MANAGE_ORDERS:"profile/manage-orders",PROFILE_MANAGE_ADDRESS:"profile/deliver-address",PROFILE_VOUCHER:"profile/voucher",PROFILE_MEMBER_CARD:"profile/member-card",CART:"cart",CART_CHECKOUT:"cart/checkout",ORDER_CONFIRMATION:"order-confirmation",PROMOTION:"promotion"},"vi-VN":{PRODUCT:"san-pham",CATEGORY:"danh-muc",BRAND:"thuong-hieu",SEARCH:"tim-kiem",PROFILE:"ho-so",PROFILE_MANAGE_ORDERS:"ho-so/quan-li-don-hang",PROFILE_MANAGE_ADDRESS:"ho-so/dia-chi-giao-hang",PROFILE_VOUCHER:"ho-so/khuyen-mai",PROFILE_MEMBER_CARD:"ho-so/the-thanh-vien",CART:"gio-hang",CART_CHECKOUT:"gio-hang/thanh-toan",ORDER_CONFIRMATION:"kiem-tra-don-hang",PROMOTION:"khuyen-mai"}},HEADER_LOGO_ALIGNMENT:"188px",globalFontFamily:"Inter",ENABLE_COMMUNITY_LOCALES:["vi-VN","id-ID","ms-MY","en-PH","th-TH"],ENABLE_CARE_LOCALES:["vi-VN","id-ID","en-PH"],ENABLE_HEALTH_PARENTING_LOCALES:["vi-VN","en-PH","id-ID","ms-MY","km-KH","th-TH","my-MM","zh-TW"],SEO_SCHEMA:I});function g(e){return null!=e}var O,A={formatAutoCompleteAddress:function(e){return e&&e.place_id?{placeId:e.place_id,description:e.description||""}:null},formatPrice:function(e,o){var t="string"==typeof e?parseInt(e):e;return new Intl.NumberFormat(o||"vi-VN").format(t)},formatHotSearchKeyword:function(e){return{text:(null==e?void 0:e.name)||""}},formatHelpfulUrl:function(e){return{name:(null==e?void 0:e.name)||"",featuredImage:(null==e?void 0:e.featured_image)||"",url:(null==e?void 0:e.url)||""}},formatCategory:function(e,o,i){var l,n,a,r=i?i+"/"+e.slug:e.slug,s=(null===(n=null===(l=null==e?void 0:e.children)||void 0===l?void 0:l.map)||void 0===n?void 0:n.call(l,(function(o){return A.formatCategory(o,e.id,r)})))||[];return{id:null==e?void 0:e.id,name:(null==e?void 0:e.name)||"",logo:(null==e?void 0:e.logo)||"",slug:(null==e?void 0:e.slug)||"",fullSlug:r||"",children:s,backgroundColor:e.color||t.theme.colors.teal50,parentId:o||0,products:(null===(a=e.products)||void 0===a?void 0:a.map(A.formatProduct))||[]}},formatFooterInfo:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_,h,E,v,I,T,g=(null===(i=null===(t=null===(o=null==e?void 0:e.branch)||void 0===o?void 0:o.branch)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,(function(e){return{flag:e.flag||"",name:e.name||"",url:e.url||""}})))||[],O=(null===(a=null===(n=null===(l=null==e?void 0:e.general)||void 0===l?void 0:l.verified)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,(function(e){return{image:e.image||"",url:e.url||""}})))||[],A=(null===(s=null===(r=null==e?void 0:e.menu)||void 0===r?void 0:r.map)||void 0===s?void 0:s.call(r,(function(e){var o,t;return{menu_title:e.menu_title,items:null===(t=null===(o=e.items)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{title:e.title,url:e.url}}))}})))||[],f=(null===(d=null===(c=null===(u=null==e?void 0:e.social)||void 0===u?void 0:u.socials)||void 0===c?void 0:c.map)||void 0===d?void 0:d.call(c,(function(e){return{icon:e.icon||"",name:e.name||"",url:e.url||""}})))||[];return{branch:{title:(null===(m=null==e?void 0:e.branch)||void 0===m?void 0:m.title)||"",branch:g},general:{logo:null!==(_=null===(p=null==e?void 0:e.general)||void 0===p?void 0:p.logo)&&void 0!==_?_:"",content:null!==(E=null===(h=null==e?void 0:e.general)||void 0===h?void 0:h.content)&&void 0!==E?E:"",copyright:null!==(I=null===(v=null==e?void 0:e.general)||void 0===v?void 0:v.copyright)&&void 0!==I?I:"",verified:O},menu:A,social:{title:(null===(T=null==e?void 0:e.social)||void 0===T?void 0:T.title)||"",socials:f}}},formatNavigation:function(e){var o,t,i,l,n,a;return{hotSearchKeywords:(null===(t=null===(o=null==e?void 0:e.hot_search_keywords)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatHotSearchKeyword))||[],helpfulUrls:(null===(l=null===(i=null==e?void 0:e.helpful_urls)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatHelpfulUrl))||[],categories:(null===(a=null===(n=null==e?void 0:e.categories)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,(function(e){return A.formatCategory(e)})))||[],footer:A.formatFooterInfo(null==e?void 0:e.footer),storeId:(null==e?void 0:e.store_id)||0,customerId:(null==e?void 0:e.customer_id)||0,cartItemsQty:"number"==typeof(null==e?void 0:e.cart_items_qty)?e.cart_items_qty:null}},formatPriceInfo:function(e){return e?{final:e.final||0,regular:e.regular||0,discountPercent:e.discount_percent||0}:null},formatProduct:function(e){var o,t,i,l;if(!e)return null;var n={final:0,regular:0,discountPercent:0};return{id:e.id||0,price:e.price&&A.formatPriceInfo(e.price)||n,thumbnail:e.thumbnail||"",name:e.name||"",averageRating:Number((e.average_rating||0).toFixed(2)),reviewsCount:e.reviews_count||0,tag:e.tag||null,sku:e.sku||"",slug:e.slug||"",images:e.images||[],tags:e.tags||[],unit:e.unit||"",brand:e.brand?{name:e.brand.name||"",image:e.brand.image||"",slug:e.brand.slug||"",productsCount:e.brand.products_count||0}:null,description:e.description||"",productPromotions:(null===(t=null===(o=e.product_promotions)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatProductPromotion).filter(g))||[],categories:(null===(l=null===(i=e.categories)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,(function(e){return A.formatCategory(e)})).filter(g))||[],isInStock:(null==e?void 0:e.is_in_stock)||!1}},formatBanner:function(e){return e?{name:e.name||"",url:e.url||"",featuredImage:e.featured_image||"",alt:e.image_alt}:null},formatBlogPost:function(e){var o,t;return e?{title:e.title||"",image:e.image||"",link:e.link||"",postData:e.post_data?{reviewed:e.post_data.reviewed?{author:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.author||void 0),editor:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.editor||void 0),expert:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.expert||void 0),factCheck:A.formatBlogPostDataReviewedUser(e.post_data.reviewed.fact_check||void 0),isAuthor:Boolean(e.post_data.reviewed.is_author)}:null,categories:e.post_data.categories?null===(t=(o=e.post_data.categories).map)||void 0===t?void 0:t.call(o,(function(e){return{termId:e.term_id||0,name:e.name||"",permalink:e.permalink||"",textColor:e.text_color||""}})):[],postDate:e.post_data.post_date||"",postModified:e.post_data.post_modified||"",modifiedTime:e.post_data.modified_time||""}:null}:null},formatBlogPostDataReviewedUser:function(e){return e?{id:e.ID||0,userId:e.user_id||0,formerRole:e.former_role||"",role:e.role||"",slug:e.slug||"",displayName:e.display_name||"",description:e.description||"",profileUrl:e.profile_url||"",avatar:e.avatar||"",avatarThumbnail:e.avatar_thumbnail||"",turnOffProfile:Boolean(e.turn_off_profile)}:null},formatBrand:function(e){var o,t,i,l;return e?{id:e.id||0,image:e.image||"",position:e.position||"",isPopular:e.is_popular||!1,summary:e.summary||"",name:e.name||"",slug:e.slug||"",description:e.description||null,banners:(null===(t=null===(o=e.banners)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatBanner).filter(g))||[],bestsellerProducts:(null===(l=null===(i=e.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(g))||[]}:null},formatHomePage:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_,h,E,v,I,T,O;return e?{brands:e.brands?null===(t=(o=e.brands).map)||void 0===t?void 0:t.call(o,A.formatBrand).filter(g):[],hotDeals:e.hot_deals?null===(l=(i=e.hot_deals).map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(g):[],newProducts:e.new_products?null===(a=(n=e.new_products).map)||void 0===a?void 0:a.call(n,A.formatProduct).filter(g):[],slideBanners:e.slide_banners?null===(s=(r=e.slide_banners).map)||void 0===s?void 0:s.call(r,A.formatBanner).filter(g):[],subBanners:e.sub_banners?null===(c=(u=e.sub_banners).map)||void 0===c?void 0:c.call(u,A.formatBanner).filter(g):[],footerBanners:e.footer_banners?null===(m=(d=e.footer_banners).map)||void 0===m?void 0:m.call(d,A.formatBanner).filter(g):[],blogPosts:e.blog_posts?null===(_=(p=e.blog_posts).map)||void 0===_?void 0:_.call(p,A.formatBlogPost).filter(g):[],popularCategories:e.popular_categories?null===(E=(h=e.popular_categories).map)||void 0===E?void 0:E.call(h,(function(e){return A.formatCategory(e)})).filter(g):[],suggestProducts:e.suggest_products?null===(I=(v=e.suggest_products).map)||void 0===I?void 0:I.call(v,(function(e){return A.formatCategory(e)})).filter(g):[],promotions:e.promotions?null===(O=(T=e.promotions).map)||void 0===O?void 0:O.call(T,(function(e){return A.formatPromotion(e)})).filter(g):[]}:null},formatCategoryPage:function(e){var o,t,i,l;return e?{id:e.id||0,name:e.name||"",slug:e.slug||"",description:e.description||null,banners:(null===(t=null===(o=e.banners)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatBanner).filter(g))||[],bestsellerProducts:(null===(l=null===(i=e.bestseller_products)||void 0===i?void 0:i.map)||void 0===l?void 0:l.call(i,A.formatProduct).filter(g))||[]}:null},formatBrandPage:function(e){return e?A.formatBrand(e):null},formatPagination:function(e){return e?{current:e.current||0,first:e.first||0,itemsPerPage:e.items_per_page||0,last:e.last||0,next:e.next||0,prev:e.prev||0,totalItems:e.total_items||0}:null},formatProductDetailPage:function(e){var t,i,l,n,a,r,s,u;return e?o.__assign(o.__assign({},A.formatProduct(e)),{relatedProducts:(null===(i=null===(t=e.related_products)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,A.formatProduct).filter(g))||[],bestsellerProducts:(null===(n=null===(l=e.bestseller_products)||void 0===l?void 0:l.map)||void 0===n?void 0:n.call(l,A.formatProduct).filter(g))||[],viewedProducts:(null===(r=null===(a=e.viewed_products)||void 0===a?void 0:a.map)||void 0===r?void 0:r.call(a,A.formatProduct).filter(g))||[],promotions:(null===(u=null===(s=e.promotions)||void 0===s?void 0:s.map)||void 0===u?void 0:u.call(s,A.formatPromotion).filter(g))||[]}):null},formatProductReview:function(e){var o,t;return e?{reviewId:e.review_id||"",createdAt:e.created_at||"",title:e.title||"",detail:e.detail||"",nickname:e.nick_name||"",avatar:e.avatar||"",ratingVotes:(null===(t=null===(o=e.rating_votes)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{ratingCode:e.rating_code||"",value:Number(e.value)||0,percent:Number(e.percent)||0}})))||[],images:e.images||[]}:null},formatProductPromotion:function(e){return e?{id:e.id||0,name:e.name||"",thumbnail:e.thumbnail||"",expirationDate:e.expiration_date||""}:null},formatPromotion:function(e){return e?{id:e.id||0,name:e.name||"",slug:e.slug||"",thumbnail:e.thumbnail||"",expiredDate:e.expired_date||"",banners:e.banners||[],points:0,description:e.description||"",metaTitle:e.meta_title||"",metaKeywords:e.meta_keywords||"",metaDescription:e.meta_description||""}:null},formatCustomAttributes:function(e,o){var t;return(null==e?void 0:e.length)&&(null===(t=null==e?void 0:e.find((function(e){return e.attribute_code===o})))||void 0===t?void 0:t.value)||""},formatAddress:function(e){var o,t,i,l;return e?{id:e.id||0,fullName:e.firstname||"",telephone:e.telephone||"",province:{value:null===(o=e.region)||void 0===o?void 0:o.region_id,label:null===(t=e.region)||void 0===t?void 0:t.region}||null,district:{value:A.formatCustomAttributes(e.custom_attributes,"district_id"),label:A.formatCustomAttributes(e.custom_attributes,"district")},commune:{value:A.formatCustomAttributes(e.custom_attributes,"ward_id"),label:A.formatCustomAttributes(e.custom_attributes,"ward")},street:(null===(i=null==e?void 0:e.street)||void 0===i?void 0:i.length)?null==e?void 0:e.street[0]:"",isDefault:e.default_billing&&e.default_shipping||!1,fullAddress:(null===(l=null==e?void 0:e.extension_attributes)||void 0===l?void 0:l.full_address)||""}:null},formatProvince:function(e){return(null==e?void 0:e.available_regions)?e.available_regions.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatDistrict:function(e){return(null==e?void 0:e.districts)?e.districts.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatCommune:function(e){return(null==e?void 0:e.communes)?e.communes.map((function(e){return{value:e.id||"",label:e.name||""}})):[]},formatOrder:function(e){var o,t;return e?{orderNumber:(null==e?void 0:e.order_number)||"",shippingData:(null==e?void 0:e.shipping_data)?{shippingMethod:e.shipping_data.shipping_method||"",shippingDescription:e.shipping_data.shipping_description||"",shippingAddress:e.shipping_data.shipping_address?{fullName:e.shipping_data.shipping_address.firstname||"",fullAddress:e.shipping_data.shipping_address.full_address||"",telephone:e.shipping_data.shipping_address.telephone||""}:null,storeAddress:null}:null,orderedDate:(null==e?void 0:e.ordered_date)||"",status:(null==e?void 0:e.status)||null,totals:(null==e?void 0:e.totals)?{subtotal:e.totals.subtotal||0,shippingAmount:e.totals.shipping_amount||0,discountAmount:e.totals.discount_amount||0,grandTotal:e.totals.grand_total||0}:null,products:(null===(t=null===(o=null==e?void 0:e.products)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,(function(e){return{sku:e.sku||"",name:e.name||"",price:e.price||0,rowTotal:e.row_total||0,image:e.image||"",qty:e.qty||0}})))||[],paymentMethod:(null==e?void 0:e.payment_method)||""}:null},formatStatistic:function(e){var o,t,i,l,n;return e?{pending:Number(null===(o=null==e?void 0:e.find((function(e){return"pending"===e.status})))||void 0===o?void 0:o.amount)||0,processing:Number(null===(t=null==e?void 0:e.find((function(e){return"processing"===e.status})))||void 0===t?void 0:t.amount)||0,delivering:Number(null===(i=null==e?void 0:e.find((function(e){return"delivering"===e.status})))||void 0===i?void 0:i.amount)||0,complete:Number(null===(l=null==e?void 0:e.find((function(e){return"complete"===e.status})))||void 0===l?void 0:l.amount)||0,canceled:Number(null===(n=null==e?void 0:e.find((function(e){return"canceled"===e.status})))||void 0===n?void 0:n.amount)||0}:{}},formatCartItem:function(e){var o,t,i,l,n,a,r,s;return e?{itemId:e.item_id||0,sku:e.sku||"",qty:e.qty||0,name:e.name||"",price:e.price||0,basePrice:(null===(o=e.extension_attributes)||void 0===o?void 0:o.base_price)||0,productType:e.product_type||"",quoteId:e.quote_id||"",thumbnail:(null===(t=e.extension_attributes)||void 0===t?void 0:t.thumbnail)||"",rowTotal:(null===(i=e.extension_attributes)||void 0===i?void 0:i.row_total)||0,promotions:(null===(a=null===(n=null===(l=e.extension_attributes)||void 0===l?void 0:l.promotions)||void 0===n?void 0:n.map)||void 0===a?void 0:a.call(n,A.formatProductPromotion))||[],isInStock:(null===(r=e.extension_attributes)||void 0===r?void 0:r.is_in_stock)||!1,urlProduct:(null===(s=e.extension_attributes)||void 0===s?void 0:s.url_key)||""}:null},formatCartAddress:function(e){var o;return e?{customerAddressId:(null==e?void 0:e.customer_address_id)||0,id:e.id||0,region:e.region||"",regionId:e.region_id||0,regionCode:e.region_code||"",countryId:e.country_id||"",street:e.street||[],postcode:e.postcode||"",city:e.city||"",firstname:e.firstname||"",lastname:e.lastname||"",customerId:e.customer_id||0,email:e.email||"",telephone:e.telephone||"",sameAsBilling:e.same_as_billing||0,saveInAddressBook:e.save_in_address_book||0,fullAddress:(null===(o=e.extension_attributes)||void 0===o?void 0:o.full_address)||""}:null},formatEstimatedShipping:function(e){return e?{carrierCode:e.carrier_code||"",methodCode:e.method_code||"",carrierTitle:e.carrier_title||"",methodTitle:e.method_title||"",amount:e.amount||0,baseAmount:e.base_amount||0,available:e.available||!1,errorMessage:e.error_message||"",priceExclTax:e.price_excl_tax||0,priceInclTax:e.price_incl_tax||0}:null},formatCartLoggedInCustomer:function(e){var o,t,i;return e?{email:e.email||"",firstname:e.firstname||"",lastname:e.lastname||"",id:e.id||0,groupId:e.group_id||0,createdAt:e.created_at||"",updatedAt:e.updated_at||"",createdIn:e.created_in||"",storeId:e.store_id||0,websiteId:e.website_id||0,addresses:(null===(t=null===(o=e.addresses)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatCartAddress))||[],disableAutoGroupChange:e.disable_auto_group_change||0,isSubscribed:(null===(i=e.extension_attributes)||void 0===i?void 0:i.is_subscribed)||!1}:null},formatCart:function(e){var o,t,i,l,n,a,r,s,u,c,d,m,p,_;return e?{id:e.id||0,createdAt:e.created_at||"",updatedAt:e.updated_at||"",isActive:e.is_active||!1,isVirtual:e.is_virtual||!1,items:(null===(i=null===(t=null===(o=e.items)||void 0===o?void 0:o.map)||void 0===t?void 0:t.call(o,A.formatCartItem))||void 0===i?void 0:i.sort((function(e,o){return Number(null==o?void 0:o.isInStock)-Number(null==e?void 0:e.isInStock)})))||[],itemsCount:e.items_count||0,itemsQty:e.items_qty||0,customer:e.customer?A.formatCartLoggedInCustomer(e.customer):null,billingAddress:e.billing_address?A.formatCartAddress(e.billing_address):null,origOrderId:e.orig_order_id||0,currency:{globalCurrencyCode:(null===(l=e.currency)||void 0===l?void 0:l.global_currency_code)||"",baseCurrencyCode:(null===(n=e.currency)||void 0===n?void 0:n.base_currency_code)||"",storeCurrencyCode:(null===(a=e.currency)||void 0===a?void 0:a.store_currency_code)||"",quoteCurrencyCode:(null===(r=e.currency)||void 0===r?void 0:r.quote_currency_code)||"",storeToBaseRate:(null===(s=e.currency)||void 0===s?void 0:s.store_to_base_rate)||0,storeToQuoteRate:(null===(u=e.currency)||void 0===u?void 0:u.store_to_quote_rate)||0,baseToGlobalRate:(null===(c=e.currency)||void 0===c?void 0:c.base_to_global_rate)||0,baseToQuoteRate:(null===(d=e.currency)||void 0===d?void 0:d.base_to_quote_rate)||0},customerIsGuest:e.customer_is_guest||!1,customerNoteNotify:e.customer_note_notify||!1,customerTaxClassId:e.customer_tax_class_id||0,storeId:e.store_id||0,shippingAssignments:null===(_=null===(p=null===(m=e.extension_attributes)||void 0===m?void 0:m.shipping_assignments)||void 0===p?void 0:p.map)||void 0===_?void 0:_.call(p,(function(e){var o,t,i;return{shipping:{address:e.shipping.address?A.formatCartAddress(e.shipping.address):null,method:(null===(o=e.shipping)||void 0===o?void 0:o.method)||""},items:(null===(i=(t=e.items).map)||void 0===i?void 0:i.call(t,A.formatCartItem))||[]}}))}:null},formatCartTotal:function(e){var o,t,i;return e?{grandTotal:e.grand_total||0,baseGrandTotal:e.base_grand_total||0,subtotal:e.subtotal||0,baseSubtotal:e.base_subtotal||0,discountAmount:e.discount_amount||0,baseDiscountAmount:e.base_discount_amount||0,subtotalWithDiscount:e.subtotal_with_discount||0,baseSubtotalWithDiscount:e.base_subtotal_with_discount||0,shippingAmount:e.shipping_amount||0,baseShippingAmount:e.base_shipping_amount||0,shippingDiscountAmount:e.shipping_discount_amount||0,baseShippingDiscountAmount:e.base_shipping_discount_amount||0,taxAmount:e.tax_amount||0,baseTaxAmount:e.base_tax_amount||0,weeeTaxAppliedAmount:e.weee_tax_applied_amount||0,shippingTaxAmount:e.shipping_tax_amount||0,baseShippingTaxAmount:e.base_shipping_tax_amount||0,subtotalInclTax:e.subtotal_incl_tax||0,shippingInclTax:e.shipping_incl_tax||0,baseShippingInclTax:e.base_shipping_incl_tax||0,baseCurrencyCode:e.base_currency_code||"",quoteCurrencyCode:e.quote_currency_code||"",itemsQty:e.items_qty||0,coupon:{couponCode:e.coupon_code||"",couponDescription:(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.coupon_description_text)||""},items:(null===(i=null===(t=e.items)||void 0===t?void 0:t.map)||void 0===i?void 0:i.call(t,(function(e){return{itemId:e.item_id||0,price:e.price||0,basePrice:e.base_price||0,qty:e.qty||0,rowTotal:e.row_total||0,baseRowTotal:e.base_row_total||0,rowTotalWithDiscount:e.row_total_with_discount||0,taxAmount:e.tax_amount||0,baseTaxAmount:e.base_tax_amount||0,taxPercent:e.tax_percent||0,discountAmount:e.discount_amount||0,baseDiscountAmount:e.base_discount_amount||0,discountPercent:e.discount_percent||0,priceInclTax:e.price_incl_tax||0,basePriceInclTax:e.base_price_incl_tax||0,rowTotalInclTax:e.row_total_incl_tax||0,baseRowTotalInclTax:e.base_row_total_incl_tax||0,options:e.options||"",weeeTaxAppliedAmount:e.weee_tax_applied_amount||0,weeeTaxApplied:e.weee_tax_applied||0,name:e.name||""}})))||[],totalSegments:e.total_segments||[]}:null},formatPaymentMethod:function(e){return e?null==e?void 0:e.map((function(e){return{code:(null==e?void 0:e.payment_code)||"",title:(null==e?void 0:e.payment_title)||"",thumbnail:(null==e?void 0:e.payment_thumbnail)||""}})):null},formatPaymentInformation:function(e){var o;return e?{paymentMethods:A.formatPaymentMethod(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.payment_detail_info)||[],totals:A.formatCartTotal(e.totals)}:null},formatOrderConfirmation:function(e){return e?{isSuccess:e.is_success||!1,orderInfo:A.formatOrder(e.order_info)}:null},formatCoupons:function(e){var o;return(null===(o=null==e?void 0:e.items)||void 0===o?void 0:o.length)?e.items.map((function(e){return{code:(null==e?void 0:e.code)||"",name:(null==e?void 0:e.name)||"",thumbnail:(null==e?void 0:e.thumbnail)||"",description:(null==e?void 0:e.expired_date)||""}})):null},formatShippings:function(e){return e?e.map((function(e){var o;return{carrierCode:e.carrier_code||"",methodCode:e.method_code||"",title:e.carrier_title||"",description:e.method_title||"",price:(null==e?void 0:e.base_amount)||0,thumbnail:(null===(o=null==e?void 0:e.extension_attributes)||void 0===o?void 0:o.thumbnail)||""}})):[]}},f=Object.freeze({__proto__:null,dataFormatter:A});!function(e){e.MALE="gender.male",e.FEMALE="gender.female",e.OTHER="gender.other"}(O||(O={}));var b=Object.freeze({__proto__:null,get GenderLabel(){return O},DATE_FORMAT_API:"yyyy-MM-dd",DATE_FORMAT:"dd-MM-yyyy"});exports.apiTypes=l,exports.constants=T,exports.dataTypes=n,exports.index=f,exports.types=b;
|
package/build/types-b129e43d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-f7929e76.js"),t=require("react"),n=require("./constants-ea7b35a2.js"),a=require("./constants-d4ec4195.js"),i=require("./cookieHelper-612b90fa.js"),o=require("./useTranslations-f5815b25.js"),r=require("lodash/debounce"),l=require("./index.styled-31c53cd9.js"),s=require("./index-a9dac361.js");require("react-range"),require("react-dom"),require("./translationsContext-d7c8e0a0.js"),require("date-fns");var c=require("styled-components"),u=require("./theme-da70da1e.js"),d=require("react-loading-skeleton"),p=require("react-id-generator"),h=require("lodash/shuffle"),f=require("./useOutsideClick-528bfd6c.js");function g(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var m=g(t),C=g(r),v=g(c),x=g(d),y=g(h);var b,_,w,E,k,L,S,T,O,I,M,R,A=v.default.div(b||(b=e.__makeTemplateObject([""],[""]))),N=v.default.div(_||(_=e.__makeTemplateObject(["\n --searchbar-z-index: 305;\n &[data-is-modal='true'] {\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n height: var(--mobile-care-searchbar-height, 100%);\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n background-color: white;\n z-index: var(--searchbar-z-index);\n }\n"],["\n --searchbar-z-index: 305;\n &[data-is-modal='true'] {\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n height: var(--mobile-care-searchbar-height, 100%);\n overflow-y: auto;\n -webkit-overflow-scrolling: touch;\n background-color: white;\n z-index: var(--searchbar-z-index);\n }\n"]))),P=v.default.section(w||(w=e.__makeTemplateObject([""],[""]))),F=v.default.input(E||(E=e.__makeTemplateObject(["\n position: fixed;\n left: -100%;\n top: -100%;\n"],["\n position: fixed;\n left: -100%;\n top: -100%;\n"]))),z=v.default(s.Input)(k||(k=e.__makeTemplateObject(["\n #booking-search-bar & {\n input {\n font-size: 16px;\n }\n }\n"],["\n #booking-search-bar & {\n input {\n font-size: 16px;\n }\n }\n"]))),j=c.createGlobalStyle(L||(L=e.__makeTemplateObject(["\n .care-popup-open {\n overflow: hidden;\n position: fixed;\n &::before {\n content: '';\n inset: 0;\n position: absolute;\n background-color: white;\n min-height: 100vh;\n min-width: 100vw;\n z-index: 2;\n }\n }\n"],["\n .care-popup-open {\n overflow: hidden;\n position: fixed;\n &::before {\n content: '';\n inset: 0;\n position: absolute;\n background-color: white;\n min-height: 100vh;\n min-width: 100vw;\n z-index: 2;\n }\n }\n"]))),D=function(e){var t=e.className,n=e.color;return m.default.createElement("svg",{className:t,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("path",{d:"M18 6L6 18",stroke:n||"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),m.default.createElement("path",{d:"M6 6L18 18",stroke:n||"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))},H=function(e){var t=e.className,n=e.color;return m.default.createElement("svg",{width:"14",height:"20",viewBox:"0 0 14 20",className:t},m.default.createElement("path",{d:"M7 0C3.134 0 0 3.134 0 7C0 10.966 4.404 16.82 6.226 19.071C6.626 19.565 7.374 19.565 7.774 19.071C9.596 16.82 14 10.966 14 7C14 3.134 10.866 0 7 0ZM7 9.5C5.619 9.5 4.5 8.381 4.5 7C4.5 5.619 5.619 4.5 7 4.5C8.381 4.5 9.5 5.619 9.5 7C9.5 8.381 8.381 9.5 7 9.5Z",fill:n||"currentColor"}))},V=function(e){var t=e.className,n=e.color;return m.default.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",className:t},m.default.createElement("path",{d:"M9.99967 6.66658C8.15801 6.66658 6.66634 8.15825 6.66634 9.99992C6.66634 11.8416 8.15801 13.3333 9.99967 13.3333C11.8413 13.3333 13.333 11.8416 13.333 9.99992C13.333 8.15825 11.8413 6.66658 9.99967 6.66658ZM17.4497 9.16658C17.0663 5.69158 14.308 2.93325 10.833 2.54992V1.66659C10.833 1.20825 10.458 0.833252 9.99967 0.833252C9.54134 0.833252 9.16634 1.20825 9.16634 1.66659V2.54992C5.69134 2.93325 2.93301 5.69158 2.54967 9.16658H1.66634C1.20801 9.16658 0.833008 9.54158 0.833008 9.99992C0.833008 10.4583 1.20801 10.8333 1.66634 10.8333H2.54967C2.93301 14.3083 5.69134 17.0666 9.16634 17.4499V18.3333C9.16634 18.7916 9.54134 19.1666 9.99967 19.1666C10.458 19.1666 10.833 18.7916 10.833 18.3333V17.4499C14.308 17.0666 17.0663 14.3083 17.4497 10.8333H18.333C18.7913 10.8333 19.1663 10.4583 19.1663 9.99992C19.1663 9.54158 18.7913 9.16658 18.333 9.16658H17.4497ZM9.99967 15.8333C6.77467 15.8333 4.16634 13.2249 4.16634 9.99992C4.16634 6.77492 6.77467 4.16658 9.99967 4.16658C13.2247 4.16658 15.833 6.77492 15.833 9.99992C15.833 13.2249 13.2247 15.8333 9.99967 15.8333Z",fill:n||"currentColor"}))},B=function(e){var t=e.className,n=e.color;return m.default.createElement("svg",{className:t,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("path",{d:"M11 18C14.866 18 18 14.866 18 11C18 7.13401 14.866 4 11 4C7.13401 4 4 7.13401 4 11C4 14.866 7.13401 18 11 18Z",stroke:n||"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),m.default.createElement("path",{d:"M20 20L16 16",stroke:n||"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}))},K=function(e){var t=e.width,n=e.height;return m.default.createElement("svg",{width:t||30,height:n||30,viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("circle",{cx:"15",cy:"15",r:"15",fill:"#F7F9FC"}))},Z=v.default.li(S||(S=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 16px;\n\n > :first-child {\n flex: 1;\n }\n\n > :nth-child(2) {\n flex: 6;\n }\n\n & + li::before {\n content: '';\n position: absolute;\n left: 18px;\n right: 18px;\n top: 0;\n height: 1px;\n background-color: ",";\n }\n"],["\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 8px 16px;\n\n > :first-child {\n flex: 1;\n }\n\n > :nth-child(2) {\n flex: 6;\n }\n\n & + li::before {\n content: '';\n position: absolute;\n left: 18px;\n right: 18px;\n top: 0;\n height: 1px;\n background-color: ",";\n }\n"])),u.theme.colors.neutral100),G=v.default.div(T||(T=e.__makeTemplateObject(["\n display: flex;\n position: absolute;\n top: 48px;\n min-width: 100%;\n box-shadow: 0px 24px 32px rgba(0, 0, 0, 0.04),\n 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04),\n 0px 0px 1px rgba(0, 0, 0, 0.04);\n border-radius: 6px;\n background-color: white;\n z-index: 30;\n\n "," {\n position: relative;\n top: 0;\n box-shadow: initial;\n }\n"],["\n display: flex;\n position: absolute;\n top: 48px;\n min-width: 100%;\n box-shadow: 0px 24px 32px rgba(0, 0, 0, 0.04),\n 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04),\n 0px 0px 1px rgba(0, 0, 0, 0.04);\n border-radius: 6px;\n background-color: white;\n z-index: 30;\n\n "," {\n position: relative;\n top: 0;\n box-shadow: initial;\n }\n"])),o.MediaQueries.mbDown),U=v.default.ul(O||(O=e.__makeTemplateObject(["\n width: 100%;\n max-height: 600px;\n overflow-y: auto;\n"],["\n width: 100%;\n max-height: 600px;\n overflow-y: auto;\n"]))),q=v.default(H)(I||(I=e.__makeTemplateObject(["\n width: 12px;\n height: 18px;\n"],["\n width: 12px;\n height: 18px;\n"]))),Q=v.default.li(M||(M=e.__makeTemplateObject(["\n position: relative;\n cursor: pointer;\n padding: 12px 18px;\n display: flex;\n align-items: center;\n gap: 14px;\n overflow: hidden;\n\n ","\n\n & + li::before {\n content: '';\n position: absolute;\n left: 18px;\n right: 18px;\n top: 0;\n height: 1px;\n background-color: ",";\n }\n\n &:not([data-is-denied='true']):hover {\n background-color: ",";\n }\n\n &:last-child:hover {\n border-bottom-right-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n &:first-child:hover {\n border-top-right-radius: 6px;\n border-top-left-radius: 6px;\n }\n\n &[data-is-denied='true'] {\n cursor: not-allowed;\n }\n"],["\n position: relative;\n cursor: pointer;\n padding: 12px 18px;\n display: flex;\n align-items: center;\n gap: 14px;\n overflow: hidden;\n\n ","\n\n & + li::before {\n content: '';\n position: absolute;\n left: 18px;\n right: 18px;\n top: 0;\n height: 1px;\n background-color: ",";\n }\n\n &:not([data-is-denied='true']):hover {\n background-color: ",";\n }\n\n &:last-child:hover {\n border-bottom-right-radius: 6px;\n border-bottom-left-radius: 6px;\n }\n\n &:first-child:hover {\n border-top-right-radius: 6px;\n border-top-left-radius: 6px;\n }\n\n &[data-is-denied='true'] {\n cursor: not-allowed;\n }\n"])),(function(e){return e.isSelected&&"\n &::after {\n content: ".concat("url(\"data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.9803 0.990669C16.7205 0.99841 16.4739 1.10699 16.2928 1.2934L5.99984 11.5864L2.70687 8.2934C2.61473 8.19743 2.50436 8.12081 2.38223 8.06802C2.2601 8.01524 2.12867 7.98735 1.99563 7.986C1.86259 7.98464 1.73061 8.00985 1.60743 8.06014C1.48426 8.11043 1.37235 8.18479 1.27827 8.27887C1.1842 8.37295 1.10983 8.48485 1.05954 8.60803C1.00926 8.73121 0.98405 8.86318 0.985403 8.99622C0.986757 9.12926 1.01464 9.26069 1.06743 9.38282C1.12021 9.50495 1.19684 9.61532 1.29281 9.70747L5.29281 13.7075C5.48035 13.8949 5.73467 14.0002 5.99984 14.0002C6.26501 14.0002 6.51933 13.8949 6.70687 13.7075L17.7069 2.70747C17.8514 2.567 17.9501 2.38616 17.99 2.18864C18.03 1.99112 18.0093 1.78614 17.9308 1.60055C17.8523 1.41497 17.7195 1.25744 17.5499 1.14861C17.3803 1.03978 17.1817 0.984729 16.9803 0.990669Z' fill='%232685F1'/%3E%3C/svg%3E%0A\")",";\n top: 50%;\n right: 18px;\n position: absolute;\n transform: translateY(-50%);\n }\n ")}),u.theme.colors.neutral100,u.theme.colors.neutral50),W=v.default((function(t){var n=t.count,a=t.className,i=p.useId(n);return m.default.createElement(m.default.Fragment,null,e.__spreadArray([],Array(n),!0).map((function(e,t){return m.default.createElement(Z,{className:a,key:i[t]},m.default.createElement(x.default,{count:1,height:32}),m.default.createElement(x.default,{count:1,height:24}))})))}))(R||(R=e.__makeTemplateObject(["\n &:first-child {\n padding-top: 18px;\n }\n"],["\n &:first-child {\n padding-top: 18px;\n }\n"]))),Y=function(e){var t=e.cities,n=e.isLoading,a=e.onLocationClick,i=e.onCurrentLocationClick,r=e.geoLocationPermission,s=void 0===r?"unset":r,c=e.isLocationLoading,d=e.selectedLocation,p=o.useTranslations().t,h="denied"===s,f=function(){return m.default.createElement(Q,{role:"button",tabIndex:0,onClick:function(e){h||(e.nativeEvent.stopImmediatePropagation(),c||i())},"data-is-denied":h},h?m.default.createElement(l.Text,{color:"var(--gray600)",size:"md"},"x"):c?m.default.createElement(x.default,{height:20,width:20}):m.default.createElement(V,{color:u.theme.colors.primaryBase}),m.default.createElement("div",null,h?m.default.createElement(l.Text,{color:"var(--gray600)",size:"sm",style:{lineHeight:1.5}},p("booking.searchBar.grantLocation")):c?m.default.createElement(x.default,{height:20,style:{width:"calc(100% - 16px)"}}):m.default.createElement(l.Text,{size:"md"},p("booking.searchBar.useCurrentLocation"))))};return m.default.createElement(G,{"data-testid":"location-search-results"},m.default.createElement(U,null,n?m.default.createElement(W,{count:5}):!t||t.length<1?m.default.createElement(m.default.Fragment,null,f(),m.default.createElement(Q,{"data-is-denied":"true"},m.default.createElement(l.Text,{size:"sm",color:"#ccc"},p("booking.searchBar.noResults")))):m.default.createElement(m.default.Fragment,null,f(),t.map((function(e){return m.default.createElement(Q,{key:e.id,onClick:function(t){t.nativeEvent.stopImmediatePropagation(),a&&a(e)},role:"button",tabIndex:0,"aria-label":"Select ".concat(e.name," as location"),isSelected:(null==d?void 0:d.id)===e.id},m.default.createElement(q,{color:u.theme.colors.neutral400}),m.default.createElement(l.Text,{size:"md"},e.name))})))))},J="TYPE_CHARACTER",X="REMOVE_CHARACTER",$="REMOVE_ALL",ee="REMOVE_LAST_VISIBLE_NODE",te="PAUSE_FOR",ne="CHANGE_DELETE_SPEED",ae="CHANGE_DELAY",ie="PASTE_STRING",oe=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},re="TEXT_NODE",le=function(){function t(t){var n=this;this.state={lastFrameTime:null,pauseUntil:null,eventQueue:[],eventLoop:null,eventLoopPaused:!1,reverseCalledEvents:[],calledEvents:[],visibleNodes:[],initialOptions:null},this.options={strings:null,delay:"natural",pauseFor:1500,deleteSpeed:"natural",loop:!1,autoStart:!1,stringSplitter:null,onCreateTextNode:null,onRemoveNode:null},this.start=function(){return n.state.eventLoopPaused=!1,n.runEventLoop(),n},this.pause=function(){return n.state.eventLoopPaused=!0,n},this.stop=function(){return n.state.eventLoop&&(window.cancelAnimationFrame(n.state.eventLoop),n.state.eventLoop=null),n},this.pauseFor=function(e){return n.addEventToQueue(te,{ms:e}),n},this.typeOutAllStrings=function(){return"string"==typeof n.options.strings?(n.typeString(n.options.strings).pauseFor(n.options.pauseFor),n):(n.options.strings.forEach((function(e){n.typeString(e).pauseFor(n.options.pauseFor).deleteAll(n.options.deleteSpeed)})),n)},this.typeString=function(e,t){if(void 0===t&&(t=null),e){var a=(n.options||{}).stringSplitter,i="function"==typeof a?a(e):e.split("");n.typeCharacters(i,t)}return n},this.pasteString=function(e,t){return void 0===t&&(t=null),e&&n.addEventToQueue(ie,{character:e,node:t}),n},this.deleteAll=function(e){return void 0===e&&(e="natural"),n.addEventToQueue($,{speed:e}),n},this.changeDeleteSpeed=function(e){if(!e)throw new Error("Must provide new delete speed");return n.addEventToQueue(ne,{speed:e}),n},this.changeDelay=function(e){if(!e)throw new Error("Must provide new delay");return n.addEventToQueue(ae,{delay:e}),n},this.deleteChars=function(e){if(!e)throw new Error("Must provide amount of characters to delete");for(var t=0;t<e;t++)n.addEventToQueue(X);return n},this.typeCharacters=function(e,t){if(void 0===t&&(t=null),!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach((function(e){n.addEventToQueue(J,{character:e,node:t})})),n},this.removeCharacters=function(e){if(!e||!Array.isArray(e))throw new Error("Characters must be an array");return e.forEach((function(){n.addEventToQueue(X)})),n},this.addEventToQueue=function(e,t,a){return void 0===a&&(a=!1),n.addEventToStateProperty(e,t,a,"eventQueue")},this.addReverseCalledEvent=function(e,t,a){return void 0===a&&(a=!1),n.options.loop?n.addEventToStateProperty(e,t,a,"reverseCalledEvents"):n},this.addEventToStateProperty=function(t,a,i,o){void 0===i&&(i=!1);var r={eventName:t,eventArgs:a||{}};return n.state[o]=i?e.__spreadArray([r],n.state[o],!0):e.__spreadArray(e.__spreadArray([],n.state[o],!0),[r],!1),n},this.runEventLoop=function(){n.state.lastFrameTime||(n.state.lastFrameTime=Date.now());var t=Date.now(),a=t-n.state.lastFrameTime;if(!n.state.eventQueue.length){if(!n.options.loop)return;n.state.eventQueue=e.__spreadArray([],n.state.calledEvents,!0),n.state.calledEvents=[],n.options=e.__assign({},n.state.initialOptions)}if(n.state.eventLoop=window.requestAnimationFrame(n.runEventLoop),!n.state.eventLoopPaused){if(n.state.pauseUntil){if(t<n.state.pauseUntil)return;n.state.pauseUntil=null}var i=e.__spreadArray([],n.state.eventQueue,!0),o=i.shift();if(!(a<=(o.eventName===ee||o.eventName===X?"natural"===n.options.deleteSpeed?oe(40,80):n.options.deleteSpeed:"natural"===n.options.delay?oe(120,160):n.options.delay))){var r=o.eventName,l=o.eventArgs;switch(r){case ie:case J:var s=l.character,c=document.createTextNode(s),u=c;n.options.onCreateTextNode&&"function"==typeof n.options.onCreateTextNode&&(u=n.options.onCreateTextNode(s,c)),n.state.visibleNodes=e.__spreadArray(e.__spreadArray([],n.state.visibleNodes,!0),[{type:re,character:s,node:u}],!1);break;case X:i.unshift({eventName:ee,eventArgs:{removingCharacterNode:!0}});break;case te:var d=o.eventArgs.ms;n.state.pauseUntil=Date.now()+parseInt(d);break;case $:var p=n.state.visibleNodes,h=l.speed,f=[];h&&f.push({eventName:ne,eventArgs:{speed:h,temp:!0}});for(var g=0,m=p.length;g<m;g++)f.push({eventName:ee,eventArgs:{removingCharacterNode:!1}});h&&f.push({eventName:ne,eventArgs:{speed:n.options.deleteSpeed,temp:!0}}),i.unshift.apply(i,f);break;case ee:if(n.state.visibleNodes.length){var C=n.state.visibleNodes.pop(),v=C.node;s=C.character;n.options.onRemoveNode&&"function"==typeof n.options.onRemoveNode&&n.options.onRemoveNode({node:v,character:s}),v&&v.parentNode.removeChild(v)}break;case ne:n.options.deleteSpeed=o.eventArgs.speed;break;case ae:n.options.delay=o.eventArgs.delay}n.options.loop&&(o.eventName===ee||o.eventArgs&&o.eventArgs.temp||(n.state.calledEvents=e.__spreadArray(e.__spreadArray([],n.state.calledEvents,!0),[o],!1))),n.state.eventQueue=i,n.state.lastFrameTime=t}}},t&&(this.options=e.__assign(e.__assign({},this.options),t)),this.state.initialOptions=e.__assign({},this.options),this.init()}return t.prototype.init=function(){this.addEventToQueue($,null,!0),!0===this.options.autoStart&&this.options.strings&&this.typeOutAllStrings().start()},t}();function se(e){var n=e.inputRef,a=e.wrapperRef,i=e.disabled,r=o.useTranslations(),l=r.t,s=r.locale,c=t.useMemo((function(){if(i)return[];var e=["booking.searchBar.placeholder.hospital","booking.searchBar.placeholder.doctor"];return"zh-TW"!==s&&e.push("booking.searchBar.placeholder.specialty","booking.searchBar.placeholder.service"),y.default(e).map((function(e){return l(e)}))}),[l,s]);function u(e){var t=p();return t&&(t.placeholder=t.placeholder+e),null}function d(){var e=p();e&&(e.placeholder=e.placeholder.slice(0,-1))}function p(){return n&&n.current?n.current:a&&a.current&&a.current.querySelector("input")||null}t.useEffect((function(){if(!i){var e=p();e&&(e.placeholder="",new le({strings:c,autoStart:!0,loop:!0,delay:32,deleteSpeed:32,pauseFor:1500,onCreateTextNode:u,onRemoveNode:d}))}}),[n,a])}var ce,ue=v.default.div(ce||(ce=e.__makeTemplateObject(["\n user-select: none;\n input {\n pointer-events: none;\n background-color: white;\n }\n"],["\n user-select: none;\n input {\n pointer-events: none;\n background-color: white;\n }\n"])));function de(n){var a=n.focused,i=n.value,r=void 0===i?"":i,l=n.onClick,s=n.trackingAttributes,c=n.inputSearchPlaceholder,d=o.useTranslations().t,p=t.useRef(null);se({wrapperRef:p,disabled:!!c});var h=t.useMemo((function(){return s?{"data-event-category":s.dataEventCategory,"data-event-action":s.dataEventAction,"data-event-label":s.dataEventLabel}:{}}),[s]);return m.default.createElement(ue,e.__assign({onClick:function(){return l&&l()},ref:p},h),m.default.createElement(z,{inputClassName:"location"===a?"focused":void 0,name:"booking-search-placeholder",displayIcon:m.default.createElement(B,{color:u.theme.colors.gray400}),placeholder:d("booking.searchBar.searchInput.placeholder"),value:r,size:"md"}))}var pe,he,fe,ge,me,Ce,ve=v.default.header(pe||(pe=e.__makeTemplateObject(["\n display: flex;\n height: 64px;\n align-items: center;\n justify-content: space-between;\n margin: 0 auto;\n position: sticky;\n z-index: 99;\n background-color: white;\n top: 0;\n left: 0;\n"],["\n display: flex;\n height: 64px;\n align-items: center;\n justify-content: space-between;\n margin: 0 auto;\n position: sticky;\n z-index: 99;\n background-color: white;\n top: 0;\n left: 0;\n"]))),xe=v.default.div(he||(he=e.__makeTemplateObject(["\n display: inline-flex;\n flex: 1;\n justify-content: flex-end;\n cursor: pointer;\n text-decoration: underline;\n"],["\n display: inline-flex;\n flex: 1;\n justify-content: flex-end;\n cursor: pointer;\n text-decoration: underline;\n"]))),ye=v.default.div(fe||(fe=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-left: 16px;\n cursor: pointer;\n"],["\n display: flex;\n align-items: center;\n margin-left: 16px;\n cursor: pointer;\n"]))),be=v.default.div(ge||(ge=e.__makeTemplateObject(["\n width: 100%;\n margin-left: 24px;\n"],["\n width: 100%;\n margin-left: 24px;\n"]))),_e=v.default(l.Text)(me||(me=e.__makeTemplateObject(["\n color: ",";\n text-align: start;\n"],["\n color: ",";\n text-align: start;\n"])),u.theme.colors.secondaryDark),we=function(e){var t=e.className,n=e.onLeftClick,a=e.headingText,i=e.onRightClick,o=e.iconLeft,r=e.textRight;return m.default.createElement(ve,{className:t},m.default.createElement(ye,{onClick:n},o||m.default.createElement(D,{color:u.theme.colors.gray800})),m.default.createElement(be,null,m.default.createElement(_e,{size:"md",type:"bold"},a)),m.default.createElement(xe,{onClick:i},r&&m.default.createElement("p",null,r)))},Ee={"en-PH":3,"tl-PH":2,"id-ID":3,"vi-VN":2,"zh-TW":0},ke={isMobile:!1,isDebug:!1,navigateTo:null,geoLocationPermission:"unset",geoLocationCoordinates:null,focused:"none",searchLocationKeywords:"",searchKeywords:"",selectedLocation:null,defaultCity:null,initialCities:[],cities:[],searchResults:[],initialSearchResults:[],isLoadingCities:!1,isLoadingSearchResults:!1,isMobileModalOpened:!1,initialSelectedCity:null,autoCompleteDisabled:!1,inputSearchPlaceholder:"",locale:"vi-VN"};function Le(t){var n=t.selectedLocation,a=t.searchLocationKeywords;return n&&a!==n.name?e.__assign(e.__assign({},t),{searchLocationKeywords:n.name}):t}function Se(t,a){var i;switch(t.isDebug&&console.log("bookingSearchBar",{action:a,state:t}),a.type){case Ce.NavigateTo:return e.__assign(e.__assign({},t),{navigateTo:a.payload,focused:"none",isMobileModalOpened:!1});case Ce.ClickOutsideInputLocation:return t.isMobile||"location"!==t.focused?t:Le(e.__assign(e.__assign({},t),{focused:"none"}));case Ce.ClickOutsideInputSearch:return t.isMobile||"search"!==t.focused?t:e.__assign(e.__assign({},t),{focused:"none"});case Ce.FocusInputLocation:var o=e.__assign(e.__assign({},t),{focused:"location"});return(null===(i=t.selectedLocation)||void 0===i?void 0:i.id)===n.ID_OPTION_CURRENT_LOCATION&&(o.searchLocationKeywords=""),o;case Ce.FocusInputSearch:var r=e.__assign(e.__assign({},t),{focused:"search"});return t.isMobile?Le(r):r;case Ce.ChangeInputLocation:return e.__assign(e.__assign({},t),{searchLocationKeywords:a.payload});case Ce.ChangeInputSearch:var l=a.payload;return e.__assign(e.__assign({},t),{searchKeywords:l,isLoadingSearchResults:l.trim().length>Ee[t.locale]});case Ce.SelectCurrentLocation:return e.__assign(e.__assign({},t),{focused:"none",selectedLocation:a.payload,searchLocationKeywords:a.payload.name});case Ce.ClearInputLocation:return e.__assign(e.__assign({},t),{focused:"location",cities:t.initialCities,searchLocationKeywords:""});case Ce.ClearInputSearch:return e.__assign(e.__assign({},t),{focused:"search",searchKeywords:""});case Ce.SelectLocation:return e.__assign(e.__assign({},t),{focused:"none",selectedLocation:a.payload,searchLocationKeywords:a.payload.name});case Ce.SelectSearchResult:return e.__assign(e.__assign({},t),{searchKeywords:a.payload.name,isMobileModalOpened:!1,focused:"none",navigateTo:a.payload.url});case Ce.FetchCitiesStart:return e.__assign(e.__assign({},t),{isLoadingCities:!0});case Ce.FetchCitiesFinish:return e.__assign(e.__assign({},t),{isLoadingCities:!1});case Ce.FetchSearchResultsStart:return e.__assign(e.__assign({},t),{isLoadingSearchResults:!0});case Ce.FetchSearchResultsFinish:return e.__assign(e.__assign({},t),{isLoadingSearchResults:!1});case Ce.FetchSearchResultsComplete:var s=e.__assign(e.__assign({},t),{searchResults:a.payload});return 0===t.initialSearchResults.length&&(s.initialSearchResults=a.payload),s;case Ce.FetchCitiesByGeoIpComplete:var c=a.payload.cities,u=a.payload.default;(c=c.filter((function(e){return e.id!==u.id}))).unshift(u),t.initialSelectedCity&&!c.find((function(e){return e.id===t.initialSelectedCity.id}))&&c.unshift(t.initialSelectedCity);var d=e.__assign(e.__assign({},t),{defaultCity:u,initialCities:c,cities:c});return"denied"!==t.geoLocationPermission||t.initialSelectedCity||(d.selectedLocation=u,d.searchLocationKeywords=u.name),d;case Ce.FetchCitiesByKeywordComplete:return e.__assign(e.__assign({},t),{cities:a.payload});case Ce.DisplayInitialCities:return e.__assign(e.__assign({},t),{cities:t.initialCities});case Ce.DisplayInitialSearchResults:return e.__assign(e.__assign({},t),{searchResults:t.initialSearchResults,isLoadingSearchResults:!1});case Ce.GrantGeoLocationPermission:return e.__assign(e.__assign({},t),{geoLocationPermission:"granted",geoLocationCoordinates:a.payload});case Ce.DenyGeoLocationPermission:return e.__assign(e.__assign({},t),{geoLocationPermission:"denied",geoLocationCoordinates:null});case Ce.OpenMobileModal:return e.__assign(e.__assign({},t),{isMobileModalOpened:!0});case Ce.CloseMobileModal:return e.__assign(e.__assign({},t),{isMobileModalOpened:!1});case Ce.UpdateInitialSearchValue:return e.__assign(e.__assign({},t),{searchKeywords:a.payload});case Ce.SetInputSearchPlaceholder:return e.__assign(e.__assign({},t),{inputSearchPlaceholder:a.payload});default:return t}}!function(e){e.NavigateTo="navigate to url",e.ClickOutsideInputLocation="click outside input location",e.ClickOutsideInputSearch="click outside input search",e.SelectCurrentLocation="select current location",e.FocusInputLocation="focus input location",e.FocusInputSearch="focus input search",e.ChangeInputLocation="change input location",e.ChangeInputSearch="change input search",e.ClearInputLocation="clear input location",e.ClearInputSearch="clear input search",e.SelectLocation="select location",e.FetchCitiesStart="fetch cities start",e.FetchCitiesFinish="fetch cities finish",e.FetchSearchResultsStart="fetch search results start",e.FetchSearchResultsComplete="fetch search results complete",e.FetchSearchResultsFinish="fetch search results finish",e.FetchCitiesByGeoIpComplete="fetch cities by geo IP finish",e.FetchCitiesByKeywordComplete="fetch cities by keyword finish",e.DisplayInitialCities="display initial cities",e.DisplayInitialSearchResults="display initial search results",e.GrantGeoLocationPermission="grant geolocation permission",e.DenyGeoLocationPermission="deny geolocation permission",e.OpenMobileModal="open mobile modal",e.CloseMobileModal="close mobile modal",e.UpdateInitialSearchValue="update initial search value",e.SelectSearchResult="select search result",e.SetInputSearchPlaceholder="set input search placeholder"}(Ce||(Ce={}));var Te,Oe,Ie,Me,Re,Ae,Ne,Pe=function(){return m.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18"},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.97887 8.15493C2.97887 5.29627 5.29627 2.97887 8.15493 2.97887C11.0136 2.97887 13.331 5.29627 13.331 8.15493C13.331 11.0136 11.0136 13.331 8.15493 13.331C5.29627 13.331 2.97887 11.0136 2.97887 8.15493ZM8.15493 1.5C4.47951 1.5 1.5 4.47951 1.5 8.15493C1.5 11.8303 4.47951 14.8099 8.15493 14.8099C9.72624 14.8099 11.1704 14.2653 12.3089 13.3546L15.2377 16.2834C15.5265 16.5722 15.9947 16.5722 16.2834 16.2834C16.5722 15.9947 16.5722 15.5265 16.2834 15.2377L13.3546 12.3089C14.2653 11.1704 14.8099 9.72624 14.8099 8.15493C14.8099 4.47951 11.8303 1.5 8.15493 1.5Z",fill:"white"}))},Fe=v.default.button(Te||(Te=e.__makeTemplateObject(["\n min-height: 100%;\n border-radius: 6px;\n background-color: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 11px;\n cursor: pointer;\n flex: 0.3;\n\n "," {\n --margin: 16px;\n min-height: 32px;\n margin: var(--margin);\n width: calc(100% - var(--margin) * 2);\n position: absolute;\n bottom: 0;\n }\n\n &:hover {\n background-color: ",";\n }\n\n &:active {\n background-color: ",";\n }\n\n &:focus-visible {\n outline: 1px solid black;\n }\n"],["\n min-height: 100%;\n border-radius: 6px;\n background-color: ",";\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 11px;\n cursor: pointer;\n flex: 0.3;\n\n "," {\n --margin: 16px;\n min-height: 32px;\n margin: var(--margin);\n width: calc(100% - var(--margin) * 2);\n position: absolute;\n bottom: 0;\n }\n\n &:hover {\n background-color: ",";\n }\n\n &:active {\n background-color: ",";\n }\n\n &:focus-visible {\n outline: 1px solid black;\n }\n"])),(function(e){return e.theme.colors.primaryBase}),o.MediaQueries.mbDown,(function(e){return e.theme.colors.primaryHover}),(function(e){return e.theme.colors.primaryActive})),ze=v.default(l.Text)(Oe||(Oe=e.__makeTemplateObject(["\n font-weight: ",";\n"],["\n font-weight: ",";\n"])),(function(e){return e.theme.sizes.fwSemiBold})),je=function(e){var t=e.onClick,n=(0,o.useTranslations().t)("booking.searchBar.searchButton");return m.default.createElement(Fe,{onClick:t,title:n},m.default.createElement(Pe,null),m.default.createElement(ze,{size:"s3",color:"white"},n))},De=v.default.div(Ie||(Ie=e.__makeTemplateObject(["\n display: flex;\n gap: 16px;\n "," {\n flex-direction: column;\n padding: 14px;\n background-color: ",";\n\n input {\n filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.04))\n drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.06))\n drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04));\n }\n }\n\n input {\n background-color: white;\n }\n"],["\n display: flex;\n gap: 16px;\n "," {\n flex-direction: column;\n padding: 14px;\n background-color: ",";\n\n input {\n filter: drop-shadow(0px 4px 8px rgba(0, 0, 0, 0.04))\n drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.06))\n drop-shadow(0px 0px 1px rgba(0, 0, 0, 0.04));\n }\n }\n\n input {\n background-color: white;\n }\n"])),o.MediaQueries.mbDown,u.theme.colors.blue50),He=v.default.div(Me||(Me=e.__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"]))),Ve=v.default(He)(Re||(Re=e.__makeTemplateObject(["\n flex: 1;\n"],["\n flex: 1;\n"]))),Be=v.default(He)(Ae||(Ae=e.__makeTemplateObject(["\n flex: 2;\n"],["\n flex: 2;\n"]))),Ke=v.default((function(e){var t=e.className,n=e.color;return m.default.createElement("svg",{className:t,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("rect",{x:"4",y:"4",width:"16",height:"16",rx:"8",fill:"white"}),m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM8.29289 8.29289C8.68342 7.90237 9.31658 7.90237 9.70711 8.29289L12 10.5858L14.2929 8.29289C14.6834 7.90237 15.3166 7.90237 15.7071 8.29289C16.0976 8.68342 16.0976 9.31658 15.7071 9.70711L13.4142 12L15.7071 14.2929C16.0976 14.6834 16.0976 15.3166 15.7071 15.7071C15.3166 16.0976 14.6834 16.0976 14.2929 15.7071L12 13.4142L9.70711 15.7071C9.31658 16.0976 8.68342 16.0976 8.29289 15.7071C7.90237 15.3166 7.90237 14.6834 8.29289 14.2929L10.5858 12L8.29289 9.70711C7.90237 9.31658 7.90237 8.68342 8.29289 8.29289Z",fill:n||"currentColor"}))}))(Ne||(Ne=e.__makeTemplateObject(["\n display: none;\n &.shown {\n display: block;\n }\n"],["\n display: none;\n &.shown {\n display: block;\n }\n"])));function Ze(e){var a=e.isMobile,i=e.state,r=e.dispatch,l=e.debouncedFetchCitiesByKeyword,s=e.debouncedFetchSearchResults,c=e.focusLocationInput,d=e.focusSearchInput,p=e.renderLocationResults,h=e.renderSearchResults,g=e.trackingAttributes,C=e.onSearch,v=e.initalSearchValue,x=t.useRef(null),y=t.useRef(null),b=i.focused,_=i.searchLocationKeywords,w=i.geoLocationPermission,E=i.selectedLocation,k=i.searchKeywords,L=i.inputSearchPlaceholder,S=o.useTranslations().t;se({wrapperRef:y,disabled:!!L}),f.useOutsideClick(x,(function(){r({type:Ce.ClickOutsideInputLocation})})),f.useOutsideClick(y,(function(){r({type:Ce.ClickOutsideInputSearch})}));var T=t.useMemo((function(){return"granted"===w&&(null==E?void 0:E.id)===n.ID_OPTION_CURRENT_LOCATION?u.theme.colors.primaryBase:u.theme.colors.gray400}),[w,E]),O=t.useCallback((function(e){r({type:Ce.ChangeInputSearch,payload:e}),"function"!=typeof C&&(e.trim().length>Ee[i.locale]||v?s(e.trim(),i):(s.cancel(),r({type:Ce.DisplayInitialSearchResults})))}),[r,i]),I=t.useCallback((function(e){r({type:Ce.ChangeInputLocation,payload:e}),e.trim().length>Ee[i.locale]?l(e.trim()):(l.cancel(),r({type:Ce.DisplayInitialCities}))}),[l,r]);return m.default.createElement(De,null,m.default.createElement(Ve,{ref:x},m.default.createElement(z,{inputClassName:"location"===b?"focused":void 0,placeholder:S("booking.searchBar.locationPlaceholder"),autoComplete:"off",name:"search-location",displayIcon:m.default.createElement(H,{className:"location-pin-icon",color:T}),actionIcon:m.default.createElement(Ke,{color:u.theme.colors.gray300,className:""!==_?"shown":""}),onActionClick:function(){r({type:Ce.ClearInputLocation}),l.cancel(),c()},value:_,onChange:I,onFocus:function(){return r({type:Ce.FocusInputLocation})},size:"md"}),!a&&p()),m.default.createElement(Be,{ref:y},m.default.createElement(z,{placeholder:L||S("booking.searchBar.searchInput.placeholder"),autoComplete:"off",name:"search-results",actionIcon:m.default.createElement(Ke,{color:u.theme.colors.gray300,className:""!==k?"shown":""}),onActionClick:function(){r({type:Ce.ClearInputSearch}),s.cancel(),s("",i),d()},value:k,onChange:O,onFocus:function(){return r({type:Ce.FocusInputSearch})},inputClassName:"search"===b?"focused":void 0,size:"md",trackingAttributes:g,onKeyPress:function(e){i.autoCompleteDisabled&&"Enter"===e.key&&C&&C({cityId:i.selectedLocation.id,keyword:k})},enterKeyHint:i.autoCompleteDisabled?"search":void 0}),!a&&h()),i.autoCompleteDisabled&&!i.isMobile&&m.default.createElement(je,{onClick:function(){C({cityId:i.selectedLocation.id,keyword:k})}}))}var Ge,Ue,qe,Qe,We,Ye,Je,Xe,$e,et,tt,nt,at,it,ot=v.default.li(Ge||(Ge=e.__makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: var(--rowGap);\n cursor: pointer;\n"],["\n display: flex;\n align-items: center;\n gap: var(--rowGap);\n cursor: pointer;\n"]))),rt=v.default.div(Ue||(Ue=e.__makeTemplateObject(["\n --wrapper-size: var(--graphicSize);\n border-radius: calc(var(--wrapper-size) / 2);\n background-color: var(--neutral50);\n width: var(--wrapper-size);\n height: var(--wrapper-size);\n aspect-ratio: 1/1;\n overflow: hidden;\n\n ","\n\n img {\n width: var(--graphicSize);\n height: var(--graphicSize);\n ","\n }\n\n &:focus-visible {\n outline: 1px solid ",";\n }\n"],["\n --wrapper-size: var(--graphicSize);\n border-radius: calc(var(--wrapper-size) / 2);\n background-color: var(--neutral50);\n width: var(--wrapper-size);\n height: var(--wrapper-size);\n aspect-ratio: 1/1;\n overflow: hidden;\n\n ","\n\n img {\n width: var(--graphicSize);\n height: var(--graphicSize);\n ","\n }\n\n &:focus-visible {\n outline: 1px solid ",";\n }\n"])),(function(e){var t=e.type;return t&&"doctors"===t&&"\n border-radius: calc(var(--graphicSize) / 2);\n "}),(function(e){var t=e.type;return t&&"doctors"===t?"\n\n object-fit: cover; \n ":"\n object-fit: contain;\n "}),u.theme.colors.gray600),lt=v.default(l.Text)(qe||(qe=e.__makeTemplateObject(["\n line-height: 22px;\n letter-spacing: -0.2px;\n\n "," {\n &[data-size='p3'] {\n font-size: 14px;\n }\n }\n"],["\n line-height: 22px;\n letter-spacing: -0.2px;\n\n "," {\n &[data-size='p3'] {\n font-size: 14px;\n }\n }\n"])),o.MediaQueries.tdUp),st=v.default.figure(Qe||(Qe=e.__makeTemplateObject(["\n max-width: var(--graphicSize);\n min-width: var(--graphicSize);\n"],["\n max-width: var(--graphicSize);\n min-width: var(--graphicSize);\n"]))),ct=v.default.svg(We||(We=e.__makeTemplateObject(["\n margin: 0 auto;\n display: block;\n"],["\n margin: 0 auto;\n display: block;\n"]))),ut=v.default.div(Ye||(Ye=e.__makeTemplateObject(["\n display: grid;\n place-items: center;\n"],["\n display: grid;\n place-items: center;\n"]))),dt={doctors:function(e){var t=e.width,n=e.height;return m.default.createElement("svg",{width:t||32,height:n||32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("g",{clipPath:"url(#clip0_14712_400114)"},m.default.createElement("rect",{width:"32",height:"32",rx:"16",fill:"#E4E8EC"}),m.default.createElement("path",{d:"M22.065 9.58305C22.1108 9.80952 22.1431 10.0396 22.1614 10.2722C22.3769 13.0522 22.5858 16.1276 22.5727 17.618C22.5306 20.5688 19.708 21.1325 19.4564 21.1769L19.4495 21.5357L19.5228 23.9014C20.8688 23.9341 22.203 24.1759 23.4772 24.6196C24.5264 24.9739 25.4827 25.5591 26.2757 26.332C27.0688 27.105 27.6783 28.0461 28.0594 29.0858L31.9886 39.2068C31.91 39.3048 30.6939 39.6356 29.4888 39.944C30.1695 42.3315 30.4582 44.8142 30.3432 47.2953C30.2991 48.2666 30.1816 49.264 29.7245 50.1211C29.4508 50.6342 29.0319 51.0912 28.5296 51.3753C28.5099 51.4347 28.4864 51.4928 28.4593 51.5495C28.4293 51.6146 28.3908 51.6756 28.3448 51.7307C28.3293 51.7772 28.3232 51.8406 28.3162 51.9135C28.3004 52.0779 28.2799 52.2909 28.1362 52.4685C28.001 52.6373 27.8519 52.7945 27.6905 52.9386C27.6905 52.9386 27.092 52.9667 26.4133 52.9845L26.458 58.4088H5.7492L6.30965 52.9523L5.66093 53.1637C5.07664 53.3528 4.45628 53.4028 3.84925 53.3099C3.24222 53.2169 2.66526 52.9835 2.1643 52.6283C1.61489 52.2388 1.17445 51.715 0.884966 51.1068C0.595484 50.4987 0.46662 49.8266 0.510669 49.1545L0.644528 47.1369L1.41503 38.3366L1.81323 38.4135L-0.914307 37.8437L-0.402886 36.5663C-0.407359 36.5645 -0.411803 36.5627 -0.416214 36.5608C-0.410804 36.56 -0.40538 36.5594 -0.399946 36.5589L2.05995 30.4146C3.00034 28.0825 4.7421 26.1624 6.97187 24.9999C8.56171 24.176 10.3028 23.6861 12.0882 23.5597L11.788 16.5865C11.1882 16.6507 10.0095 16.5266 9.96087 14.954C9.91229 13.3824 11.0457 13.3171 11.6507 13.3961L11.6445 13.2523C11.5785 12.8433 11.5088 12.439 11.4577 12.2132C11.3782 11.8628 11.2611 11.4953 11.1419 11.1207C10.8794 10.2967 10.6061 9.43855 10.697 8.65293C10.697 8.65293 10.6909 8.00438 11.4565 7.24044C11.3707 6.86644 11.3686 6.47786 11.4507 6.10258C11.5366 5.70965 11.7125 5.34199 11.9645 5.02848C12.2165 4.71497 12.5377 4.46414 12.9029 4.29569C13.2682 4.12725 13.6675 4.04577 14.0696 4.05766C14.2277 4.06393 14.3849 4.08493 14.5418 4.10589C14.7932 4.13945 15.0439 4.17294 15.2971 4.14581C15.7708 4.09409 16.177 3.83884 16.5862 3.58167C16.8357 3.42492 17.0863 3.26745 17.354 3.15494C17.9119 2.93744 18.5266 2.91281 19.1002 3.08497C19.6738 3.25713 20.1733 3.61619 20.5192 4.105C20.5943 4.21716 20.6621 4.33678 20.7298 4.45631C20.9035 4.76299 21.077 5.06915 21.373 5.24769C21.5927 5.38236 21.8482 5.42658 22.1057 5.47114C22.2633 5.49842 22.4216 5.52582 22.5728 5.57417C23.0267 5.71015 23.3999 6.0411 23.6319 6.45436C23.6327 6.40753 23.6317 6.36062 23.629 6.31374C23.6502 6.3657 23.6623 6.42092 23.6649 6.47698C23.6661 6.49165 23.667 6.50632 23.6677 6.521C23.8246 6.82609 23.9058 7.17114 23.8885 7.51347C23.8544 7.93447 23.7053 8.33801 23.4574 8.68001C23.2096 9.02201 22.8725 9.28933 22.483 9.45278C22.3469 9.50712 22.2071 9.55061 22.065 9.58305Z",fill:"white"})),m.default.createElement("defs",null,m.default.createElement("clipPath",{id:"clip0_14712_400114"},m.default.createElement("rect",{width:"32",height:"32",rx:"16",fill:"white"}))))},services:function(e){var t=e.width,n=e.height;return m.default.createElement("svg",{width:t||30,height:n||30,viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m.default.createElement("circle",{cx:"15",cy:"15",r:"15",fill:"#F7F9FC"}),m.default.createElement("path",{d:"M14.9998 6.66663C12.2752 6.66663 9.85335 7.97848 8.33317 9.99996H10.5988C11.8 8.94527 13.3625 8.33329 14.9998 8.33329C16.6372 8.33329 18.1997 8.94527 19.4009 9.99996H21.6665C20.1463 7.97848 17.7244 6.66663 14.9998 6.66663ZM7.7863 10.8333C7.07666 13.0403 6.6665 15.5989 6.6665 18.3333C6.6665 20.0846 6.82601 21.7675 7.13525 23.3333H22.8644C23.1737 21.7675 23.3332 20.0846 23.3332 18.3333C23.3332 15.5989 22.923 13.0403 22.2134 10.8333H7.7863ZM14.9998 13.3333C17.3013 13.3333 19.1665 15.1985 19.1665 17.5C19.1665 19.8014 17.3013 21.6666 14.9998 21.6666C12.6984 21.6666 10.8332 19.8014 10.8332 17.5C10.8332 15.1985 12.6984 13.3333 14.9998 13.3333ZM14.1665 15V16.6666H12.4998V18.3333H14.1665V20H15.8332V18.3333H17.4998V16.6666H15.8332V15H14.1665Z",fill:"#BFC5CC"}))}},pt=function(e){var n=e.type,a=e.item,i=e.imageUrl,o=e.onClickItem,r=t.useMemo((function(){var e=dt[n]||K;return m.default.createElement(e,{width:32,height:"services"===n?32:24})}),[n]);return m.default.createElement(ot,{onClick:function(){return o&&o(a)},onKeyDown:function(e){"Enter"!==e.key&&"Space"!==e.key||o&&o(a)},tabIndex:0,role:"button"},m.default.createElement(st,null,"hospitals"===n?m.default.createElement(ct,{width:"12",height:"16",viewBox:"0 0 12 16"},m.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0.75 5.94873C0.75 3.04623 3.0975 0.69873 6 0.69873C8.9025 0.69873 11.25 3.04623 11.25 5.94873C11.25 9.07623 7.935 13.3887 6.5775 15.0312C6.2775 15.3912 5.73 15.3912 5.43 15.0312C4.065 13.3887 0.75 9.07623 0.75 5.94873ZM4.125 5.94873C4.125 6.98373 4.965 7.82373 6 7.82373C7.035 7.82373 7.875 6.98373 7.875 5.94873C7.875 4.91373 7.035 4.07373 6 4.07373C4.965 4.07373 4.125 4.91373 4.125 5.94873Z",fill:"#9AA2AC"})):m.default.createElement(rt,{type:n},i?m.default.createElement("img",{src:i,width:32,height:"services"===n?32:24}):r)),m.default.createElement(lt,{color:u.theme.colors.gray800,size:"p3"},a.name))},ht=function(){return m.default.createElement("svg",{width:"14",height:"18",viewBox:"0 0 14 18"},m.default.createElement("path",{d:"M7.00004 0.666992C5.29757 0.666992 3.64067 0.813476 2.52087 1.03158C1.73311 1.18457 1.16671 1.86816 1.16671 2.6722V4.83366C1.16671 5.29264 1.54106 5.66699 2.00004 5.66699H12C12.459 5.66699 12.8334 5.29264 12.8334 4.83366V2.69824C12.8334 1.89421 12.267 1.21061 11.4792 1.05762C10.3562 0.839518 8.69275 0.666992 7.00004 0.666992ZM6.16671 1.50033H7.83337V2.33366H8.66671V4.00033H7.83337V4.83366H6.16671V4.00033H5.33337V2.33366H6.16671V1.50033ZM1.42712 6.50033C1.3197 6.89421 1.24158 7.32389 1.19275 7.77637C1.14718 8.18001 1.05603 9.25423 1.06254 9.36491C0.603556 9.72624 0.333374 10.2861 0.333374 10.9014C0.333374 11.8356 0.977906 12.6364 1.84379 12.8285C2.74548 15.0192 4.55212 17.3337 7.00004 17.3337C9.44796 17.3337 11.2546 14.9964 12.1563 12.8024C13.0222 12.6136 13.6667 11.8356 13.6667 10.9014C13.6667 10.2861 13.3965 9.72624 12.9375 9.36491C12.9441 9.25423 12.8562 8.16048 12.8073 7.75033C12.7552 7.30436 12.6804 6.89095 12.573 6.50033H5.35942C6.52804 8.20606 9.27543 7.18717 11.0365 7.62012C11.5736 8.79199 11.1667 10.4326 11.1667 10.4326L11.8177 10.641C11.9121 10.6702 12 10.7549 12 10.9014C12 11.0576 11.8861 11.1943 11.6875 11.1878L11.0105 11.0837L10.7761 11.7347C9.96554 14.0492 8.4128 15.667 7.00004 15.667C5.58728 15.667 4.03455 14.0492 3.224 11.7347L2.96358 11.0837L2.26046 11.1878C2.11723 11.1878 2.00004 11.0576 2.00004 10.9014C2.00004 10.7549 2.08793 10.6702 2.18233 10.641L2.83337 10.4326C2.73246 10.5531 2.4102 8.7041 2.83337 8.03678C3.59184 7.5127 4.2266 7.87728 5.12504 6.50033H1.42712ZM5.17712 9.05241C4.57166 9.05241 4.08337 9.55371 4.08337 10.1722C4.08337 10.7907 4.57166 11.292 5.17712 11.292C5.78259 11.292 6.27087 10.7907 6.27087 10.1722C6.27087 9.55371 5.78259 9.05241 5.17712 9.05241ZM8.82296 9.05241C8.21749 9.05241 7.72921 9.55371 7.72921 10.1722C7.72921 10.7907 8.21749 11.292 8.82296 11.292C9.42843 11.292 9.91671 10.7907 9.91671 10.1722C9.91671 9.55371 9.42843 9.05241 8.82296 9.05241Z",fill:"#9AA2AC"}))},ft=function(){return m.default.createElement("svg",{width:"18",height:"18",viewBox:"0 0 18 18"},m.default.createElement("path",{d:"M8.99996 0.666992C6.27535 0.666992 3.85348 1.97884 2.33329 4.00033H4.59892C5.80009 2.94564 7.36259 2.33366 8.99996 2.33366C10.6373 2.33366 12.1998 2.94564 13.401 4.00033H15.6666C14.1464 1.97884 11.7246 0.666992 8.99996 0.666992ZM1.78642 4.83366C1.07678 7.04069 0.666626 9.59928 0.666626 12.3337C0.666626 14.085 0.826131 15.7679 1.13538 17.3337H16.8645C17.1738 15.7679 17.3333 14.085 17.3333 12.3337C17.3333 9.59928 16.9231 7.04069 16.2135 4.83366H1.78642ZM8.99996 7.33366C11.3014 7.33366 13.1666 9.19889 13.1666 11.5003C13.1666 13.8018 11.3014 15.667 8.99996 15.667C6.69853 15.667 4.83329 13.8018 4.83329 11.5003C4.83329 9.19889 6.69853 7.33366 8.99996 7.33366ZM8.16663 9.00033V10.667H6.49996V12.3337H8.16663V14.0003H9.83329V12.3337H11.5V10.667H9.83329V9.00033H8.16663Z",fill:"#9AA2AC"}))},gt=function(){return m.default.createElement("svg",{width:"16",height:"17",viewBox:"0 0 16 17"},m.default.createElement("path",{d:"M8 0.666992L0.5 5.63533V14.8337C0.5 15.7545 1.24583 16.5003 2.16667 16.5003H13.8333C14.7542 16.5003 15.5 15.7545 15.5 14.8337V5.63533L8 0.666992ZM11.3333 10.667H8.83333V13.167H7.16667V10.667H4.66667V9.00033H7.16667V6.50033H8.83333V9.00033H11.3333V10.667Z",fill:"#9AA2AC"}))},mt=function(){return m.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16"},m.default.createElement("path",{d:"M3.83333 0.5C2.94928 0.5 2.10143 0.851189 1.47631 1.47631C0.851189 2.10143 0.5 2.94928 0.5 3.83333C0.5 4.71739 0.851189 5.56523 1.47631 6.19036C2.10143 6.81548 2.94928 7.16667 3.83333 7.16667C4.71739 7.16667 5.56523 6.81548 6.19036 6.19036C6.81548 5.56523 7.16667 4.71739 7.16667 3.83333C7.16667 2.94928 6.81548 2.10143 6.19036 1.47631C5.56523 0.851189 4.71739 0.5 3.83333 0.5V0.5ZM10.5 0.5C9.57917 0.5 8.83333 1.24583 8.83333 2.16667V5.5C8.83333 6.42083 9.57917 7.16667 10.5 7.16667H13.8333C14.7542 7.16667 15.5 6.42083 15.5 5.5V2.16667C15.5 1.24583 14.7542 0.5 13.8333 0.5H10.5ZM3.83333 8.83333C2.94928 8.83333 2.10143 9.18452 1.47631 9.80964C0.851189 10.4348 0.5 11.2826 0.5 12.1667C0.5 13.0507 0.851189 13.8986 1.47631 14.5237C2.10143 15.1488 2.94928 15.5 3.83333 15.5C4.71739 15.5 5.56523 15.1488 6.19036 14.5237C6.81548 13.8986 7.16667 13.0507 7.16667 12.1667C7.16667 11.2826 6.81548 10.4348 6.19036 9.80964C5.56523 9.18452 4.71739 8.83333 3.83333 8.83333V8.83333ZM12.1667 8.83333C11.2826 8.83333 10.4348 9.18452 9.80964 9.80964C9.18452 10.4348 8.83333 11.2826 8.83333 12.1667C8.83333 13.0507 9.18452 13.8986 9.80964 14.5237C10.4348 15.1488 11.2826 15.5 12.1667 15.5C13.0507 15.5 13.8986 15.1488 14.5237 14.5237C15.1488 13.8986 15.5 13.0507 15.5 12.1667C15.5 11.2826 15.1488 10.4348 14.5237 9.80964C13.8986 9.18452 13.0507 8.83333 12.1667 8.83333V8.83333Z",fill:"#9AA2AC"}))},Ct=v.default.header(Je||(Je=e.__makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n padding: 12px 24px;\n background-color: ",";\n box-shadow: inset 0px 1px 0px #e4e8ec;\n"],["\n display: flex;\n justify-content: space-between;\n padding: 12px 24px;\n background-color: ",";\n box-shadow: inset 0px 1px 0px #e4e8ec;\n"])),u.theme.colors.neutral50),vt=v.default.div(Xe||(Xe=e.__makeTemplateObject(["\n display: grid;\n flex: 2;\n align-items: center;\n gap: 16px;\n grid-template-columns: 16px 1fr;\n"],["\n display: grid;\n flex: 2;\n align-items: center;\n gap: 16px;\n grid-template-columns: 16px 1fr;\n"]))),xt=v.default.p($e||($e=e.__makeTemplateObject(["\n color: ",";\n font-size: 14px;\n font-weight: ",";\n letter-spacing: -0.2px;\n line-height: 22px;\n"],["\n color: ",";\n font-size: 14px;\n font-weight: ",";\n letter-spacing: -0.2px;\n line-height: 22px;\n"])),u.theme.colors.neutral800,u.theme.sizes.fwSemiBold),yt=v.default.button(et||(et=e.__makeTemplateObject(["\n flex: 1;\n cursor: pointer;\n text-align: end;\n"],["\n flex: 1;\n cursor: pointer;\n text-align: end;\n"]))),bt=v.default.section(tt||(tt=e.__makeTemplateObject(["\n padding: 12px 16px;\n --rowGap: 16px;\n --graphicSize: 32px;\n\n "," {\n --rowGap: 8px;\n }\n"],["\n padding: 12px 16px;\n --rowGap: 16px;\n --graphicSize: 32px;\n\n "," {\n --rowGap: 8px;\n }\n"])),o.MediaQueries.tdUp),_t=v.default.ul(nt||(nt=e.__makeTemplateObject(["\n --gap: 16px;\n "," {\n --gap: 8px;\n }\n\n display: grid;\n overflow: hidden;\n gap: var(--gap);\n transition: max-height 0.8s ease-out;\n\n ","\n\n ","\n\n@media (prefers-reduced-motion) {\n transition: none;\n }\n\n "," {\n grid-template-columns: 1fr 1fr;\n } ;\n"],["\n --gap: 16px;\n "," {\n --gap: 8px;\n }\n\n display: grid;\n overflow: hidden;\n gap: var(--gap);\n transition: max-height 0.8s ease-out;\n\n ","\n\n ","\n\n@media (prefers-reduced-motion) {\n transition: none;\n }\n\n "," {\n grid-template-columns: 1fr 1fr;\n } ;\n"])),o.MediaQueries.tdUp,(function(e){return e.isMore&&"\n height: auto;\n max-height: 0;\n margin-top: var(--gap);\n "}),(function(e){return e.isShown&&"\n max-height: 600px;\n "}),o.MediaQueries.tdUp),wt=v.default(l.Text)(at||(at=e.__makeTemplateObject(["\n margin-top: 12px;\n margin-bottom: 8px;\n cursor: pointer;\n text-align: start;\n text-transform: capitalize;\n"],["\n margin-top: 12px;\n margin-bottom: 8px;\n cursor: pointer;\n text-align: start;\n text-transform: capitalize;\n"]))),Et=function(e){var a=e.type,i=e.data,r=e.state,s=e.dispatch,c=e.itemsToShow,d=e.itemsToShowDesktop,p=e.isMobile,h=e.isLoading,f=e.keyword,g=t.useState(!1),C=g[0],v=g[1],y=o.useTranslations(),b=y.t,_=y.locale,w=r.selectedLocation,E=r.searchKeywords,k=t.useMemo((function(){return n.LOCALIZED_SLUGS[_]}),[_]),L=t.useMemo((function(){return{doctors:{name:b("booking.searchPopup.doctors"),icon:m.default.createElement(ht,null),slug:k.DOCTOR},services:{name:b("booking.searchPopup.services"),icon:m.default.createElement(ft,null),slug:k.SERVICE},hospitals:{name:b("booking.searchPopup.hospitals"),icon:m.default.createElement(gt,null),slug:k.HOSPITAL},specialties:{name:b("booking.searchPopup.specialties"),icon:m.default.createElement(mt,null),slug:k.SPECIALTIES}}}),[a,k]),S=t.useMemo((function(){return L[a].slug}),[L]),T=p?c:d;function O(e){var t="";switch(a){case"specialties":t="/".concat(w.slug,"/").concat(L.doctors.slug,"/").concat(e.slug);break;case"services":t="/".concat(w.slug,"/").concat(S,"/").concat(e.slug);break;case"doctors":case"hospitals":t="/".concat(S,"/").concat(e.slug,"-").concat(e.id)}t&&s({type:Ce.SelectSearchResult,payload:{name:e.name,url:t}})}function I(e){return m.default.createElement(pt,{key:e.id,item:e,type:a,imageUrl:e.logo||e.avatar||e.thumbnail,onClickItem:O})}return m.default.createElement("section",null,m.default.createElement(Ct,null,m.default.createElement(vt,null,L[a].icon,m.default.createElement(xt,null,L[a].name)),m.default.createElement(yt,{onClick:function(){var e="";switch(a){case"specialties":e="/".concat(S);break;case"services":case"doctors":case"hospitals":e="/".concat(w.slug,"/").concat(S)}e&&s({type:Ce.NavigateTo,payload:e})}},m.default.createElement(l.Text,{size:"p3",color:u.theme.colors.primaryBase},b("booking.searchPopup.seeAll")))),(h||i&&i.length>0)&&m.default.createElement(bt,null,m.default.createElement(_t,null,h&&Array(2).fill(void 0).map((function(e,t){return m.default.createElement(ot,{key:a+"loading"+t},m.default.createElement(st,null,m.default.createElement(ut,null,m.default.createElement(x.default,{height:14,width:"hospitals"===a?12:32,style:{maxWidth:"var(--graphicSize)",minHeight:"var(--graphicSize)"}}))),m.default.createElement(x.default,{width:120,height:24}))})),!h&&i&&i.length>0&&i.slice(0,T).map(I)),m.default.createElement(_t,{isShown:C,isMore:!0},i.slice(T,-1).map(I)),"specialties"===a&&T<i.length&&!h&&m.default.createElement("button",{onClick:function(){return v(!C)}},m.default.createElement(wt,{size:"p3",color:u.theme.colors.primaryBase},b(C?"booking.searchPopup.seeLessSpecialties":"booking.searchPopup.seeMoreSpecialties"))),"specialties"!==a&&T<i.length&&!h&&f.trim().length>Ee[_]&&m.default.createElement("button",{onClick:function(){var e=L[a].slug,t="/".concat(w.slug,"/").concat(e,"?q=").concat(E);s({type:Ce.NavigateTo,payload:t})}},m.default.createElement(wt,{size:"p3",color:u.theme.colors.primaryBase},b("booking.searchPopup.searchIn.".concat(a),{name:f})))),!h&&0===(null==i?void 0:i.length)&&m.default.createElement(bt,null,m.default.createElement(l.Text,{size:"sm",color:u.theme.colors.gray400},b("booking.searchBar.noResults"))))},kt=v.default.section(it||(it=e.__makeTemplateObject(["\n background-color: white;\n border-radius: 4px;\n position: absolute;\n width: 100%;\n z-index: 30;\n\n "," {\n box-shadow: 0px 24px 32px rgba(0, 0, 0, 0.04),\n 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04),\n 0px 0px 1px rgba(0, 0, 0, 0.04);\n }\n"],["\n background-color: white;\n border-radius: 4px;\n position: absolute;\n width: 100%;\n z-index: 30;\n\n "," {\n box-shadow: 0px 24px 32px rgba(0, 0, 0, 0.04),\n 0px 16px 24px rgba(0, 0, 0, 0.04), 0px 4px 8px rgba(0, 0, 0, 0.04),\n 0px 0px 1px rgba(0, 0, 0, 0.04);\n }\n"])),o.MediaQueries.tdUp),Lt=function(e){var t=e.data,n=e.state,a=e.dispatch,i=e.isMobile,o=e.isLoading,r=e.keyword;return m.default.createElement(kt,null,t&&t.map((function(e){return m.default.createElement(Et,{type:e.type,state:n,dispatch:a,itemsToShow:2,itemsToShowDesktop:4,key:e.type,data:e.results,isMobile:i,isLoading:o,keyword:r})})))},St="api/lists/cities?keyword={keyword}&country_id={countryId}&site={domain}&_nopaging={noPaging}",Tt="api/v2/search/?site={domain}&type={searchType}&keyword={keyword}&city_id={city}&latitude={lat}&longitude={lng}",Ot="api/geobyip?site={domain}&latitude={lat}&longitude={lng}",It=function(t,a,i){return o.stringFormat(t,e.__assign(e.__assign({},a),{domain:n.domainLocales[i||"en-PH"]}))};var Mt;!function(e){e[e.SPECIALTY=1]="SPECIALTY",e[e.DOCTOR=2]="DOCTOR",e[e.CLINIC=3]="CLINIC",e[e.SERVICE=4]="SERVICE"}(Mt||(Mt={}));var Rt=Object.freeze({__proto__:null,get RedirectType(){return Mt}});exports.BookingSearchBar=function(r){var l=r.isMobile,s=r.careApiDomain,c=r.geoLocationPermission,u=r.geoLocationCoordinates,d=r.initialSelectedCity,p=r.initialSearchValue,h=void 0===p?"":p,f=r.careFrontDomain,g=void 0===f?"/care":f,v=r.isDebug,x=void 0!==v&&v,y=r.askForGeolocationPermission,b=void 0!==y&&y,_=r.gaTrackingSearchBar,w=r.autoCompleteDisabled,E=void 0!==w&&w,k=r.inputSearchPlaceholder,L=void 0===k?"":k,S=r.routerPush,T=r.onGeoLocationPermissionChange,O=r.onSearch,I=r.onChangeLocation,M=o.useTranslations(),R=M.t,z=M.locale,D=t.useRef(null),H=t.useRef(null),V=t.useState(void 0),B=V[0],K=V[1],Z=function(){var e=t.useState((function(){if("undefined"==typeof window)return"unset";if(i.getCookie(a.USER_GEOLOCATION_COORDINATES_COOKIE))return"granted";var e=!location.protocol.includes("https")&&"localhost"!==location.hostname;return!navigator.geolocation||e?"denied":"unset"})),n=e[0],o=e[1],r=t.useState((function(){if("undefined"==typeof window)return null;var e=i.getCookie(a.USER_GEOLOCATION_COORDINATES_COOKIE);if(e)try{return JSON.parse(e)}catch(e){console.log(e)}return null})),l=r[0],s=r[1],c=t.useCallback((function(){navigator.geolocation&&navigator.geolocation.getCurrentPosition((function(e){var t={lat:"".concat(Math.round(1e7*e.coords.latitude)/1e7),lng:"".concat(Math.round(1e7*e.coords.longitude)/1e7)};i.setCookie(a.USER_GEOLOCATION_COORDINATES_COOKIE,JSON.stringify(t),0,15),s(t),o("granted")}),(function(){i.deleteCookie(a.USER_GEOLOCATION_COORDINATES_COOKIE),o("denied")}))}),[]);return t.useMemo((function(){return{geoLocationPermission:n,geoLocationCoordinates:l,requestGeoLocation:c}}),[n,l])}(),G=Z.geoLocationPermission,U=Z.geoLocationCoordinates,q=Z.requestGeoLocation,Q=t.useReducer(Se,ke,(function(t){return e.__assign(e.__assign({},t),{isDebug:x,isMobile:l,geoLocationPermission:c||G||"unset",geoLocationCoordinates:u||U||null,searchKeywords:h,initialSelectedCity:d||null,selectedLocation:d||t.selectedLocation||null,searchLocationKeywords:(null==d?void 0:d.name)||t.searchLocationKeywords,autoCompleteDisabled:E,inputSearchPlaceholder:L,locale:z})})),W=Q[0],J=Q[1],X=W.navigateTo,$=W.focused,ee=W.isLoadingCities,te=W.cities,ne=W.searchKeywords,ae=W.geoLocationPermission,ie=W.selectedLocation,oe=W.initialSelectedCity,re=W.defaultCity,le=W.searchResults,se=W.isLoadingSearchResults,ce=W.isMobileModalOpened,ue=W.inputSearchPlaceholder,pe=function(a){var i=a.dispatch,o=a.careApiDomain,r=a.locale,l=void 0===r?"vi-VN":r,s=t.useCallback((function(e,t){void 0===t&&(t={});var n="".concat(o).concat(e);return i({type:Ce.FetchCitiesStart}),fetch(It(n,t,l),{method:"GET"}).then((function(e){return e.json()})).then((function(e){return 1===e._status&&e._data?null==e?void 0:e._data:(console.log("error loading cities",e),Promise.reject(e))})).finally((function(){return i({type:Ce.FetchCitiesFinish})}))}),[l]),c=t.useCallback((function(t){var n=t.coordinates,a={};n&&(a={lat:n.lat,lng:n.lng});var o=[s(Ot,a)];return"zh-TW"===l&&o.push(s(St,{noPaging:1})),Promise.all(o).then((function(t){var n=t[0],a=t[1],o=e.__assign({},n);if(a){var r=o.cities.map((function(e){return e.id}));o.cities=o.cities.concat(a.cities.filter((function(e){return!r.includes(e.id)})))}i({type:Ce.FetchCitiesByGeoIpComplete,payload:o})})).catch((function(e){return console.error("error loading cities by location",e)}))}),[l,o,i]);return{fetchCitiesByLocation:c,fetchCitiesByKeyword:t.useCallback((function(e){return s(St,{keyword:e}).then((function(e){i({type:Ce.FetchCitiesByKeywordComplete,payload:e.cities})})).catch((function(e){return console.error("error loading cities by keyword",e)}))}),[l,o,i]),fetchSearchResults:t.useCallback((function(e,t){var a="".concat(o).concat(Tt);i({type:Ce.FetchSearchResultsStart});var r=t.defaultCity,s=t.selectedLocation,c=t.geoLocationCoordinates,u="";if(s&&r){s.id===n.ID_OPTION_CURRENT_LOCATION?c||(u=r.id):u=s.id;var d=(null==c?void 0:c.lat)||"",p=(null==c?void 0:c.lng)||"";return fetch(It(a,{domain:o,searchType:"global",keyword:e.trim().length>Ee[l]?e.trim():"",city:u===n.ID_OPTION_CURRENT_LOCATION?"":u,lat:d,lng:p},l),{method:"GET",headers:{accept:"version=2.0.0.0"}}).then((function(e){return e.json()})).then((function(e){return 1===e._status&&e._data?null==e?void 0:e._data:Promise.reject(e)})).then((function(e){return i({type:Ce.FetchSearchResultsComplete,payload:e})})).catch((function(e){console.log("error loading search results",{url:a,error:e})})).finally((function(){return i({type:Ce.FetchSearchResultsFinish})}))}i({type:Ce.FetchSearchResultsFinish})}),[l,o,i])}}({dispatch:J,locale:z,careApiDomain:s}),he=pe.fetchCitiesByLocation,fe=pe.fetchCitiesByKeyword,ge=pe.fetchSearchResults,me=t.useMemo((function(){var e;return{id:n.ID_OPTION_CURRENT_LOCATION,name:R("booking.searchBar.currentLocation"),slug:null===(e=n.LOCALIZED_SLUGS[z])||void 0===e?void 0:e.CURRENT}}),[R,z]),ve=t.useMemo((function(){return C.default(fe,400)}),[fe]),xe=t.useMemo((function(){return C.default(ge,400)}),[ge]);t.useEffect((function(){""!==h&&h!==W.searchKeywords&&J({type:Ce.UpdateInitialSearchValue,payload:h})}),[h]),t.useEffect((function(){b&&(null==ie?void 0:ie.id)===n.ID_OPTION_CURRENT_LOCATION&&"unset"===ae&&q()}),[b,ie,ae]),t.useEffect((function(){c||ae===G||("granted"===G&&U?J({type:Ce.GrantGeoLocationPermission,payload:U}):"denied"===G&&J({type:Ce.DenyGeoLocationPermission}))}),[ae,G,U,c]),t.useEffect((function(){X&&(S?S(X):window.location.href="".concat(g).concat(X))}),[X]);var ye=t.useCallback((function(){J({type:Ce.SelectCurrentLocation,payload:me})}),[R,J]);t.useEffect((function(){"denied"===ae||oe||ye(),T&&T(ae,W.geoLocationCoordinates),l&&"granted"===ae&&ie&&J({type:Ce.FocusInputSearch}),he({coordinates:W.geoLocationCoordinates})}),[ae]),t.useEffect((function(){ie&&re&&ge(W.searchKeywords,W)}),[ie,re]),t.useEffect((function(){L!==ue&&J({type:Ce.SetInputSearchPlaceholder,payload:L})}),[L,ue]),t.useEffect((function(){ce?document.body.classList.add("care-popup-open"):document.body.classList.remove("care-popup-open")}),[ce]);var be=t.useCallback((function(e){J({type:Ce.SelectLocation,payload:e}),Te(),I&&I(e)}),[R,J]);function _e(){l&&"granted"!==W.geoLocationPermission?q():(ye(),Te())}function Le(){var e;D.current&&(null===(e=D.current.querySelector('input[name="search-location"]'))||void 0===e||e.focus())}function Te(){var e;D.current&&(null===(e=D.current.querySelector('input[name="search-results"]'))||void 0===e||e.focus())}function Oe(){return"location"!==$?null:m.default.createElement(Y,{isLoading:ee,cities:te,onLocationClick:be,onCurrentLocationClick:_e,isLocationLoading:ee,geoLocationPermission:ae,selectedLocation:ie})}function Ie(){return"search"!==$?null:W.autoCompleteDisabled?l?m.default.createElement(je,{onClick:function(){O({cityId:W.selectedLocation.id,keyword:ne})}}):null:m.default.createElement(Lt,{data:le,state:W,dispatch:J,isMobile:!1,keyword:ne,isLoading:se})}function Me(){return m.default.createElement(Ze,{isMobile:l,state:W,dispatch:J,debouncedFetchCitiesByKeyword:ve,debouncedFetchSearchResults:xe,focusLocationInput:Le,focusSearchInput:Te,renderLocationResults:Oe,renderSearchResults:Ie,trackingAttributes:_,onSearch:O,initalSearchValue:h})}return t.useEffect((function(){if(window.visualViewport){var e=function(e){var t=e.target;K(null==t?void 0:t.height)};return window.visualViewport.addEventListener("resize",e),function(){window.visualViewport.removeEventListener("resize",e)}}}),[K]),l?m.default.createElement(m.default.Fragment,null,m.default.createElement(j,null),m.default.createElement(F,{ref:H}),m.default.createElement(N,{id:"booking-search-bar",ref:D,"data-is-modal":l&&ce,style:{"--mobile-care-searchbar-height":ce&&B?"".concat(B,"px"):"100%"}},ce?m.default.createElement(m.default.Fragment,null,m.default.createElement(P,null,m.default.createElement(we,{headingText:"Search",onLeftClick:function(){J({type:Ce.CloseMobileModal})}}),Me()),Oe(),Ie()):m.default.createElement(de,{onClick:function(){var t;return e.__awaiter(this,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return H.current&&H.current.focus(),J({type:Ce.OpenMobileModal}),[4,Promise.resolve()];case 1:return e.sent(),D.current&&(null===(t=D.current.querySelector('input[name="search-location"]'))||void 0===t||t.focus()),[2]}}))}))},focused:$,value:ne,trackingAttributes:_,inputSearchPlaceholder:L}))):m.default.createElement(A,{id:"booking-search-bar",ref:D},Me())},exports.types=Rt;
|
package/build/types-cfe2f3a5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./tslib.es6-f7929e76.js"),t=require("react"),n=require("./index.styled-31c53cd9.js"),a=require("./index-a42bf49e.js"),o=require("./useTranslations-f5815b25.js"),i=require("./index.styled-9b06e721.js"),l=require("./theme-da70da1e.js");require("react-range");var r=require("react-dom");require("date-fns");var s=require("./index-a9dac361.js"),c=require("lodash/debounce"),u=require("./index-15a8d752.js"),d=require("./number-95704111.js"),m=require("./constants-d4ec4195.js");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function v(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var f=p(t),g=v(r),h=p(c),C=function(a){var o=a.title,l=a.url,r=a.image,s=a.logo,c=a.className,d=a.style,m=a.noRefetch,p=t.useContext(i.TogetherComponentGlobalContext).data,v=p.locale,g=p.env.isMarryBaby,h=t.useState(!1),C=h[0],w=h[1],E=t.useRef(m);E.current=m;var y=t.useState(null),k=y[0],_=y[1];t.useEffect((function(){e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(t){return E.current?[2]:l?(_((function(t){return e.__assign(e.__assign({},t),{isFetching:!0})})),i.callApi(i.getApiPath(i.PATHS.FETCH_PREVIEW,{_locale:v}),"POST",{data:{link:l}}).then((function(e){var t,n,a;w(!1),_({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:l,image:(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.image)||(null===(a=null==e?void 0:e.data)||void 0===a?void 0:a.logo)})})).catch((function(){_(null)})),[2]):[2,_(null)]}))}))}),[l]);var b=(null==k?void 0:k.image)||r,T=(null==k?void 0:k.title)||o,S=(null==k?void 0:k.logo)||s,P=(null==k?void 0:k.url)||l,x=P.replace("http://","").replace("https://","").split(/[/?#]/)[0],N=t.useRef(!1);return f.default.createElement(i.StyledCardLink,{"data-is-marrybaby":g,className:"".concat(c," no-replace-click"),style:d},f.default.createElement("a",{href:P,target:"_blank",rel:"noreferrer"},b&&f.default.createElement("div",{className:"link-image-wrapper"},!g&&f.default.createElement("img",{className:"link-image-blur",src:b,onError:function(e){N.current||(N.current=!0,e.currentTarget.src=i.DEFAULT_IMG)}}),f.default.createElement("img",{className:"link-image",src:b,onError:function(e){N.current||(N.current=!0,e.currentTarget.src=i.DEFAULT_IMG)}})),f.default.createElement("div",{className:"link-info-container"},f.default.createElement(n.Text,{size:"n1"},g&&S&&!C&&f.default.createElement("img",{className:"link-logo",src:S,onError:function(e){return w(!0)}}),x),f.default.createElement(u.Heading,{tag:"h6"},T))))},w=function(e){var a=e.topics,o=e.onClick,l=e.className,r=e.style,s=function(){var e=t.useState(!1),n=e[0],a=e[1],o=t.useRef(null),i=t.useRef(null),l=t.useRef();return{sliding:n,mouseDownHandler:function(e){if(o.current){l.current=setTimeout((function(){a(!0)}),500),i.current={left:o.current.scrollLeft,x:e.clientX};var t=function(e){var t=i.current;if(t){var n=e.clientX-t.x;o.current&&(o.current.scrollLeft=t.left-n)}},n=function(){l.current&&(clearTimeout(l.current),l.current=void 0),a(!1),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",n)}},sliderRef:o,pos:i}}(),c=s.sliding,u=s.mouseDownHandler,d=s.sliderRef,m=t.useContext(i.TogetherComponentGlobalContext),p=m.data.env.togetherBasePath,v=m.action.sanitizeFunction;return f.default.createElement(i.StyledTagTopic,{ref:d,onClick:o,onMouseDown:function(e){return u(e)},className:"".concat(l," ").concat(c?"sliding":""),style:r},a.map((function(e,t){return f.default.createElement("a",{className:"tag-link-item",key:t,href:e.isActive&&!e.isHidden?"".concat(p).concat(e.url):void 0},f.default.createElement(n.Text,{size:"p3"},f.default.createElement("span",{dangerouslySetInnerHTML:{__html:(null==v?void 0:v(e.name))||e.name}})))})))},E=function(e){var n=e.onClick;e.color;var a=e.className,l=e.style,r=t.useContext(i.TogetherComponentGlobalContext).data.env.isMarryBaby,s=o.useTranslations().t;return f.default.createElement(i.LabelSortPin,{label:f.default.createElement(f.default.Fragment,null,r&&f.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M3.5 19.9999L7.87 15.6299' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath fill-rule='evenodd' clip-rule='evenodd' d='M4.95634 11.294C4.56534 11.685 4.56534 12.318 4.95634 12.708L7.87434 15.626L10.7923 18.544C11.1833 18.935 11.8163 18.935 12.2063 18.544L13.3813 17.369C13.5693 17.181 13.6743 16.927 13.6743 16.662V12.726L16.5743 9.82597L18.8833 9.94897C19.1663 9.96397 19.4433 9.85797 19.6433 9.65797L20.2173 9.08397C20.6083 8.69297 20.6083 8.05997 20.2173 7.66997L15.8313 3.28397C15.4403 2.89297 14.8073 2.89297 14.4173 3.28397L13.8433 3.85797C13.6423 4.05897 13.5363 4.33497 13.5523 4.61797L13.6753 6.92697L10.7753 9.82697H6.83834C6.57334 9.82697 6.31834 9.93197 6.13134 10.12L4.95634 11.294V11.294Z' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3cpath d='M16.5699 9.83018L13.6699 6.93018' stroke='%23FB8C00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e %3c/svg%3e"})," ",s("label.pinnedPost")),rightLabel:!r&&f.default.createElement("img",{className:"label-sort-pin-icon",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cline x1='7.18605' y1='7.68219' x2='3.68219' y2='13.8139' stroke='%23FEA21E' stroke-linecap='round'/%3e%3cpath d='M3.24591 7.78426C3.21275 7.84168 3.20376 7.90993 3.22092 7.97398C3.23808 8.03803 3.27998 8.09264 3.3374 8.12579L8.78429 11.2706C8.90385 11.3396 9.05674 11.2986 9.12578 11.1791C9.71191 10.1641 9.71348 8.97262 9.23682 7.99339L10.8583 5.18521C11.5115 5.00603 12.0982 4.57973 12.4638 3.94629C12.5328 3.82672 12.4919 3.67383 12.3723 3.6048L8.18237 1.18584C8.12494 1.15268 8.0567 1.1437 7.99265 1.16086C7.92861 1.17803 7.874 1.21993 7.84086 1.27736C7.47521 1.91077 7.39934 2.63194 7.57065 3.28723L5.94919 6.09545C4.86323 6.1723 3.83201 6.76934 3.24591 7.78426Z' fill='%23FEA21E' stroke='%23FEA21E' stroke-width='0.5' stroke-linejoin='round'/%3e%3c/svg%3e"}),onClick:n,color:"white",className:"label-pinned ".concat(a),style:l})},y=function(e){return{message:e("notification.failure"),type:"danger"}},k="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%23FE921D'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",_=function(t){var n=t.id,a=t.locale;return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return n?[4,i.callApiWithAuth(i.getApiPath(i.PATHS.POST.LIKE,{id:n,_locale:a}),"GET")]:[2];case 1:return[2,e.sent()]}}))}))},b=function(t){var n=t.id,a=t.locale;return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return n?[4,i.callApiWithAuth(i.getApiPath(i.PATHS.POST.DELETE,{id:n,_locale:a}),"DELETE")]:[2];case 1:return[2,e.sent()]}}))}))},T=function(t){var n=t.title,a=t.description,o=t.communityId,l=t.imageFiles,r=t.previewUrl,s=t.topicIds,c=t.locale,u=t.sanitizeFunction,d=t.categoryCommunityId,m=t.categoryTopicIds,p=t.introUrl,v=t.bannerUrl,f=t.scheduleTime;return e.__awaiter(void 0,void 0,void 0,(function(){var t,g,h,C,w;return e.__generator(this,(function(e){switch(e.label){case 0:return t=new FormData,g=i.removeBannedWordWrapper(a),h=i.removeBannedWordWrapper(n),C=i.getMentionIdsFromString(g),t.append("title",h),t.append("description",i.encodePostContent(g,u)),d?t.append("category_community",String(d)):o&&t.append("community_id",String(o)),(null==r?void 0:r.title)&&t.append("preview_title",r.title),(null==r?void 0:r.description)&&t.append("preview_description",r.description),(null==r?void 0:r.url)&&t.append("preview_link",r.url),(null==r?void 0:r.image)&&t.append("preview_image",r.image),null==s||s.forEach((function(e){t.append("topics[]",String(e||""))})),null==m||m.forEach((function(e){t.append("category_topics[]",String(e||""))})),(null==l?void 0:l.length)?[4,Promise.all(l.map((function(e,t){return new Promise((function(n){setTimeout((function(){n(i.uploadAndGetSrc(e,c))}),2e3*t)}))})))]:[3,2];case 1:return null==(w=e.sent())||w.filter(Boolean).slice(0,i.MAX_IMAGE_UPLOADS).forEach((function(e,n){t.append("images[".concat(n,"]"),e)})),[3,3];case 2:t.append("images",""),e.label=3;case 3:return null==C||C.forEach((function(e){t.append("mention_ids[]",e)})),t.append("intro_url",p||""),t.append("banner",v||""),f&&(t.append("post_type","scheduled"),t.append("schedule_datetime",f)),[2,t]}}))}))},S=function(t){var n=t.locale,a=t.formData,o=t.isArticleComment;return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return[4,i.callApiWithAuth(i.getApiPath(o?i.PATHS.POST.CREATE_ARTICLE_COMMENT:i.PATHS.POST.CREATE,{_locale:n}),"POST",{data:a,headers:{"Content-Type":"multipart/form-data"}})];case 1:return[2,e.sent()]}}))}))},P=function(t){var n=t.id,a=t.locale,o=t.formData;return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){switch(e.label){case 0:return[4,i.callApiWithAuth(i.getApiPath(i.PATHS.POST.UPDATE,{id:n,_locale:a}),"POST",{data:o})];case 1:return[2,e.sent()]}}))}))},x=function(e){var t=e.id,n=e.reason,a=e.locale,o=new FormData;return o.append("reason",n),i.callApiWithAuth(i.getApiPath(i.PATHS.POST.REPORT,{_locale:a,id:t}),"POST",{data:o})},N=function(e,n){var a=t.useState(e||[]),o=a[0],i=a[1];return{onSelectImages:function(t){var a=t.target.files;a&&(n&&e?n((e||o).concat(Array.from(a))):i((function(t){var o=e||t;return n&&n(o.concat(Array.from(a))),o.concat(Array.from(a))})))},onRemoveImage:function(t){if(n&&e){var a=e;a.splice(t,1),n(a.slice())}else i((function(a){var o=e||a;return o.splice(t,1),n&&n(o.slice()),o.slice()}))},onRemoveAllImages:function(){n?n([]):i([])},imageSrcs:t.useMemo((function(){return(e||o).map((function(e){return"string"==typeof e?e:URL.createObjectURL(e)}))}),[e,o]),imageFiles:e||o}},I="data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 22.9844C17.5228 22.9844 22 18.5072 22 12.9844C22 7.46153 17.5228 2.98438 12 2.98438C6.47715 2.98438 2 7.46153 2 12.9844C2 18.5072 6.47715 22.9844 12 22.9844Z' fill='%23262626'/%3e%3cpath d='M14.8281 10.1562L9.17127 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.17188 10.1562L14.8287 15.8131' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",A=function(e){var a=e.className,r=e.style,s=e.bannedWords,c=void 0===s?[]:s,u=e.value,d=e.onChange,m=e.onPreviewUrlChange,p=e.onInvalidUrlsChange,v=e.onImageFilesChange,g=e.imageFiles,h=e.isReplying,w=o.useTranslations().t,E=t.useState(null),y=E[0],_=E[1],b=t.useRef(null),T=N(g,v),S=T.onSelectImages,P=T.onRemoveImage,x=T.imageSrcs;return t.useEffect((function(){m&&((null==y?void 0:y.url)?m({title:y.title||"",url:y.url||"",image:y.image||"",description:y.description||""}):m(null))}),[y]),f.default.createElement(i.StyledCreatePostDescription,{className:a,style:r},f.default.createElement(n.Text,{size:"p4",className:"description-label"},w("createPost.popup.description")),f.default.createElement("div",{className:"textarea-control"},f.default.createElement("div",{className:"textarea-wrapper"},f.default.createElement(i.RichTextEditor,{html:u||"",onChange:d,bannedWords:c,onImagePickerClick:function(){var e;return null===(e=b.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:_,onInvalidUrlsChange:p,isReplying:h}))),f.default.createElement(n.Text,{size:"p4",className:"count-string"},w("character"),": ",i.innertext_1(u||"").length),(!x||0===x.length)&&y&&f.default.createElement("div",{className:"link-preview-wrapper"},y.isFetching?f.default.createElement(i.Loading,null):f.default.createElement(f.default.Fragment,null,f.default.createElement(C,{title:y.title,url:y.url||"#",image:y.image,noRefetch:!0}),f.default.createElement("img",{src:I,className:"icon-close",onClick:function(){return _(null)}}))),f.default.createElement("input",{ref:b,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:S}),x.length>i.MAX_IMAGE_UPLOADS?f.default.createElement("div",{className:"input-notification"},f.default.createElement("img",{src:k}),f.default.createElement(n.Text,{size:"p4",color:l.theme.colors.alertWarning},w("createPost.popup.warningImage"))):null,x.length>0&&f.default.createElement("div",{className:"image-gallery"},x.map((function(e,t){return f.default.createElement("div",{key:t,className:"image-item"},f.default.createElement("img",{src:e}),f.default.createElement("img",{className:"close-btn",src:I,onClick:function(){return P(t)}}))}))))},M=function(e,t){if(!t)return e;var n=t.limit,a=t.bannedWords,o=void 0===a?[]:a,l="number"==typeof n&&n>=0?e.substring(0,n):e;return i.highlightBadWords(l,o)},L=function(e){var a,l=e.className,r=e.style,c=e.bannedWords,u=void 0===c?[]:c,d=e.value,m=e.onChange,p=o.useTranslations().t,v=t.useState(""),g=v[0],C=v[1],w=t.useRef(null);t.useEffect((function(){if(w.current){var e=function(e){var t;e.preventDefault();var n=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/plain");document.execCommand("insertHTML",!1,n)},t=w.current;return t.addEventListener("paste",e),function(){return t.removeEventListener("paste",e)}}}),[w]);var E=(null==u?void 0:u.join(","))||"";t.useEffect((function(){var e;if(E){var t=null===(e=w.current)||void 0===e?void 0:e.innerText;if(t){var n=i.highlightBadWords(t,u);n!==t&&(m&&m(n),C(n))}}}),[E]);var y=t.useCallback(h.default((function(e){if(w.current){var t=M(w.current.innerText,{limit:120,bannedWords:u});m&&m(t),C(t)}}),300),[]);return t.useEffect((function(){setTimeout((function(){var e;null===(e=w.current)||void 0===e||e.focus()}),500)}),[]),f.default.createElement(i.StyledCreatePostTitle,{className:l,style:r},f.default.createElement(s.Input,{name:"title",value:d||g,size:"md",label:p("createPost.title"),CustomInput:f.default.createElement(i._default,{innerRef:w,html:d||g,onChange:function(e){if(w.current&&w.current.innerText!==(d||g)){var t=M(w.current.innerText,{bannedWords:u});m&&m(t),C(t),y(w.current.innerText)}},className:"title-input"})}),f.default.createElement(n.Text,{size:"p4",className:"count-string"},p("createPost.popup.wordCount",{count:(null===(a=w.current)||void 0===a?void 0:a.innerText.length)||0,max:120})))},R=function(n){var a=n.className,o=n.style,l=n.topics,r=n.communityId,s=n.onChange,c=n.isLoading,u=n.disabled,d=n.forceTopics,m=n.selectedTopics,p=n.noFetch,v=t.useContext(i.TogetherComponentGlobalContext).data,g=v.locale,h=v.env.isMarryBaby,C=t.useState(l?e.__spreadArray([],l,!0):[]),w=C[0],E=C[1],y=t.useState(m?e.__spreadArray([],m,!0):[]),k=y[0],_=y[1],b=t.useState(!1),T=b[0],S=b[1],P=t.useRef(l);P.current=l,t.useEffect((function(){var t;!r||p||(null===(t=P.current)||void 0===t?void 0:t.length)||(E([]),S(!0),e.__awaiter(void 0,void 0,void 0,(function(){var t,n,a,o;return e.__generator(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,i.callApi(i.getApiPath(i.PATHS.TOPIC.LIST,{communityId:r,_locale:g}),"GET")];case 1:return t=e.sent(),n=null===(o=null==t?void 0:t.data)||void 0===o?void 0:o.topics,Array.isArray(n)&&E((function(){return(null==n?void 0:n.map(i.formatTopic).sort((function(e,t){return(e.order||0)-(t.order||0)})))||[]})),[3,3];case 2:return a=e.sent(),console.log(a),S(!1),[3,3];case 3:return S(!1),[2]}}))})))}),[r,p]);var x=null==l?void 0:l.map((function(e){return e.id})).join("-"),N=null==w?void 0:w.map((function(e){return e.id})).join("-"),I=null==d?void 0:d.map((function(e){return e.id})).join("-");t.useEffect((function(){l&&void 0!==x&&x!==N&&E(l)}),[l,x,N]);var A=t.useMemo((function(){return w.filter((function(e){return!(null==d?void 0:d.some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})))}))}),[N,I]);return f.default.createElement(i.StyledTopicSelectList,{"data-is-marrybaby":h,className:a,style:o},d.map((function(e){return f.default.createElement(B,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:!0,selected:!0})})),A.map((function(e){return f.default.createElement(B,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:u,selected:(m||k).some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})),onClick:function(){var t=m||k,n=t.findIndex((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId}));-1!==n?t.splice(n,1):t.push(e),s&&m?s(t.slice()):(s&&s(t.slice()),_(t.slice()))}})})),(c||T)&&f.default.createElement(i.Loading,{className:"topic-spinner"}))},B=function(e){var t=e.topic,n=e.disabled,a=e.selected,o=e.onClick;return f.default.createElement("div",{className:"tag-item"+(a?" --active":""),"data-disabled":n,onClick:n?void 0:o},t.name)},j=function(e){var a=e.className,l=e.isMarryBaby,r=e.style,s=e.title,c=e.description,d=e.acceptText,m=e.cancelText,p=e.onAccept,v=e.thumbnail,h=e.isThumbnailIcon,C=e.onClose,w=t.useContext(i.TogetherComponentGlobalContext).data.env.isMarryBaby,E="boolean"==typeof l?l:w,y=t.useState(!1),k=y[0],_=y[1];return t.useEffect((function(){return o.toggleNoScroll(!0),setTimeout((function(){return _(!0)}),0),function(){return o.toggleNoScroll(!1)}}),[]),g.createPortal(f.default.createElement(i.StyledPopupDanger,{"data-is-marrybaby":E,className:a,style:r,"data-open":k},f.default.createElement(i.PopupFrame,{className:"popup-frame",isOpen:k,onClose:C},f.default.createElement("div",{className:"confirm-dialog",onClick:function(e){return e.stopPropagation()}},f.default.createElement("div",{className:"confirm-content"},v&&f.default.createElement("div",{className:"thumbnail-container ".concat(h?"is-icon":"")},f.default.createElement("img",{className:"thumbnail",src:v})),f.default.createElement(u.Heading,{className:"title",tag:"h2"},s),f.default.createElement(n.Text,{className:"desc",size:"lg"},c),f.default.createElement("div",{className:"btn-group"},f.default.createElement(n.Button,{theme:E?"marryBaby":"helloSites",size:"md",color:"secondary",onClick:function(){null==p||p(),null==C||C()}},d),f.default.createElement(n.Button,{theme:E?"marryBaby":"helloSites",size:"md",onClick:C},m)))),E&&v&&f.default.createElement("div",{className:"thumbnail-container is-mobile ".concat(h?"is-icon":"")},f.default.createElement("img",{className:"thumbnail",src:v})))),document.body)},F=function(t){var n=t.postId,a=t.message,o=t.photos,l=t.link,r=t.locale,s=t.sanitizeFunction,c=t.replyingUserId,u=t.replyingUserName,d=t.replyingId;return e.__awaiter(void 0,void 0,void 0,(function(){var t,m,p;return e.__generator(this,(function(e){switch(e.label){case 0:return t=new FormData,m=i.encodePostContent(a.replace(/(\ )+/g," "),s),p=i.getMentionIdsFromString(m),o&&o.length>0?[4,Promise.all(null==o?void 0:o.map((function(e){return i.uploadAndGetSrc(e,r)})))]:[3,2];case 1:e.sent().filter(Boolean).slice(0,i.MAX_IMAGE_UPLOADS).forEach((function(e){t.append("images[]",e)})),e.label=2;case 2:return l&&t.append("link",l),null==p||p.forEach((function(e){t.append("mention_ids[]",e)})),t.append("post_id",n),d&&t.append("parent_id",d),c&&(p.unshift(c),m='[mention+id="'.concat(c,'"+name="').concat((u||"").replace('"',"'"),'"]').concat(m),t.append("parent_user_id",String(c))),t.append("content",m),t.append("content",m),[2,t]}}))}))},D=function(t,n){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){return[2,i.callApiWithAuth(i.getApiPath(i.PATHS.COMMENT.CREATE,{_locale:n}),"POST",{data:t,headers:{"Content-Type":"multipart/form-data"}})]}))}))},O=function(t,n){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){return[2,i.callApiWithAuth(i.getApiPath(i.PATHS.COMMENT.REPLY,{_locale:n}),"POST",{data:t,headers:{"Content-Type":"multipart/form-data"}})]}))}))},H=function(t){var n=t.commentId,a=t.setLike,o=void 0!==a&&a,l=t.locale;return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(e){return[2,i.callApiWithAuth(i.getApiPath(o?i.PATHS.COMMENT.LIKE:i.PATHS.COMMENT.UNLIKE,{_locale:l,id:n}),"GET")]}))}))},U=function(e){var t=e.id,n=e.locale;return i.callApiWithAuth(i.getApiPath(i.PATHS.COMMENT.DELETE,{_locale:n,id:t}),"DELETE")},W=function(a){var l=a.isReply,r=a.className,c=a.onClose,u=a.replyToName,d=a.style,m=a.replyingId,p=a.replyingUser,v=a.onPostSuccess;a.isMainCmt;var g=a.post,h=a.isMarryBaby,w=t.useContext(i.TogetherComponentGlobalContext),E=w.action,y=E.pushNotifications,k=E.sanitizeFunction,_=w.data,b=_.userInfo,T=_.locale,S=_.env.isMarryBaby,P="boolean"==typeof h?h:S,x=o.useTranslations().t,A=N(),M=A.onSelectImages,L=A.onRemoveImage,R=A.imageSrcs,B=A.onRemoveAllImages,j=A.imageFiles,H=t.useState(""),U=H[0],W=H[1],z=t.useContext(i.MainInputTriggerContext).trigger,V=t.useState(!1),G=V[0],q=V[1],Z=t.useRef(null),K=t.useRef(null),Q=t.useRef(null),X=t.useState([]),$=X[0],J=X[1],Y=t.useState([]),ee=Y[0],te=Y[1],ne=t.useState(null),ae=ne[0],oe=ne[1];return t.useEffect((function(){var e;null===(e=Q.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((function(){var e;null===(e=K.current)||void 0===e||e.focus()}),400)}),[z]),f.default.createElement(i.StyledInputCommentBar,{"data-is-reply":l,className:r,style:d},l&&f.default.createElement("div",{className:"reply-to-container"},f.default.createElement(n.Text,{size:"p4"},f.default.createElement("span",{dangerouslySetInnerHTML:{__html:x("inputComment.replyTo",{name:'<span style="color: #2D87F3; cursor: pointer">@'.concat(u||"","</span>")})}})),f.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8.00016' cy='8.50004' r='6.66667' fill='white' stroke='%23404040'/%3e%3cpath d='M10 6.5L6 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6 6.5L10 10.5' stroke='%23404040' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-close-comment",onClick:function(){return c&&c()}})),f.default.createElement("div",{className:"input-container",ref:Q},f.default.createElement(i.UserAvatar,{className:"avatar-wrapper ".concat(l?"avatar-wrapper-reply":""),avatar:(null==b?void 0:b.id)?b.avatar:i.DEFAULT_AVATAR_IMG,username:(null==b?void 0:b.name)||(null==b?void 0:b.username)}),f.default.createElement("input",{ref:Z,onChange:M,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),f.default.createElement(s.Input,{value:U,name:"input",size:"md",className:"input-wrapper",displayIcon:f.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.7543 4.85352H4.49227C4.01776 4.85352 3.56268 5.04201 3.22715 5.37754C2.89162 5.71307 2.70313 6.16815 2.70312 6.64266V19.1667C2.70313 19.6412 2.89162 20.0963 3.22715 20.4318C3.56268 20.7673 4.01776 20.9558 4.49227 20.9558H17.0163C17.4908 20.9558 17.9459 20.7673 18.2814 20.4318C18.6169 20.0963 18.8054 19.6412 18.8054 19.1667V12.9047' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M17.4633 3.51187C17.8192 3.15599 18.3019 2.95605 18.8052 2.95605C19.3085 2.95605 19.7912 3.15599 20.147 3.51187C20.5029 3.86775 20.7029 4.35044 20.7029 4.85373C20.7029 5.35702 20.5029 5.83971 20.147 6.19559L11.6486 14.694L8.07031 15.5886L8.96489 12.0103L17.4633 3.51187Z' stroke='%232D87F3' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"}),CustomInput:f.default.createElement("div",{className:"as-input"},f.default.createElement(i.RichTextEditor,{className:"textarea",html:U,onChange:W,onImagePickerClick:function(){var e;return null===(e=Z.current)||void 0===e?void 0:e.click()},bannedWords:ee,onPreviewUrlChange:oe,onInvalidUrlsChange:J,setEditorRef:function(e){return K.current=e},isReplying:l}))}),f.default.createElement(n.Button,{theme:P?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,n,a,o,r,s,u,d,f,h,C,w,E;return e.__generator(this,(function(_){switch(_.label){case 0:if(!(null==g?void 0:g.id)||G)return[2];q(!0),_.label=1;case 1:return _.trys.push([1,4,,5]),t=function(e){W(""),B(),c&&c();var t=i.formatComment(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),v&&v(t)},[4,F(e.__assign({message:U,photos:j,postId:String(g.id),link:null==ae?void 0:ae.url,sanitizeFunction:k,locale:T},l&&m?{replyingUserId:String((null==p?void 0:p.id)||(null===(r=null==g?void 0:g.author)||void 0===r?void 0:r.id)||""),replyingId:m,replyingUserName:(null==p?void 0:p.name)||(null==p?void 0:p.username)||""}:{}))];case 2:return n=_.sent(),[4,l&&m?O(n,T):D(n,T)];case 3:return a=_.sent(),(null==(o=null==a?void 0:a.data)?void 0:o.id)&&!(null===(u=null===(s=null==a?void 0:a.messages)||void 0===s?void 0:s.moderation)||void 0===u?void 0:u.type)?t(a):"banned"===(null===(f=null===(d=null==a?void 0:a.messages)||void 0===d?void 0:d.moderation)||void 0===f?void 0:f.type)?(y({title:x("notification.comment.blocked.title"),message:x("notification.comment.blocked.message"),type:"danger"}),a.messages.moderation.words&&te(a.messages.moderation.words)):"suspect"===(null===(C=null===(h=null==a?void 0:a.messages)||void 0===h?void 0:h.moderation)||void 0===C?void 0:C.type)?(y({title:x("notification.comment.suspect.title"),message:x("notification.comment.suspect.message"),type:"warning"}),W(""),B(),c&&c()):(null===(w=null==a?void 0:a.messages)||void 0===w?void 0:w.find((function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(y({message:x("notification.suspend.message"),type:"warning"}),W(""),B(),c&&c()):y({title:"",message:(null===(E=null==a?void 0:a.messages)||void 0===E?void 0:E[0])||x("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 4:return _.sent(),y({title:"",message:x("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 5:return q(!1),[2]}}))}))},isLoading:G,isDisabled:!!(null==$?void 0:$.length)||G||!U||(null==U?void 0:U.length)<2||!U.trim()},f.default.createElement("img",{src:"data:image/svg+xml,%3csvg width='20' height='21' viewBox='0 0 20 21' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 9.73438L3.75 13.4844L7.5 17.2344' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M16.25 4.73438L16.25 10.3026C16.25 11.1464 15.9208 11.9557 15.3347 12.5524C14.7487 13.1491 13.9538 13.4844 13.125 13.4844L3.75 13.4844' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",className:"icon-enter"}))),(null==$?void 0:$.length)?f.default.createElement("div",{className:"error-text"},x("notification.limitUrlDomain")):null,(!R||0===R.length)&&ae&&f.default.createElement("div",{className:"link-preview-wrapper"},ae.isFetching?f.default.createElement(i.Loading,null):f.default.createElement(f.default.Fragment,null,f.default.createElement(C,{title:ae.title,url:ae.url||"#",image:ae.image,noRefetch:!0}),f.default.createElement("img",{src:I,className:"icon-close",onClick:function(){return oe(null)}}))),R&&R.length>0&&f.default.createElement("div",{className:"preview-images-container"},R.map((function(e,t){return f.default.createElement("div",{key:t,className:"image-src-wrapper"},f.default.createElement("img",{className:"preview-image",src:e}),f.default.createElement("img",{src:I,className:"icon-close-circle",onClick:function(){return L(t)}}))}))))},z="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14C11.3137 14 14 11.3137 14 8C14 4.68629 11.3137 2 8 2C4.68629 2 2 4.68629 2 8C2 11.3137 4.68629 14 8 14Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 5V8' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11H8.00708' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",V=function(a){var r=a.className,s=a.style,c=a.reason,u=a.reasonText,d=a.onClose,m=a.postId,p=t.useContext(i.TogetherComponentGlobalContext),v=p.data,g=v.locale,h=v.env.isMarryBaby,C=p.action.pushNotifications,w=o.useTranslations().t,E=t.useState(!1),y=E[0],k=E[1];return f.default.createElement(i.StyledSubmitReportForm,{"data-is-marrybaby":h,className:r,style:s},f.default.createElement("ul",{className:"report-list"},f.default.createElement("li",{className:"report-item"},f.default.createElement("img",{src:z}),f.default.createElement(n.Text,{className:"__label",color:l.theme.colors.gray800,size:"p4"},u))),f.default.createElement(n.Button,{theme:h?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:y,onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:if(!m||y)return[2];k(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,x({id:m,reason:c,locale:g})];case 2:return 1===(null==(t=e.sent())?void 0:t.status)&&(C({message:"Post reported",type:"success"}),d&&d()),[3,4];case 3:return e.sent(),[3,4];case 4:return k(!1),[2]}}))}))}},w("submit")))},G=function(e){var n=e.className,a=e.style,l=e.replyingTo,r=e.mentionedUser,s=e.description,c=e.disableShortenContent,u=e.mentions,d=void 0===u?[]:u,m=t.useState(!1),p=m[0],v=m[1],g=o.useTranslations().t,h=i.useTogetherAuthRequiredAction().authActionWrapper,C=t.useState(!1),w=C[0],E=C[1],y=i.decodeMention(i.decodePostUrl(s||"","display"),d),k=t.useContext(i.TogetherComponentGlobalContext).action.sanitizeFunction,_=t.useMemo((function(){var e=k(y||"");if(c||p)return{showContent:e,hasSeeMore:!1};var t=e.slice(0,200),n=200-27*((t.match(/<\/div>/g)||[]).length-1),a=(t||"").slice(0,n<40?40:n),o=k(a.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),i=o.length<e.length-10;return{showContent:i?o:e,hasSeeMore:i}}),[c,p,y]),b=(null==r?void 0:r.name)||l,T="expert"===(null==r?void 0:r.role)&&!!(null==r?void 0:r.partnerId);return f.default.createElement(f.default.Fragment,null,T&&f.default.createElement(i.PopupExpert,{isOpen:w,onClose:function(){return E(!1)},expertId:String(null==r?void 0:r.partnerId)}),f.default.createElement(i.StyledPostContent,{className:"".concat(n," no-replace-click"),style:a},b&&f.default.createElement("span",{onClick:function(){return T&&E(!0)},className:"post-content-replying"},"@",b),(null==s?void 0:s.startsWith("[mention+id="))&&f.default.createElement("span",{className:"post-content-replying tag-only"},"@"),f.default.createElement("span",{dangerouslySetInnerHTML:{__html:_.showContent},className:"post-content ".concat(_.hasSeeMore?"has-see-more":"")}),_.hasSeeMore&&!p&&f.default.createElement("span",null,"... ",f.default.createElement("span",{onClick:function(e){e.preventDefault(),e.stopPropagation(),h((function(){return v(!0)}))},className:"see-more-text"},g("post.seeMore")))))},q=function(e){var a=e.className,l=e.style,r=e.authorName,s=e.images,c=e.onClose,u=e.onOpenSingleView,d=o.useTranslations().t,m=t.useState(!1),p=m[0],v=m[1];return t.useEffect((function(){setTimeout((function(){v(!0)}),0)}),[]),g.createPortal(f.default.createElement(i.StyledImagePreviewPopup,{className:a,style:l,"data-open":p},f.default.createElement("div",{className:"top-bar"},f.default.createElement("img",{className:"icon-arrow-left",src:"data:image/svg+xml,%3csvg width='24' height='25' viewBox='0 0 24 25' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10.0508 18.0607L4.00078 12.0367L10.0508 6.01172' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4.00195 12.0352L19.002 12.0352' stroke='%23262626' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",onClick:c,alt:"go back"}),f.default.createElement(n.Text,{size:"p2",type:"bold",style:{textAlign:"center"}},d("previewPhotos.title",{name:r}))),f.default.createElement("div",{className:"container"},s.map((function(e,t){return f.default.createElement("img",{className:"img-preview",key:t,src:e,onClick:function(){return null==u?void 0:u(t)},alt:"post img"})})))),document.body)},Z="data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12.8125L10 8.8125L6 4.8125' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",K=function(e){var n=e.initialViewIndex,a=e.images,o=e.onClose,l=t.useState(n),r=l[0],s=l[1],c=t.useState(!1),u=c[0],d=c[1];t.useEffect((function(){setTimeout((function(){d(!0)}),0)}),[]);var m=null==a?void 0:a[r],p=0===r,v=!(null==a?void 0:a.length)||r===(null==a?void 0:a.length)-1;return g.createPortal(f.default.createElement(i.StyledImagePreviewContainer,{"data-open":u&&!!m},f.default.createElement(i.StyledImagePreviewTopbar,null,f.default.createElement("img",{src:i.img,className:"icon-close",onClick:o,alt:"close"})),m&&r>=0&&f.default.createElement(f.default.Fragment,null,f.default.createElement(i.StyledImagePreviewWrapper,null,f.default.createElement("img",{className:"img-preview",src:m,alt:"post img open"}),f.default.createElement(i.StyledArrowWrapper,{"data-disabled":p,onClick:function(){return!p&&s(r-1)}},f.default.createElement(i.StyledCircleArrow,null,f.default.createElement("img",{src:Z,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":p}))),f.default.createElement(i.StyledArrowWrapper,{"data-right":!0,"data-disabled":v,onClick:function(){return!v&&s(r+1)}},f.default.createElement(i.StyledCircleArrow,null,f.default.createElement("img",{src:Z,alt:"right arrow","data-disabled":v})))))),document.body)},Q=function(e){var n=e.className,a=e.images,l=void 0===a?[]:a,r=e.style,s=e.authorName,c=t.useContext(i.TogetherComponentGlobalContext).data.env.isMarryBaby,m="+ ".concat((l.length||0)-4),p=t.useState(!1),v=p[0],g=p[1],h=t.useState(-1),C=h[0],w=h[1];t.useEffect((function(){setTimeout((function(){return null===d.lazyLoadInstance||void 0===d.lazyLoadInstance?void 0:d.lazyLoadInstance.update()}),100)}),[null==l?void 0:l.slice(0,5).join("|")]);var E=l.length>5,y=t.useRef(!1);return t.useEffect((function(){return function(){y.current&&o.toggleNoScroll(!1)}}),[]),t.useEffect((function(){v||C>=0?(o.toggleNoScroll(!0),y.current=!0):(o.toggleNoScroll(!1),y.current=!1)}),[v,C]),f.default.createElement(f.default.Fragment,null,f.default.createElement(i.StyledPostImagePreview,{className:n,style:r,"data-image-count":E?5:l.length||0,"data-is-marrybaby":c},null==l?void 0:l.slice(0,5).map((function(e,t){return f.default.createElement("div",{className:"img-wrapper",key:t,onClick:function(){t>=4&&E?g(!0):w(t)}},!c&&f.default.createElement("img",{className:"lazy img-preview-blur","data-src":e}),f.default.createElement("img",{className:"lazy img-preview","data-src":e}),4===t&&E&&f.default.createElement("div",{className:"img-more-overlay"},f.default.createElement(u.Heading,{tag:"h1",color:"white"},m)))}))),v&&f.default.createElement(q,{authorName:s||"",images:l,onClose:function(){return g(!1)},onOpenSingleView:w}),C>=0&&f.default.createElement(K,{images:l,initialViewIndex:C,onClose:function(){return w(-1)}}))},X=function(n){var a=n.url,o=n.image,l=n.className,r=n.style,s=t.useContext(i.TogetherComponentGlobalContext).data.locale,c=t.useState(null),u=c[0],d=c[1];t.useEffect((function(){e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(t){return o?[2]:a?(d((function(t){return e.__assign(e.__assign({},t),{isFetching:!0})})),i.callApi(i.getApiPath(i.PATHS.FETCH_PREVIEW,{_locale:s}),"POST",{data:{link:a}}).then((function(e){var t,n;d({url:a,image:(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.image)||(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.logo)})})).catch((function(){d(null)})),[2]):[2,d(null)]}))}))}),[a,o]);var m=(null==u?void 0:u.image)||o,p=(null==u?void 0:u.url)||a,v=t.useMemo((function(){return i.youtubeVidIdGetter(p)}),[p]),g=t.useMemo((function(){return i.facebookVidIdGetter(p)}),[p]),h=t.useRef(0),C=t.useRef(0),w=t.useState(!1),E=w[0],y=w[1];t.useEffect((function(){var e=function(){var e,t=null===(e=k.current)||void 0===e?void 0:e.getBoundingClientRect(),n=!1;t&&(!h.current||Math.abs((h.current-t.width)/(null==t?void 0:t.width))>.2)&&(h.current=Math.floor(t.width),n=!0),t&&(!C.current||Math.abs((C.current-t.height)/(null==t?void 0:t.height))>.2)&&(C.current=Math.floor(t.height),n=!0),n&&y((function(e){return!e}))};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var k=t.useRef(null),_=t.useRef(!1);return f.default.createElement(i.StyledSocialLinkPreview,{className:"".concat(l," no-replace-click"),style:r,ref:k},o||!v&&!g?f.default.createElement("a",{href:p,target:"_blank",rel:"noreferrer"},f.default.createElement("div",{className:"link-image-wrapper ".concat((null==u?void 0:u.isFetching)?"fetching":"")},(null==u?void 0:u.isFetching)?f.default.createElement(i.Loading,{className:"loading-spinner"}):f.default.createElement("img",{className:"link-image",src:m||i.DEFAULT_IMG,onError:function(e){_.current||(_.current=!0,e.currentTarget.src=i.DEFAULT_IMG)}}))):f.default.createElement("div",{className:"link-image-wrapper"},v?f.default.createElement("iframe",{width:"100%",height:"100%",src:"https://www.youtube.com/embed/".concat(v,"?&autoplay=1&mute=1"),frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"}}):g?f.default.createElement("iframe",{key:String(E),src:"https://www.facebook.com/plugins/video.php?href=".concat(encodeURIComponent(p),"&autoplay=1&show_text=false&t=0&width=").concat(h.current,"&height=").concat(C.current),style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:C.current,width:h.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"}):null))},$="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M5 10C3.9 10 3 10.9 3 12C3 13.1 3.9 14 5 14C6.1 14 7 13.1 7 12C7 10.9 6.1 10 5 10Z' fill='%233E3F58'/%3e %3cpath d='M19 10C17.9 10 17 10.9 17 12C17 13.1 17.9 14 19 14C20.1 14 21 13.1 21 12C21 10.9 20.1 10 19 10Z' fill='%233E3F58'/%3e %3cpath d='M12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z' fill='%233E3F58'/%3e %3c/svg%3e",J="data:image/svg+xml,%3csvg width='3' height='13' viewBox='0 0 3 13' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='1.58326' cy='6.41663' r='1.25' transform='rotate(89.9997 1.58326 6.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='1.41663' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 1.41663)' fill='%23595959'/%3e%3cellipse cx='1.58326' cy='11.4166' rx='1.25' ry='1.25' transform='rotate(89.9997 1.58326 11.4166)' fill='%23595959'/%3e%3c/svg%3e",Y="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 4H3.33333H14' stroke='%23737373' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33334 3.99992V2.66659C5.33334 2.31296 5.47382 1.97382 5.72387 1.72378C5.97392 1.47373 6.31305 1.33325 6.66668 1.33325H9.33334C9.68697 1.33325 10.0261 1.47373 10.2762 1.72378C10.5262 1.97382 10.6667 2.31296 10.6667 2.66659V3.99992M12.6667 3.99992V13.3333C12.6667 13.6869 12.5262 14.026 12.2762 14.2761C12.0261 14.5261 11.687 14.6666 11.3333 14.6666H4.66668C4.31305 14.6666 3.97392 14.5261 3.72387 14.2761C3.47382 14.026 3.33334 13.6869 3.33334 13.3333V3.99992H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66666 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33334 7.33325V11.3333' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ee=function(n){var a=n.onDeleteComment,l=n.commentId,r=n.className,s=void 0===r?"":r,c=n.popoverClassName,u=void 0===c?"":c,d=t.useContext(i.TogetherComponentGlobalContext),m=d.data,p=m.env.isMarryBaby,v=m.locale,g=d.action.pushNotifications,h=o.useTranslations().t,C=t.useState(!1),w=C[0],E=C[1],y=i.useTogetherAuthRequiredAction().authActionWrapper;return f.default.createElement("div",{className:s,onClick:function(e){e.preventDefault(),e.stopPropagation()}},w&&f.default.createElement(j,{thumbnail:"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0)'%3e%3cpath d='M2 4.00781H3.33333H14' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.33337 4.00846V2.67513C5.33337 2.32151 5.47385 1.98237 5.7239 1.73232C5.97395 1.48227 6.31309 1.3418 6.66671 1.3418H9.33337C9.687 1.3418 10.0261 1.48227 10.2762 1.73232C10.5262 1.98237 10.6667 2.32151 10.6667 2.67513V4.00846M12.6667 4.00846V13.3418C12.6667 13.6954 12.5262 14.0346 12.2762 14.2846C12.0261 14.5347 11.687 14.6751 11.3334 14.6751H4.66671C4.31309 14.6751 3.97395 14.5347 3.7239 14.2846C3.47385 14.0346 3.33337 13.6954 3.33337 13.3418V4.00846H12.6667Z' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M6.66663 7.3418V11.3418' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M9.33337 7.3418V11.3418' stroke='%23737373' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0'%3e%3crect width='16' height='16' fill='white' transform='translate(0 0.0078125)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",isThumbnailIcon:!0,title:h("popup.deleteComment.title"),description:h("popup.deleteComment.description"),acceptText:h("popup.deletePost.accept"),cancelText:h("popup.deletePost.cancel"),onAccept:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,n;return e.__generator(this,(function(e){switch(e.label){case 0:return l?[4,U({id:l,locale:v})]:[2];case 1:return 1===(null==(t=e.sent())?void 0:t.status)?(a&&a(),g({title:"",message:h("notification.success"),type:"success"})):g({title:"",message:(null===(n=null==t?void 0:t.messages)||void 0===n?void 0:n[0])||h("notification.failure"),type:"danger"}),[2]}}))}))},onClose:function(){return E(!1)}}),f.default.createElement(i.TreePopoverMenu,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:Y,label:h("actionPopover.delete"),onClick:function(){y((function(){E(!0)}))}}]},className:u,toggleButtonContent:f.default.createElement("img",{src:p?$:J}),buttonProps:{}}))},te=function(l){var r,s,c,u,d,p=l.className,v=l.style,g=l.comment,h=l.type,w=void 0===h?"comment":h,E=l.level,y=void 0===E?0:E,k=l.replyingId,_=l.onPostCommentSuccess,b=l.post,T=l.onDeleteComment,S=l.refetchComment,P=l.hasQuickBookingEnable,x=l.handleMakeAppointment,N=t.useContext(i.TogetherComponentGlobalContext).data,I=N.locale,A=N.userInfo,M=N.env.isMarryBaby,L=o.useTranslations().t,R=t.useState(g||null),B=R[0],j=R[1],F=B.id;B.countReplies;var D=B.countLikes,O=B.content,U=B.createdAt,z=B.replies,V=void 0===z?[]:z,q=B.images,Z=void 0===q?[]:q,K=B.author,X=B.liked,$=B.link,J=B.mentionedUser,Y=B.mentions,ne=function(e){try{var t=e.match(/\[@([^\]]+)\]/),n=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:n}}catch(e){}return{text:""}}(O),ae=ne.text,oe=ne.replyingTo,ie=i.useTogetherAuthRequiredAction({_joinCommunityIds:[null===(r=null==b?void 0:b.community)||void 0===r?void 0:r.id],_joinTopicIds:null===(s=null==b?void 0:b.topics)||void 0===s?void 0:s.map((function(e){return e.id}))}).authActionWrapper,le=t.useState(4),re=le[0],se=le[1],ce=!!(null==A?void 0:A.id)&&(null==V?void 0:V.some((function(e){return e.author.id===A.id}))),ue=function(t){j((function(n){n.replies.unshift(t);var a=e.__assign(e.__assign({},n),{replies:n.replies.slice(),countReplies:n.countReplies+1});return S&&S(a),a}))},de=t.useState(!1),me=de[0],pe=de[1],ve=t.useMemo((function(){return"comment"===w&&V&&0!=V.length?V.sort((function(e,t){var n=new Date(e.createdAt).getTime(),a=new Date(t.createdAt).getTime();return n>a?-1:n<a?1:0})):V}),[w,V]),fe=(null==V?void 0:V.length)||0,ge=String(null==K?void 0:K.email)&&(null==A?void 0:A.email)&&String(null==K?void 0:K.email)===String(null==A?void 0:A.email),he=(null==K?void 0:K.name)||(null==K?void 0:K.username)||"",Ce=null==K?void 0:K.avatar,we=(null==K?void 0:K.username)||(null==K?void 0:K.name)||"",Ee=t.useState(null),ye=Ee[0],ke=Ee[1],_e=t.useState(null),be=_e[0],Te=_e[1];t.useEffect((function(){if(null==K?void 0:K.hospitalId){t=K.hospitalId,e.__awaiter(void 0,void 0,void 0,(function(){var n,a;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,i.callApi(i.getCarePath(i.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:m.domainLocales[I]}),"get")];case 1:return n=e.sent(),(null===(a=null==n?void 0:n._data)||void 0===a?void 0:a.branch)&&ke(null==n?void 0:n._data.branch),[2]}}))}))}var t,n;if(null==K?void 0:K.doctorId){n=K.doctorId,e.__awaiter(void 0,void 0,void 0,(function(){var t,a;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,i.callApi(i.getCarePath(i.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:n,website_url:m.domainLocales[I]}),"get")];case 1:return t=e.sent(),(null===(a=null==t?void 0:t._data)||void 0===a?void 0:a.doctor)&&Te(null==t?void 0:t._data.doctor),[2]}}))}))}}),[K.hospitalId,K.doctorId]);var Se=(null==be?void 0:be.valid_outpatient)||(null==be?void 0:be.valid_telemedicine),Pe=((null==ye?void 0:ye.total_available_service)||(null==ye?void 0:ye.total_available_doctor))>0,xe=P&&(Se||Pe);return f.default.createElement(i.TogetherAuthConfigContextProvider,{defaultParams:{_joinCommunityIds:[null===(c=null==b?void 0:b.community)||void 0===c?void 0:c.id],_joinTopicIds:null===(u=null==b?void 0:b.topics)||void 0===u?void 0:u.map((function(e){return e.id}))}},f.default.createElement(i.StyledCardPost,{className:p,style:v,"data-is-reply":!!y,"data-is-marrybaby":M,"data-has-booking":xe},"reply"===w&&f.default.createElement(a.Divider,{className:"top-divider",type:"solid"}),f.default.createElement(i.CardAuthor,{avatar:Ce,name:he,username:we,email:null==K?void 0:K.email,time:U,className:"post-author ".concat(ge?"with-popover":""),type:w,userId:null==K?void 0:K.id,role:null==K?void 0:K.role,expertId:null==K?void 0:K.partnerId,title:null==K?void 0:K.title,doctorId:null==K?void 0:K.doctorId,hospitalId:null==K?void 0:K.hospitalId,hasQuickBooking:xe,handleMakeAppointment:x}),f.default.createElement(G,{className:"post-content-wrapper",replyingTo:oe,mentionedUser:J,description:ae,mentions:Y}),f.default.createElement("span",null),f.default.createElement("span",null),Z&&Z.length>0?f.default.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},f.default.createElement(Q,{images:Z,authorName:null==K?void 0:K.username})):null,Z&&0!==Z.length||!$?null:f.default.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},f.default.createElement(C,{url:$})),"most-engaging"!==w?f.default.createElement(f.default.Fragment,null,f.default.createElement(i.CardReactions,{type:i.CardReactionType.reply,loveCount:D,replyCount:fe,className:"post-reaction",liked:X,isReplied:ce,hideCommentIcon:"reply"===w,onCommentClick:function(){return ie((function(){return pe((function(e){return!e}))}))},onCommentCountClick:function(){return ie((function(){pe(!0)}))},onLikeClick:function(){return ie((function(){return e.__awaiter(void 0,void 0,void 0,(function(){return e.__generator(this,(function(t){switch(t.label){case 0:return F?[4,H({commentId:F,setLike:!X,locale:I})]:[3,2];case 1:1===t.sent().status&&j((function(t){return e.__assign(e.__assign({},t),{liked:!X,countLikes:t.countLikes+(X?-1:1)})})),t.label=2;case 2:return[2]}}))}))}))}}),me&&f.default.createElement(W,{replyingId:k||B.id,replyToName:K.name||K.username||"",isReply:!0,onClose:function(){return pe(!1)},onPostSuccess:function(e){"reply"===w?_&&_(e):ue(e)},post:b,replyingUser:K}),"comment"===w&&V&&V.length>0?f.default.createElement("div",{className:"comment-reply-wrapper"},null===(d=null==ve?void 0:ve.slice(0,re))||void 0===d?void 0:d.map((function(t){return f.default.createElement(te,{key:t.id,comment:t,type:"reply",className:"comment-reply-item",level:y+1,replyingId:F,onPostCommentSuccess:ue,post:b,onDeleteComment:function(){j((function(n){return e.__assign(e.__assign({},n),{replies:n.replies.filter((function(e){return e.id!==t.id})),countReplies:n.countReplies-1})}))},handleMakeAppointment:x,hasQuickBookingEnable:P})})),fe>re&&f.default.createElement(f.default.Fragment,null,f.default.createElement(a.Divider,{className:"top-divider",type:"solid"}),f.default.createElement(n.Button,{className:"more-cmt",size:"lg",color:"ghost",onClick:function(){return se((function(e){return e+4}))}},L("comment.seeMoreReplies",{count:fe-re}),f.default.createElement("img",{className:"chevron-right",src:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6 12L10 8L6 4' stroke='%232D87F3' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e"})))):null):null,ge&&f.default.createElement(ee,{onDeleteComment:T,className:"popover",commentId:B.id})))},ne="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='%23595959' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ae="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 13.3334L8 10.3704L4 13.3334V3.85187C4 3.53754 4.12041 3.23608 4.33474 3.01382C4.54906 2.79155 4.83975 2.66669 5.14286 2.66669H10.8571C11.1602 2.66669 11.4509 2.79155 11.6653 3.01382C11.8796 3.23608 12 3.53754 12 3.85187V13.3334Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",oe="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 5.33337C13.1046 5.33337 14 4.43794 14 3.33337C14 2.2288 13.1046 1.33337 12 1.33337C10.8954 1.33337 10 2.2288 10 3.33337C10 4.43794 10.8954 5.33337 12 5.33337Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M4 10C5.10457 10 6 9.10457 6 8C6 6.89543 5.10457 6 4 6C2.89543 6 2 6.89543 2 8C2 9.10457 2.89543 10 4 10Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M12 14.6666C13.1046 14.6666 14 13.7712 14 12.6666C14 11.5621 13.1046 10.6666 12 10.6666C10.8954 10.6666 10 11.5621 10 12.6666C10 13.7712 10.8954 14.6666 12 14.6666Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M5.72668 9.00665L10.28 11.66' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M10.2734 4.33997L5.72668 6.9933' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",ie=function(n){var a=n.authorEmail,l=n.onDeletePost,r=n.shareUrl,s=n.post,c=n.className,u=void 0===c?"":c,d=n.popoverClassName,m=void 0===d?"":d,p=n.onBookmark,v=n.onRemoveBookmark,g=n.onEditPost,h=t.useContext(i.TogetherComponentGlobalContext),C=h.data,w=C.locale,E=C.userInfo,y=C.togetherUserId,k=C.env.isMarryBaby,_=h.action.pushNotifications,T=o.useTranslations().t,S=t.useState(!1),P=S[0],x=S[1],N=t.useState(!1),I=N[0],A=N[1],M=t.useState(!1),L=M[0],R=M[1],B=i.useTogetherAuthRequiredAction().authActionWrapper,F=a&&(null==E?void 0:E.email)&&a===String(null==E?void 0:E.email);return f.default.createElement("div",{className:u,onClick:function(e){e.preventDefault(),e.stopPropagation()}},L&&f.default.createElement(i.SharePopup,{url:r,text:null==s?void 0:s.title,onClose:function(){return R(!1)}}),I&&f.default.createElement(j,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:T("popup.deletePost.title"),description:T("popup.deletePost.description"),acceptText:T("popup.deletePost.accept"),cancelText:T("popup.deletePost.cancel"),onAccept:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:if(!(null==s?void 0:s.id)||P)return[2];x(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,b({id:s.id,locale:w})];case 2:return 1===(null==(t=e.sent())?void 0:t.status)&&(null==l||l()),[3,4];case 3:return e.sent(),[3,4];case 4:return x(!1),[2]}}))}))},onClose:function(){return A(!1)}}),f.default.createElement(i.TreePopoverMenu,{className:m,toggleButtonContent:f.default.createElement("img",{src:k?$:J}),position:"bottom",align:"end",buttonProps:{isLoading:P},data:F?{isShowheader:!1,type:"list",list:[{icon:oe,label:T("morePopover.share"),onClick:function(){return R(!0)}},{icon:"data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.16952 3.2356H2.99484C2.6785 3.2356 2.37512 3.36126 2.15143 3.58495C1.92774 3.80863 1.80208 4.11202 1.80208 4.42836V12.7777C1.80208 13.094 1.92774 13.3974 2.15143 13.6211C2.37512 13.8448 2.6785 13.9705 2.99484 13.9705H11.3442C11.6605 13.9705 11.9639 13.8448 12.1876 13.6211C12.4113 13.3974 12.537 13.094 12.537 12.7777V8.60303' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M11.6425 2.341C11.8798 2.10375 12.2016 1.97046 12.5371 1.97046C12.8726 1.97046 13.1944 2.10375 13.4317 2.341C13.6689 2.57826 13.8022 2.90005 13.8022 3.23558C13.8022 3.57111 13.6689 3.89289 13.4317 4.13015L7.76607 9.79578L5.38054 10.3922L5.97692 8.00663L11.6425 2.341Z' stroke='%23595959' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e",label:T("actionPopover.edit"),onClick:g},{icon:Y,label:T("actionPopover.delete"),onClick:function(){B((function(){return A(!0)}))}}]}:{isShowheader:!1,type:"list",list:[{icon:oe,label:T("morePopover.share"),onClick:function(){return R(!0)}},{icon:(null==s?void 0:s.bookmarked)?ne:ae,label:(null==s?void 0:s.bookmarked)?T("morePopover.unsavePost"):T("morePopover.savePost"),onClick:function(){B((function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return(null==E?void 0:E.id)&&(null==s?void 0:s.id)?(null==s?void 0:s.bookmarked)?[4,i.callApiWithAuth(i.getApiPath(i.PATHS.BOOKMARK.DELETE,{_locale:w}),"DELETE",{data:{post_id:String(s.id)}})]:[3,2]:[2];case 1:return 1===(null==(t=e.sent())?void 0:t.status)?(_({title:"",message:"Removed saved post",type:"success",displayIcon:ae}),v&&v()):_({title:"",message:"Remove failed",type:"danger",displayIcon:ae}),[3,4];case 2:return[4,i.callApiWithAuth(i.getApiPath(i.PATHS.BOOKMARK.CREATE,{_locale:w}),"POST",{data:{user_id:y||E.id,post_id:s.id}})];case 3:1===(null==(t=e.sent())?void 0:t.status)?(_({title:"",message:"Post saved",type:"success",displayIcon:ne}),p&&p()):_({title:"",message:"Post saved failed",type:"danger",displayIcon:ae}),e.label=4;case 4:return[2]}}))}))}))}},{icon:z,label:T("morePopover.report"),subTree:{title:T("morePopover.report.title"),description:T("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(i.REPORT_REASON_MAP).map((function(e){return{label:i.REPORT_REASON_MAP[e].label,reason:i.REPORT_REASON_MAP[e].reportReasonText,reasonValue:e}})).map((function(e){return{label:T(e.label),subTree:{title:T("morePopover.reportSubmit.title"),description:T("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:function(t){return f.default.createElement(V,{reason:e.reasonValue,reasonText:T(e.reason),postId:null==s?void 0:s.id,onClose:function(){return t&&t(!1)}})}}}}))}}]}}))},le=function(t,n){return e.__awaiter(void 0,void 0,void 0,(function(){var a,o,l,r;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,i.callApiWithOptionalAuth(i.getApiPath(i.PATHS.COMMENT.LIST,{postId:t,_locale:n,sort:"popularity",perPage:1,withoutReply:1}),"GET")];case 1:return a=e.sent(),[2,null===(r=null===(l=null===(o=null==a?void 0:a.data)||void 0===o?void 0:o.comments)||void 0===l?void 0:l.map(i.formatComment))||void 0===r?void 0:r[0]]}}))}))},re=Object.freeze({__proto__:null});exports.CardLink=C,exports.CardPost=function(a){var l=a.className,r=a.style,s=a.hideViewMoreComment,c=a.showMostEngaging,d=a.onCommentClick,m=a.onCommentCountClick,p=a.onMostEngagingCommentClick,v=a.onPostCommentSuccess,g=a.disableCardLink,h=a.disableShortenContent,k=a.onDeletePost,b=a.onEditPost,T=a.post,S=a.mostEngagingComment,P=a.onDeleteComment,x=a.showInputComment,N=a.InlineCommentsComponent,I=a.hasQuickBookingEnable,A=a.handleMakeAppointment,M=t.useState(T),L=M[0],R=M[1],B=t.useState(!1),j=B[0],F=B[1],D=t.useState(S),O=D[0],H=D[1],U=L.community,z=L.topics,V=L.author,q=L.slug,Z=L.isPin,K=L.liked,$=L.scheduleDateTime,J=L.createdAt,Y=L.photos,ee=L.mentions,ne=L.title,ae=L.description,oe=L.previewUrl,re=L.likesCount,se=L.commentsCount,ce=L.id,ue=L.commented,de=t.useContext(i.TogetherComponentGlobalContext),me=de.data,pe=me.locale,ve=me.env,fe=ve.isMarryBaby,ge=ve.togetherBasePath,he=de.action.pushNotifications,Ce=o.useTranslations().t,we=t.useState(x),Ee=we[0],ye=we[1],ke="".concat(ge,"/").concat((null==U?void 0:U.slug)||"_","/").concat(q||""),_e="".concat(i.getCurrentBaseUrl(pe)).concat(ke),be=i.useTogetherAuthRequiredAction((null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==z?void 0:z.map((function(e){return e.id}))}:void 0).authActionWrapper,Te=t.useState(!1),Se=Te[0],Pe=Te[1];t.useEffect((function(){ye(x)}),[x]);var xe=(null==V?void 0:V.name)||(null==V?void 0:V.username)||"",Ne=(null==V?void 0:V.username)||(null==V?void 0:V.name)||"",Ie=null==V?void 0:V.avatar,Ae=t.useState(null),Me=Ae[0],Le=Ae[1],Re=t.useState(null),Be=Re[0],je=Re[1];t.useEffect((function(){if(null==V?void 0:V.hospitalId){t=V.hospitalId,e.__awaiter(void 0,void 0,void 0,(function(){var n,a;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,i.callApi(i.getCarePath(i.CARE_PATHS.GET_HOSPITAL_INFO,{hospital_branch_id:t,website_url:i.domainLocales[pe]}),"get")];case 1:return n=e.sent(),(null===(a=null==n?void 0:n._data)||void 0===a?void 0:a.branch)&&Le(null==n?void 0:n._data.branch),[2]}}))}))}var t,n;if(null==V?void 0:V.doctorId){n=V.doctorId,e.__awaiter(void 0,void 0,void 0,(function(){var t,a;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,i.callApi(i.getCarePath(i.CARE_PATHS.GET_DOCTOR_INFO,{doctorId:n,website_url:i.domainLocales[pe]}),"get")];case 1:return t=e.sent(),(null===(a=null==t?void 0:t._data)||void 0===a?void 0:a.doctor)&&je(null==t?void 0:t._data.doctor),[2]}}))}))}}),[V.hospitalId,V.doctorId]);var Fe=(null==Be?void 0:Be.valid_outpatient)||(null==Be?void 0:Be.valid_telemedicine),De=((null==Me?void 0:Me.total_available_service)||(null==Me?void 0:Me.total_available_doctor))>0,Oe=I&&(Fe||De);t.useEffect((function(){e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:return ce&&se&&c&&!(null==S?void 0:S.id)?[4,le(ce,pe)]:[3,2];case 1:t=e.sent(),H(t),e.label=2;case 2:return[2]}}))}))}),[ce,pe,se,c,null==S?void 0:S.id]),t.useEffect((function(){H(S)}),[null==S?void 0:S.id]);var He=function(t){return e.__awaiter(void 0,void 0,void 0,(function(){var n;return e.__generator(this,(function(a){switch(a.label){case 0:return se>1&&(null==O?void 0:O.id)&&(null==O?void 0:O.id)===(null==t?void 0:t.id)?[4,le(ce,pe)]:[3,2];case 1:n=a.sent(),H(n),a.label=2;case 2:return R((function(t){return e.__assign(e.__assign({},t),{commentsCount:t.commentsCount-1})})),P&&P(t),[2]}}))}))};return f.default.createElement(i.TogetherAuthConfigContextProvider,{defaultParams:(null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==z?void 0:z.map((function(e){return e.id}))}:void 0},j&&f.default.createElement(i.SharePopup,{url:_e,avatar:i.DEFAULT_IMG,text:ne,onClose:function(){return F(!1)}}),f.default.createElement(i.StyledCardPost$1,{className:l,style:r,"data-is-marrybaby":fe},Z?f.default.createElement(E,{className:"post-pin"}):null,f.default.createElement("div",{style:{position:"relative"}},f.default.createElement(i.CardAuthor,{avatar:Ie,name:xe,username:Ne,url:g?void 0:ke,email:null==V?void 0:V.email,time:$||J,community:U,className:"post-author",role:null==V?void 0:V.role,userId:null==V?void 0:V.id,expertId:null==V?void 0:V.partnerId,doctorId:null==V?void 0:V.doctorId,hospitalId:null==V?void 0:V.hospitalId,title:null==V?void 0:V.title,hasQuickBooking:Oe,handleMakeAppointment:A}),f.default.createElement(ie,{authorEmail:String(null==V?void 0:V.email),onDeletePost:k,shareUrl:_e,post:L,className:"popover",onEditPost:b})),f.default.createElement("a",{href:g?void 0:ke,className:"post-content-link-wrapper"},ne&&f.default.createElement(u.Heading,{className:"post-content-title",as:"h1",tag:"h5",fontWeight:"bold"},i.innertext_1(ne)),f.default.createElement(G,{className:"post-content-wrapper",description:ae,disableShortenContent:h,mentions:ee})),f.default.createElement("span",null),f.default.createElement("span",null),f.default.createElement("div",{key:"tag-topic"},z&&z.length>0?f.default.createElement(w,{topics:z,className:"post-topics"}):null),f.default.createElement("div",{key:"social-preview"},(null==L?void 0:L.introUrl)?f.default.createElement("div",{className:"social-preview-wrapper ".concat((null==Y?void 0:Y.length)?"has-image":"")},f.default.createElement(X,{url:L.introUrl,image:L.bannerImage})):null),f.default.createElement("div",{key:"image-preview"},(null==Y?void 0:Y.length)?f.default.createElement("div",{className:"image-preview-wrapper"},f.default.createElement(Q,{images:Y,authorName:null==V?void 0:V.name})):null),f.default.createElement("div",{key:"link-preview"},(null==L?void 0:L.introUrl)||(null==Y?void 0:Y.length)||!(null==oe?void 0:oe.url)?null:f.default.createElement("div",{className:"link-preview-wrapper"},f.default.createElement(C,{title:oe.title,url:oe.url,image:oe.image}))),f.default.createElement(i.CardReactions,{type:i.CardReactionType.post,loveCount:re,replyCount:se,className:"post-reaction ".concat((null==Y?void 0:Y.length)||(null==oe?void 0:oe.url)?"hide-top-border":""),liked:Se?!K:K,isReplied:ue,onCommentClick:function(){return be((function(){d?d():ye((function(e){return!e}))}))},onCommentCountClick:function(){be((function(){fe?ye(!0):m?m():!g&&(window.location.href=ke)}))},onShareClick:function(){F(!0)},onLikeClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(n){switch(n.label){case 0:if(!ce||Se)return[2];Pe(!0),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,_({id:ce,locale:pe})];case 2:return 1!==(null==(t=n.sent())?void 0:t.status)?he(y(Ce)):R((function(t){return e.__assign(e.__assign({},t),{likesCount:(t.likesCount||0)+(t.liked?-1:1),liked:!t.liked})})),[3,4];case 3:return n.sent(),he(y(Ce)),[3,4];case 4:return Pe(!1),[2]}}))}))},showingMostEngaging:!(!c||!(null==O?void 0:O.id))}),Ee&&f.default.createElement(W,{isMainCmt:!x,onClose:function(){return ye(!1)},onPostSuccess:function(t){0!==se||(null==O?void 0:O.id)||H(t),R((function(t){return e.__assign(e.__assign({},t),{commentsCount:t.commentsCount+1,commented:!0})})),v&&v(t)},post:L}),c&&(null==O?void 0:O.id)?f.default.createElement("div",{className:"most-engaging-wrapper",onClick:function(e){p?(e.stopPropagation(),p()):window.location.href=ke}},f.default.createElement(te,{hasQuickBookingEnable:I,handleMakeAppointment:A,comment:O,onDeleteComment:function(){He&&He(O)},className:"most-engaging-comment",type:"most-engaging",key:O.id}),se>1&&!s&&f.default.createElement(n.Button,{className:"see-more-comments",color:"ghost",size:"md"},Ce("comment.seeMoreComments",{count:se-1}))):null,N))},exports.CardPostPopoverMore=ie,exports.CardReply=te,exports.CardReplyPopover=ee,exports.CreateNewPostContent=function(r){var s=r.className,c=r.style,u=r.onPostCreatedEdited,d=r.onClose,m=r.communities,p=void 0===m?[]:m,v=r.forceSelectCommunity,g=r.forceSelectTopics,h=r.articleId,C=r.optionalTopic,w=r.editPostData,E=r.defaultCommunity,_=r.defaultTopics,b=r.noFetchTopic,x=r.hideTopicList,N=!!(null==w?void 0:w.id),I=t.useContext(i.TogetherComponentGlobalContext),M=I.data,B=M.locale,j=M.env.isMarryBaby,F=I.action,D=F.pushNotifications,O=F.sanitizeFunction,H=o.useTranslations().t,U=t.useState(!1),W=U[0],z=U[1],V=t.useState(""),G=V[0],q=V[1],Z=t.useState(""),K=Z[0],Q=Z[1],X=t.useState(v?{label:v.name,value:"".concat(v.id||"","-").concat(v.mappedCategoryId||"")}:{label:H("community.choose"),value:""}),$=X[0],J=X[1],Y=t.useState(e.__spreadArray([],g,!0)||[]),ee=Y[0],te=Y[1],ne=t.useState([]),ae=ne[0],oe=ne[1],ie=t.useState([]),le=ie[0],re=ie[1],se=v||p.find((function(e){return"".concat(e.id||"","-").concat(e.mappedCategoryId||"")===$.value})),ce=v?[v]:p.filter((function(e){return e.isActive})).sort((function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),ue=t.useState(null),de=ue[0],me=ue[1],pe=t.useState([]),ve=pe[0],fe=pe[1],ge=G&&i.innertext_1(K)&&(C||!C&&ee.length>0)&&se&&(!ae||ae.length<=i.MAX_IMAGE_UPLOADS)&&!(null==ve?void 0:ve.length)&&!W;t.useEffect((function(){if(w){var e=w;q(e.title||""),Q(i.decodeMention(i.decodePostUrl(e.description||"","edit"),e.mentions)),J({label:e.community.name,value:"".concat(e.community.id||"","-").concat(e.community.mappedCategoryId||"")}),te(e.topics||[]),oe(e.photos||[])}else E&&J({label:E.name,value:"".concat(E.id||"","-").concat(E.mappedCategoryId||"")}),_&&te(_)}),[]);var he=function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t,n,a,o,l,r,s,c,m,p,v,f;return e.__generator(this,(function(e){switch(e.label){case 0:return[4,T({title:G,description:K,communityId:String((null==se?void 0:se.id)||""),imageFiles:ae,previewUrl:de,topicIds:null==ee?void 0:ee.map((function(e){return String(e.id||"")})).filter(Boolean),locale:B,sanitizeFunction:O,categoryCommunityId:String((null==se?void 0:se.mappedCategoryId)||""),categoryTopicIds:null==ee?void 0:ee.map((function(e){return String(e.mappedCategoryId||"")})).filter(Boolean)})];case 1:return t=e.sent(),h&&t.append("article_id",h),N?(null==w?void 0:w.id)?[4,P({id:w.id,formData:t,locale:B})]:[3,3]:[3,4];case 2:n=e.sent(),e.label=3;case 3:return[3,6];case 4:return[4,S({formData:t,locale:B,isArticleComment:!(null==se?void 0:se.id)&&!!(null==se?void 0:se.mappedCategoryId)})];case 5:n=e.sent(),e.label=6;case 6:return(null==(a=null==n?void 0:n.data)?void 0:a.id)&&!(null===(l=null===(o=null==n?void 0:n.messages)||void 0===o?void 0:o.moderation)||void 0===l?void 0:l.type)?(D({message:H("createPost.popup.success"),type:"success"}),function(e){u&&u(i.formatPost(e),N),d&&d()}(a)):"banned"===(null===(s=null===(r=null==n?void 0:n.messages)||void 0===r?void 0:r.moderation)||void 0===s?void 0:s.type)?(D({title:H("notification.post.blocked.title"),message:H("notification.post.blocked.message"),type:"danger"}),n.messages.moderation.words&&re(n.messages.moderation.words)):"suspect"===(null===(m=null===(c=null==n?void 0:n.messages)||void 0===c?void 0:c.moderation)||void 0===m?void 0:m.type)?(D({title:H("notification.post.suspect.title"),message:H("notification.post.suspect.message"),type:"warning"}),d&&d()):(null===(v=null===(p=null==n?void 0:n.messages)||void 0===p?void 0:p.find)||void 0===v?void 0:v.call(p,(function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(D({message:H("notification.suspend.message"),type:"danger"}),d&&d()):D({message:(null===(f=null==n?void 0:n.messages)||void 0===f?void 0:f[0])||H("notification.failure"),type:"danger"}),[2]}}))}))};return f.default.createElement(i.StyledCreateNewPost,{className:s,style:c},f.default.createElement("div",{className:"input-group-container"},f.default.createElement(L,{className:"input-group",bannedWords:le,value:G,onChange:q}),f.default.createElement(A,{className:"input-group",bannedWords:le,value:K,onChange:Q,onPreviewUrlChange:me,onInvalidUrlsChange:fe,onImageFilesChange:oe,imageFiles:ae}),f.default.createElement("div",{className:"input-group"},f.default.createElement(n.Text,{size:"p4",className:"input-group-label"},H("admin.community")),f.default.createElement(a.Dropdown,{options:(null==ce?void 0:ce.map((function(e,t){return{label:e.name,value:"".concat(e.id||"","-").concat(e.mappedCategoryId||"")}})))||[],id:"community-picker",placeholder:H("community.choose"),value:$,onChange:function(e){J({label:e.label,value:String(e.value)}),te([])},disabled:!!v}),f.default.createElement(n.Text,{size:"sm",className:"warning",color:l.theme.colors.gray400},"* ",H("commentPopup.warning.newPost"))),!x&&f.default.createElement("div",{className:"input-group"},f.default.createElement(n.Text,{size:"p4",className:"input-group-label"},H("tab.topic")),f.default.createElement("div",{className:"input-notification"},f.default.createElement("img",{src:se?"data:image/svg+xml,%3csvg width='16' height='17' viewBox='0 0 16 17' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 14.5C11.3137 14.5 14 11.8137 14 8.5C14 5.18629 11.3137 2.5 8 2.5C4.68629 2.5 2 5.18629 2 8.5C2 11.8137 4.68629 14.5 8 14.5Z' fill='%232D87F3'/%3e%3cpath d='M8 5.5V8.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3cpath d='M8 11.5H8.00708' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e":k}),f.default.createElement(n.Text,{size:"base",color:l.theme.colors.gray500},H(se?"createPost.popup.primary":"createPost.popup.warning"))),se&&f.default.createElement(R,{className:"tag-list",communityId:se.id,forceTopics:g,onChange:te,selectedTopics:ee,noFetch:b}))),f.default.createElement(n.Button,{theme:j?"marryBaby":"helloSites",className:"submit-btn",size:"lg",onClick:function(){return e.__awaiter(void 0,void 0,void 0,(function(){var t;return e.__generator(this,(function(e){switch(e.label){case 0:if(!ge||W)return[3,5];z(!0),e.label=1;case 1:return e.trys.push([1,3,,4]),[4,he()];case 2:return e.sent(),[3,4];case 3:return t=e.sent(),console.error(t),D(y(H)),[3,4];case 4:z(!1),e.label=5;case 5:return[2]}}))}))},isDisabled:!ge,isLoading:W},H("createPost.popup.submit")))},exports.CreatePostDescription=A,exports.CreatePostTitle=L,exports.ImagePreviewPopup=q,exports.InputCommentBar=W,exports.LabelPin=E,exports.PopupDanger=j,exports.PostContent=G,exports.PostImagePreview=Q,exports.PostSingleImageViewPopup=K,exports.SubmitReportForm=V,exports.TagTopic=w,exports.TopicSelectList=R,exports.types=re;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var n,t,e,r,a,o=require("./tslib.es6-f7929e76.js"),i=require("styled-components"),s=require("react"),l=require("./translationsContext-d7c8e0a0.js");exports.Gender=void 0,(n=exports.Gender||(exports.Gender={})).Boy="boy",n.Girl="girl",exports.BabyGrowthChartType=void 0,(t=exports.BabyGrowthChartType||(exports.BabyGrowthChartType={}))[t.Weight=0]="Weight",t[t.Height=1]="Height",t[t.Head=2]="Head",t[t.BMI=3]="BMI",exports.BabyGrowthChartDuration=void 0,(e=exports.BabyGrowthChartDuration||(exports.BabyGrowthChartDuration={}))[e.Weekly=0]="Weekly",e[e.Monthly=1]="Monthly",e[e.Yearly=2]="Yearly",exports.BabyGrowthResultTab=void 0,(r=exports.BabyGrowthResultTab||(exports.BabyGrowthResultTab={}))[r.Weight=0]="Weight",r[r.Height=1]="Height",r[r.Head=2]="Head",r[r.BMI=3]="BMI",r[r.Record=4]="Record",exports.LOCALE=void 0,(a=exports.LOCALE||(exports.LOCALE={})).Vietnam="vi-VN",a.Indonesia="id-ID",a.Malaysia="ms-MY",a.Cambodia="km-KH",a.PhilippinesEnglish="en-PH",a.PhilippinesTagalog="tl-PH",a.Thailand="th-TH",a.Myanmar="my-MM",a.Taiwan="zh-TW",a.India="hi-IN";var d,m,c,f,p,u,_,T,y,O=function(n){var t=Object.keys(n);return t.length?"?"+t.map((function(t){return"".concat(t,"=").concat(n[t])})).join("&"):""},h={BREAK_POINT_SMALL_MOBILE:481,BREAK_POINT_MOBILE:768,BREAK_POINT_TABLET:1024,BREAK_POINT_PC:1200},B={smbDown:"@media (max-width: ".concat(h.BREAK_POINT_SMALL_MOBILE-1,"px)"),smbUp:"@media (min-width: ".concat(h.BREAK_POINT_SMALL_MOBILE,"px)"),mbDown:"@media (max-width: ".concat(h.BREAK_POINT_MOBILE-1,"px)"),mbOnly:"@media (min-width: ".concat(h.BREAK_POINT_SMALL_MOBILE,"px) and (max-width: ").concat(h.BREAK_POINT_MOBILE-1,"px)"),mbUp:"@media (min-width: ".concat(h.BREAK_POINT_MOBILE,"px)"),tdDown:"@media (max-width: ".concat(h.BREAK_POINT_TABLET-1,"px)"),tdOnly:"@media (min-width: ".concat(h.BREAK_POINT_MOBILE,"px) and (max-width: ").concat(h.BREAK_POINT_TABLET-1,"px)"),tdUp:"@media (min-width: ".concat(h.BREAK_POINT_TABLET,"px)"),pcUp:"@media (min-width: ".concat(h.BREAK_POINT_PC,"px)"),pcOnly:"@media (min-width: ".concat(h.BREAK_POINT_TABLET,"px) and (max-width: ").concat(h.BREAK_POINT_PC-1,"px)"),pcDown:"@media (max-width: ".concat(h.BREAK_POINT_PC-1,"px)")},I=i.keyframes(d||(d=o.__makeTemplateObject(["\nfrom {\n transform: translate3d(0, 100%, 0);\n visibility: visible;\n}\n\nto {\n transform: translate3d(0, 0, 0);\n}\n"],["\nfrom {\n transform: translate3d(0, 100%, 0);\n visibility: visible;\n}\n\nto {\n transform: translate3d(0, 0, 0);\n}\n"]))),b=i.keyframes(m||(m=o.__makeTemplateObject(["\nfrom {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"],["\nfrom {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"]))),E=i.keyframes(c||(c=o.__makeTemplateObject(["\n from {\n transform: translate3d(-100%, 0, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"],["\n from {\n transform: translate3d(-100%, 0, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"]))),x=i.keyframes(f||(f=o.__makeTemplateObject(["\n from {\n transform: translate3d(100%, 0, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"],["\n from {\n transform: translate3d(100%, 0, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"]))),L=i.keyframes(p||(p=o.__makeTemplateObject(["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(0, 100%, 0);\n}\n"],["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(0, 100%, 0);\n}\n"]))),A=i.keyframes(u||(u=o.__makeTemplateObject(["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(-100%, 0, 0);\n}\n"],["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(-100%, 0, 0);\n}\n"]))),P=i.keyframes(_||(_=o.__makeTemplateObject(["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(100%, 0, 0);\n}\n"],["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(100%, 0, 0);\n}\n"]))),w=i.keyframes(T||(T=o.__makeTemplateObject(["\n from {\n transform: translate3d(0, 0, 0);\n }\n\n to {\n visibility: hidden;\n transform: translate3d(0, -100%, 0);\n }\n"],["\n from {\n transform: translate3d(0, 0, 0);\n }\n\n to {\n visibility: hidden;\n transform: translate3d(0, -100%, 0);\n }\n"]))),v=i.keyframes(y||(y=o.__makeTemplateObject(["\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n"],["\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n"]))),M="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function R(n){var t={exports:{}};return n(t,t.exports),t.exports}var N=R((function(n){(function(t){function e(n){var t=new Error(n);return t.name="ValueError",t}function r(n){return function(t){var r=Array.prototype.slice.call(arguments,1),a=0,o="UNDEFINED";return t.replace(/([{}])\1|[{](.*?)(?:!(.+?))?[}]/g,(function(t,i,s,l){if(null!=i)return i;var d=s;if(d.length>0){if("IMPLICIT"===o)throw e("cannot switch from implicit to explicit numbering");o="EXPLICIT"}else{if("EXPLICIT"===o)throw e("cannot switch from explicit to implicit numbering");o="IMPLICIT",d=String(a),a+=1}var m=d.split("."),c=(/^\d+$/.test(m[0])?m:["0"].concat(m)).reduce((function(n,t){return n.reduce((function(n,e){return null!=e&&t in Object(e)?["function"==typeof e[t]?e[t]():e[t]]:[]}),[])}),[r]).reduce((function(n,t){return t}),"");if(null==l)return c;if(Object.prototype.hasOwnProperty.call(n,l))return n[l](c);throw e('no transformer named "'+l+'"')}))}}var a=r({});a.create=r,a.extend=function(n,e){var a=r(e);n.format=function(){var n=Array.prototype.slice.call(arguments);return n.unshift(this),a.apply(t,n)}},n.exports=a}).call(M,M)}));exports.Breakpoints=h,exports.MediaQueries=B,exports.commonjsGlobal=M,exports.createCommonjsModule=R,exports.fadeIn=v,exports.formatUrlWithPageParam=function(n,t,e){void 0===t&&(t=1),void 0===e&&(e="page");var r=n.split("?"),a=r[0],o=r[1],i=new URLSearchParams(o||""),s={};return i.forEach((function(n,t){n&&(s[t]=n)})),Number(t)>1?s[e]=String(t):delete s[e],a+O(s)},exports.getBoundariesFromMediaQueryKey=function(n){switch(n){case"smbDown":return[0,h.BREAK_POINT_SMALL_MOBILE-1];case"smbUp":return[h.BREAK_POINT_SMALL_MOBILE,0];case"mbDown":return[0,h.BREAK_POINT_MOBILE-1];case"mbOnly":return[h.BREAK_POINT_SMALL_MOBILE,h.BREAK_POINT_MOBILE-1];case"mbUp":return[h.BREAK_POINT_MOBILE,0];case"tdDown":return[0,h.BREAK_POINT_TABLET-1];case"tdOnly":return[h.BREAK_POINT_MOBILE,h.BREAK_POINT_TABLET-1];case"tdUp":return[h.BREAK_POINT_TABLET,0];case"pcUp":return[h.BREAK_POINT_PC,0];case"pcOnly":return[h.BREAK_POINT_TABLET,h.BREAK_POINT_PC-1];case"pcDown":return[0,h.BREAK_POINT_PC-1]}},exports.makeParams=O,exports.slideInDown=b,exports.slideInLeft=E,exports.slideInRight=x,exports.slideInUp=I,exports.slideOutDown=L,exports.slideOutLeft=A,exports.slideOutRight=P,exports.slideOutUp=w,exports.stringFormat=N,exports.toggleNoScroll=function(n){"undefined"!=typeof window&&(document.documentElement.classList.toggle("noscroll",n),document.body.classList.toggle("noscroll",n))},exports.useTranslations=function(){var n=s.useContext(l.TranslationsContext)||{locale:"en-PH"},t=n.values,e=n.locale;return s.useMemo((function(){return{t:function(n,r){return t?t[n]?r?N(t[n]||n,r):t[n]||n:(console.warn("[useTranslations] Missing translation for key ".concat(n," and locale ").concat(e)),r?N(l.defaultTranslations[n]||n,r):l.defaultTranslations[n]||n):(console.error("[useTranslations] t method called before translation values are loaded"),n)},locale:e}}),[t,e])};
|