@hhgtech/hhg-components 1.19.8 → 1.19.10
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/Locale-11b51016.js +1 -0
- package/build/ageGenerate-43b59eac.js +1 -0
- package/build/babyGrowth.js +1 -0
- package/build/care.js +1 -1
- package/build/components/atoms/babyGrowthGender/index.d.ts +7 -0
- package/build/components/atoms/babyGrowthGender/index.styled.d.ts +3 -0
- package/build/components/atoms/babyGrowthLegend/index.d.ts +12 -0
- package/build/components/atoms/babyGrowthLegend/index.styled.d.ts +2 -0
- package/build/components/atoms/babyGrowthProfileRadio/index.d.ts +9 -0
- package/build/components/atoms/babyGrowthProfileRadio/index.styled.d.ts +1 -0
- package/build/components/atoms/babyGrowthRecord/index.d.ts +10 -0
- package/build/components/atoms/babyGrowthRecord/index.styled.d.ts +1 -0
- package/build/components/atoms/babyGrowthSwitch/index.d.ts +11 -0
- package/build/components/atoms/babyGrowthSwitch/index.styled.d.ts +1 -0
- package/build/components/atoms/babyGrowthTooltip/index.d.ts +12 -0
- package/build/components/atoms/babyGrowthTooltip/index.styled.d.ts +1 -0
- package/build/components/atoms/drawer/index.d.ts +5 -1
- package/build/components/atoms/icons/Boy.d.ts +4 -0
- package/build/components/atoms/icons/Calendar.d.ts +4 -0
- package/build/components/atoms/icons/GenderBoy.d.ts +4 -0
- package/build/components/atoms/icons/GenderChooseBoy.d.ts +4 -0
- package/build/components/atoms/icons/GenderChooseGirl.d.ts +4 -0
- package/build/components/atoms/icons/GenderGirl.d.ts +4 -0
- package/build/components/atoms/icons/Girl.d.ts +4 -0
- package/build/components/atoms/icons/Kebab.d.ts +4 -0
- package/build/components/atoms/icons/index.d.ts +8 -0
- package/build/components/atoms/index.d.ts +4 -0
- package/build/components/atoms/radioImageGroup/index.d.ts +16 -0
- package/build/components/atoms/radioImageGroup/index.styled.d.ts +2 -0
- package/build/components/atoms/textArea/index.d.ts +1 -0
- package/build/components/babyGrowth.d.ts +16 -0
- package/build/components/molecules/babyGrowthChooseProfileDrawer/index.d.ts +10 -0
- package/build/components/molecules/babyGrowthChooseProfileDrawer/index.styled.d.ts +2 -0
- package/build/components/molecules/childCard/index.d.ts +19 -0
- package/build/components/molecules/childCard/index.styled.d.ts +3 -0
- package/build/components/molecules/childCard/menu.d.ts +11 -0
- package/build/components/molecules/dropdownSearch/index.styled.d.ts +1 -1
- package/build/components.js +1 -1
- package/build/{theme-79e84625.js → constants-d4ec4195.js} +1 -1
- package/build/cookieHelper-612b90fa.js +1 -0
- package/build/core.d.ts +1 -2
- package/build/core.js +1 -1
- package/build/ecom.js +1 -1
- package/build/esm/Locale-69030fff.js +1 -0
- package/build/esm/ageGenerate-6621e812.js +1 -0
- package/build/esm/babyGrowth.js +1 -0
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/{theme-d85b3a33.js → constants-17d17987.js} +1 -1
- package/build/esm/cookieHelper-0e8521c3.js +1 -0
- package/build/esm/core.js +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/i18n.js +1 -1
- package/build/esm/index-00ab4efc.js +1 -0
- package/build/esm/index-051acf7a.js +1 -0
- package/build/esm/{index-17e56dd2.js → index-2222afbf.js} +1 -1
- package/build/esm/index-9f8cb5a8.js +1 -0
- package/build/esm/index-a1d21c9c.js +1 -0
- package/build/esm/index-a7e7ef36.js +1 -0
- package/build/esm/index-f9f7b290.js +1 -0
- package/build/esm/index.js +1 -1
- package/build/esm/index.styled-5cf1d3ff.js +1 -0
- package/build/esm/index.styled-d726d68a.js +1 -0
- package/build/esm/navigation.js +1 -1
- package/build/esm/number-126ee62e.js +1 -0
- package/build/esm/routing-93ed4dbc.js +1 -0
- package/build/esm/theme-ed3b5e70.js +1 -0
- package/build/esm/together.js +1 -1
- package/build/esm/translationsContext-e813aff9.js +1 -0
- package/build/esm/translationsProvider-30f3552d.js +1 -0
- package/build/esm/types-26e71aa2.js +1 -0
- package/build/esm/types-4dd2d020.js +1 -0
- package/build/esm/types-b1d131ee.js +1 -0
- package/build/esm/{useTranslations-f3eec98c.js → useTranslations-a2981e90.js} +1 -1
- package/build/i18n.js +1 -1
- package/build/index-4df077f8.js +1 -0
- package/build/index-5a667f53.js +1 -0
- package/build/{index-c9b9e9d1.js → index-760a2519.js} +1 -1
- package/build/{index-dbb52923.js → index-7a4c1ca3.js} +1 -1
- package/build/index-839f79f2.js +1 -0
- package/build/index-9fc3b179.js +1 -0
- package/build/index-dbdb74fc.js +1 -0
- package/build/index.d.ts +1 -2
- package/build/index.js +1 -1
- package/build/index.styled-0449d74a.js +1 -0
- package/build/index.styled-46a15e50.js +1 -0
- package/build/interfaces/types/BabyGrowth.d.ts +149 -0
- package/build/interfaces/types/Locale.d.ts +12 -0
- package/build/interfaces/{types.d.ts → types/index.d.ts} +2 -0
- package/build/misc/ageGenerate.d.ts +5 -0
- package/build/misc/index.d.ts +8 -0
- package/build/navigation.js +1 -1
- package/build/number-95704111.js +1 -0
- package/build/routing-3fb6d350.js +1 -0
- package/build/theme-da70da1e.js +1 -0
- package/build/together.js +1 -1
- package/build/translationsContext-d7c8e0a0.js +1 -0
- package/build/translationsProvider-5ccb1448.js +1 -0
- package/build/types-18cefca9.js +1 -0
- package/build/types-2cb4d8ad.js +1 -0
- package/build/types-be287c22.js +1 -0
- package/build/{useTranslations-41d2f908.js → useTranslations-e2db2b05.js} +1 -1
- package/package.json +4 -1
- package/build/cookieHelper-57954a1e.js +0 -1
- package/build/esm/cookieHelper-083bb24e.js +0 -1
- package/build/esm/index-04b83fef.js +0 -1
- package/build/esm/index-130e6504.js +0 -1
- package/build/esm/index-a6f4de82.js +0 -1
- package/build/esm/index.styled-4510c448.js +0 -1
- package/build/esm/translationsContext-b0b4655d.js +0 -1
- package/build/esm/translationsProvider-7ccc3d2b.js +0 -1
- package/build/esm/types-a9462b3e.js +0 -1
- package/build/esm/types-bb039dd3.js +0 -1
- package/build/esm/types-dd4dd7f7.js +0 -1
- package/build/esm/useFbDataLayer-58443cc1.js +0 -1
- package/build/index-3532b37c.js +0 -1
- package/build/index-568e37d3.js +0 -1
- package/build/index.styled-66508bf8.js +0 -1
- package/build/translationsContext-351bc1a7.js +0 -1
- package/build/translationsProvider-d06a3c76.js +0 -1
- package/build/types-8ced0dc3.js +0 -1
- package/build/types-ed09baa8.js +0 -1
- package/build/types-ff716cdb.js +0 -1
- package/build/useFbDataLayer-508d5450.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as e,e as t,_ as n,a as i}from"./tslib.es6-fd0a5c98.js";import o,{useContext as a,useState as r,useRef as l,useEffect as s,useMemo as c,useCallback as u}from"react";import{m as d,E as m,F as p,H as v,I as g,J as h,K as f,M as w,b as k,N as C,O as y,Q as E,R as b,V as N,W as I,X as T,Y as x,Z as M,L as _,_ as P,$ as L,a0 as S,a1 as j,a2 as B,a3 as F,a4 as R,a5 as D,B as O,z as A,a6 as z,j as V,a7 as U,a8 as H,U as W,a9 as Z,aa as G,ab as K,u as Q,g as X,ac as J,ad as Y,ae as $,af as q,ag as ee,ah as te,ai as ne,aj as ie,x as oe,ak as ae,al as re,am as le,an as se,ao as ce,a as ue,ap as de,f as me,C as pe,aq as ve,ar as ge,as as he,S as fe,at as we,o as ke,au as Ce,av as ye,aw as Ee}from"./index.styled-4510c448.js";import{T as be,I as Ne}from"./cookieHelper-083bb24e.js";import{a as Ie,D as Te}from"./index-130e6504.js";import{u as xe,t as Me}from"./useTranslations-f3eec98c.js";import{t as _e,d as Pe}from"./theme-d85b3a33.js";import"react-range";import*as Le from"react-dom";import Se from"lodash/debounce";var je=function(i){var c=i.title,u=i.url,w=i.image,k=i.logo,C=i.className,y=i.style,E=i.noRefetch,b=a(d).data,N=b.locale,I=b.env.isMarryBaby,T=r(!1),x=T[0],M=T[1],_=l(E);_.current=E;var P=r(null),L=P[0],S=P[1];s((function(){e(void 0,void 0,void 0,(function(){return t(this,(function(e){return _.current?[2]:u?(S((function(e){return n(n({},e),{isFetching:!0})})),g(h(f.FETCH_PREVIEW,{_locale:N}),"POST",{data:{link:u}}).then((function(e){var t,n,i;M(!1),S({title:null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.title,url:u,image:(null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.image)||(null===(i=null==e?void 0:e.data)||void 0===i?void 0:i.logo)})})).catch((function(){S(null)})),[2]):[2,S(null)]}))}))}),[u]);var j=(null==L?void 0:L.image)||w,B=(null==L?void 0:L.title)||c,F=(null==L?void 0:L.logo)||k,R=(null==L?void 0:L.url)||u,D=R.replace("http://","").replace("https://","").split(/[/?#]/)[0],O=l(!1);return o.createElement(m,{"data-is-marrybaby":I,className:"".concat(C," no-replace-click"),style:y},o.createElement("a",{href:R,target:"_blank",rel:"noreferrer"},j&&o.createElement("div",{className:"link-image-wrapper"},!I&&o.createElement("img",{className:"link-image-blur",src:j,onError:function(e){O.current||(O.current=!0,e.currentTarget.src=p)}}),o.createElement("img",{className:"link-image",src:j,onError:function(e){O.current||(O.current=!0,e.currentTarget.src=p)}})),o.createElement("div",{className:"link-info-container"},o.createElement(be,{size:"n1"},I&&F&&!x&&o.createElement("img",{className:"link-logo",src:F,onError:function(e){return M(!0)}}),D),o.createElement(v,{tag:"h6"},B))))},Be=function(e){var t=e.topics,n=e.onClick,i=e.className,s=e.style,c=function(){var e=r(!1),t=e[0],n=e[1],i=l(null),o=l(null),a=l();return{sliding:t,mouseDownHandler:function(e){if(i.current){a.current=setTimeout((function(){n(!0)}),500),o.current={left:i.current.scrollLeft,x:e.clientX};var t=function(e){var t=o.current;if(t){var n=e.clientX-t.x;i.current&&(i.current.scrollLeft=t.left-n)}},r=function(){a.current&&(clearTimeout(a.current),a.current=void 0),n(!1),document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",t),document.addEventListener("mouseup",r)}},sliderRef:i,pos:o}}(),u=c.sliding,m=c.mouseDownHandler,p=c.sliderRef,v=a(d),g=v.data.env.togetherBasePath,h=v.action.sanitizeFunction;return o.createElement(w,{ref:p,onClick:n,onMouseDown:function(e){return m(e)},className:"".concat(i," ").concat(u?"sliding":""),style:s},t.map((function(e,t){return o.createElement("a",{className:"tag-link-item",key:t,href:e.isActive&&!e.isHidden?"".concat(g).concat(e.url):void 0},o.createElement(be,{size:"p3"},o.createElement("span",{dangerouslySetInnerHTML:{__html:(null==h?void 0:h(e.name))||e.name}})))})))},Fe=function(e){var t=e.onClick;e.color;var n=e.className,i=e.style,r=a(d).data.env.isMarryBaby,l=xe().t;return o.createElement(k,{label:o.createElement(o.Fragment,null,r&&o.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"})," ",l("label.pinnedPost")),rightLabel:!r&&o.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:t,color:"white",className:"label-pinned ".concat(n),style:i})},Re=function(e){return{message:e("notification.failure"),type:"danger"}},De="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",Oe=function(n){var i=n.id,o=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return i?[4,C(h(f.POST.LIKE,{id:i,_locale:o}),"GET")]:[2];case 1:return[2,e.sent()]}}))}))},Ae=function(n){var i=n.id,o=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return i?[4,C(h(f.POST.DELETE,{id:i,_locale:o}),"DELETE")]:[2];case 1:return[2,e.sent()]}}))}))},ze=function(n){var i=n.title,o=n.description,a=n.communityId,r=n.imageFiles,l=n.previewUrl,s=n.topicIds,c=n.locale,u=n.sanitizeFunction,d=n.categoryCommunityId,m=n.categoryTopicIds,p=n.introUrl,v=n.bannerUrl,g=n.scheduleTime;return e(void 0,void 0,void 0,(function(){var e,n,h,f,w;return t(this,(function(t){switch(t.label){case 0:return e=new FormData,n=E(o),h=E(i),f=b(n),e.append("title",h),e.append("description",N(n,u)),d?e.append("category_community",String(d)):a&&e.append("community_id",String(a)),(null==l?void 0:l.title)&&e.append("preview_title",l.title),(null==l?void 0:l.description)&&e.append("preview_description",l.description),(null==l?void 0:l.url)&&e.append("preview_link",l.url),(null==l?void 0:l.image)&&e.append("preview_image",l.image),null==s||s.forEach((function(t){e.append("topics[]",String(t||""))})),null==m||m.forEach((function(t){e.append("category_topics[]",String(t||""))})),(null==r?void 0:r.length)?[4,Promise.all(r.map((function(e,t){return new Promise((function(n){setTimeout((function(){n(I(e,c))}),2e3*t)}))})))]:[3,2];case 1:return null==(w=t.sent())||w.filter(Boolean).slice(0,y).forEach((function(t,n){e.append("images[".concat(n,"]"),t)})),[3,3];case 2:e.append("images",""),t.label=3;case 3:return null==f||f.forEach((function(t){e.append("mention_ids[]",t)})),e.append("intro_url",p||""),e.append("banner",v||""),g&&(e.append("post_type","scheduled"),e.append("schedule_datetime",g)),[2,e]}}))}))},Ve=function(n){var i=n.locale,o=n.formData,a=n.isArticleComment;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,C(h(a?f.POST.CREATE_ARTICLE_COMMENT:f.POST.CREATE,{_locale:i}),"POST",{data:o,headers:{"Content-Type":"multipart/form-data"}})];case 1:return[2,e.sent()]}}))}))},Ue=function(n){var i=n.id,o=n.locale,a=n.formData;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return[4,C(h(f.POST.UPDATE,{id:i,_locale:o}),"POST",{data:a})];case 1:return[2,e.sent()]}}))}))},He=function(e){var t=e.id,n=e.reason,i=e.locale,o=new FormData;return o.append("reason",n),C(h(f.POST.REPORT,{_locale:i,id:t}),"POST",{data:o})},We=function(e,t){var n=r(e||[]),i=n[0],o=n[1];return{onSelectImages:function(n){var a=n.target.files;a&&(t&&e?t((e||i).concat(Array.from(a))):o((function(n){var i=e||n;return t&&t(i.concat(Array.from(a))),i.concat(Array.from(a))})))},onRemoveImage:function(n){if(t&&e){var i=e;i.splice(n,1),t(i.slice())}else o((function(i){var o=e||i;return o.splice(n,1),t&&t(o.slice()),o.slice()}))},onRemoveAllImages:function(){t?t([]):o([])},imageSrcs:c((function(){return(e||i).map((function(e){return"string"==typeof e?e:URL.createObjectURL(e)}))}),[e,i]),imageFiles:e||i}},Ze="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",Ge=function(e){var t=e.className,n=e.style,i=e.bannedWords,a=void 0===i?[]:i,c=e.value,u=e.onChange,d=e.onPreviewUrlChange,m=e.onInvalidUrlsChange,p=e.onImageFilesChange,v=e.imageFiles,g=e.isReplying,h=xe().t,f=r(null),w=f[0],k=f[1],C=l(null),E=We(v,p),b=E.onSelectImages,N=E.onRemoveImage,I=E.imageSrcs;return s((function(){d&&((null==w?void 0:w.url)?d({title:w.title||"",url:w.url||"",image:w.image||"",description:w.description||""}):d(null))}),[w]),o.createElement(T,{className:t,style:n},o.createElement(be,{size:"p4",className:"description-label"},h("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(x,{html:c||"",onChange:u,bannedWords:a,onImagePickerClick:function(){var e;return null===(e=C.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:k,onInvalidUrlsChange:m,isReplying:g}))),o.createElement(be,{size:"p4",className:"count-string"},h("character"),": ",M(c||"").length),(!I||0===I.length)&&w&&o.createElement("div",{className:"link-preview-wrapper"},w.isFetching?o.createElement(_,null):o.createElement(o.Fragment,null,o.createElement(je,{title:w.title,url:w.url||"#",image:w.image,noRefetch:!0}),o.createElement("img",{src:Ze,className:"icon-close",onClick:function(){return k(null)}}))),o.createElement("input",{ref:C,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:b}),I.length>y?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:De}),o.createElement(be,{size:"p4",color:_e.colors.alertWarning},h("createPost.popup.warningImage"))):null,I.length>0&&o.createElement("div",{className:"image-gallery"},I.map((function(e,t){return o.createElement("div",{key:t,className:"image-item"},o.createElement("img",{src:e}),o.createElement("img",{className:"close-btn",src:Ze,onClick:function(){return N(t)}}))}))))},Ke=function(e,t){if(!t)return e;var n=t.limit,i=t.bannedWords,o=void 0===i?[]:i,a="number"==typeof n&&n>=0?e.substring(0,n):e;return P(a,o)},Qe=function(e){var t,n=e.className,i=e.style,a=e.bannedWords,c=void 0===a?[]:a,d=e.value,m=e.onChange,p=xe().t,v=r(""),g=v[0],h=v[1],f=l(null);s((function(){if(f.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=f.current;return t.addEventListener("paste",e),function(){return t.removeEventListener("paste",e)}}}),[f]);var w=(null==c?void 0:c.join(","))||"";s((function(){var e;if(w){var t=null===(e=f.current)||void 0===e?void 0:e.innerText;if(t){var n=P(t,c);n!==t&&(m&&m(n),h(n))}}}),[w]);var k=u(Se((function(e){if(f.current){var t=Ke(f.current.innerText,{limit:120,bannedWords:c});m&&m(t),h(t)}}),300),[]);return s((function(){setTimeout((function(){var e;null===(e=f.current)||void 0===e||e.focus()}),500)}),[]),o.createElement(L,{className:n,style:i},o.createElement(Ne,{name:"title",value:d||g,size:"md",label:p("createPost.title"),CustomInput:o.createElement(S,{innerRef:f,html:d||g,onChange:function(e){if(f.current&&f.current.innerText!==(d||g)){var t=Ke(f.current.innerText,{bannedWords:c});m&&m(t),h(t),k(f.current.innerText)}},className:"title-input"})}),o.createElement(be,{size:"p4",className:"count-string"},p("createPost.popup.wordCount",{count:(null===(t=f.current)||void 0===t?void 0:t.innerText.length)||0,max:120})))},Xe=function(n){var u=n.className,m=n.style,p=n.topics,v=n.communityId,w=n.onChange,k=n.isLoading,C=n.disabled,y=n.forceTopics,E=n.selectedTopics,b=n.noFetch,N=a(d).data,I=N.locale,T=N.env.isMarryBaby,x=r(p?i([],p,!0):[]),M=x[0],P=x[1],L=r(E?i([],E,!0):[]),S=L[0],F=L[1],R=r(!1),D=R[0],O=R[1],A=l(p);A.current=p,s((function(){var n;!v||b||(null===(n=A.current)||void 0===n?void 0:n.length)||(P([]),O(!0),e(void 0,void 0,void 0,(function(){var e,n,i,o;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,g(h(f.TOPIC.LIST,{communityId:v,_locale:I}),"GET")];case 1:return e=t.sent(),n=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.topics,Array.isArray(n)&&P((function(){return(null==n?void 0:n.map(B).sort((function(e,t){return(e.order||0)-(t.order||0)})))||[]})),[3,3];case 2:return i=t.sent(),console.log(i),O(!1),[3,3];case 3:return O(!1),[2]}}))})))}),[v,b]);var z=null==p?void 0:p.map((function(e){return e.id})).join("-"),V=null==M?void 0:M.map((function(e){return e.id})).join("-"),U=null==y?void 0:y.map((function(e){return e.id})).join("-");s((function(){p&&void 0!==z&&z!==V&&P(p)}),[p,z,V]);var H=c((function(){return M.filter((function(e){return!(null==y?void 0:y.some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})))}))}),[V,U]);return o.createElement(j,{"data-is-marrybaby":T,className:u,style:m},y.map((function(e){return o.createElement(Je,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:!0,selected:!0})})),H.map((function(e){return o.createElement(Je,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:C,selected:(E||S).some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})),onClick:function(){var t=E||S,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),w&&E?w(t.slice()):(w&&w(t.slice()),F(t.slice()))}})})),(k||D)&&o.createElement(_,{className:"topic-spinner"}))},Je=function(e){var t=e.topic,n=e.disabled,i=e.selected,a=e.onClick;return o.createElement("div",{className:"tag-item"+(i?" --active":""),"data-disabled":n,onClick:n?void 0:a},t.name)},Ye=function(n){var l=n.className,c=n.style,u=n.onPostCreatedEdited,m=n.onClose,p=n.communities,v=void 0===p?[]:p,g=n.forceSelectCommunity,h=n.forceSelectTopics,f=n.articleId,w=n.optionalTopic,k=n.editPostData,C=n.defaultCommunity,E=n.defaultTopics,b=n.noFetchTopic,N=n.hideTopicList,I=!!(null==k?void 0:k.id),T=a(d),x=T.data,_=x.locale,P=x.env.isMarryBaby,L=T.action,S=L.pushNotifications,j=L.sanitizeFunction,B=xe().t,z=r(!1),V=z[0],U=z[1],H=r(""),W=H[0],Z=H[1],G=r(""),K=G[0],Q=G[1],X=r(g?{label:g.name,value:"".concat(g.id||"","-").concat(g.mappedCategoryId||"")}:{label:B("community.choose"),value:""}),J=X[0],Y=X[1],$=r(i([],h,!0)||[]),q=$[0],ee=$[1],te=r([]),ne=te[0],ie=te[1],oe=r([]),ae=oe[0],re=oe[1],le=g||v.find((function(e){return"".concat(e.id||"","-").concat(e.mappedCategoryId||"")===J.value})),se=g?[g]:v.filter((function(e){return e.isActive})).sort((function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),ce=r(null),ue=ce[0],de=ce[1],me=r([]),pe=me[0],ve=me[1],ge=W&&M(K)&&(w||!w&&q.length>0)&&le&&(!ne||ne.length<=y)&&!(null==pe?void 0:pe.length)&&!V;s((function(){if(k){var e=k;Z(e.title||""),Q(F(R(e.description||"","edit"),e.mentions)),Y({label:e.community.name,value:"".concat(e.community.id||"","-").concat(e.community.mappedCategoryId||"")}),ee(e.topics||[]),ie(e.photos||[])}else C&&Y({label:C.name,value:"".concat(C.id||"","-").concat(C.mappedCategoryId||"")}),E&&ee(E)}),[]);var he=function(){return e(void 0,void 0,void 0,(function(){var e,n,i,o,a,r,l,s,c,d,p,v;return t(this,(function(t){switch(t.label){case 0:return[4,ze({title:W,description:K,communityId:String((null==le?void 0:le.id)||""),imageFiles:ne,previewUrl:ue,topicIds:null==q?void 0:q.map((function(e){return String(e.id||"")})).filter(Boolean),locale:_,sanitizeFunction:j,categoryCommunityId:String((null==le?void 0:le.mappedCategoryId)||""),categoryTopicIds:null==q?void 0:q.map((function(e){return String(e.mappedCategoryId||"")})).filter(Boolean)})];case 1:return e=t.sent(),f&&e.append("article_id",f),I?(null==k?void 0:k.id)?[4,Ue({id:k.id,formData:e,locale:_})]:[3,3]:[3,4];case 2:n=t.sent(),t.label=3;case 3:return[3,6];case 4:return[4,Ve({formData:e,locale:_,isArticleComment:!(null==le?void 0:le.id)&&!!(null==le?void 0:le.mappedCategoryId)})];case 5:n=t.sent(),t.label=6;case 6:return(null==(i=null==n?void 0:n.data)?void 0:i.id)&&!(null===(a=null===(o=null==n?void 0:n.messages)||void 0===o?void 0:o.moderation)||void 0===a?void 0:a.type)?(S({message:B("createPost.popup.success"),type:"success"}),function(e){u&&u(A(e),I),m&&m()}(i)):"banned"===(null===(l=null===(r=null==n?void 0:n.messages)||void 0===r?void 0:r.moderation)||void 0===l?void 0:l.type)?(S({title:B("notification.post.blocked.title"),message:B("notification.post.blocked.message"),type:"danger"}),n.messages.moderation.words&&re(n.messages.moderation.words)):"suspect"===(null===(c=null===(s=null==n?void 0:n.messages)||void 0===s?void 0:s.moderation)||void 0===c?void 0:c.type)?(S({title:B("notification.post.suspect.title"),message:B("notification.post.suspect.message"),type:"warning"}),m&&m()):(null===(p=null===(d=null==n?void 0:n.messages)||void 0===d?void 0:d.find)||void 0===p?void 0:p.call(d,(function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(S({message:B("notification.suspend.message"),type:"danger"}),m&&m()):S({message:(null===(v=null==n?void 0:n.messages)||void 0===v?void 0:v[0])||B("notification.failure"),type:"danger"}),[2]}}))}))};return o.createElement(D,{className:l,style:c},o.createElement("div",{className:"input-group-container"},o.createElement(Qe,{className:"input-group",bannedWords:ae,value:W,onChange:Z}),o.createElement(Ge,{className:"input-group",bannedWords:ae,value:K,onChange:Q,onPreviewUrlChange:de,onInvalidUrlsChange:ve,onImageFilesChange:ie,imageFiles:ne}),o.createElement("div",{className:"input-group"},o.createElement(be,{size:"p4",className:"input-group-label"},B("admin.community")),o.createElement(Ie,{options:(null==se?void 0:se.map((function(e,t){return{label:e.name,value:"".concat(e.id||"","-").concat(e.mappedCategoryId||"")}})))||[],id:"community-picker",placeholder:B("community.choose"),value:J,onChange:function(e){Y({label:e.label,value:String(e.value)}),ee([])},disabled:!!g}),o.createElement(be,{size:"sm",className:"warning",color:_e.colors.gray400},"* ",B("commentPopup.warning.newPost"))),!N&&o.createElement("div",{className:"input-group"},o.createElement(be,{size:"p4",className:"input-group-label"},B("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:le?"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":De}),o.createElement(be,{size:"base",color:_e.colors.gray500},B(le?"createPost.popup.primary":"createPost.popup.warning"))),le&&o.createElement(Xe,{className:"tag-list",communityId:le.id,forceTopics:h,onChange:ee,selectedTopics:q,noFetch:b}))),o.createElement(O,{theme:P?"marryBaby":"helloSites",className:"submit-btn",size:"lg",onClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!ge||V)return[3,5];U(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,he()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),console.error(e),S(Re(B)),[3,4];case 4:U(!1),t.label=5;case 5:return[2]}}))}))},isDisabled:!ge,isLoading:V},B("createPost.popup.submit")))},$e=function(e){var t=e.className,n=e.isMarryBaby,i=e.style,l=e.title,c=e.description,u=e.acceptText,m=e.cancelText,p=e.onAccept,g=e.thumbnail,h=e.isThumbnailIcon,f=e.onClose,w=a(d).data.env.isMarryBaby,k="boolean"==typeof n?n:w,C=r(!1),y=C[0],E=C[1];return s((function(){return Me(!0),setTimeout((function(){return E(!0)}),0),function(){return Me(!1)}}),[]),Le.createPortal(o.createElement(z,{"data-is-marrybaby":k,className:t,style:i,"data-open":y},o.createElement(V,{className:"popup-frame",isOpen:y,onClose:f},o.createElement("div",{className:"confirm-dialog",onClick:function(e){return e.stopPropagation()}},o.createElement("div",{className:"confirm-content"},g&&o.createElement("div",{className:"thumbnail-container ".concat(h?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:g})),o.createElement(v,{className:"title",tag:"h2"},l),o.createElement(be,{className:"desc",size:"lg"},c),o.createElement("div",{className:"btn-group"},o.createElement(O,{theme:k?"marryBaby":"helloSites",size:"md",color:"secondary",onClick:function(){null==p||p(),null==f||f()}},u),o.createElement(O,{theme:k?"marryBaby":"helloSites",size:"md",onClick:f},m)))),k&&g&&o.createElement("div",{className:"thumbnail-container is-mobile ".concat(h?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:g})))),document.body)},qe=function(n){var i=n.postId,o=n.message,a=n.photos,r=n.link,l=n.locale,s=n.sanitizeFunction,c=n.replyingUserId,u=n.replyingUserName,d=n.replyingId;return e(void 0,void 0,void 0,(function(){var e,n,m;return t(this,(function(t){switch(t.label){case 0:return e=new FormData,n=N(o.replace(/(\ )+/g," "),s),m=b(n),a&&a.length>0?[4,Promise.all(null==a?void 0:a.map((function(e){return I(e,l)})))]:[3,2];case 1:t.sent().filter(Boolean).slice(0,y).forEach((function(t){e.append("images[]",t)})),t.label=2;case 2:return r&&e.append("link",r),null==m||m.forEach((function(t){e.append("mention_ids[]",t)})),e.append("post_id",i),d&&e.append("parent_id",d),c&&(m.unshift(c),n='[mention+id="'.concat(c,'"+name="').concat((u||"").replace('"',"'"),'"]').concat(n),e.append("parent_user_id",String(c))),e.append("content",n),e.append("content",n),[2,e]}}))}))},et=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,C(h(f.COMMENT.CREATE,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},tt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,C(h(f.COMMENT.REPLY,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},nt=function(n){var i=n.commentId,o=n.setLike,a=void 0!==o&&o,r=n.locale;return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,C(h(a?f.COMMENT.LIKE:f.COMMENT.UNLIKE,{_locale:r,id:i}),"GET")]}))}))},it=function(e){var t=e.id,n=e.locale;return C(h(f.COMMENT.DELETE,{_locale:n,id:t}),"DELETE")},ot=function(i){var c=i.isReply,u=i.className,m=i.onClose,p=i.replyToName,v=i.style,g=i.replyingId,h=i.replyingUser,f=i.onPostSuccess;i.isMainCmt;var w=i.post,k=i.isMarryBaby,C=a(d),y=C.action,E=y.pushNotifications,b=y.sanitizeFunction,N=C.data,I=N.userInfo,T=N.locale,M=N.env.isMarryBaby,P="boolean"==typeof k?k:M,L=xe().t,S=We(),j=S.onSelectImages,B=S.onRemoveImage,F=S.imageSrcs,R=S.onRemoveAllImages,D=S.imageFiles,A=r(""),z=A[0],V=A[1],K=a(U).trigger,Q=r(!1),X=Q[0],J=Q[1],Y=l(null),$=l(null),q=l(null),ee=r([]),te=ee[0],ne=ee[1],ie=r([]),oe=ie[0],ae=ie[1],re=r(null),le=re[0],se=re[1];return s((function(){var e;null===(e=q.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((function(){var e;null===(e=$.current)||void 0===e||e.focus()}),400)}),[K]),o.createElement(H,{"data-is-reply":c,className:u,style:v},c&&o.createElement("div",{className:"reply-to-container"},o.createElement(be,{size:"p4"},o.createElement("span",{dangerouslySetInnerHTML:{__html:L("inputComment.replyTo",{name:'<span style="color: #2D87F3; cursor: pointer">@'.concat(p||"","</span>")})}})),o.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 m&&m()}})),o.createElement("div",{className:"input-container",ref:q},o.createElement(W,{className:"avatar-wrapper ".concat(c?"avatar-wrapper-reply":""),avatar:(null==I?void 0:I.id)?I.avatar:Z,username:(null==I?void 0:I.name)||(null==I?void 0:I.username)}),o.createElement("input",{ref:Y,onChange:j,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),o.createElement(Ne,{value:z,name:"input",size:"md",className:"input-wrapper",displayIcon:o.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:o.createElement("div",{className:"as-input"},o.createElement(x,{className:"textarea",html:z,onChange:V,onImagePickerClick:function(){var e;return null===(e=Y.current)||void 0===e?void 0:e.click()},bannedWords:oe,onPreviewUrlChange:se,onInvalidUrlsChange:ne,setEditorRef:function(e){return $.current=e},isReplying:c}))}),o.createElement(O,{theme:P?"marryBaby":"helloSites",className:"send-button",size:"sm",onClick:function(){return e(void 0,void 0,void 0,(function(){var e,i,o,a,r,l,s,u,d,p,v,k,C;return t(this,(function(t){switch(t.label){case 0:if(!(null==w?void 0:w.id)||X)return[2];J(!0),t.label=1;case 1:return t.trys.push([1,4,,5]),e=function(e){V(""),R(),m&&m();var t=G(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),f&&f(t)},[4,qe(n({message:z,photos:D,postId:String(w.id),link:null==le?void 0:le.url,sanitizeFunction:b,locale:T},c&&g?{replyingUserId:String((null==h?void 0:h.id)||(null===(r=null==w?void 0:w.author)||void 0===r?void 0:r.id)||""),replyingId:g,replyingUserName:(null==h?void 0:h.name)||(null==h?void 0:h.username)||""}:{}))];case 2:return i=t.sent(),[4,c&&g?tt(i,T):et(i,T)];case 3:return o=t.sent(),(null==(a=null==o?void 0:o.data)?void 0:a.id)&&!(null===(s=null===(l=null==o?void 0:o.messages)||void 0===l?void 0:l.moderation)||void 0===s?void 0:s.type)?e(o):"banned"===(null===(d=null===(u=null==o?void 0:o.messages)||void 0===u?void 0:u.moderation)||void 0===d?void 0:d.type)?(E({title:L("notification.comment.blocked.title"),message:L("notification.comment.blocked.message"),type:"danger"}),o.messages.moderation.words&&ae(o.messages.moderation.words)):"suspect"===(null===(v=null===(p=null==o?void 0:o.messages)||void 0===p?void 0:p.moderation)||void 0===v?void 0:v.type)?(E({title:L("notification.comment.suspect.title"),message:L("notification.comment.suspect.message"),type:"warning"}),V(""),R(),m&&m()):(null===(k=null==o?void 0:o.messages)||void 0===k?void 0:k.find((function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(E({message:L("notification.suspend.message"),type:"warning"}),V(""),R(),m&&m()):E({title:"",message:(null===(C=null==o?void 0:o.messages)||void 0===C?void 0:C[0])||L("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 4:return t.sent(),E({title:"",message:L("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 5:return J(!1),[2]}}))}))},isLoading:X,isDisabled:!!(null==te?void 0:te.length)||X||!z||(null==z?void 0:z.length)<2||!z.trim()},o.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==te?void 0:te.length)?o.createElement("div",{className:"error-text"},L("notification.limitUrlDomain")):null,(!F||0===F.length)&&le&&o.createElement("div",{className:"link-preview-wrapper"},le.isFetching?o.createElement(_,null):o.createElement(o.Fragment,null,o.createElement(je,{title:le.title,url:le.url||"#",image:le.image,noRefetch:!0}),o.createElement("img",{src:Ze,className:"icon-close",onClick:function(){return se(null)}}))),F&&F.length>0&&o.createElement("div",{className:"preview-images-container"},F.map((function(e,t){return o.createElement("div",{key:t,className:"image-src-wrapper"},o.createElement("img",{className:"preview-image",src:e}),o.createElement("img",{src:Ze,className:"icon-close-circle",onClick:function(){return B(t)}}))}))))},at="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",rt=function(n){var i=n.className,l=n.style,s=n.reason,c=n.reasonText,u=n.onClose,m=n.postId,p=a(d),v=p.data,g=v.locale,h=v.env.isMarryBaby,f=p.action.pushNotifications,w=xe().t,k=r(!1),C=k[0],y=k[1];return o.createElement(K,{"data-is-marrybaby":h,className:i,style:l},o.createElement("ul",{className:"report-list"},o.createElement("li",{className:"report-item"},o.createElement("img",{src:at}),o.createElement(be,{className:"__label",color:_e.colors.gray800,size:"p4"},c))),o.createElement(O,{theme:h?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:C,onClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!m||C)return[2];y(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,He({id:m,reason:s,locale:g})];case 2:return 1===(null==(e=t.sent())?void 0:e.status)&&(f({message:"Post reported",type:"success"}),u&&u()),[3,4];case 3:return t.sent(),[3,4];case 4:return y(!1),[2]}}))}))}},w("submit")))},lt=function(e){var t=e.className,n=e.style,i=e.replyingTo,l=e.mentionedUser,s=e.description,u=e.disableShortenContent,m=e.mentions,p=void 0===m?[]:m,v=r(!1),g=v[0],h=v[1],f=xe().t,w=Q().authActionWrapper,k=r(!1),C=k[0],y=k[1],E=F(R(s||"","display"),p),b=a(d).action.sanitizeFunction,N=c((function(){var e=b(E||"");if(u||g)return{showContent:e,hasSeeMore:!1};var t=e.slice(0,200),n=200-27*((t.match(/<\/div>/g)||[]).length-1),i=(t||"").slice(0,n<40?40:n),o=b(i.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),a=o.length<e.length-10;return{showContent:a?o:e,hasSeeMore:a}}),[u,g,E]),I=(null==l?void 0:l.name)||i,T="expert"===(null==l?void 0:l.role)&&!!(null==l?void 0:l.partnerId);return o.createElement(o.Fragment,null,T&&o.createElement(X,{isOpen:C,onClose:function(){return y(!1)},expertId:String(null==l?void 0:l.partnerId)}),o.createElement(J,{className:"".concat(t," no-replace-click"),style:n},I&&o.createElement("span",{onClick:function(){return T&&y(!0)},className:"post-content-replying"},"@",I),(null==s?void 0:s.startsWith("[mention+id="))&&o.createElement("span",{className:"post-content-replying tag-only"},"@"),o.createElement("span",{dangerouslySetInnerHTML:{__html:N.showContent},className:"post-content ".concat(N.hasSeeMore?"has-see-more":"")}),N.hasSeeMore&&!g&&o.createElement("span",null,"... ",o.createElement("span",{onClick:function(e){e.preventDefault(),e.stopPropagation(),w((function(){return h(!0)}))},className:"see-more-text"},f("post.seeMore")))))},st=function(e){var t=e.className,n=e.style,i=e.authorName,a=e.images,l=e.onClose,c=e.onOpenSingleView,u=xe().t,d=r(!1),m=d[0],p=d[1];return s((function(){setTimeout((function(){p(!0)}),0)}),[]),Le.createPortal(o.createElement(Y,{className:t,style:n,"data-open":m},o.createElement("div",{className:"top-bar"},o.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:l,alt:"go back"}),o.createElement(be,{size:"p2",type:"bold",style:{textAlign:"center"}},u("previewPhotos.title",{name:i}))),o.createElement("div",{className:"container"},a.map((function(e,t){return o.createElement("img",{className:"img-preview",key:t,src:e,onClick:function(){return null==c?void 0:c(t)},alt:"post img"})})))),document.body)},ct="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",ut=function(e){var t=e.initialViewIndex,n=e.images,i=e.onClose,a=r(t),l=a[0],c=a[1],u=r(!1),d=u[0],m=u[1];s((function(){setTimeout((function(){m(!0)}),0)}),[]);var p=null==n?void 0:n[l],v=0===l,g=!(null==n?void 0:n.length)||l===(null==n?void 0:n.length)-1;return Le.createPortal(o.createElement($,{"data-open":d&&!!p},o.createElement(q,null,o.createElement("img",{src:ee,className:"icon-close",onClick:i,alt:"close"})),p&&l>=0&&o.createElement(o.Fragment,null,o.createElement(te,null,o.createElement("img",{className:"img-preview",src:p,alt:"post img open"}),o.createElement(ne,{"data-disabled":v,onClick:function(){return!v&&c(l-1)}},o.createElement(ie,null,o.createElement("img",{src:ct,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":v}))),o.createElement(ne,{"data-right":!0,"data-disabled":g,onClick:function(){return!g&&c(l+1)}},o.createElement(ie,null,o.createElement("img",{src:ct,alt:"right arrow","data-disabled":g})))))),document.body)},dt=function(e){var t=e.className,n=e.images,i=void 0===n?[]:n,c=e.style,u=e.authorName,m=a(d).data.env.isMarryBaby,p="+ ".concat((i.length||0)-4),g=r(!1),h=g[0],f=g[1],w=r(-1),k=w[0],C=w[1];s((function(){setTimeout((function(){return null==oe?void 0:oe.update()}),100)}),[null==i?void 0:i.slice(0,5).join("|")]);var y=i.length>5,E=l(!1);return s((function(){return function(){E.current&&Me(!1)}}),[]),s((function(){h||k>=0?(Me(!0),E.current=!0):(Me(!1),E.current=!1)}),[h,k]),o.createElement(o.Fragment,null,o.createElement(ae,{className:t,style:c,"data-image-count":y?5:i.length||0,"data-is-marrybaby":m},null==i?void 0:i.slice(0,5).map((function(e,t){return o.createElement("div",{className:"img-wrapper",key:t,onClick:function(){t>=4&&y?f(!0):C(t)}},!m&&o.createElement("img",{className:"lazy img-preview-blur","data-src":e}),o.createElement("img",{className:"lazy img-preview","data-src":e}),4===t&&y&&o.createElement("div",{className:"img-more-overlay"},o.createElement(v,{tag:"h1",color:"white"},p)))}))),h&&o.createElement(st,{authorName:u||"",images:i,onClose:function(){return f(!1)},onOpenSingleView:C}),k>=0&&o.createElement(ut,{images:i,initialViewIndex:k,onClose:function(){return C(-1)}}))},mt=function(i){var u=i.url,m=i.image,v=i.className,w=i.style,k=a(d).data.locale,C=r(null),y=C[0],E=C[1];s((function(){e(void 0,void 0,void 0,(function(){return t(this,(function(e){return m?[2]:u?(E((function(e){return n(n({},e),{isFetching:!0})})),g(h(f.FETCH_PREVIEW,{_locale:k}),"POST",{data:{link:u}}).then((function(e){var t,n;E({url:u,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(){E(null)})),[2]):[2,E(null)]}))}))}),[u,m]);var b=(null==y?void 0:y.image)||m,N=(null==y?void 0:y.url)||u,I=c((function(){return re(N)}),[N]),T=c((function(){return le(N)}),[N]),x=l(0),M=l(0),P=r(!1),L=P[0],S=P[1];s((function(){var e=function(){var e,t=null===(e=j.current)||void 0===e?void 0:e.getBoundingClientRect(),n=!1;t&&(!x.current||Math.abs((x.current-t.width)/(null==t?void 0:t.width))>.2)&&(x.current=Math.floor(t.width),n=!0),t&&(!M.current||Math.abs((M.current-t.height)/(null==t?void 0:t.height))>.2)&&(M.current=Math.floor(t.height),n=!0),n&&S((function(e){return!e}))};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var j=l(null),B=l(!1);return o.createElement(se,{className:"".concat(v," no-replace-click"),style:w,ref:j},m||!I&&!T?o.createElement("a",{href:N,target:"_blank",rel:"noreferrer"},o.createElement("div",{className:"link-image-wrapper ".concat((null==y?void 0:y.isFetching)?"fetching":"")},(null==y?void 0:y.isFetching)?o.createElement(_,{className:"loading-spinner"}):o.createElement("img",{className:"link-image",src:b||p,onError:function(e){B.current||(B.current=!0,e.currentTarget.src=p)}}))):o.createElement("div",{className:"link-image-wrapper"},I?o.createElement("iframe",{width:"100%",height:"100%",src:"https://www.youtube.com/embed/".concat(I,"?&autoplay=1&mute=1"),frameBorder:"0",allowFullScreen:!0,style:{position:"absolute",top:0,left:0,border:"none",overflow:"hidden"}}):T?o.createElement("iframe",{key:String(L),src:"https://www.facebook.com/plugins/video.php?href=".concat(encodeURIComponent(N),"&autoplay=1&show_text=false&t=0&width=").concat(x.current,"&height=").concat(M.current),style:{position:"absolute",top:"50%",left:"50%",border:"none",overflow:"hidden",height:M.current,width:x.current,transform:"translate(-50%, -50%)"},scrolling:"no",frameBorder:"0",allowFullScreen:!0,allow:"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share"}):null))},pt="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",vt="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",gt="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",ht=function(n){var i=n.onDeleteComment,l=n.commentId,s=n.className,c=void 0===s?"":s,u=n.popoverClassName,m=void 0===u?"":u,p=a(d),v=p.data,g=v.env.isMarryBaby,h=v.locale,f=p.action.pushNotifications,w=xe().t,k=r(!1),C=k[0],y=k[1],E=Q().authActionWrapper;return o.createElement("div",{className:c,onClick:function(e){e.preventDefault(),e.stopPropagation()}},C&&o.createElement($e,{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:w("popup.deleteComment.title"),description:w("popup.deleteComment.description"),acceptText:w("popup.deletePost.accept"),cancelText:w("popup.deletePost.cancel"),onAccept:function(){return e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return l?[4,it({id:l,locale:h})]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(i&&i(),f({title:"",message:w("notification.success"),type:"success"})):f({title:"",message:(null===(n=null==e?void 0:e.messages)||void 0===n?void 0:n[0])||w("notification.failure"),type:"danger"}),[2]}}))}))},onClose:function(){return y(!1)}}),o.createElement(ce,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:gt,label:w("actionPopover.delete"),onClick:function(){E((function(){y(!0)}))}}]},className:m,toggleButtonContent:o.createElement("img",{src:g?pt:vt}),buttonProps:{}}))},ft=function(i){var l,u,m,p,v,h=i.className,f=i.style,w=i.comment,k=i.type,C=void 0===k?"comment":k,y=i.level,E=void 0===y?0:y,b=i.replyingId,N=i.onPostCommentSuccess,I=i.post,T=i.onDeleteComment,x=i.refetchComment,M=i.hasQuickBookingEnable,_=i.handleMakeAppointment,P=a(d).data,L=P.locale,S=P.userInfo,j=P.env.isMarryBaby,B=xe().t,F=r(w||null),R=F[0],D=F[1],A=R.id;R.countReplies;var z=R.countLikes,V=R.content,U=R.createdAt,H=R.replies,W=void 0===H?[]:H,Z=R.images,G=void 0===Z?[]:Z,K=R.author,X=R.liked,J=R.link,Y=R.mentionedUser,$=R.mentions,q=function(e){try{var t=e.match(/\[@([^\]]+)\]/),n=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:n}}catch(e){}return{text:""}}(V),ee=q.text,te=q.replyingTo,ne=Q({_joinCommunityIds:[null===(l=null==I?void 0:I.community)||void 0===l?void 0:l.id],_joinTopicIds:null===(u=null==I?void 0:I.topics)||void 0===u?void 0:u.map((function(e){return e.id}))}).authActionWrapper,ie=r(4),oe=ie[0],ae=ie[1],re=!!(null==S?void 0:S.id)&&(null==W?void 0:W.some((function(e){return e.author.id===S.id}))),le=function(e){D((function(t){t.replies.unshift(e);var i=n(n({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return x&&x(i),i}))},se=r(!1),ce=se[0],fe=se[1],we=c((function(){return"comment"===C&&W&&0!=W.length?W.sort((function(e,t){var n=new Date(e.createdAt).getTime(),i=new Date(t.createdAt).getTime();return n>i?-1:n<i?1:0})):W}),[C,W]),ke=(null==W?void 0:W.length)||0,Ce=String(null==K?void 0:K.email)&&(null==S?void 0:S.email)&&String(null==K?void 0:K.email)===String(null==S?void 0:S.email),ye=(null==K?void 0:K.name)||(null==K?void 0:K.username)||"",Ee=null==K?void 0:K.avatar,be=(null==K?void 0:K.username)||(null==K?void 0:K.name)||"",Ne=r(null),Ie=Ne[0],Me=Ne[1],_e=r(null),Le=_e[0],Se=_e[1];s((function(){if(null==K?void 0:K.hospitalId){n=K.hospitalId,e(void 0,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,g(ge(he.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:Pe[L]}),"get")];case 1:return e=t.sent(),(null===(i=null==e?void 0:e._data)||void 0===i?void 0:i.branch)&&Me(null==e?void 0:e._data.branch),[2]}}))}))}var n,i;if(null==K?void 0:K.doctorId){i=K.doctorId,e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,g(ge(he.GET_DOCTOR_INFO,{doctorId:i,website_url:Pe[L]}),"get")];case 1:return e=t.sent(),(null===(n=null==e?void 0:e._data)||void 0===n?void 0:n.doctor)&&Se(null==e?void 0:e._data.doctor),[2]}}))}))}}),[K.hospitalId,K.doctorId]);var Be=(null==Le?void 0:Le.valid_outpatient)||(null==Le?void 0:Le.valid_telemedicine),Fe=((null==Ie?void 0:Ie.total_available_service)||(null==Ie?void 0:Ie.total_available_doctor))>0,Re=M&&(Be||Fe);return o.createElement(ue,{defaultParams:{_joinCommunityIds:[null===(m=null==I?void 0:I.community)||void 0===m?void 0:m.id],_joinTopicIds:null===(p=null==I?void 0:I.topics)||void 0===p?void 0:p.map((function(e){return e.id}))}},o.createElement(de,{className:h,style:f,"data-is-reply":!!E,"data-is-marrybaby":j,"data-has-booking":Re},"reply"===C&&o.createElement(Te,{className:"top-divider",type:"solid"}),o.createElement(me,{avatar:Ee,name:ye,username:be,email:null==K?void 0:K.email,time:U,className:"post-author ".concat(Ce?"with-popover":""),type:C,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:Re,handleMakeAppointment:_}),o.createElement(lt,{className:"post-content-wrapper",replyingTo:te,mentionedUser:Y,description:ee,mentions:$}),o.createElement("span",null),o.createElement("span",null),G&&G.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(dt,{images:G,authorName:null==K?void 0:K.username})):null,G&&0!==G.length||!J?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(je,{url:J})),"most-engaging"!==C?o.createElement(o.Fragment,null,o.createElement(pe,{type:ve.reply,loveCount:z,replyCount:ke,className:"post-reaction",liked:X,isReplied:re,hideCommentIcon:"reply"===C,onCommentClick:function(){return ne((function(){return fe((function(e){return!e}))}))},onCommentCountClick:function(){return ne((function(){fe(!0)}))},onLikeClick:function(){return ne((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return A?[4,nt({commentId:A,setLike:!X,locale:L})]:[3,2];case 1:1===e.sent().status&&D((function(e){return n(n({},e),{liked:!X,countLikes:e.countLikes+(X?-1:1)})})),e.label=2;case 2:return[2]}}))}))}))}}),ce&&o.createElement(ot,{replyingId:b||R.id,replyToName:K.name||K.username||"",isReply:!0,onClose:function(){return fe(!1)},onPostSuccess:function(e){"reply"===C?N&&N(e):le(e)},post:I,replyingUser:K}),"comment"===C&&W&&W.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(v=null==we?void 0:we.slice(0,oe))||void 0===v?void 0:v.map((function(e){return o.createElement(ft,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:E+1,replyingId:A,onPostCommentSuccess:le,post:I,onDeleteComment:function(){D((function(t){return n(n({},t),{replies:t.replies.filter((function(t){return t.id!==e.id})),countReplies:t.countReplies-1})}))},handleMakeAppointment:_,hasQuickBookingEnable:M})})),ke>oe&&o.createElement(o.Fragment,null,o.createElement(Te,{className:"top-divider",type:"solid"}),o.createElement(O,{className:"more-cmt",size:"lg",color:"ghost",onClick:function(){return ae((function(e){return e+4}))}},B("comment.seeMoreReplies",{count:ke-oe}),o.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,Ce&&o.createElement(ht,{onDeleteComment:T,className:"popover",commentId:R.id})))},wt="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",kt="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",Ct="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",yt=function(n){var i=n.authorEmail,l=n.onDeletePost,s=n.shareUrl,c=n.post,u=n.className,m=void 0===u?"":u,p=n.popoverClassName,v=void 0===p?"":p,g=n.onBookmark,w=n.onRemoveBookmark,k=n.onEditPost,y=a(d),E=y.data,b=E.locale,N=E.userInfo,I=E.togetherUserId,T=E.env.isMarryBaby,x=y.action.pushNotifications,M=xe().t,_=r(!1),P=_[0],L=_[1],S=r(!1),j=S[0],B=S[1],F=r(!1),R=F[0],D=F[1],O=Q().authActionWrapper,A=i&&(null==N?void 0:N.email)&&i===String(null==N?void 0:N.email);return o.createElement("div",{className:m,onClick:function(e){e.preventDefault(),e.stopPropagation()}},R&&o.createElement(fe,{url:s,text:null==c?void 0:c.title,onClose:function(){return D(!1)}}),j&&o.createElement($e,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:M("popup.deletePost.title"),description:M("popup.deletePost.description"),acceptText:M("popup.deletePost.accept"),cancelText:M("popup.deletePost.cancel"),onAccept:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!(null==c?void 0:c.id)||P)return[2];L(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Ae({id:c.id,locale:b})];case 2:return 1===(null==(e=t.sent())?void 0:e.status)&&(null==l||l()),[3,4];case 3:return t.sent(),[3,4];case 4:return L(!1),[2]}}))}))},onClose:function(){return B(!1)}}),o.createElement(ce,{className:v,toggleButtonContent:o.createElement("img",{src:T?pt:vt}),position:"bottom",align:"end",buttonProps:{isLoading:P},data:A?{isShowheader:!1,type:"list",list:[{icon:Ct,label:M("morePopover.share"),onClick:function(){return D(!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:M("actionPopover.edit"),onClick:k},{icon:gt,label:M("actionPopover.delete"),onClick:function(){O((function(){return B(!0)}))}}]}:{isShowheader:!1,type:"list",list:[{icon:Ct,label:M("morePopover.share"),onClick:function(){return D(!0)}},{icon:(null==c?void 0:c.bookmarked)?wt:kt,label:(null==c?void 0:c.bookmarked)?M("morePopover.unsavePost"):M("morePopover.savePost"),onClick:function(){O((function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return(null==N?void 0:N.id)&&(null==c?void 0:c.id)?(null==c?void 0:c.bookmarked)?[4,C(h(f.BOOKMARK.DELETE,{_locale:b}),"DELETE",{data:{post_id:String(c.id)}})]:[3,2]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(x({title:"",message:"Removed saved post",type:"success",displayIcon:kt}),w&&w()):x({title:"",message:"Remove failed",type:"danger",displayIcon:kt}),[3,4];case 2:return[4,C(h(f.BOOKMARK.CREATE,{_locale:b}),"POST",{data:{user_id:I||N.id,post_id:c.id}})];case 3:1===(null==(e=t.sent())?void 0:e.status)?(x({title:"",message:"Post saved",type:"success",displayIcon:wt}),g&&g()):x({title:"",message:"Post saved failed",type:"danger",displayIcon:kt}),t.label=4;case 4:return[2]}}))}))}))}},{icon:at,label:M("morePopover.report"),subTree:{title:M("morePopover.report.title"),description:M("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(we).map((function(e){return{label:we[e].label,reason:we[e].reportReasonText,reasonValue:e}})).map((function(e){return{label:M(e.label),subTree:{title:M("morePopover.reportSubmit.title"),description:M("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:function(t){return o.createElement(rt,{reason:e.reasonValue,reasonText:M(e.reason),postId:null==c?void 0:c.id,onClose:function(){return t&&t(!1)}})}}}}))}}]}}))},Et=function(n,i){return e(void 0,void 0,void 0,(function(){var e,o,a,r;return t(this,(function(t){switch(t.label){case 0:return[4,Ee(h(f.COMMENT.LIST,{postId:n,_locale:i,sort:"popularity",perPage:1,withoutReply:1}),"GET")];case 1:return e=t.sent(),[2,null===(r=null===(a=null===(o=null==e?void 0:e.data)||void 0===o?void 0:o.comments)||void 0===a?void 0:a.map(G))||void 0===r?void 0:r[0]]}}))}))},bt=function(i){var l=i.className,c=i.style,u=i.hideViewMoreComment,m=i.showMostEngaging,h=i.onCommentClick,f=i.onCommentCountClick,w=i.onMostEngagingCommentClick,k=i.onPostCommentSuccess,C=i.disableCardLink,y=i.disableShortenContent,E=i.onDeletePost,b=i.onEditPost,N=i.post,I=i.mostEngagingComment,T=i.onDeleteComment,x=i.showInputComment,_=i.InlineCommentsComponent,P=i.hasQuickBookingEnable,L=i.handleMakeAppointment,S=r(N),j=S[0],B=S[1],F=r(!1),R=F[0],D=F[1],A=r(I),z=A[0],V=A[1],U=j.community,H=j.topics,W=j.author,Z=j.slug,G=j.isPin,K=j.liked,X=j.scheduleDateTime,J=j.createdAt,Y=j.photos,$=j.mentions,q=j.title,ee=j.description,te=j.previewUrl,ne=j.likesCount,ie=j.commentsCount,oe=j.id,ae=j.commented,re=a(d),le=re.data,se=le.locale,ce=le.env,de=ce.isMarryBaby,we=ce.togetherBasePath,Ee=re.action.pushNotifications,be=xe().t,Ne=r(x),Ie=Ne[0],Te=Ne[1],Me="".concat(we,"/").concat((null==U?void 0:U.slug)||"_","/").concat(Z||""),_e="".concat(ke(se)).concat(Me),Pe=Q((null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==H?void 0:H.map((function(e){return e.id}))}:void 0).authActionWrapper,Le=r(!1),Se=Le[0],De=Le[1];s((function(){Te(x)}),[x]);var Ae=(null==W?void 0:W.name)||(null==W?void 0:W.username)||"",ze=(null==W?void 0:W.username)||(null==W?void 0:W.name)||"",Ve=null==W?void 0:W.avatar,Ue=r(null),He=Ue[0],We=Ue[1],Ze=r(null),Ge=Ze[0],Ke=Ze[1];s((function(){if(null==W?void 0:W.hospitalId){n=W.hospitalId,e(void 0,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,g(ge(he.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:ye[se]}),"get")];case 1:return e=t.sent(),(null===(i=null==e?void 0:e._data)||void 0===i?void 0:i.branch)&&We(null==e?void 0:e._data.branch),[2]}}))}))}var n,i;if(null==W?void 0:W.doctorId){i=W.doctorId,e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,g(ge(he.GET_DOCTOR_INFO,{doctorId:i,website_url:ye[se]}),"get")];case 1:return e=t.sent(),(null===(n=null==e?void 0:e._data)||void 0===n?void 0:n.doctor)&&Ke(null==e?void 0:e._data.doctor),[2]}}))}))}}),[W.hospitalId,W.doctorId]);var Qe=(null==Ge?void 0:Ge.valid_outpatient)||(null==Ge?void 0:Ge.valid_telemedicine),Xe=((null==He?void 0:He.total_available_service)||(null==He?void 0:He.total_available_doctor))>0,Je=P&&(Qe||Xe);s((function(){e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return oe&&ie&&m&&!(null==I?void 0:I.id)?[4,Et(oe,se)]:[3,2];case 1:e=t.sent(),V(e),t.label=2;case 2:return[2]}}))}))}),[oe,se,ie,m,null==I?void 0:I.id]),s((function(){V(I)}),[null==I?void 0:I.id]);var Ye=function(i){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:return ie>1&&(null==z?void 0:z.id)&&(null==z?void 0:z.id)===(null==i?void 0:i.id)?[4,Et(oe,se)]:[3,2];case 1:e=t.sent(),V(e),t.label=2;case 2:return B((function(e){return n(n({},e),{commentsCount:e.commentsCount-1})})),T&&T(i),[2]}}))}))};return o.createElement(ue,{defaultParams:(null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==H?void 0:H.map((function(e){return e.id}))}:void 0},R&&o.createElement(fe,{url:_e,avatar:p,text:q,onClose:function(){return D(!1)}}),o.createElement(Ce,{className:l,style:c,"data-is-marrybaby":de},G?o.createElement(Fe,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative"}},o.createElement(me,{avatar:Ve,name:Ae,username:ze,url:C?void 0:Me,email:null==W?void 0:W.email,time:X||J,community:U,className:"post-author",role:null==W?void 0:W.role,userId:null==W?void 0:W.id,expertId:null==W?void 0:W.partnerId,doctorId:null==W?void 0:W.doctorId,hospitalId:null==W?void 0:W.hospitalId,title:null==W?void 0:W.title,hasQuickBooking:Je,handleMakeAppointment:L}),o.createElement(yt,{authorEmail:String(null==W?void 0:W.email),onDeletePost:E,shareUrl:_e,post:j,className:"popover",onEditPost:b})),o.createElement("a",{href:C?void 0:Me,className:"post-content-link-wrapper"},q&&o.createElement(v,{className:"post-content-title",as:"h1",tag:"h5",fontWeight:"bold"},M(q)),o.createElement(lt,{className:"post-content-wrapper",description:ee,disableShortenContent:y,mentions:$})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},H&&H.length>0?o.createElement(Be,{topics:H,className:"post-topics"}):null),o.createElement("div",{key:"social-preview"},(null==j?void 0:j.introUrl)?o.createElement("div",{className:"social-preview-wrapper ".concat((null==Y?void 0:Y.length)?"has-image":"")},o.createElement(mt,{url:j.introUrl,image:j.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==Y?void 0:Y.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(dt,{images:Y,authorName:null==W?void 0:W.name})):null),o.createElement("div",{key:"link-preview"},(null==j?void 0:j.introUrl)||(null==Y?void 0:Y.length)||!(null==te?void 0:te.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(je,{title:te.title,url:te.url,image:te.image}))),o.createElement(pe,{type:ve.post,loveCount:ne,replyCount:ie,className:"post-reaction ".concat((null==Y?void 0:Y.length)||(null==te?void 0:te.url)?"hide-top-border":""),liked:Se?!K:K,isReplied:ae,onCommentClick:function(){return Pe((function(){h?h():Te((function(e){return!e}))}))},onCommentCountClick:function(){Pe((function(){de?Te(!0):f?f():!C&&(window.location.href=Me)}))},onShareClick:function(){D(!0)},onLikeClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!oe||Se)return[2];De(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Oe({id:oe,locale:se})];case 2:return 1!==(null==(e=t.sent())?void 0:e.status)?Ee(Re(be)):B((function(e){return n(n({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})})),[3,4];case 3:return t.sent(),Ee(Re(be)),[3,4];case 4:return De(!1),[2]}}))}))},showingMostEngaging:!(!m||!(null==z?void 0:z.id))}),Ie&&o.createElement(ot,{isMainCmt:!x,onClose:function(){return Te(!1)},onPostSuccess:function(e){0!==ie||(null==z?void 0:z.id)||V(e),B((function(e){return n(n({},e),{commentsCount:e.commentsCount+1,commented:!0})})),k&&k(e)},post:j}),m&&(null==z?void 0:z.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:function(e){w?(e.stopPropagation(),w()):window.location.href=Me}},o.createElement(ft,{hasQuickBookingEnable:P,handleMakeAppointment:L,comment:z,onDeleteComment:function(){Ye&&Ye(z)},className:"most-engaging-comment",type:"most-engaging",key:z.id}),ie>1&&!u&&o.createElement(O,{className:"see-more-comments",color:"ghost",size:"md"},be("comment.seeMoreComments",{count:ie-1}))):null,_))},Nt=Object.freeze({__proto__:null});export{je as C,ot as I,Fe as L,$e as P,rt as S,Be as T,Ye as a,Ge as b,Qe as c,Xe as d,lt as e,st as f,ut as g,dt as h,bt as i,yt as j,ft as k,ht as l,Nt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e}from"./tslib.es6-fd0a5c98.js";import{i as o,t}from"./theme-d85b3a33.js";var i,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":o?"https://".concat(m[s]):"https://discover.".concat(m[s]),_=o?"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"}(i||(i={}));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 i},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.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(o){var t,i,l,n,a,r,s,u;return o?e(e({},A.formatProduct(o)),{relatedProducts:(null===(i=null===(t=o.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=o.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=o.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=o.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"});export{l as a,T as c,n as d,f as i,b as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as t,useEffect as n}from"react";var e=Object.freeze({__proto__:null}),i=function(e){var i=t(""),o=i[0],r=i[1];n((function(){fetch("https://api.ipify.org").then((function(t){return t.text()})).then((function(t){t?r(t):fetch("https://icanhazip.com").then((function(t){return t.text()})).then((function(t){t&&r(t)}))}))}),[]),n((function(){var t=null;return e&&o&&function n(){window.fbq?window.fbq("track","FB Conversion",{user_data:[{em:e.email||"",fn:"",ln:"",ph:e.phone||"",client_ip_address:o||""}]}):t=setTimeout(n,2e3)}(),function(){t&&clearTimeout(t)}}),[e,o])};export{e as t,i as u};
|