@hhgtech/hhg-components 1.18.64 → 1.18.67
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/components/atoms/index.d.ts +6 -3
- package/build/components/molecules/index.d.ts +16 -8
- package/build/components/organisms/navigationLayout/navigationBar/index.d.ts +1 -1
- package/build/components.js +1 -1
- package/build/esm/components/atoms/index.d.ts +6 -3
- package/build/esm/components/molecules/index.d.ts +16 -8
- package/build/esm/components/organisms/navigationLayout/navigationBar/index.d.ts +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/{index-773ec0fc.js → index-02015689.js} +2 -2
- package/build/esm/{index-773ec0fc.js.map → index-02015689.js.map} +1 -1
- package/build/esm/{index-6dc161c2.js → index-1b1f72cf.js} +2 -2
- package/build/esm/{index-6dc161c2.js.map → index-1b1f72cf.js.map} +1 -1
- package/build/esm/{index-ec347944.js → index-2481fb33.js} +2 -2
- package/build/esm/{index-ec347944.js.map → index-2481fb33.js.map} +1 -1
- package/build/esm/{index-335ef676.js → index-8492ba6c.js} +2 -2
- package/build/esm/{index-335ef676.js.map → index-8492ba6c.js.map} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-e833993c.js → index.styled-c3644bb3.js} +2 -2
- package/build/esm/index.styled-c3644bb3.js.map +1 -0
- package/build/esm/navigation.js +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{types-57296778.js → types-3adcc0f7.js} +2 -2
- package/build/esm/{types-57296778.js.map → types-3adcc0f7.js.map} +1 -1
- package/build/{index-7d955e63.js → index-9894ab41.js} +2 -2
- package/build/{index-7d955e63.js.map → index-9894ab41.js.map} +1 -1
- package/build/{index-a439fdab.js → index-a01cbfaa.js} +2 -2
- package/build/{index-a439fdab.js.map → index-a01cbfaa.js.map} +1 -1
- package/build/{index-7bfe3e4b.js → index-b8921c86.js} +2 -2
- package/build/{index-7bfe3e4b.js.map → index-b8921c86.js.map} +1 -1
- package/build/{index-b30cc5ed.js → index-ea7c6be1.js} +2 -2
- package/build/{index-b30cc5ed.js.map → index-ea7c6be1.js.map} +1 -1
- package/build/index.js +1 -1
- package/build/{index.styled-be645089.js → index.styled-719b0f7e.js} +2 -2
- package/build/index.styled-719b0f7e.js.map +1 -0
- package/build/navigation.js +1 -1
- package/build/together.js +1 -1
- package/build/{types-6be2db53.js → types-75086329.js} +2 -2
- package/build/{types-6be2db53.js.map → types-75086329.js.map} +1 -1
- package/package.json +1 -1
- package/build/esm/index.styled-e833993c.js.map +0 -1
- package/build/index.styled-be645089.js.map +0 -1
package/build/esm/navigation.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./tslib.es6-fd0a5c98.js";import"react";import"./core-3d8a3f90.js";import"./cookieHelper-3c199921.js";export{N as NavigationV2,g as getNavMenuContent,c as getNavMenuContentWithCache}from"./index-
|
|
1
|
+
import"./tslib.es6-fd0a5c98.js";import"react";import"./core-3d8a3f90.js";import"./cookieHelper-3c199921.js";export{N as NavigationV2,g as getNavMenuContent,c as getNavMenuContentWithCache}from"./index-2481fb33.js";import"react-id-generator";import"./index.styled-c3644bb3.js";import"date-fns";import"react-day-picker/DayPickerInput";import"lodash/debounce";import"react-dom";import"lodash";import"./useTranslations-5638eb68.js";import"react-range";import"./theme-d85b3a33.js";import"styled-components";import"smoothscroll-polyfill";import"./constants-dc22740c.js";import"./translationsContext-977d7bc4.js";import"date-fns/locale/en-US";import"date-fns/locale/hi";import"date-fns/locale/id";import"date-fns/locale/ms";import"date-fns/locale/th";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";
|
|
2
2
|
//# sourceMappingURL=navigation.js.map
|
package/build/esm/together.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{f as CardAuthor,C as CardReactions,D as DefaultComponentGlobalContextData,G as GlobalData,b as LabelSortPin,e as LabelSorting,L as Loading,l as PopoverMenu,h as PopupDoctor,g as PopupExpert,j as PopupFrame,i as PopupHospital,k as ShareBox,S as SharePopup,T as TogetherAuthConfigContext,a as TogetherAuthConfigContextProvider,m as TogetherComponentGlobalContext,n as TogetherComponentGlobalContextProvider,c as TogetherConstants,d as TogetherDataTransforms,U as UserAvatar,u as useTogetherAuthRequiredAction}from"./index.styled-
|
|
1
|
+
export{f as CardAuthor,C as CardReactions,D as DefaultComponentGlobalContextData,G as GlobalData,b as LabelSortPin,e as LabelSorting,L as Loading,l as PopoverMenu,h as PopupDoctor,g as PopupExpert,j as PopupFrame,i as PopupHospital,k as ShareBox,S as SharePopup,T as TogetherAuthConfigContext,a as TogetherAuthConfigContextProvider,m as TogetherComponentGlobalContext,n as TogetherComponentGlobalContextProvider,c as TogetherConstants,d as TogetherDataTransforms,U as UserAvatar,u as useTogetherAuthRequiredAction}from"./index.styled-c3644bb3.js";export{C as CardLink,i as CardPost,j as CardPostPopoverMore,k as CardReply,l as CardReplyPopover,a as CreateNewPostContent,b as CreatePostDescription,c as CreatePostTitle,f as ImagePreviewPopup,I as InputCommentBar,L as LabelPin,P as PopupDanger,e as PostContent,h as PostImagePreview,g as PostSingleImageViewPopup,S as SubmitReportForm,T as TagTopic,t as TogetherTypes,d as TopicSelectList}from"./types-3adcc0f7.js";import"./tslib.es6-fd0a5c98.js";import"styled-components";import"react";import"./cookieHelper-3c199921.js";import"./theme-d85b3a33.js";import"./useTranslations-5638eb68.js";import"./translationsContext-977d7bc4.js";import"date-fns";import"date-fns/locale/en-US";import"date-fns/locale/hi";import"date-fns/locale/id";import"date-fns/locale/ms";import"date-fns/locale/th";import"date-fns/locale/vi";import"date-fns/locale/zh-TW";import"react-id-generator";import"lodash";import"react-dom";import"./index-1b1f72cf.js";import"react-range";import"lodash/debounce";
|
|
2
2
|
//# sourceMappingURL=together.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
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,z as m,E as p,H as v,F as g,I as h,J as f,K as w,b as k,M as C,N as y,O as E,Q as b,R as N,V as I,W as T,X as x,Y as M,L as _,Z as P,_ as L,$ as S,a0 as j,a1 as B,a2 as F,a3 as R,a4 as D,B as O,y as A,a5 as z,j as V,a6 as U,a7 as H,U as W,a8 as Z,a9 as G,aa as K,u as Q,g as X,ab as J,ac as Y,ad as $,ae as q,af as ee,ag as te,ah as ne,ai as ie,aj 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-e833993c.js";import{T as be,I as Ne}from"./cookieHelper-3c199921.js";import{a as Ie,D as Te}from"./index-6dc161c2.js";import{u as xe,b as Me}from"./useTranslations-5638eb68.js";import{t as _e,d as Pe}from"./theme-d85b3a33.js";import"react-range";import Le from"lodash/debounce";import*as Se from"react-dom";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(Le((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)}}),[]),Se.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)}),[]),Se.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 Se.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};
|
|
2
|
-
//# sourceMappingURL=types-
|
|
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,z as m,E as p,H as v,F as g,I as h,J as f,K as w,b as k,M as C,N as y,O as E,Q as b,R as N,V as I,W as T,X as x,Y as M,L as _,Z as P,_ as L,$ as S,a0 as j,a1 as B,a2 as F,a3 as R,a4 as D,B as O,y as A,a5 as z,j as V,a6 as U,a7 as H,U as W,a8 as Z,a9 as G,aa as K,u as Q,g as X,ab as J,ac as Y,ad as $,ae as q,af as ee,ag as te,ah as ne,ai as ie,aj 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-c3644bb3.js";import{T as be,I as Ne}from"./cookieHelper-3c199921.js";import{a as Ie,D as Te}from"./index-1b1f72cf.js";import{u as xe,b as Me}from"./useTranslations-5638eb68.js";import{t as _e,d as Pe}from"./theme-d85b3a33.js";import"react-range";import Le from"lodash/debounce";import*as Se from"react-dom";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(Le((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)}}),[]),Se.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)}),[]),Se.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 Se.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};
|
|
2
|
+
//# sourceMappingURL=types-3adcc0f7.js.map
|