@hhgtech/hhg-components 1.19.19 → 1.19.21
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/ageGenerate-0d92367e.js +1 -0
- package/build/components.js +1 -1
- package/build/core.js +1 -1
- package/build/esm/ageGenerate-374994d3.js +1 -0
- package/build/esm/babyGrowth.js +1 -1
- package/build/esm/cache.js +1 -1
- package/build/esm/care.js +1 -1
- package/build/esm/components.js +1 -1
- package/build/esm/core-286f158c.js +1 -0
- package/build/esm/core.js +1 -1
- package/build/esm/ecom.js +1 -1
- package/build/esm/i18n.js +1 -1
- package/build/esm/{index-e25a976f.js → index-6fd83093.js} +1 -1
- package/build/esm/{index-84fac470.js → index-9fb0e35b.js} +1 -1
- package/build/esm/index-c0caf448.js +1 -0
- package/build/esm/index-cc1a1d0f.js +1 -0
- package/build/esm/{index-a74b53cb.js → index-d6a90885.js} +1 -1
- package/build/esm/{index-3a36f8a0.js → index-e2eef721.js} +1 -1
- package/build/esm/{index-6e0cbc08.js → index-fca2ee63.js} +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/{index.styled-c5e035f3.js → index.styled-37563568.js} +1 -1
- package/build/esm/{index.styled-6559ec11.js → index.styled-b3822d90.js} +1 -1
- package/build/esm/{index.styled-c1edfd6f.js → index.styled-ffed6187.js} +1 -1
- package/build/esm/navigation.js +1 -1
- package/build/esm/together.js +1 -1
- package/build/esm/{translationsProvider-3b4b064d.js → translationsProvider-63b85cf2.js} +1 -1
- package/build/esm/{tslib.es6-fd0a5c98.js → tslib.es6-6ae0d506.js} +1 -1
- package/build/esm/{types-0402f8a4.js → types-2dabe70c.js} +1 -1
- package/build/esm/types-99081a6a.js +1 -0
- package/build/esm/{types-05e4d87b.js → types-bfc0e558.js} +1 -1
- package/build/esm/{useTranslations-d76b98a9.js → useTranslations-3dbb43bb.js} +1 -1
- package/build/{index-84b9f3e8.js → index-4e09e5ff.js} +1 -1
- package/build/{index-164221e6.js → index-c8166cee.js} +1 -1
- package/build/index.js +1 -1
- package/build/navigation.js +1 -1
- package/package.json +1 -1
- package/build/ageGenerate-bcd37ccf.js +0 -1
- package/build/esm/ageGenerate-61e2769b.js +0 -1
- package/build/esm/core-3d8a3f90.js +0 -1
- package/build/esm/index-448bb306.js +0 -1
- package/build/esm/index-e3b386f9.js +0 -1
- package/build/esm/types-0b6d82bd.js +0 -1
|
@@ -1 +1 @@
|
|
|
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{T as d,B as m}from"./index.styled-c5e035f3.js";import{a as p,D as v}from"./index-a74b53cb.js";import{u as g,t as h,k as f}from"./useTranslations-d76b98a9.js";import{m as w,z as k,B as C,E as y,F as E,H as b,I as N,b as I,J as T,M as x,K as M,N as _,O as P,Q as L,R as S,V as j,W as B,L as F,X as R,Y as D,_ as O,Z as A,$ as z,a0 as V,a1 as U,a2 as H,y as W,a3 as Z,j as G,a4 as K,a5 as Q,U as X,a6 as J,a7 as Y,a8 as $,u as q,g as ee,a9 as te,aa as ne,ab as ie,ac as oe,ad as ae,ae as re,af as le,ag as se,ah as ce,ai as ue,aj as de,ak as me,al as pe,a as ve,am as ge,f as he,C as fe,an as we,ao as ke,ap as Ce,S as ye,aq as Ee,o as be,ar as Ne,as as Ie,at as Te}from"./index.styled-6559ec11.js";import{t as xe}from"./theme-731042bc.js";import"react-range";import*as Me from"react-dom";import"date-fns";import{I as _e}from"./index-e25a976f.js";import Pe from"lodash/debounce";import{H as Le}from"./index-e3b386f9.js";import{l as Se}from"./number-126ee62e.js";import"styled-components";import{d as je}from"./constants-17d17987.js";var Be=function(i){var c=i.title,u=i.url,m=i.image,p=i.logo,v=i.className,g=i.style,h=i.noRefetch,f=a(w).data,N=f.locale,I=f.env.isMarryBaby,T=r(!1),x=T[0],M=T[1],_=l(h);_.current=h;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})})),y(E(b.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)||m,B=(null==L?void 0:L.title)||c,F=(null==L?void 0:L.logo)||p,R=(null==L?void 0:L.url)||u,D=R.replace("http://","").replace("https://","").split(/[/?#]/)[0],O=l(!1);return o.createElement(k,{"data-is-marrybaby":I,className:"".concat(v," no-replace-click"),style:g},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=C)}}),o.createElement("img",{className:"link-image",src:j,onError:function(e){O.current||(O.current=!0,e.currentTarget.src=C)}})),o.createElement("div",{className:"link-info-container"},o.createElement(d,{size:"n1"},I&&F&&!x&&o.createElement("img",{className:"link-logo",src:F,onError:function(e){return M(!0)}}),D),o.createElement(Le,{tag:"h6"},B))))},Fe=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(w),g=v.data.env.togetherBasePath,h=v.action.sanitizeFunction;return o.createElement(N,{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(d,{size:"p3"},o.createElement("span",{dangerouslySetInnerHTML:{__html:(null==h?void 0:h(e.name))||e.name}})))})))},Re=function(e){var t=e.onClick;e.color;var n=e.className,i=e.style,r=a(w).data.env.isMarryBaby,l=g().t;return o.createElement(I,{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})},De=function(e){return{message:e("notification.failure"),type:"danger"}},Oe="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",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,T(E(b.POST.LIKE,{id:i,_locale:o}),"GET")]:[2];case 1:return[2,e.sent()]}}))}))},ze=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,T(E(b.POST.DELETE,{id:i,_locale:o}),"DELETE")]:[2];case 1:return[2,e.sent()]}}))}))},Ve=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=M(o),h=M(i),f=_(n),e.append("title",h),e.append("description",P(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(L(e,c))}),2e3*t)}))})))]:[3,2];case 1:return null==(w=t.sent())||w.filter(Boolean).slice(0,x).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]}}))}))},Ue=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,T(E(a?b.POST.CREATE_ARTICLE_COMMENT:b.POST.CREATE,{_locale:i}),"POST",{data:o,headers:{"Content-Type":"multipart/form-data"}})];case 1:return[2,e.sent()]}}))}))},He=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,T(E(b.POST.UPDATE,{id:i,_locale:o}),"POST",{data:a})];case 1:return[2,e.sent()]}}))}))},We=function(e){var t=e.id,n=e.reason,i=e.locale,o=new FormData;return o.append("reason",n),T(E(b.POST.REPORT,{_locale:i,id:t}),"POST",{data:o})},Ze=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}},Ge="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",Ke=function(e){var t=e.className,n=e.style,i=e.bannedWords,a=void 0===i?[]:i,c=e.value,u=e.onChange,m=e.onPreviewUrlChange,p=e.onInvalidUrlsChange,v=e.onImageFilesChange,h=e.imageFiles,f=e.isReplying,w=g().t,k=r(null),C=k[0],y=k[1],E=l(null),b=Ze(h,v),N=b.onSelectImages,I=b.onRemoveImage,T=b.imageSrcs;return s((function(){m&&((null==C?void 0:C.url)?m({title:C.title||"",url:C.url||"",image:C.image||"",description:C.description||""}):m(null))}),[C]),o.createElement(S,{className:t,style:n},o.createElement(d,{size:"p4",className:"description-label"},w("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(j,{html:c||"",onChange:u,bannedWords:a,onImagePickerClick:function(){var e;return null===(e=E.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:y,onInvalidUrlsChange:p,isReplying:f}))),o.createElement(d,{size:"p4",className:"count-string"},w("character"),": ",B(c||"").length),(!T||0===T.length)&&C&&o.createElement("div",{className:"link-preview-wrapper"},C.isFetching?o.createElement(F,null):o.createElement(o.Fragment,null,o.createElement(Be,{title:C.title,url:C.url||"#",image:C.image,noRefetch:!0}),o.createElement("img",{src:Ge,className:"icon-close",onClick:function(){return y(null)}}))),o.createElement("input",{ref:E,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:N}),T.length>x?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:Oe}),o.createElement(d,{size:"p4",color:xe.colors.alertWarning},w("createPost.popup.warningImage"))):null,T.length>0&&o.createElement("div",{className:"image-gallery"},T.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:Ge,onClick:function(){return I(t)}}))}))))},Qe=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 R(a,o)},Xe=function(e){var t,n=e.className,i=e.style,a=e.bannedWords,c=void 0===a?[]:a,m=e.value,p=e.onChange,v=g().t,h=r(""),f=h[0],w=h[1],k=l(null);s((function(){if(k.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=k.current;return t.addEventListener("paste",e),function(){return t.removeEventListener("paste",e)}}}),[k]);var C=(null==c?void 0:c.join(","))||"";s((function(){var e;if(C){var t=null===(e=k.current)||void 0===e?void 0:e.innerText;if(t){var n=R(t,c);n!==t&&(p&&p(n),w(n))}}}),[C]);var y=u(Pe((function(e){if(k.current){var t=Qe(k.current.innerText,{limit:120,bannedWords:c});p&&p(t),w(t)}}),300),[]);return s((function(){setTimeout((function(){var e;null===(e=k.current)||void 0===e||e.focus()}),500)}),[]),o.createElement(D,{className:n,style:i},o.createElement(_e,{name:"title",value:m||f,size:"md",label:v("createPost.title"),CustomInput:o.createElement(O,{innerRef:k,html:m||f,onChange:function(e){if(k.current&&k.current.innerText!==(m||f)){var t=Qe(k.current.innerText,{bannedWords:c});p&&p(t),w(t),y(k.current.innerText)}},className:"title-input"})}),o.createElement(d,{size:"p4",className:"count-string"},v("createPost.popup.wordCount",{count:(null===(t=k.current)||void 0===t?void 0:t.innerText.length)||0,max:120})))},Je=function(n){var u=n.className,d=n.style,m=n.topics,p=n.communityId,v=n.onChange,g=n.isLoading,h=n.disabled,f=n.forceTopics,k=n.selectedTopics,C=n.noFetch,N=a(w).data,I=N.locale,T=N.env.isMarryBaby,x=r(m?i([],m,!0):[]),M=x[0],_=x[1],P=r(k?i([],k,!0):[]),L=P[0],S=P[1],j=r(!1),B=j[0],R=j[1],D=l(m);D.current=m,s((function(){var n;!p||C||(null===(n=D.current)||void 0===n?void 0:n.length)||(_([]),R(!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,y(E(b.TOPIC.LIST,{communityId:p,_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)&&_((function(){return(null==n?void 0:n.map(z).sort((function(e,t){return(e.order||0)-(t.order||0)})))||[]})),[3,3];case 2:return i=t.sent(),console.log(i),R(!1),[3,3];case 3:return R(!1),[2]}}))})))}),[p,C]);var O=null==m?void 0:m.map((function(e){return e.id})).join("-"),V=null==M?void 0:M.map((function(e){return e.id})).join("-"),U=null==f?void 0:f.map((function(e){return e.id})).join("-");s((function(){m&&void 0!==O&&O!==V&&_(m)}),[m,O,V]);var H=c((function(){return M.filter((function(e){return!(null==f?void 0:f.some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})))}))}),[V,U]);return o.createElement(A,{"data-is-marrybaby":T,className:u,style:d},f.map((function(e){return o.createElement(Ye,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:!0,selected:!0})})),H.map((function(e){return o.createElement(Ye,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:h,selected:(k||L).some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})),onClick:function(){var t=k||L,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),v&&k?v(t.slice()):(v&&v(t.slice()),S(t.slice()))}})})),(g||B)&&o.createElement(F,{className:"topic-spinner"}))},Ye=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)},$e=function(n){var l=n.className,c=n.style,u=n.onPostCreatedEdited,v=n.onClose,h=n.communities,f=void 0===h?[]:h,k=n.forceSelectCommunity,C=n.forceSelectTopics,y=n.articleId,E=n.optionalTopic,b=n.editPostData,N=n.defaultCommunity,I=n.defaultTopics,T=n.noFetchTopic,M=n.hideTopicList,_=!!(null==b?void 0:b.id),P=a(w),L=P.data,S=L.locale,j=L.env.isMarryBaby,F=P.action,R=F.pushNotifications,D=F.sanitizeFunction,O=g().t,A=r(!1),z=A[0],Z=A[1],G=r(""),K=G[0],Q=G[1],X=r(""),J=X[0],Y=X[1],$=r(k?{label:k.name,value:"".concat(k.id||"","-").concat(k.mappedCategoryId||"")}:{label:O("community.choose"),value:""}),q=$[0],ee=$[1],te=r(i([],C,!0)||[]),ne=te[0],ie=te[1],oe=r([]),ae=oe[0],re=oe[1],le=r([]),se=le[0],ce=le[1],ue=k||f.find((function(e){return"".concat(e.id||"","-").concat(e.mappedCategoryId||"")===q.value})),de=k?[k]:f.filter((function(e){return e.isActive})).sort((function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),me=r(null),pe=me[0],ve=me[1],ge=r([]),he=ge[0],fe=ge[1],we=K&&B(J)&&(E||!E&&ne.length>0)&&ue&&(!ae||ae.length<=x)&&!(null==he?void 0:he.length)&&!z;s((function(){if(b){var e=b;Q(e.title||""),Y(V(U(e.description||"","edit"),e.mentions)),ee({label:e.community.name,value:"".concat(e.community.id||"","-").concat(e.community.mappedCategoryId||"")}),ie(e.topics||[]),re(e.photos||[])}else N&&ee({label:N.name,value:"".concat(N.id||"","-").concat(N.mappedCategoryId||"")}),I&&ie(I)}),[]);var ke=function(){return e(void 0,void 0,void 0,(function(){var e,n,i,o,a,r,l,s,c,d,m,p;return t(this,(function(t){switch(t.label){case 0:return[4,Ve({title:K,description:J,communityId:String((null==ue?void 0:ue.id)||""),imageFiles:ae,previewUrl:pe,topicIds:null==ne?void 0:ne.map((function(e){return String(e.id||"")})).filter(Boolean),locale:S,sanitizeFunction:D,categoryCommunityId:String((null==ue?void 0:ue.mappedCategoryId)||""),categoryTopicIds:null==ne?void 0:ne.map((function(e){return String(e.mappedCategoryId||"")})).filter(Boolean)})];case 1:return e=t.sent(),y&&e.append("article_id",y),_?(null==b?void 0:b.id)?[4,He({id:b.id,formData:e,locale:S})]:[3,3]:[3,4];case 2:n=t.sent(),t.label=3;case 3:return[3,6];case 4:return[4,Ue({formData:e,locale:S,isArticleComment:!(null==ue?void 0:ue.id)&&!!(null==ue?void 0:ue.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)?(R({message:O("createPost.popup.success"),type:"success"}),function(e){u&&u(W(e),_),v&&v()}(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)?(R({title:O("notification.post.blocked.title"),message:O("notification.post.blocked.message"),type:"danger"}),n.messages.moderation.words&&ce(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)?(R({title:O("notification.post.suspect.title"),message:O("notification.post.suspect.message"),type:"warning"}),v&&v()):(null===(m=null===(d=null==n?void 0:n.messages)||void 0===d?void 0:d.find)||void 0===m?void 0:m.call(d,(function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(R({message:O("notification.suspend.message"),type:"danger"}),v&&v()):R({message:(null===(p=null==n?void 0:n.messages)||void 0===p?void 0:p[0])||O("notification.failure"),type:"danger"}),[2]}}))}))};return o.createElement(H,{className:l,style:c},o.createElement("div",{className:"input-group-container"},o.createElement(Xe,{className:"input-group",bannedWords:se,value:K,onChange:Q}),o.createElement(Ke,{className:"input-group",bannedWords:se,value:J,onChange:Y,onPreviewUrlChange:ve,onInvalidUrlsChange:fe,onImageFilesChange:re,imageFiles:ae}),o.createElement("div",{className:"input-group"},o.createElement(d,{size:"p4",className:"input-group-label"},O("admin.community")),o.createElement(p,{options:(null==de?void 0:de.map((function(e,t){return{label:e.name,value:"".concat(e.id||"","-").concat(e.mappedCategoryId||"")}})))||[],id:"community-picker",placeholder:O("community.choose"),value:q,onChange:function(e){ee({label:e.label,value:String(e.value)}),ie([])},disabled:!!k}),o.createElement(d,{size:"sm",className:"warning",color:xe.colors.gray400},"* ",O("commentPopup.warning.newPost"))),!M&&o.createElement("div",{className:"input-group"},o.createElement(d,{size:"p4",className:"input-group-label"},O("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:ue?"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":Oe}),o.createElement(d,{size:"base",color:xe.colors.gray500},O(ue?"createPost.popup.primary":"createPost.popup.warning"))),ue&&o.createElement(Je,{className:"tag-list",communityId:ue.id,forceTopics:C,onChange:ie,selectedTopics:ne,noFetch:T}))),o.createElement(m,{theme:j?"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(!we||z)return[3,5];Z(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,ke()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),console.error(e),R(De(O)),[3,4];case 4:Z(!1),t.label=5;case 5:return[2]}}))}))},isDisabled:!we,isLoading:z},O("createPost.popup.submit")))},qe=function(e){var t=e.className,n=e.isMarryBaby,i=e.style,l=e.title,c=e.description,u=e.acceptText,p=e.cancelText,v=e.onAccept,g=e.thumbnail,k=e.isThumbnailIcon,C=e.onClose,y=a(w).data.env.isMarryBaby,E="boolean"==typeof n?n:y,b=r(!1),N=b[0],I=b[1];return s((function(){return h(!0),setTimeout((function(){return I(!0)}),0),function(){return h(!1)}}),[]),Me.createPortal(o.createElement(Z,{"data-is-marrybaby":E,className:t,style:i,"data-open":N},o.createElement(G,{className:"popup-frame",isOpen:N,onClose:C},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(k?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:g})),o.createElement(Le,{className:"title",tag:"h2"},l),o.createElement(d,{className:"desc",size:"lg"},c),o.createElement("div",{className:"btn-group"},o.createElement(m,{theme:E?"marryBaby":"helloSites",size:"md",color:"secondary",onClick:function(){null==v||v(),null==C||C()}},u),o.createElement(m,{theme:E?"marryBaby":"helloSites",size:"md",onClick:C},p)))),E&&g&&o.createElement("div",{className:"thumbnail-container is-mobile ".concat(k?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:g})))),f())},et=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=P(o.replace(/(\ )+/g," "),s),m=_(n),a&&a.length>0?[4,Promise.all(null==a?void 0:a.map((function(e){return L(e,l)})))]:[3,2];case 1:t.sent().filter(Boolean).slice(0,x).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]}}))}))},tt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,T(E(b.COMMENT.CREATE,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},nt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,T(E(b.COMMENT.REPLY,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},it=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,T(E(a?b.COMMENT.LIKE:b.COMMENT.UNLIKE,{_locale:r,id:i}),"GET")]}))}))},ot=function(e){var t=e.id,n=e.locale;return T(E(b.COMMENT.DELETE,{_locale:n,id:t}),"DELETE")},at=function(i){var c=i.isReply,u=i.className,p=i.onClose,v=i.replyToName,h=i.style,f=i.replyingId,k=i.replyingUser,C=i.onPostSuccess;i.isMainCmt;var y=i.post,E=i.isMarryBaby,b=a(w),N=b.action,I=N.pushNotifications,T=N.sanitizeFunction,x=b.data,M=x.userInfo,_=x.locale,P=x.env.isMarryBaby,L="boolean"==typeof E?E:P,S=g().t,B=Ze(),R=B.onSelectImages,D=B.onRemoveImage,O=B.imageSrcs,A=B.onRemoveAllImages,z=B.imageFiles,V=r(""),U=V[0],H=V[1],W=a(K).trigger,Z=r(!1),G=Z[0],$=Z[1],q=l(null),ee=l(null),te=l(null),ne=r([]),ie=ne[0],oe=ne[1],ae=r([]),re=ae[0],le=ae[1],se=r(null),ce=se[0],ue=se[1];return s((function(){var e;null===(e=te.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((function(){var e;null===(e=ee.current)||void 0===e||e.focus()}),400)}),[W]),o.createElement(Q,{"data-is-reply":c,className:u,style:h},c&&o.createElement("div",{className:"reply-to-container"},o.createElement(d,{size:"p4"},o.createElement("span",{dangerouslySetInnerHTML:{__html:S("inputComment.replyTo",{name:'<span style="color: #2D87F3; cursor: pointer">@'.concat(v||"","</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 p&&p()}})),o.createElement("div",{className:"input-container",ref:te},o.createElement(X,{className:"avatar-wrapper ".concat(c?"avatar-wrapper-reply":""),avatar:(null==M?void 0:M.id)?M.avatar:J,username:(null==M?void 0:M.name)||(null==M?void 0:M.username)}),o.createElement("input",{ref:q,onChange:R,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),o.createElement(_e,{value:U,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(j,{className:"textarea",html:U,onChange:H,onImagePickerClick:function(){var e;return null===(e=q.current)||void 0===e?void 0:e.click()},bannedWords:re,onPreviewUrlChange:ue,onInvalidUrlsChange:oe,setEditorRef:function(e){return ee.current=e},isReplying:c}))}),o.createElement(m,{theme:L?"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,m,v,g,h;return t(this,(function(t){switch(t.label){case 0:if(!(null==y?void 0:y.id)||G)return[2];$(!0),t.label=1;case 1:return t.trys.push([1,4,,5]),e=function(e){H(""),A(),p&&p();var t=Y(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),C&&C(t)},[4,et(n({message:U,photos:z,postId:String(y.id),link:null==ce?void 0:ce.url,sanitizeFunction:T,locale:_},c&&f?{replyingUserId:String((null==k?void 0:k.id)||(null===(r=null==y?void 0:y.author)||void 0===r?void 0:r.id)||""),replyingId:f,replyingUserName:(null==k?void 0:k.name)||(null==k?void 0:k.username)||""}:{}))];case 2:return i=t.sent(),[4,c&&f?nt(i,_):tt(i,_)];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)?(I({title:S("notification.comment.blocked.title"),message:S("notification.comment.blocked.message"),type:"danger"}),o.messages.moderation.words&&le(o.messages.moderation.words)):"suspect"===(null===(v=null===(m=null==o?void 0:o.messages)||void 0===m?void 0:m.moderation)||void 0===v?void 0:v.type)?(I({title:S("notification.comment.suspect.title"),message:S("notification.comment.suspect.message"),type:"warning"}),H(""),A(),p&&p()):(null===(g=null==o?void 0:o.messages)||void 0===g?void 0:g.find((function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(I({message:S("notification.suspend.message"),type:"warning"}),H(""),A(),p&&p()):I({title:"",message:(null===(h=null==o?void 0:o.messages)||void 0===h?void 0:h[0])||S("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 4:return t.sent(),I({title:"",message:S("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 5:return $(!1),[2]}}))}))},isLoading:G,isDisabled:!!(null==ie?void 0:ie.length)||G||!U||(null==U?void 0:U.length)<2||!U.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==ie?void 0:ie.length)?o.createElement("div",{className:"error-text"},S("notification.limitUrlDomain")):null,(!O||0===O.length)&&ce&&o.createElement("div",{className:"link-preview-wrapper"},ce.isFetching?o.createElement(F,null):o.createElement(o.Fragment,null,o.createElement(Be,{title:ce.title,url:ce.url||"#",image:ce.image,noRefetch:!0}),o.createElement("img",{src:Ge,className:"icon-close",onClick:function(){return ue(null)}}))),O&&O.length>0&&o.createElement("div",{className:"preview-images-container"},O.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:Ge,className:"icon-close-circle",onClick:function(){return D(t)}}))}))))},rt="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",lt=function(n){var i=n.className,l=n.style,s=n.reason,c=n.reasonText,u=n.onClose,p=n.postId,v=a(w),h=v.data,f=h.locale,k=h.env.isMarryBaby,C=v.action.pushNotifications,y=g().t,E=r(!1),b=E[0],N=E[1];return o.createElement($,{"data-is-marrybaby":k,className:i,style:l},o.createElement("ul",{className:"report-list"},o.createElement("li",{className:"report-item"},o.createElement("img",{src:rt}),o.createElement(d,{className:"__label",color:xe.colors.gray800,size:"p4"},c))),o.createElement(m,{theme:k?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:b,onClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!p||b)return[2];N(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,We({id:p,reason:s,locale:f})];case 2:return 1===(null==(e=t.sent())?void 0:e.status)&&(C({message:"Post reported",type:"success"}),u&&u()),[3,4];case 3:return t.sent(),[3,4];case 4:return N(!1),[2]}}))}))}},y("submit")))},st=function(e){var t=e.className,n=e.style,i=e.replyingTo,l=e.mentionedUser,s=e.description,u=e.disableShortenContent,d=e.mentions,m=void 0===d?[]:d,p=r(!1),v=p[0],h=p[1],f=g().t,k=q().authActionWrapper,C=r(!1),y=C[0],E=C[1],b=V(U(s||"","display"),m),N=a(w).action.sanitizeFunction,I=c((function(){var e=N(b||"");if(u||v)return{showContent:e,hasSeeMore:!1};var t=e.slice(0,1e3),n=1e3-27*((t.match(/<\/div>/g)||[]).length-1),i=(t||"").slice(0,n<40?40:n),o=N(i.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),a=o.length<e.length-10;return{showContent:a?o:e,hasSeeMore:a}}),[u,v,b]),T=(null==l?void 0:l.name)||i,x="expert"===(null==l?void 0:l.role)&&!!(null==l?void 0:l.partnerId);return o.createElement(o.Fragment,null,x&&o.createElement(ee,{isOpen:y,onClose:function(){return E(!1)},expertId:String(null==l?void 0:l.partnerId)}),o.createElement(te,{className:"".concat(t," no-replace-click"),style:n},T&&o.createElement("span",{onClick:function(){return x&&E(!0)},className:"post-content-replying"},"@",T),(null==s?void 0:s.startsWith("[mention+id="))&&o.createElement("span",{className:"post-content-replying tag-only"},"@"),o.createElement("span",{dangerouslySetInnerHTML:{__html:I.showContent},className:"post-content ".concat(I.hasSeeMore?"has-see-more":"")}),I.hasSeeMore&&!v&&o.createElement("span",null,"... ",o.createElement("span",{onClick:function(e){e.preventDefault(),e.stopPropagation(),k((function(){return h(!0)}))},className:"see-more-text"},f("post.seeMore")))))},ct=function(e){var t=e.className,n=e.style,i=e.authorName,a=e.images,l=e.onClose,c=e.onOpenSingleView,u=g().t,m=r(!1),p=m[0],v=m[1];return s((function(){setTimeout((function(){v(!0)}),0)}),[]),Me.createPortal(o.createElement(ne,{className:t,style:n,"data-open":p},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(d,{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"})})))),f())},ut="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",dt=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 Me.createPortal(o.createElement(ie,{"data-open":d&&!!p},o.createElement(oe,null,o.createElement("img",{src:ae,className:"icon-close",onClick:i,alt:"close"})),p&&l>=0&&o.createElement(o.Fragment,null,o.createElement(re,null,o.createElement("img",{className:"img-preview",src:p,alt:"post img open"}),o.createElement(le,{"data-disabled":v,onClick:function(){return!v&&c(l-1)}},o.createElement(se,null,o.createElement("img",{src:ut,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":v}))),o.createElement(le,{"data-right":!0,"data-disabled":g,onClick:function(){return!g&&c(l+1)}},o.createElement(se,null,o.createElement("img",{src:ut,alt:"right arrow","data-disabled":g})))))),f())},mt=function(e){var t=e.className,n=e.images,i=void 0===n?[]:n,c=e.style,u=e.authorName,d=a(w).data.env.isMarryBaby,m="+ ".concat((i.length||0)-4),p=r(!1),v=p[0],g=p[1],f=r(-1),k=f[0],C=f[1];s((function(){setTimeout((function(){return null==Se?void 0:Se.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&&h(!1)}}),[]),s((function(){v||k>=0?(h(!0),E.current=!0):(h(!1),E.current=!1)}),[v,k]),o.createElement(o.Fragment,null,o.createElement(ce,{className:t,style:c,"data-image-count":y?5:i.length||0,"data-is-marrybaby":d},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?g(!0):C(t)}},!d&&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(Le,{tag:"h1",color:"white"},m)))}))),v&&o.createElement(ct,{authorName:u||"",images:i,onClose:function(){return g(!1)},onOpenSingleView:C}),k>=0&&o.createElement(dt,{images:i,initialViewIndex:k,onClose:function(){return C(-1)}}))},pt=function(i){var u=i.url,d=i.image,m=i.className,p=i.style,v=a(w).data.locale,g=r(null),h=g[0],f=g[1];s((function(){e(void 0,void 0,void 0,(function(){return t(this,(function(e){return d?[2]:u?(f((function(e){return n(n({},e),{isFetching:!0})})),y(E(b.FETCH_PREVIEW,{_locale:v}),"POST",{data:{link:u}}).then((function(e){var t,n;f({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(){f(null)})),[2]):[2,f(null)]}))}))}),[u,d]);var k=(null==h?void 0:h.image)||d,N=(null==h?void 0:h.url)||u,I=c((function(){return ue(N)}),[N]),T=c((function(){return de(N)}),[N]),x=l(0),M=l(0),_=r(!1),P=_[0],L=_[1];s((function(){var e=function(){var e,t=null===(e=S.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&&L((function(e){return!e}))};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var S=l(null),j=l(!1);return o.createElement(me,{className:"".concat(m," no-replace-click"),style:p,ref:S},d||!I&&!T?o.createElement("a",{href:N,target:"_blank",rel:"noreferrer"},o.createElement("div",{className:"link-image-wrapper ".concat((null==h?void 0:h.isFetching)?"fetching":"")},(null==h?void 0:h.isFetching)?o.createElement(F,{className:"loading-spinner"}):o.createElement("img",{className:"link-image",src:k||C,onError:function(e){j.current||(j.current=!0,e.currentTarget.src=C)}}))):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(P),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))},vt="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",gt="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",ht="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",ft=function(n){var i=n.onDeleteComment,l=n.commentId,s=n.className,c=void 0===s?"":s,u=n.popoverClassName,d=void 0===u?"":u,m=a(w),p=m.data,v=p.env.isMarryBaby,h=p.locale,f=m.action.pushNotifications,k=g().t,C=r(!1),y=C[0],E=C[1],b=q().authActionWrapper;return o.createElement("div",{className:c,onClick:function(e){e.preventDefault(),e.stopPropagation()}},y&&o.createElement(qe,{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:k("popup.deleteComment.title"),description:k("popup.deleteComment.description"),acceptText:k("popup.deletePost.accept"),cancelText:k("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,ot({id:l,locale:h})]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(i&&i(),f({title:"",message:k("notification.success"),type:"success"})):f({title:"",message:(null===(n=null==e?void 0:e.messages)||void 0===n?void 0:n[0])||k("notification.failure"),type:"danger"}),[2]}}))}))},onClose:function(){return E(!1)}}),o.createElement(pe,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:ht,label:k("actionPopover.delete"),onClick:function(){b((function(){E(!0)}))}}]},className:d,toggleButtonContent:o.createElement("img",{src:v?vt:gt}),buttonProps:{}}))},wt=function(i){var l,u,d,p,h,f=i.className,k=i.style,C=i.comment,E=i.type,b=void 0===E?"comment":E,N=i.level,I=void 0===N?0:N,T=i.replyingId,x=i.onPostCommentSuccess,M=i.post,_=i.onDeleteComment,P=i.refetchComment,L=i.hasQuickBookingEnable,S=i.handleMakeAppointment,j=a(w).data,B=j.locale,F=j.userInfo,R=j.env.isMarryBaby,D=g().t,O=r(C||null),A=O[0],z=O[1],V=A.id;A.countReplies;var U=A.countLikes,H=A.content,W=A.createdAt,Z=A.replies,G=void 0===Z?[]:Z,K=A.images,Q=void 0===K?[]:K,X=A.author,J=A.liked,Y=A.link,$=A.mentionedUser,ee=A.mentions,te=function(e){try{var t=e.match(/\[@([^\]]+)\]/),n=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:n}}catch(e){}return{text:""}}(H),ne=te.text,ie=te.replyingTo,oe=q({_joinCommunityIds:[null===(l=null==M?void 0:M.community)||void 0===l?void 0:l.id],_joinTopicIds:null===(u=null==M?void 0:M.topics)||void 0===u?void 0:u.map((function(e){return e.id}))}).authActionWrapper,ae=r(4),re=ae[0],le=ae[1],se=!!(null==F?void 0:F.id)&&(null==G?void 0:G.some((function(e){return e.author.id===F.id}))),ce=function(e){z((function(t){if(!t.replies.find((function(t){return t.id===e.id}))){t.replies.unshift(e);var i=n(n({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return P&&P(i),i}return t}))},ue=r(!1),de=ue[0],me=ue[1],pe=c((function(){return"comment"===b&&G&&0!=G.length?G.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})):G}),[b,G]),ye=(null==G?void 0:G.length)||0,Ee=String(null==X?void 0:X.email)&&(null==F?void 0:F.email)&&String(null==X?void 0:X.email)===String(null==F?void 0:F.email),be=(null==X?void 0:X.name)||(null==X?void 0:X.username)||"",Ne=null==X?void 0:X.avatar,Ie=(null==X?void 0:X.username)||(null==X?void 0:X.name)||"",Te=r(null),xe=Te[0],Me=Te[1],_e=r(null),Pe=_e[0],Le=_e[1];s((function(){if(null==X?void 0:X.hospitalId){n=X.hospitalId,e(void 0,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,y(ke(Ce.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:je[B]}),"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==X?void 0:X.doctorId){i=X.doctorId,e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,y(ke(Ce.GET_DOCTOR_INFO,{doctorId:i,website_url:je[B]}),"get")];case 1:return e=t.sent(),(null===(n=null==e?void 0:e._data)||void 0===n?void 0:n.doctor)&&Le(null==e?void 0:e._data.doctor),[2]}}))}))}}),[X.hospitalId,X.doctorId]);var Se=(null==Pe?void 0:Pe.valid_outpatient)||(null==Pe?void 0:Pe.valid_telemedicine),Fe=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Re=L&&(Se||Fe);return o.createElement(ve,{defaultParams:{_joinCommunityIds:[null===(d=null==M?void 0:M.community)||void 0===d?void 0:d.id],_joinTopicIds:null===(p=null==M?void 0:M.topics)||void 0===p?void 0:p.map((function(e){return e.id}))}},o.createElement(ge,{className:f,style:k,"data-is-reply":!!I,"data-is-marrybaby":R,"data-has-booking":Re},"reply"===b&&o.createElement(v,{className:"top-divider",type:"solid"}),o.createElement(he,{avatar:Ne,name:be,username:Ie,email:null==X?void 0:X.email,time:W,className:"post-author ".concat(Ee?"with-popover":""),type:b,userId:null==X?void 0:X.id,role:null==X?void 0:X.role,expertId:null==X?void 0:X.partnerId,title:null==X?void 0:X.title,doctorId:null==X?void 0:X.doctorId,hospitalId:null==X?void 0:X.hospitalId,hasQuickBooking:Re,handleMakeAppointment:S}),o.createElement(st,{className:"post-content-wrapper",replyingTo:ie,mentionedUser:$,description:ne,mentions:ee}),o.createElement("span",null),o.createElement("span",null),Q&&Q.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(mt,{images:Q,authorName:null==X?void 0:X.username})):null,Q&&0!==Q.length||!Y?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(Be,{url:Y})),"most-engaging"!==b?o.createElement(o.Fragment,null,o.createElement(fe,{type:we.reply,loveCount:U,replyCount:ye,className:"post-reaction",liked:J,isReplied:se,hideCommentIcon:"reply"===b,onCommentClick:function(){return oe((function(){return me((function(e){return!e}))}))},onCommentCountClick:function(){return oe((function(){me(!0)}))},onLikeClick:function(){return oe((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return V?[4,it({commentId:V,setLike:!J,locale:B})]:[3,2];case 1:1===e.sent().status&&z((function(e){return n(n({},e),{liked:!J,countLikes:e.countLikes+(J?-1:1)})})),e.label=2;case 2:return[2]}}))}))}))}}),de&&o.createElement(at,{replyingId:T||A.id,replyToName:X.name||X.username||"",isReply:!0,onClose:function(){return me(!1)},onPostSuccess:function(e){"reply"===b?x&&x(e):ce(e)},post:M,replyingUser:X}),"comment"===b&&G&&G.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(h=null==pe?void 0:pe.slice(0,re))||void 0===h?void 0:h.map((function(e){return o.createElement(wt,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:I+1,replyingId:V,onPostCommentSuccess:ce,post:M,onDeleteComment:function(){z((function(t){return n(n({},t),{replies:t.replies.filter((function(t){return t.id!==e.id})),countReplies:t.countReplies-1})}))},handleMakeAppointment:S,hasQuickBookingEnable:L})})),ye>re&&o.createElement(o.Fragment,null,o.createElement(v,{className:"top-divider",type:"solid"}),o.createElement(m,{className:"more-cmt",size:"lg",color:"ghost",onClick:function(){return le((function(e){return e+4}))}},D("comment.seeMoreReplies",{count:ye-re}),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,Ee&&o.createElement(ft,{onDeleteComment:_,className:"popover",commentId:A.id})))},kt="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",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 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",yt="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",Et=function(n){var i=n.authorEmail,l=n.onDeletePost,s=n.shareUrl,c=n.post,u=n.className,d=void 0===u?"":u,m=n.popoverClassName,p=void 0===m?"":m,v=n.onBookmark,h=n.onRemoveBookmark,f=n.onEditPost,k=a(w),C=k.data,y=C.locale,N=C.userInfo,I=C.togetherUserId,x=C.env.isMarryBaby,M=k.action.pushNotifications,_=g().t,P=r(!1),L=P[0],S=P[1],j=r(!1),B=j[0],F=j[1],R=r(!1),D=R[0],O=R[1],A=q().authActionWrapper,z=i&&(null==N?void 0:N.email)&&i===String(null==N?void 0:N.email);return o.createElement("div",{className:d,onClick:function(e){e.preventDefault(),e.stopPropagation()}},D&&o.createElement(ye,{url:s,text:null==c?void 0:c.title,onClose:function(){return O(!1)}}),B&&o.createElement(qe,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:_("popup.deletePost.title"),description:_("popup.deletePost.description"),acceptText:_("popup.deletePost.accept"),cancelText:_("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)||L)return[2];S(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,ze({id:c.id,locale:y})];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 S(!1),[2]}}))}))},onClose:function(){return F(!1)}}),o.createElement(pe,{className:p,toggleButtonContent:o.createElement("img",{src:x?vt:gt}),position:"bottom",align:"end",buttonProps:{isLoading:L},data:z?{isShowheader:!1,type:"list",list:[{icon:yt,label:_("morePopover.share"),onClick:function(){return O(!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:_("actionPopover.edit"),onClick:f},{icon:ht,label:_("actionPopover.delete"),onClick:function(){A((function(){return F(!0)}))}}]}:{isShowheader:!1,type:"list",list:[{icon:yt,label:_("morePopover.share"),onClick:function(){return O(!0)}},{icon:(null==c?void 0:c.bookmarked)?kt:Ct,label:(null==c?void 0:c.bookmarked)?_("morePopover.unsavePost"):_("morePopover.savePost"),onClick:function(){A((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,T(E(b.BOOKMARK.DELETE,{_locale:y}),"DELETE",{data:{post_id:String(c.id)}})]:[3,2]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(M({title:"",message:"Removed saved post",type:"success",displayIcon:Ct}),h&&h()):M({title:"",message:"Remove failed",type:"danger",displayIcon:Ct}),[3,4];case 2:return[4,T(E(b.BOOKMARK.CREATE,{_locale:y}),"POST",{data:{user_id:I||N.id,post_id:c.id}})];case 3:1===(null==(e=t.sent())?void 0:e.status)?(M({title:"",message:"Post saved",type:"success",displayIcon:kt}),v&&v()):M({title:"",message:"Post saved failed",type:"danger",displayIcon:Ct}),t.label=4;case 4:return[2]}}))}))}))}},{icon:rt,label:_("morePopover.report"),subTree:{title:_("morePopover.report.title"),description:_("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(Ee).map((function(e){return{label:Ee[e].label,reason:Ee[e].reportReasonText,reasonValue:e}})).map((function(e){return{label:_(e.label),subTree:{title:_("morePopover.reportSubmit.title"),description:_("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:function(t){return o.createElement(lt,{reason:e.reasonValue,reasonText:_(e.reason),postId:null==c?void 0:c.id,onClose:function(){return t&&t(!1)}})}}}}))}}]}}))},bt=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,Te(E(b.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(Y))||void 0===r?void 0:r[0]]}}))}))},Nt=function(i){var l=i.className,c=i.style,u=i.hideViewMoreComment,d=i.showMostEngaging,p=i.onCommentClick,v=i.onCommentCountClick,h=i.onMostEngagingCommentClick,f=i.onPostCommentSuccess,k=i.disableCardLink,E=i.disableShortenContent,b=i.onDeletePost,N=i.onEditPost,I=i.post,T=i.mostEngagingComment,x=i.onDeleteComment,M=i.showInputComment,_=i.InlineCommentsComponent,P=i.hasQuickBookingEnable,L=i.handleMakeAppointment,S=r(I),j=S[0],F=S[1],R=r(!1),D=R[0],O=R[1],A=r(T),z=A[0],V=A[1],U=j.community,H=j.topics,W=j.author,Z=j.slug,G=j.isPin,K=j.liked,Q=j.scheduleDateTime,X=j.createdAt,J=j.photos,Y=j.mentions,$=j.title,ee=j.description,te=j.previewUrl,ne=j.likesCount,ie=j.commentsCount,oe=j.id,ae=j.commented,re=a(w),le=re.data,se=le.locale,ce=le.env,ue=ce.isMarryBaby,de=ce.togetherBasePath,me=re.action.pushNotifications,pe=g().t,ge=r(M),Ee=ge[0],Te=ge[1],xe="".concat(de,"/").concat((null==U?void 0:U.slug)||"_","/").concat(Z||""),Me="".concat(be(se)).concat(xe),_e=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,Pe=r(!1),Se=Pe[0],je=Pe[1];s((function(){Te(M)}),[M]);var Oe=(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,y(ke(Ce.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:Ie[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,y(ke(Ce.GET_DOCTOR_INFO,{doctorId:i,website_url:Ie[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&&d&&!(null==T?void 0:T.id)?[4,bt(oe,se)]:[3,2];case 1:e=t.sent(),V(e),t.label=2;case 2:return[2]}}))}))}),[oe,se,ie,d,null==T?void 0:T.id]),s((function(){V(T)}),[null==T?void 0:T.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,bt(oe,se)]:[3,2];case 1:e=t.sent(),V(e),t.label=2;case 2:return F((function(e){return n(n({},e),{commentsCount:e.commentsCount-1})})),x&&x(i),[2]}}))}))};return o.createElement(ve,{defaultParams:(null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==H?void 0:H.map((function(e){return e.id}))}:void 0},D&&o.createElement(ye,{url:Me,avatar:C,text:$,onClose:function(){return O(!1)}}),o.createElement(Ne,{className:l,style:c,"data-is-marrybaby":ue},G?o.createElement(Re,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative"}},o.createElement(he,{avatar:Ve,name:Oe,username:ze,url:k?void 0:xe,email:null==W?void 0:W.email,time:Q||X,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(Et,{authorEmail:String(null==W?void 0:W.email),onDeletePost:b,shareUrl:Me,post:j,className:"popover",onEditPost:N})),o.createElement("a",{href:k?void 0:xe,className:"post-content-link-wrapper"},$&&o.createElement(Le,{className:"post-content-title",as:"h1",tag:"h5",fontWeight:"bold"},B($)),o.createElement(st,{className:"post-content-wrapper",description:ee,disableShortenContent:E,mentions:Y})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},H&&H.length>0?o.createElement(Fe,{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==J?void 0:J.length)?"has-image":"")},o.createElement(pt,{url:j.introUrl,image:j.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(mt,{images:J,authorName:null==W?void 0:W.name})):null),o.createElement("div",{key:"link-preview"},(null==j?void 0:j.introUrl)||(null==J?void 0:J.length)||!(null==te?void 0:te.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(Be,{title:te.title,url:te.url,image:te.image}))),o.createElement(fe,{type:we.post,loveCount:ne,replyCount:ie,className:"post-reaction ".concat((null==J?void 0:J.length)||(null==te?void 0:te.url)?"hide-top-border":""),liked:Se?!K:K,isReplied:ae,onCommentClick:function(){return _e((function(){p?p():Te((function(e){return!e}))}))},onCommentCountClick:function(){_e((function(){ue?Te(!0):v?v():!k&&(window.location.href=xe)}))},onShareClick:function(){O(!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];je(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Ae({id:oe,locale:se})];case 2:return 1!==(null==(e=t.sent())?void 0:e.status)?me(De(pe)):F((function(e){return n(n({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})})),[3,4];case 3:return t.sent(),me(De(pe)),[3,4];case 4:return je(!1),[2]}}))}))},showingMostEngaging:!(!d||!(null==z?void 0:z.id))}),Ee&&o.createElement(at,{isMainCmt:!M,onClose:function(){return Te(!1)},onPostSuccess:function(e){0!==ie||(null==z?void 0:z.id)||V(e),F((function(e){return n(n({},e),{commentsCount:e.commentsCount+1,commented:!0})})),f&&f(e)},post:j}),d&&(null==z?void 0:z.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:function(e){h?(e.stopPropagation(),h()):window.location.href=xe}},o.createElement(wt,{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(m,{className:"see-more-comments",color:"ghost",size:"md"},pe("comment.seeMoreComments",{count:ie-1}))):null,_))},It=Object.freeze({__proto__:null});export{Be as C,at as I,Re as L,qe as P,lt as S,Fe as T,$e as a,Ke as b,Xe as c,Je as d,st as e,ct as f,dt as g,mt as h,Nt as i,Et as j,wt as k,ft as l,It as t};
|
|
1
|
+
import{_ as e,a as t,b as n,c as i}from"./tslib.es6-6ae0d506.js";import o,{useContext as a,useState as r,useRef as l,useEffect as s,useMemo as c,useCallback as u}from"react";import{T as d,B as m}from"./index.styled-37563568.js";import{a as p,D as v}from"./index-d6a90885.js";import{u as g,t as h,k as f}from"./useTranslations-3dbb43bb.js";import{m as w,z as k,B as C,E as y,F as E,H as b,I as N,b as I,J as T,M as x,K as M,N as _,O as P,Q as L,R as S,V as j,W as B,L as F,X as R,Y as D,_ as O,Z as A,$ as z,a0 as V,a1 as U,a2 as H,y as W,a3 as Z,j as G,a4 as K,a5 as Q,U as X,a6 as J,a7 as Y,a8 as $,u as q,g as ee,a9 as te,aa as ne,ab as ie,ac as oe,ad as ae,ae as re,af as le,ag as se,ah as ce,ai as ue,aj as de,ak as me,al as pe,a as ve,am as ge,f as he,C as fe,an as we,ao as ke,ap as Ce,S as ye,aq as Ee,o as be,ar as Ne,as as Ie,at as Te}from"./index.styled-b3822d90.js";import{t as xe}from"./theme-731042bc.js";import"react-range";import*as Me from"react-dom";import"date-fns";import{I as _e}from"./index-6fd83093.js";import Pe from"lodash/debounce";import{H as Le}from"./index-cc1a1d0f.js";import{l as Se}from"./number-126ee62e.js";import"styled-components";import{d as je}from"./constants-17d17987.js";var Be=function(i){var c=i.title,u=i.url,m=i.image,p=i.logo,v=i.className,g=i.style,h=i.noRefetch,f=a(w).data,N=f.locale,I=f.env.isMarryBaby,T=r(!1),x=T[0],M=T[1],_=l(h);_.current=h;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})})),y(E(b.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)||m,B=(null==L?void 0:L.title)||c,F=(null==L?void 0:L.logo)||p,R=(null==L?void 0:L.url)||u,D=R.replace("http://","").replace("https://","").split(/[/?#]/)[0],O=l(!1);return o.createElement(k,{"data-is-marrybaby":I,className:"".concat(v," no-replace-click"),style:g},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=C)}}),o.createElement("img",{className:"link-image",src:j,onError:function(e){O.current||(O.current=!0,e.currentTarget.src=C)}})),o.createElement("div",{className:"link-info-container"},o.createElement(d,{size:"n1"},I&&F&&!x&&o.createElement("img",{className:"link-logo",src:F,onError:function(e){return M(!0)}}),D),o.createElement(Le,{tag:"h6"},B))))},Fe=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(w),g=v.data.env.togetherBasePath,h=v.action.sanitizeFunction;return o.createElement(N,{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(d,{size:"p3"},o.createElement("span",{dangerouslySetInnerHTML:{__html:(null==h?void 0:h(e.name))||e.name}})))})))},Re=function(e){var t=e.onClick;e.color;var n=e.className,i=e.style,r=a(w).data.env.isMarryBaby,l=g().t;return o.createElement(I,{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})},De=function(e){return{message:e("notification.failure"),type:"danger"}},Oe="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",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,T(E(b.POST.LIKE,{id:i,_locale:o}),"GET")]:[2];case 1:return[2,e.sent()]}}))}))},ze=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,T(E(b.POST.DELETE,{id:i,_locale:o}),"DELETE")]:[2];case 1:return[2,e.sent()]}}))}))},Ve=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=M(o),h=M(i),f=_(n),e.append("title",h),e.append("description",P(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(L(e,c))}),2e3*t)}))})))]:[3,2];case 1:return null==(w=t.sent())||w.filter(Boolean).slice(0,x).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]}}))}))},Ue=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,T(E(a?b.POST.CREATE_ARTICLE_COMMENT:b.POST.CREATE,{_locale:i}),"POST",{data:o,headers:{"Content-Type":"multipart/form-data"}})];case 1:return[2,e.sent()]}}))}))},He=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,T(E(b.POST.UPDATE,{id:i,_locale:o}),"POST",{data:a})];case 1:return[2,e.sent()]}}))}))},We=function(e){var t=e.id,n=e.reason,i=e.locale,o=new FormData;return o.append("reason",n),T(E(b.POST.REPORT,{_locale:i,id:t}),"POST",{data:o})},Ze=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}},Ge="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",Ke=function(e){var t=e.className,n=e.style,i=e.bannedWords,a=void 0===i?[]:i,c=e.value,u=e.onChange,m=e.onPreviewUrlChange,p=e.onInvalidUrlsChange,v=e.onImageFilesChange,h=e.imageFiles,f=e.isReplying,w=g().t,k=r(null),C=k[0],y=k[1],E=l(null),b=Ze(h,v),N=b.onSelectImages,I=b.onRemoveImage,T=b.imageSrcs;return s((function(){m&&((null==C?void 0:C.url)?m({title:C.title||"",url:C.url||"",image:C.image||"",description:C.description||""}):m(null))}),[C]),o.createElement(S,{className:t,style:n},o.createElement(d,{size:"p4",className:"description-label"},w("createPost.popup.description")),o.createElement("div",{className:"textarea-control"},o.createElement("div",{className:"textarea-wrapper"},o.createElement(j,{html:c||"",onChange:u,bannedWords:a,onImagePickerClick:function(){var e;return null===(e=E.current)||void 0===e?void 0:e.click()},onPreviewUrlChange:y,onInvalidUrlsChange:p,isReplying:f}))),o.createElement(d,{size:"p4",className:"count-string"},w("character"),": ",B(c||"").length),(!T||0===T.length)&&C&&o.createElement("div",{className:"link-preview-wrapper"},C.isFetching?o.createElement(F,null):o.createElement(o.Fragment,null,o.createElement(Be,{title:C.title,url:C.url||"#",image:C.image,noRefetch:!0}),o.createElement("img",{src:Ge,className:"icon-close",onClick:function(){return y(null)}}))),o.createElement("input",{ref:E,type:"file",accept:"image/png, image/gif, image/jpeg",multiple:!0,style:{display:"none"},onChange:N}),T.length>x?o.createElement("div",{className:"input-notification"},o.createElement("img",{src:Oe}),o.createElement(d,{size:"p4",color:xe.colors.alertWarning},w("createPost.popup.warningImage"))):null,T.length>0&&o.createElement("div",{className:"image-gallery"},T.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:Ge,onClick:function(){return I(t)}}))}))))},Qe=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 R(a,o)},Xe=function(e){var t,n=e.className,i=e.style,a=e.bannedWords,c=void 0===a?[]:a,m=e.value,p=e.onChange,v=g().t,h=r(""),f=h[0],w=h[1],k=l(null);s((function(){if(k.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=k.current;return t.addEventListener("paste",e),function(){return t.removeEventListener("paste",e)}}}),[k]);var C=(null==c?void 0:c.join(","))||"";s((function(){var e;if(C){var t=null===(e=k.current)||void 0===e?void 0:e.innerText;if(t){var n=R(t,c);n!==t&&(p&&p(n),w(n))}}}),[C]);var y=u(Pe((function(e){if(k.current){var t=Qe(k.current.innerText,{limit:120,bannedWords:c});p&&p(t),w(t)}}),300),[]);return s((function(){setTimeout((function(){var e;null===(e=k.current)||void 0===e||e.focus()}),500)}),[]),o.createElement(D,{className:n,style:i},o.createElement(_e,{name:"title",value:m||f,size:"md",label:v("createPost.title"),CustomInput:o.createElement(O,{innerRef:k,html:m||f,onChange:function(e){if(k.current&&k.current.innerText!==(m||f)){var t=Qe(k.current.innerText,{bannedWords:c});p&&p(t),w(t),y(k.current.innerText)}},className:"title-input"})}),o.createElement(d,{size:"p4",className:"count-string"},v("createPost.popup.wordCount",{count:(null===(t=k.current)||void 0===t?void 0:t.innerText.length)||0,max:120})))},Je=function(n){var u=n.className,d=n.style,m=n.topics,p=n.communityId,v=n.onChange,g=n.isLoading,h=n.disabled,f=n.forceTopics,k=n.selectedTopics,C=n.noFetch,N=a(w).data,I=N.locale,T=N.env.isMarryBaby,x=r(m?i([],m,!0):[]),M=x[0],_=x[1],P=r(k?i([],k,!0):[]),L=P[0],S=P[1],j=r(!1),B=j[0],R=j[1],D=l(m);D.current=m,s((function(){var n;!p||C||(null===(n=D.current)||void 0===n?void 0:n.length)||(_([]),R(!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,y(E(b.TOPIC.LIST,{communityId:p,_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)&&_((function(){return(null==n?void 0:n.map(z).sort((function(e,t){return(e.order||0)-(t.order||0)})))||[]})),[3,3];case 2:return i=t.sent(),console.log(i),R(!1),[3,3];case 3:return R(!1),[2]}}))})))}),[p,C]);var O=null==m?void 0:m.map((function(e){return e.id})).join("-"),V=null==M?void 0:M.map((function(e){return e.id})).join("-"),U=null==f?void 0:f.map((function(e){return e.id})).join("-");s((function(){m&&void 0!==O&&O!==V&&_(m)}),[m,O,V]);var H=c((function(){return M.filter((function(e){return!(null==f?void 0:f.some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})))}))}),[V,U]);return o.createElement(A,{"data-is-marrybaby":T,className:u,style:d},f.map((function(e){return o.createElement(Ye,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:!0,selected:!0})})),H.map((function(e){return o.createElement(Ye,{key:"".concat(e.id,"-").concat(e.mappedCategoryId),topic:e,disabled:h,selected:(k||L).some((function(t){return t.id&&t.id===e.id||t.mappedCategoryId&&t.mappedCategoryId===e.mappedCategoryId})),onClick:function(){var t=k||L,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),v&&k?v(t.slice()):(v&&v(t.slice()),S(t.slice()))}})})),(g||B)&&o.createElement(F,{className:"topic-spinner"}))},Ye=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)},$e=function(n){var l=n.className,c=n.style,u=n.onPostCreatedEdited,v=n.onClose,h=n.communities,f=void 0===h?[]:h,k=n.forceSelectCommunity,C=n.forceSelectTopics,y=n.articleId,E=n.optionalTopic,b=n.editPostData,N=n.defaultCommunity,I=n.defaultTopics,T=n.noFetchTopic,M=n.hideTopicList,_=!!(null==b?void 0:b.id),P=a(w),L=P.data,S=L.locale,j=L.env.isMarryBaby,F=P.action,R=F.pushNotifications,D=F.sanitizeFunction,O=g().t,A=r(!1),z=A[0],Z=A[1],G=r(""),K=G[0],Q=G[1],X=r(""),J=X[0],Y=X[1],$=r(k?{label:k.name,value:"".concat(k.id||"","-").concat(k.mappedCategoryId||"")}:{label:O("community.choose"),value:""}),q=$[0],ee=$[1],te=r(i([],C,!0)||[]),ne=te[0],ie=te[1],oe=r([]),ae=oe[0],re=oe[1],le=r([]),se=le[0],ce=le[1],ue=k||f.find((function(e){return"".concat(e.id||"","-").concat(e.mappedCategoryId||"")===q.value})),de=k?[k]:f.filter((function(e){return e.isActive})).sort((function(e,t){return e.name>t.name?1:e.name<t.name?-1:0})),me=r(null),pe=me[0],ve=me[1],ge=r([]),he=ge[0],fe=ge[1],we=K&&B(J)&&(E||!E&&ne.length>0)&&ue&&(!ae||ae.length<=x)&&!(null==he?void 0:he.length)&&!z;s((function(){if(b){var e=b;Q(e.title||""),Y(V(U(e.description||"","edit"),e.mentions)),ee({label:e.community.name,value:"".concat(e.community.id||"","-").concat(e.community.mappedCategoryId||"")}),ie(e.topics||[]),re(e.photos||[])}else N&&ee({label:N.name,value:"".concat(N.id||"","-").concat(N.mappedCategoryId||"")}),I&&ie(I)}),[]);var ke=function(){return e(void 0,void 0,void 0,(function(){var e,n,i,o,a,r,l,s,c,d,m,p;return t(this,(function(t){switch(t.label){case 0:return[4,Ve({title:K,description:J,communityId:String((null==ue?void 0:ue.id)||""),imageFiles:ae,previewUrl:pe,topicIds:null==ne?void 0:ne.map((function(e){return String(e.id||"")})).filter(Boolean),locale:S,sanitizeFunction:D,categoryCommunityId:String((null==ue?void 0:ue.mappedCategoryId)||""),categoryTopicIds:null==ne?void 0:ne.map((function(e){return String(e.mappedCategoryId||"")})).filter(Boolean)})];case 1:return e=t.sent(),y&&e.append("article_id",y),_?(null==b?void 0:b.id)?[4,He({id:b.id,formData:e,locale:S})]:[3,3]:[3,4];case 2:n=t.sent(),t.label=3;case 3:return[3,6];case 4:return[4,Ue({formData:e,locale:S,isArticleComment:!(null==ue?void 0:ue.id)&&!!(null==ue?void 0:ue.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)?(R({message:O("createPost.popup.success"),type:"success"}),function(e){u&&u(W(e),_),v&&v()}(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)?(R({title:O("notification.post.blocked.title"),message:O("notification.post.blocked.message"),type:"danger"}),n.messages.moderation.words&&ce(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)?(R({title:O("notification.post.suspect.title"),message:O("notification.post.suspect.message"),type:"warning"}),v&&v()):(null===(m=null===(d=null==n?void 0:n.messages)||void 0===d?void 0:d.find)||void 0===m?void 0:m.call(d,(function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(R({message:O("notification.suspend.message"),type:"danger"}),v&&v()):R({message:(null===(p=null==n?void 0:n.messages)||void 0===p?void 0:p[0])||O("notification.failure"),type:"danger"}),[2]}}))}))};return o.createElement(H,{className:l,style:c},o.createElement("div",{className:"input-group-container"},o.createElement(Xe,{className:"input-group",bannedWords:se,value:K,onChange:Q}),o.createElement(Ke,{className:"input-group",bannedWords:se,value:J,onChange:Y,onPreviewUrlChange:ve,onInvalidUrlsChange:fe,onImageFilesChange:re,imageFiles:ae}),o.createElement("div",{className:"input-group"},o.createElement(d,{size:"p4",className:"input-group-label"},O("admin.community")),o.createElement(p,{options:(null==de?void 0:de.map((function(e,t){return{label:e.name,value:"".concat(e.id||"","-").concat(e.mappedCategoryId||"")}})))||[],id:"community-picker",placeholder:O("community.choose"),value:q,onChange:function(e){ee({label:e.label,value:String(e.value)}),ie([])},disabled:!!k}),o.createElement(d,{size:"sm",className:"warning",color:xe.colors.gray400},"* ",O("commentPopup.warning.newPost"))),!M&&o.createElement("div",{className:"input-group"},o.createElement(d,{size:"p4",className:"input-group-label"},O("tab.topic")),o.createElement("div",{className:"input-notification"},o.createElement("img",{src:ue?"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":Oe}),o.createElement(d,{size:"base",color:xe.colors.gray500},O(ue?"createPost.popup.primary":"createPost.popup.warning"))),ue&&o.createElement(Je,{className:"tag-list",communityId:ue.id,forceTopics:C,onChange:ie,selectedTopics:ne,noFetch:T}))),o.createElement(m,{theme:j?"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(!we||z)return[3,5];Z(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,ke()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),console.error(e),R(De(O)),[3,4];case 4:Z(!1),t.label=5;case 5:return[2]}}))}))},isDisabled:!we,isLoading:z},O("createPost.popup.submit")))},qe=function(e){var t=e.className,n=e.isMarryBaby,i=e.style,l=e.title,c=e.description,u=e.acceptText,p=e.cancelText,v=e.onAccept,g=e.thumbnail,k=e.isThumbnailIcon,C=e.onClose,y=a(w).data.env.isMarryBaby,E="boolean"==typeof n?n:y,b=r(!1),N=b[0],I=b[1];return s((function(){return h(!0),setTimeout((function(){return I(!0)}),0),function(){return h(!1)}}),[]),Me.createPortal(o.createElement(Z,{"data-is-marrybaby":E,className:t,style:i,"data-open":N},o.createElement(G,{className:"popup-frame",isOpen:N,onClose:C},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(k?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:g})),o.createElement(Le,{className:"title",tag:"h2"},l),o.createElement(d,{className:"desc",size:"lg"},c),o.createElement("div",{className:"btn-group"},o.createElement(m,{theme:E?"marryBaby":"helloSites",size:"md",color:"secondary",onClick:function(){null==v||v(),null==C||C()}},u),o.createElement(m,{theme:E?"marryBaby":"helloSites",size:"md",onClick:C},p)))),E&&g&&o.createElement("div",{className:"thumbnail-container is-mobile ".concat(k?"is-icon":"")},o.createElement("img",{className:"thumbnail",src:g})))),f())},et=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=P(o.replace(/(\ )+/g," "),s),m=_(n),a&&a.length>0?[4,Promise.all(null==a?void 0:a.map((function(e){return L(e,l)})))]:[3,2];case 1:t.sent().filter(Boolean).slice(0,x).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]}}))}))},tt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,T(E(b.COMMENT.CREATE,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},nt=function(n,i){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){return[2,T(E(b.COMMENT.REPLY,{_locale:i}),"POST",{data:n,headers:{"Content-Type":"multipart/form-data"}})]}))}))},it=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,T(E(a?b.COMMENT.LIKE:b.COMMENT.UNLIKE,{_locale:r,id:i}),"GET")]}))}))},ot=function(e){var t=e.id,n=e.locale;return T(E(b.COMMENT.DELETE,{_locale:n,id:t}),"DELETE")},at=function(i){var c=i.isReply,u=i.className,p=i.onClose,v=i.replyToName,h=i.style,f=i.replyingId,k=i.replyingUser,C=i.onPostSuccess;i.isMainCmt;var y=i.post,E=i.isMarryBaby,b=a(w),N=b.action,I=N.pushNotifications,T=N.sanitizeFunction,x=b.data,M=x.userInfo,_=x.locale,P=x.env.isMarryBaby,L="boolean"==typeof E?E:P,S=g().t,B=Ze(),R=B.onSelectImages,D=B.onRemoveImage,O=B.imageSrcs,A=B.onRemoveAllImages,z=B.imageFiles,V=r(""),U=V[0],H=V[1],W=a(K).trigger,Z=r(!1),G=Z[0],$=Z[1],q=l(null),ee=l(null),te=l(null),ne=r([]),ie=ne[0],oe=ne[1],ae=r([]),re=ae[0],le=ae[1],se=r(null),ce=se[0],ue=se[1];return s((function(){var e;null===(e=te.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"start"}),setTimeout((function(){var e;null===(e=ee.current)||void 0===e||e.focus()}),400)}),[W]),o.createElement(Q,{"data-is-reply":c,className:u,style:h},c&&o.createElement("div",{className:"reply-to-container"},o.createElement(d,{size:"p4"},o.createElement("span",{dangerouslySetInnerHTML:{__html:S("inputComment.replyTo",{name:'<span style="color: #2D87F3; cursor: pointer">@'.concat(v||"","</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 p&&p()}})),o.createElement("div",{className:"input-container",ref:te},o.createElement(X,{className:"avatar-wrapper ".concat(c?"avatar-wrapper-reply":""),avatar:(null==M?void 0:M.id)?M.avatar:J,username:(null==M?void 0:M.name)||(null==M?void 0:M.username)}),o.createElement("input",{ref:q,onChange:R,type:"file",multiple:!0,accept:"image/png,image/jpeg",name:"images",style:{display:"none"}}),o.createElement(_e,{value:U,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(j,{className:"textarea",html:U,onChange:H,onImagePickerClick:function(){var e;return null===(e=q.current)||void 0===e?void 0:e.click()},bannedWords:re,onPreviewUrlChange:ue,onInvalidUrlsChange:oe,setEditorRef:function(e){return ee.current=e},isReplying:c}))}),o.createElement(m,{theme:L?"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,m,v,g,h;return t(this,(function(t){switch(t.label){case 0:if(!(null==y?void 0:y.id)||G)return[2];$(!0),t.label=1;case 1:return t.trys.push([1,4,,5]),e=function(e){H(""),A(),p&&p();var t=Y(e.data);"string"==typeof t.images&&(t.images=JSON.parse(t.images)),C&&C(t)},[4,et(n({message:U,photos:z,postId:String(y.id),link:null==ce?void 0:ce.url,sanitizeFunction:T,locale:_},c&&f?{replyingUserId:String((null==k?void 0:k.id)||(null===(r=null==y?void 0:y.author)||void 0===r?void 0:r.id)||""),replyingId:f,replyingUserName:(null==k?void 0:k.name)||(null==k?void 0:k.username)||""}:{}))];case 2:return i=t.sent(),[4,c&&f?nt(i,_):tt(i,_)];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)?(I({title:S("notification.comment.blocked.title"),message:S("notification.comment.blocked.message"),type:"danger"}),o.messages.moderation.words&&le(o.messages.moderation.words)):"suspect"===(null===(v=null===(m=null==o?void 0:o.messages)||void 0===m?void 0:m.moderation)||void 0===v?void 0:v.type)?(I({title:S("notification.comment.suspect.title"),message:S("notification.comment.suspect.message"),type:"warning"}),H(""),A(),p&&p()):(null===(g=null==o?void 0:o.messages)||void 0===g?void 0:g.find((function(e){var t;return!!(null===(t=null==e?void 0:e.includes)||void 0===t?void 0:t.call(e,"suspend"))})))?(I({message:S("notification.suspend.message"),type:"warning"}),H(""),A(),p&&p()):I({title:"",message:(null===(h=null==o?void 0:o.messages)||void 0===h?void 0:h[0])||S("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 4:return t.sent(),I({title:"",message:S("notification.comment.somethingWrong"),type:"danger"}),[3,5];case 5:return $(!1),[2]}}))}))},isLoading:G,isDisabled:!!(null==ie?void 0:ie.length)||G||!U||(null==U?void 0:U.length)<2||!U.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==ie?void 0:ie.length)?o.createElement("div",{className:"error-text"},S("notification.limitUrlDomain")):null,(!O||0===O.length)&&ce&&o.createElement("div",{className:"link-preview-wrapper"},ce.isFetching?o.createElement(F,null):o.createElement(o.Fragment,null,o.createElement(Be,{title:ce.title,url:ce.url||"#",image:ce.image,noRefetch:!0}),o.createElement("img",{src:Ge,className:"icon-close",onClick:function(){return ue(null)}}))),O&&O.length>0&&o.createElement("div",{className:"preview-images-container"},O.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:Ge,className:"icon-close-circle",onClick:function(){return D(t)}}))}))))},rt="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",lt=function(n){var i=n.className,l=n.style,s=n.reason,c=n.reasonText,u=n.onClose,p=n.postId,v=a(w),h=v.data,f=h.locale,k=h.env.isMarryBaby,C=v.action.pushNotifications,y=g().t,E=r(!1),b=E[0],N=E[1];return o.createElement($,{"data-is-marrybaby":k,className:i,style:l},o.createElement("ul",{className:"report-list"},o.createElement("li",{className:"report-item"},o.createElement("img",{src:rt}),o.createElement(d,{className:"__label",color:xe.colors.gray800,size:"p4"},c))),o.createElement(m,{theme:k?"marryBaby":"helloSites",className:"report-submit",size:"lg",color:"primary",isLoading:b,onClick:function(){return e(void 0,void 0,void 0,(function(){var e;return t(this,(function(t){switch(t.label){case 0:if(!p||b)return[2];N(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,We({id:p,reason:s,locale:f})];case 2:return 1===(null==(e=t.sent())?void 0:e.status)&&(C({message:"Post reported",type:"success"}),u&&u()),[3,4];case 3:return t.sent(),[3,4];case 4:return N(!1),[2]}}))}))}},y("submit")))},st=function(e){var t=e.className,n=e.style,i=e.replyingTo,l=e.mentionedUser,s=e.description,u=e.disableShortenContent,d=e.mentions,m=void 0===d?[]:d,p=r(!1),v=p[0],h=p[1],f=g().t,k=q().authActionWrapper,C=r(!1),y=C[0],E=C[1],b=V(U(s||"","display"),m),N=a(w).action.sanitizeFunction,I=c((function(){var e=N(b||"");if(u||v)return{showContent:e,hasSeeMore:!1};var t=e.slice(0,1e3),n=1e3-27*((t.match(/<\/div>/g)||[]).length-1),i=(t||"").slice(0,n<40?40:n),o=N(i.replace(/(<|<\/)( +|[a-zA-Z]*)$/gi,"")),a=o.length<e.length-10;return{showContent:a?o:e,hasSeeMore:a}}),[u,v,b]),T=(null==l?void 0:l.name)||i,x="expert"===(null==l?void 0:l.role)&&!!(null==l?void 0:l.partnerId);return o.createElement(o.Fragment,null,x&&o.createElement(ee,{isOpen:y,onClose:function(){return E(!1)},expertId:String(null==l?void 0:l.partnerId)}),o.createElement(te,{className:"".concat(t," no-replace-click"),style:n},T&&o.createElement("span",{onClick:function(){return x&&E(!0)},className:"post-content-replying"},"@",T),(null==s?void 0:s.startsWith("[mention+id="))&&o.createElement("span",{className:"post-content-replying tag-only"},"@"),o.createElement("span",{dangerouslySetInnerHTML:{__html:I.showContent},className:"post-content ".concat(I.hasSeeMore?"has-see-more":"")}),I.hasSeeMore&&!v&&o.createElement("span",null,"... ",o.createElement("span",{onClick:function(e){e.preventDefault(),e.stopPropagation(),k((function(){return h(!0)}))},className:"see-more-text"},f("post.seeMore")))))},ct=function(e){var t=e.className,n=e.style,i=e.authorName,a=e.images,l=e.onClose,c=e.onOpenSingleView,u=g().t,m=r(!1),p=m[0],v=m[1];return s((function(){setTimeout((function(){v(!0)}),0)}),[]),Me.createPortal(o.createElement(ne,{className:t,style:n,"data-open":p},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(d,{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"})})))),f())},ut="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",dt=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 Me.createPortal(o.createElement(ie,{"data-open":d&&!!p},o.createElement(oe,null,o.createElement("img",{src:ae,className:"icon-close",onClick:i,alt:"close"})),p&&l>=0&&o.createElement(o.Fragment,null,o.createElement(re,null,o.createElement("img",{className:"img-preview",src:p,alt:"post img open"}),o.createElement(le,{"data-disabled":v,onClick:function(){return!v&&c(l-1)}},o.createElement(se,null,o.createElement("img",{src:ut,style:{transform:"rotate(180deg)"},alt:"left arrow","data-disabled":v}))),o.createElement(le,{"data-right":!0,"data-disabled":g,onClick:function(){return!g&&c(l+1)}},o.createElement(se,null,o.createElement("img",{src:ut,alt:"right arrow","data-disabled":g})))))),f())},mt=function(e){var t=e.className,n=e.images,i=void 0===n?[]:n,c=e.style,u=e.authorName,d=a(w).data.env.isMarryBaby,m="+ ".concat((i.length||0)-4),p=r(!1),v=p[0],g=p[1],f=r(-1),k=f[0],C=f[1];s((function(){setTimeout((function(){return null==Se?void 0:Se.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&&h(!1)}}),[]),s((function(){v||k>=0?(h(!0),E.current=!0):(h(!1),E.current=!1)}),[v,k]),o.createElement(o.Fragment,null,o.createElement(ce,{className:t,style:c,"data-image-count":y?5:i.length||0,"data-is-marrybaby":d},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?g(!0):C(t)}},!d&&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(Le,{tag:"h1",color:"white"},m)))}))),v&&o.createElement(ct,{authorName:u||"",images:i,onClose:function(){return g(!1)},onOpenSingleView:C}),k>=0&&o.createElement(dt,{images:i,initialViewIndex:k,onClose:function(){return C(-1)}}))},pt=function(i){var u=i.url,d=i.image,m=i.className,p=i.style,v=a(w).data.locale,g=r(null),h=g[0],f=g[1];s((function(){e(void 0,void 0,void 0,(function(){return t(this,(function(e){return d?[2]:u?(f((function(e){return n(n({},e),{isFetching:!0})})),y(E(b.FETCH_PREVIEW,{_locale:v}),"POST",{data:{link:u}}).then((function(e){var t,n;f({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(){f(null)})),[2]):[2,f(null)]}))}))}),[u,d]);var k=(null==h?void 0:h.image)||d,N=(null==h?void 0:h.url)||u,I=c((function(){return ue(N)}),[N]),T=c((function(){return de(N)}),[N]),x=l(0),M=l(0),_=r(!1),P=_[0],L=_[1];s((function(){var e=function(){var e,t=null===(e=S.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&&L((function(e){return!e}))};return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]);var S=l(null),j=l(!1);return o.createElement(me,{className:"".concat(m," no-replace-click"),style:p,ref:S},d||!I&&!T?o.createElement("a",{href:N,target:"_blank",rel:"noreferrer"},o.createElement("div",{className:"link-image-wrapper ".concat((null==h?void 0:h.isFetching)?"fetching":"")},(null==h?void 0:h.isFetching)?o.createElement(F,{className:"loading-spinner"}):o.createElement("img",{className:"link-image",src:k||C,onError:function(e){j.current||(j.current=!0,e.currentTarget.src=C)}}))):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(P),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))},vt="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",gt="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",ht="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",ft=function(n){var i=n.onDeleteComment,l=n.commentId,s=n.className,c=void 0===s?"":s,u=n.popoverClassName,d=void 0===u?"":u,m=a(w),p=m.data,v=p.env.isMarryBaby,h=p.locale,f=m.action.pushNotifications,k=g().t,C=r(!1),y=C[0],E=C[1],b=q().authActionWrapper;return o.createElement("div",{className:c,onClick:function(e){e.preventDefault(),e.stopPropagation()}},y&&o.createElement(qe,{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:k("popup.deleteComment.title"),description:k("popup.deleteComment.description"),acceptText:k("popup.deletePost.accept"),cancelText:k("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,ot({id:l,locale:h})]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(i&&i(),f({title:"",message:k("notification.success"),type:"success"})):f({title:"",message:(null===(n=null==e?void 0:e.messages)||void 0===n?void 0:n[0])||k("notification.failure"),type:"danger"}),[2]}}))}))},onClose:function(){return E(!1)}}),o.createElement(pe,{position:"bottom",align:"end",data:{isShowheader:!1,type:"list",list:[{icon:ht,label:k("actionPopover.delete"),onClick:function(){b((function(){E(!0)}))}}]},className:d,toggleButtonContent:o.createElement("img",{src:v?vt:gt}),buttonProps:{}}))},wt=function(i){var l,u,d,p,h,f=i.className,k=i.style,C=i.comment,E=i.type,b=void 0===E?"comment":E,N=i.level,I=void 0===N?0:N,T=i.replyingId,x=i.onPostCommentSuccess,M=i.post,_=i.onDeleteComment,P=i.refetchComment,L=i.hasQuickBookingEnable,S=i.handleMakeAppointment,j=a(w).data,B=j.locale,F=j.userInfo,R=j.env.isMarryBaby,D=g().t,O=r(C||null),A=O[0],z=O[1],V=A.id;A.countReplies;var U=A.countLikes,H=A.content,W=A.createdAt,Z=A.replies,G=void 0===Z?[]:Z,K=A.images,Q=void 0===K?[]:K,X=A.author,J=A.liked,Y=A.link,$=A.mentionedUser,ee=A.mentions,te=function(e){try{var t=e.match(/\[@([^\]]+)\]/),n=t?t[0].replace("[@","").replace("]",""):"";return{text:e.replace(/\[@([^\]]+)\]/,"").trim(),replyingTo:n}}catch(e){}return{text:""}}(H),ne=te.text,ie=te.replyingTo,oe=q({_joinCommunityIds:[null===(l=null==M?void 0:M.community)||void 0===l?void 0:l.id],_joinTopicIds:null===(u=null==M?void 0:M.topics)||void 0===u?void 0:u.map((function(e){return e.id}))}).authActionWrapper,ae=r(4),re=ae[0],le=ae[1],se=!!(null==F?void 0:F.id)&&(null==G?void 0:G.some((function(e){return e.author.id===F.id}))),ce=function(e){z((function(t){if(!t.replies.find((function(t){return t.id===e.id}))){t.replies.unshift(e);var i=n(n({},t),{replies:t.replies.slice(),countReplies:t.countReplies+1});return P&&P(i),i}return t}))},ue=r(!1),de=ue[0],me=ue[1],pe=c((function(){return"comment"===b&&G&&0!=G.length?G.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})):G}),[b,G]),ye=(null==G?void 0:G.length)||0,Ee=String(null==X?void 0:X.email)&&(null==F?void 0:F.email)&&String(null==X?void 0:X.email)===String(null==F?void 0:F.email),be=(null==X?void 0:X.name)||(null==X?void 0:X.username)||"",Ne=null==X?void 0:X.avatar,Ie=(null==X?void 0:X.username)||(null==X?void 0:X.name)||"",Te=r(null),xe=Te[0],Me=Te[1],_e=r(null),Pe=_e[0],Le=_e[1];s((function(){if(null==X?void 0:X.hospitalId){n=X.hospitalId,e(void 0,void 0,void 0,(function(){var e,i;return t(this,(function(t){switch(t.label){case 0:return[4,y(ke(Ce.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:je[B]}),"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==X?void 0:X.doctorId){i=X.doctorId,e(void 0,void 0,void 0,(function(){var e,n;return t(this,(function(t){switch(t.label){case 0:return[4,y(ke(Ce.GET_DOCTOR_INFO,{doctorId:i,website_url:je[B]}),"get")];case 1:return e=t.sent(),(null===(n=null==e?void 0:e._data)||void 0===n?void 0:n.doctor)&&Le(null==e?void 0:e._data.doctor),[2]}}))}))}}),[X.hospitalId,X.doctorId]);var Se=(null==Pe?void 0:Pe.valid_outpatient)||(null==Pe?void 0:Pe.valid_telemedicine),Fe=((null==xe?void 0:xe.total_available_service)||(null==xe?void 0:xe.total_available_doctor))>0,Re=L&&(Se||Fe);return o.createElement(ve,{defaultParams:{_joinCommunityIds:[null===(d=null==M?void 0:M.community)||void 0===d?void 0:d.id],_joinTopicIds:null===(p=null==M?void 0:M.topics)||void 0===p?void 0:p.map((function(e){return e.id}))}},o.createElement(ge,{className:f,style:k,"data-is-reply":!!I,"data-is-marrybaby":R,"data-has-booking":Re},"reply"===b&&o.createElement(v,{className:"top-divider",type:"solid"}),o.createElement(he,{avatar:Ne,name:be,username:Ie,email:null==X?void 0:X.email,time:W,className:"post-author ".concat(Ee?"with-popover":""),type:b,userId:null==X?void 0:X.id,role:null==X?void 0:X.role,expertId:null==X?void 0:X.partnerId,title:null==X?void 0:X.title,doctorId:null==X?void 0:X.doctorId,hospitalId:null==X?void 0:X.hospitalId,hasQuickBooking:Re,handleMakeAppointment:S}),o.createElement(st,{className:"post-content-wrapper",replyingTo:ie,mentionedUser:$,description:ne,mentions:ee}),o.createElement("span",null),o.createElement("span",null),Q&&Q.length>0?o.createElement("div",{key:"image-preview",className:"image-preview-wrapper","data-is-reply":!0},o.createElement(mt,{images:Q,authorName:null==X?void 0:X.username})):null,Q&&0!==Q.length||!Y?null:o.createElement("div",{key:"link-preview",className:"link-preview-wrapper","data-is-reply":!0},o.createElement(Be,{url:Y})),"most-engaging"!==b?o.createElement(o.Fragment,null,o.createElement(fe,{type:we.reply,loveCount:U,replyCount:ye,className:"post-reaction",liked:J,isReplied:se,hideCommentIcon:"reply"===b,onCommentClick:function(){return oe((function(){return me((function(e){return!e}))}))},onCommentCountClick:function(){return oe((function(){me(!0)}))},onLikeClick:function(){return oe((function(){return e(void 0,void 0,void 0,(function(){return t(this,(function(e){switch(e.label){case 0:return V?[4,it({commentId:V,setLike:!J,locale:B})]:[3,2];case 1:1===e.sent().status&&z((function(e){return n(n({},e),{liked:!J,countLikes:e.countLikes+(J?-1:1)})})),e.label=2;case 2:return[2]}}))}))}))}}),de&&o.createElement(at,{replyingId:T||A.id,replyToName:X.name||X.username||"",isReply:!0,onClose:function(){return me(!1)},onPostSuccess:function(e){"reply"===b?x&&x(e):ce(e)},post:M,replyingUser:X}),"comment"===b&&G&&G.length>0?o.createElement("div",{className:"comment-reply-wrapper"},null===(h=null==pe?void 0:pe.slice(0,re))||void 0===h?void 0:h.map((function(e){return o.createElement(wt,{key:e.id,comment:e,type:"reply",className:"comment-reply-item",level:I+1,replyingId:V,onPostCommentSuccess:ce,post:M,onDeleteComment:function(){z((function(t){return n(n({},t),{replies:t.replies.filter((function(t){return t.id!==e.id})),countReplies:t.countReplies-1})}))},handleMakeAppointment:S,hasQuickBookingEnable:L})})),ye>re&&o.createElement(o.Fragment,null,o.createElement(v,{className:"top-divider",type:"solid"}),o.createElement(m,{className:"more-cmt",size:"lg",color:"ghost",onClick:function(){return le((function(e){return e+4}))}},D("comment.seeMoreReplies",{count:ye-re}),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,Ee&&o.createElement(ft,{onDeleteComment:_,className:"popover",commentId:A.id})))},kt="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",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 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",yt="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",Et=function(n){var i=n.authorEmail,l=n.onDeletePost,s=n.shareUrl,c=n.post,u=n.className,d=void 0===u?"":u,m=n.popoverClassName,p=void 0===m?"":m,v=n.onBookmark,h=n.onRemoveBookmark,f=n.onEditPost,k=a(w),C=k.data,y=C.locale,N=C.userInfo,I=C.togetherUserId,x=C.env.isMarryBaby,M=k.action.pushNotifications,_=g().t,P=r(!1),L=P[0],S=P[1],j=r(!1),B=j[0],F=j[1],R=r(!1),D=R[0],O=R[1],A=q().authActionWrapper,z=i&&(null==N?void 0:N.email)&&i===String(null==N?void 0:N.email);return o.createElement("div",{className:d,onClick:function(e){e.preventDefault(),e.stopPropagation()}},D&&o.createElement(ye,{url:s,text:null==c?void 0:c.title,onClose:function(){return O(!1)}}),B&&o.createElement(qe,{thumbnail:"./svg/delete.svg",isThumbnailIcon:!0,title:_("popup.deletePost.title"),description:_("popup.deletePost.description"),acceptText:_("popup.deletePost.accept"),cancelText:_("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)||L)return[2];S(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,ze({id:c.id,locale:y})];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 S(!1),[2]}}))}))},onClose:function(){return F(!1)}}),o.createElement(pe,{className:p,toggleButtonContent:o.createElement("img",{src:x?vt:gt}),position:"bottom",align:"end",buttonProps:{isLoading:L},data:z?{isShowheader:!1,type:"list",list:[{icon:yt,label:_("morePopover.share"),onClick:function(){return O(!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:_("actionPopover.edit"),onClick:f},{icon:ht,label:_("actionPopover.delete"),onClick:function(){A((function(){return F(!0)}))}}]}:{isShowheader:!1,type:"list",list:[{icon:yt,label:_("morePopover.share"),onClick:function(){return O(!0)}},{icon:(null==c?void 0:c.bookmarked)?kt:Ct,label:(null==c?void 0:c.bookmarked)?_("morePopover.unsavePost"):_("morePopover.savePost"),onClick:function(){A((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,T(E(b.BOOKMARK.DELETE,{_locale:y}),"DELETE",{data:{post_id:String(c.id)}})]:[3,2]:[2];case 1:return 1===(null==(e=t.sent())?void 0:e.status)?(M({title:"",message:"Removed saved post",type:"success",displayIcon:Ct}),h&&h()):M({title:"",message:"Remove failed",type:"danger",displayIcon:Ct}),[3,4];case 2:return[4,T(E(b.BOOKMARK.CREATE,{_locale:y}),"POST",{data:{user_id:I||N.id,post_id:c.id}})];case 3:1===(null==(e=t.sent())?void 0:e.status)?(M({title:"",message:"Post saved",type:"success",displayIcon:kt}),v&&v()):M({title:"",message:"Post saved failed",type:"danger",displayIcon:Ct}),t.label=4;case 4:return[2]}}))}))}))}},{icon:rt,label:_("morePopover.report"),subTree:{title:_("morePopover.report.title"),description:_("morePopover.report.description"),isShowheader:!0,type:"list",list:Object.keys(Ee).map((function(e){return{label:Ee[e].label,reason:Ee[e].reportReasonText,reasonValue:e}})).map((function(e){return{label:_(e.label),subTree:{title:_("morePopover.reportSubmit.title"),description:_("morePopover.reportSubmit.description"),isShowheader:!0,type:"jsx",jsxRenderer:function(t){return o.createElement(lt,{reason:e.reasonValue,reasonText:_(e.reason),postId:null==c?void 0:c.id,onClose:function(){return t&&t(!1)}})}}}}))}}]}}))},bt=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,Te(E(b.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(Y))||void 0===r?void 0:r[0]]}}))}))},Nt=function(i){var l=i.className,c=i.style,u=i.hideViewMoreComment,d=i.showMostEngaging,p=i.onCommentClick,v=i.onCommentCountClick,h=i.onMostEngagingCommentClick,f=i.onPostCommentSuccess,k=i.disableCardLink,E=i.disableShortenContent,b=i.onDeletePost,N=i.onEditPost,I=i.post,T=i.mostEngagingComment,x=i.onDeleteComment,M=i.showInputComment,_=i.InlineCommentsComponent,P=i.hasQuickBookingEnable,L=i.handleMakeAppointment,S=r(I),j=S[0],F=S[1],R=r(!1),D=R[0],O=R[1],A=r(T),z=A[0],V=A[1],U=j.community,H=j.topics,W=j.author,Z=j.slug,G=j.isPin,K=j.liked,Q=j.scheduleDateTime,X=j.createdAt,J=j.photos,Y=j.mentions,$=j.title,ee=j.description,te=j.previewUrl,ne=j.likesCount,ie=j.commentsCount,oe=j.id,ae=j.commented,re=a(w),le=re.data,se=le.locale,ce=le.env,ue=ce.isMarryBaby,de=ce.togetherBasePath,me=re.action.pushNotifications,pe=g().t,ge=r(M),Ee=ge[0],Te=ge[1],xe="".concat(de,"/").concat((null==U?void 0:U.slug)||"_","/").concat(Z||""),Me="".concat(be(se)).concat(xe),_e=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,Pe=r(!1),Se=Pe[0],je=Pe[1];s((function(){Te(M)}),[M]);var Oe=(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,y(ke(Ce.GET_HOSPITAL_INFO,{hospital_branch_id:n,website_url:Ie[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,y(ke(Ce.GET_DOCTOR_INFO,{doctorId:i,website_url:Ie[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&&d&&!(null==T?void 0:T.id)?[4,bt(oe,se)]:[3,2];case 1:e=t.sent(),V(e),t.label=2;case 2:return[2]}}))}))}),[oe,se,ie,d,null==T?void 0:T.id]),s((function(){V(T)}),[null==T?void 0:T.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,bt(oe,se)]:[3,2];case 1:e=t.sent(),V(e),t.label=2;case 2:return F((function(e){return n(n({},e),{commentsCount:e.commentsCount-1})})),x&&x(i),[2]}}))}))};return o.createElement(ve,{defaultParams:(null==U?void 0:U.slug)?{_joinCommunityIds:[U.id],_joinTopicIds:null==H?void 0:H.map((function(e){return e.id}))}:void 0},D&&o.createElement(ye,{url:Me,avatar:C,text:$,onClose:function(){return O(!1)}}),o.createElement(Ne,{className:l,style:c,"data-is-marrybaby":ue},G?o.createElement(Re,{className:"post-pin"}):null,o.createElement("div",{style:{position:"relative"}},o.createElement(he,{avatar:Ve,name:Oe,username:ze,url:k?void 0:xe,email:null==W?void 0:W.email,time:Q||X,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(Et,{authorEmail:String(null==W?void 0:W.email),onDeletePost:b,shareUrl:Me,post:j,className:"popover",onEditPost:N})),o.createElement("a",{href:k?void 0:xe,className:"post-content-link-wrapper"},$&&o.createElement(Le,{className:"post-content-title",as:"h1",tag:"h5",fontWeight:"bold"},B($)),o.createElement(st,{className:"post-content-wrapper",description:ee,disableShortenContent:E,mentions:Y})),o.createElement("span",null),o.createElement("span",null),o.createElement("div",{key:"tag-topic"},H&&H.length>0?o.createElement(Fe,{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==J?void 0:J.length)?"has-image":"")},o.createElement(pt,{url:j.introUrl,image:j.bannerImage})):null),o.createElement("div",{key:"image-preview"},(null==J?void 0:J.length)?o.createElement("div",{className:"image-preview-wrapper"},o.createElement(mt,{images:J,authorName:null==W?void 0:W.name})):null),o.createElement("div",{key:"link-preview"},(null==j?void 0:j.introUrl)||(null==J?void 0:J.length)||!(null==te?void 0:te.url)?null:o.createElement("div",{className:"link-preview-wrapper"},o.createElement(Be,{title:te.title,url:te.url,image:te.image}))),o.createElement(fe,{type:we.post,loveCount:ne,replyCount:ie,className:"post-reaction ".concat((null==J?void 0:J.length)||(null==te?void 0:te.url)?"hide-top-border":""),liked:Se?!K:K,isReplied:ae,onCommentClick:function(){return _e((function(){p?p():Te((function(e){return!e}))}))},onCommentCountClick:function(){_e((function(){ue?Te(!0):v?v():!k&&(window.location.href=xe)}))},onShareClick:function(){O(!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];je(!0),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,Ae({id:oe,locale:se})];case 2:return 1!==(null==(e=t.sent())?void 0:e.status)?me(De(pe)):F((function(e){return n(n({},e),{likesCount:(e.likesCount||0)+(e.liked?-1:1),liked:!e.liked})})),[3,4];case 3:return t.sent(),me(De(pe)),[3,4];case 4:return je(!1),[2]}}))}))},showingMostEngaging:!(!d||!(null==z?void 0:z.id))}),Ee&&o.createElement(at,{isMainCmt:!M,onClose:function(){return Te(!1)},onPostSuccess:function(e){0!==ie||(null==z?void 0:z.id)||V(e),F((function(e){return n(n({},e),{commentsCount:e.commentsCount+1,commented:!0})})),f&&f(e)},post:j}),d&&(null==z?void 0:z.id)?o.createElement("div",{className:"most-engaging-wrapper",onClick:function(e){h?(e.stopPropagation(),h()):window.location.href=xe}},o.createElement(wt,{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(m,{className:"see-more-comments",color:"ghost",size:"md"},pe("comment.seeMoreComments",{count:ie-1}))):null,_))},It=Object.freeze({__proto__:null});export{Be as C,at as I,Re as L,qe as P,lt as S,Fe as T,$e as a,Ke as b,Xe as c,Je as d,st as e,ct as f,dt as g,mt as h,Nt as i,Et as j,wt as k,ft as l,It as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as n}from"./tslib.es6-6ae0d506.js";import{keyframes as t}from"styled-components";import{useContext as a,useMemo as r}from"react";import{T as e,d as i}from"./translationsContext-221a5963.js";var o,s,l,d,c;!function(n){n.Boy="boy",n.Girl="girl"}(o||(o={})),function(n){n[n.Weight=0]="Weight",n[n.Height=1]="Height",n[n.Head=2]="Head",n[n.BMI=3]="BMI"}(s||(s={})),function(n){n[n.Weekly=0]="Weekly",n[n.Monthly=1]="Monthly",n[n.Yearly=2]="Yearly"}(l||(l={})),function(n){n[n.Weight=0]="Weight",n[n.Height=1]="Height",n[n.Head=2]="Head",n[n.BMI=3]="BMI",n[n.Record=4]="Record"}(d||(d={})),function(n){n.Vietnam="vi-VN",n.Indonesia="id-ID",n.Malaysia="ms-MY",n.Cambodia="km-KH",n.PhilippinesEnglish="en-PH",n.PhilippinesTagalog="tl-PH",n.Thailand="th-TH",n.Myanmar="my-MM",n.Taiwan="zh-TW",n.India="hi-IN"}(c||(c={}));var m,f,u,p,_,E,I,T,B,h=function(n){var t=Object.keys(n);return t.length?"?"+t.map((function(t){return"".concat(t,"=").concat(n[t])})).join("&"):""},O=function(n,t,a){void 0===t&&(t=1),void 0===a&&(a="page");var r=n.split("?"),e=r[0],i=r[1],o=new URLSearchParams(i||""),s={};return o.forEach((function(n,t){n&&(s[t]=n)})),Number(t)>1?s[a]=String(t):delete s[a],e+h(s)},y=function(n){"undefined"!=typeof window&&(document.documentElement.style.overflow=n?"hidden":"")},b={BREAK_POINT_SMALL_MOBILE:481,BREAK_POINT_MOBILE:768,BREAK_POINT_TABLET:1024,BREAK_POINT_PC:1200},A={smbDown:"@media (max-width: ".concat(b.BREAK_POINT_SMALL_MOBILE-1,"px)"),smbUp:"@media (min-width: ".concat(b.BREAK_POINT_SMALL_MOBILE,"px)"),mbDown:"@media (max-width: ".concat(b.BREAK_POINT_MOBILE-1,"px)"),mbOnly:"@media (min-width: ".concat(b.BREAK_POINT_SMALL_MOBILE,"px) and (max-width: ").concat(b.BREAK_POINT_MOBILE-1,"px)"),mbUp:"@media (min-width: ".concat(b.BREAK_POINT_MOBILE,"px)"),tdDown:"@media (max-width: ".concat(b.BREAK_POINT_TABLET-1,"px)"),tdOnly:"@media (min-width: ".concat(b.BREAK_POINT_MOBILE,"px) and (max-width: ").concat(b.BREAK_POINT_TABLET-1,"px)"),tdUp:"@media (min-width: ".concat(b.BREAK_POINT_TABLET,"px)"),pcUp:"@media (min-width: ".concat(b.BREAK_POINT_PC,"px)"),pcOnly:"@media (min-width: ".concat(b.BREAK_POINT_TABLET,"px) and (max-width: ").concat(b.BREAK_POINT_PC-1,"px)"),pcDown:"@media (max-width: ".concat(b.BREAK_POINT_PC-1,"px)")},P=function(n){switch(n){case"smbDown":return[0,b.BREAK_POINT_SMALL_MOBILE-1];case"smbUp":return[b.BREAK_POINT_SMALL_MOBILE,0];case"mbDown":return[0,b.BREAK_POINT_MOBILE-1];case"mbOnly":return[b.BREAK_POINT_SMALL_MOBILE,b.BREAK_POINT_MOBILE-1];case"mbUp":return[b.BREAK_POINT_MOBILE,0];case"tdDown":return[0,b.BREAK_POINT_TABLET-1];case"tdOnly":return[b.BREAK_POINT_MOBILE,b.BREAK_POINT_TABLET-1];case"tdUp":return[b.BREAK_POINT_TABLET,0];case"pcUp":return[b.BREAK_POINT_PC,0];case"pcOnly":return[b.BREAK_POINT_TABLET,b.BREAK_POINT_PC-1];case"pcDown":return[0,b.BREAK_POINT_PC-1]}},v=function(){var n="hhg-comp-popup-wrapper";if(!document.querySelector("#"+n)){var t=document.createElement("div");t.id=n,document.body.appendChild(t)}return document.querySelector("#"+n)},L=t(m||(m=n(["\nfrom {\n transform: translate3d(0, 100%, 0);\n visibility: visible;\n}\n\nto {\n transform: translate3d(0, 0, 0);\n}\n"],["\nfrom {\n transform: translate3d(0, 100%, 0);\n visibility: visible;\n}\n\nto {\n transform: translate3d(0, 0, 0);\n}\n"]))),w=t(f||(f=n(["\nfrom {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"],["\nfrom {\n transform: translate3d(0, -100%, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"]))),M=t(u||(u=n(["\n from {\n transform: translate3d(-100%, 0, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"],["\n from {\n transform: translate3d(-100%, 0, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"]))),N=t(p||(p=n(["\n from {\n transform: translate3d(100%, 0, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"],["\n from {\n transform: translate3d(100%, 0, 0);\n visibility: visible;\n }\n\n to {\n transform: translate3d(0, 0, 0);\n }\n"]))),R=t(_||(_=n(["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(0, 100%, 0);\n}\n"],["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(0, 100%, 0);\n}\n"]))),K=t(E||(E=n(["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(-100%, 0, 0);\n}\n"],["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(-100%, 0, 0);\n}\n"]))),x=t(I||(I=n(["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(100%, 0, 0);\n}\n"],["\nfrom {\n transform: translate3d(0, 0, 0);\n}\n\nto {\n visibility: hidden;\n transform: translate3d(100%, 0, 0);\n}\n"]))),g=t(T||(T=n(["\n from {\n transform: translate3d(0, 0, 0);\n }\n\n to {\n visibility: hidden;\n transform: translate3d(0, -100%, 0);\n }\n"],["\n from {\n transform: translate3d(0, 0, 0);\n }\n\n to {\n visibility: hidden;\n transform: translate3d(0, -100%, 0);\n }\n"]))),C=t(B||(B=n(["\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n"],["\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n"]))),H="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function S(n){var t={exports:{}};return n(t,t.exports),t.exports}var D=S((function(n){(function(t){function a(n){var t=new Error(n);return t.name="ValueError",t}function r(n){return function(t){var r=Array.prototype.slice.call(arguments,1),e=0,i="UNDEFINED";return t.replace(/([{}])\1|[{](.*?)(?:!(.+?))?[}]/g,(function(t,o,s,l){if(null!=o)return o;var d=s;if(d.length>0){if("IMPLICIT"===i)throw a("cannot switch from implicit to explicit numbering");i="EXPLICIT"}else{if("EXPLICIT"===i)throw a("cannot switch from explicit to implicit numbering");i="IMPLICIT",d=String(e),e+=1}var c=d.split("."),m=(/^\d+$/.test(c[0])?c:["0"].concat(c)).reduce((function(n,t){return n.reduce((function(n,a){return null!=a&&t in Object(a)?["function"==typeof a[t]?a[t]():a[t]]:[]}),[])}),[r]).reduce((function(n,t){return t}),"");if(null==l)return m;if(Object.prototype.hasOwnProperty.call(n,l))return n[l](m);throw a('no transformer named "'+l+'"')}))}}var e=r({});e.create=r,e.extend=function(n,a){var e=r(a);n.format=function(){var n=Array.prototype.slice.call(arguments);return n.unshift(this),e.apply(t,n)}},n.exports=e}).call(H,H)}));function U(){var n=a(e)||{locale:"en-PH"},t=n.values,o=n.locale;return r((function(){return{t:function(n,a){return t?t[n]?a?D(t[n]||n,a):t[n]||n:(console.warn("[useTranslations] Missing translation for key ".concat(n," and locale ").concat(o)),a?D(i[n]||n,a):i[n]||n):(console.error("[useTranslations] t method called before translation values are loaded"),n)},locale:o}}),[t,o])}export{b as B,o as G,c as L,A as M,w as a,M as b,N as c,g as d,R as e,K as f,x as g,C as h,O as i,P as j,v as k,s as l,h as m,l as n,d as o,S as p,H as q,D as r,L as s,y as t,U as u};
|