1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4882,9321],{2693:()=>{},14882:(e,t,a)=>{"use strict";a.d(t,{f:()=>m});var l=a(64795),n=a(43982),s=a(72074),o=a(57043);function r(e,t){var a;console.log("\uD83D\uDD0D ACL Office24: ".concat(e,":"),{hasData:!!(null==t?void 0:t.data),dataType:typeof(null==t?void 0:t.data),isArray:Array.isArray(null==t?void 0:t.data),dataLength:(null==t||null==(a=t.data)?void 0:a.length)||0,hasPagination:!!(null==t?void 0:t.pagination)})}function i(e,t){if(console.error("â ACL Office24: Error in ".concat(e,":"),t),t instanceof l.G)throw console.error("â ACL Office24: Response validation failed:",t.errors),(0,s.yO)(Error("API response validation failed: ".concat(t.errors.map(e=>e.message).join(", "))));throw(0,s.yO)(t)}function c(e,t){throw console.error("â ACL Office24: Error in ".concat(e,":"),t),(0,s.yO)(t)}function d(e){var t,a,l,n;console.log("\uD83D\uDD0D ACL Office24: Comments data structure:",{hasData:!!(null==e?void 0:e.data),postId:null==e||null==(t=e.data)?void 0:t.postId,commentsCount:(null==e||null==(l=e.data)||null==(a=l.comments)?void 0:a.length)||0,hasStats:!!(null==e||null==(n=e.data)?void 0:n.stats)})}let m={async getFeed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=e.type||"for_you",a=e.page||1,l=e.limit||10,s=new URLSearchParams({type:t,page:a.toString(),limit:l.toString()});console.log("\uD83D\uDD0D ACL Office24: Making request to /feed with params:",Object.fromEntries(s.entries()));let i=await n.Ay.get("/feed?".concat(s));console.log("â
ACL Office24: Feed API response received:",i.status),r("Raw response data structure",i.data),console.log("\uD83D\uDD0D ACL Office24: Validating and transforming response...");let c=(0,o.e0)(i.data);return console.log("â
ACL Office24: Successfully processed ".concat(c.length," posts for PostGrid")),c}catch(e){i("getFeed",e)}},async getRawFeed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=e.type||"for_you",a=e.page||1,l=e.limit||10,s=new URLSearchParams({type:t,page:a.toString(),limit:l.toString()});console.log("\uD83D\uDD0D ACL Office24: Making raw feed request to /feed with params:",Object.fromEntries(s.entries()));let o=await n.Ay.get("/feed?".concat(s));return console.log("â
ACL Office24: Raw feed API response received:",o.status),console.log("â
ACL Office24: Returning raw feed response"),o.data}catch(e){c("getRawFeed",e)}},async getExtendedFeed(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=e.type||"for_you",a=e.page||1,l=e.limit||10,s=new URLSearchParams({type:t,page:a.toString(),limit:l.toString()});console.log("\uD83D\uDD0D ACL Office24: Making extended feed request to /feed with params:",Object.fromEntries(s.entries()));let i=await n.Ay.get("/feed?".concat(s));console.log("â
ACL Office24: Extended feed API response received:",i.status),r("Raw response data structure",i.data),console.log("\uD83D\uDD0D ACL Office24: Transforming to extended format...");let c=(0,o.xD)(i.data,t);return console.log("â
ACL Office24: Successfully processed ".concat(c.gridData.length," posts for extended feed")),console.log("\uD83D\uDD0D ACL Office24: Extended data includes ".concat(c.fullData.length," full post records")),c}catch(e){c("getExtendedFeed",e)}},async getCompanyFeed(e){try{if(!e.companyId)throw Error("Company ID is required for fetching company feed");let t=String(e.companyId),a=e.page||1,l=e.limit||10,s=new URLSearchParams({page:a.toString(),limit:l.toString()});console.log("\uD83D\uDD0D ACL Office24: Making request to /api/v1/company/".concat(t,"/gallery with params:"),Object.fromEntries(s.entries()));let i=await n.Ay.get("/api/v1/company/".concat(t,"/gallery?").concat(s));console.log("â
ACL Office24: Company feed API response received:",i.status),r("Raw response data structure",i.data),console.log("\uD83D\uDD0D ACL Office24: Validating and transforming response...");let c=(0,o.xD)(i.data);return console.log("â
ACL Office24: Successfully processed ".concat(c.gridData.length," posts for company ").concat(t," PostGrid")),c}catch(e){i("getCompanyFeed",e)}},async getHashtags(){try{console.log("\uD83D\uDD0D ACL Office24: Making request to /hashtags");let e=await n.Ay.get("/hashtags");return console.log("â
ACL Office24: Hashtags API response received:",e.status),e}catch(e){c("getHashtags",e)}},async testFeedApi(){try{console.log("\uD83E\uDDEA ACL Office24: Testing feed API...");let a=await this.getFeed();if(console.log("â
ACL Office24: Feed API test result:"),console.log("- Total posts transformed: ".concat(a.length)),a.length>0){var e,t;let l=a[0];console.log("\uD83D\uDD0D ACL Office24: Sample transformed post:"),console.log("- Post ID: ".concat(l.postId)),console.log("- Media count: ".concat(l.media.length)),console.log("- First media type: ".concat(null==(e=l.media[0])?void 0:e.type)),console.log("- First media URL: ".concat(null==(t=l.media[0])?void 0:t.url))}
1console.log("â
ACL Office24: Feed API test completed successfully")}catch(e){console.error("â ACL Office24: Feed API test failed:",e)}},async getPostComments(e){try{var t,a,l;console.log("\uD83D\uDD0D ACL Office24: Making request to /post/".concat(e,"/comments"));let s=await n.Ay.get("/post/".concat(e,"/comments"));return console.log("â
ACL Office24: Post comments API response received:",s.status),d(s.data),console.log("â
ACL Office24: Successfully fetched ".concat((null==(l=s.data)||null==(a=l.data)||null==(t=a.comments)?void 0:t.length)||0," comments for post ").concat(e)),s.data}catch(t){c("getPostComments for post ".concat(e),t)}},async getPostCommentsForModal(e){try{var t,a;console.log("\uD83D\uDD0D ACL Office24: Making request to /post/".concat(e,"/comments for modal"));let l=await n.Ay.get("/post/".concat(e,"/comments"));console.log("â
ACL Office24: Post comments API response received:",l.status),d(l.data);let s=(0,o.$O)((null==(a=l.data)||null==(t=a.data)?void 0:t.comments)||[]);return console.log("â
ACL Office24: Successfully transformed ".concat(s.length," comments for modal display")),s}catch(t){c("getPostCommentsForModal for post ".concat(e),t)}},async getPostWithCommentsForModal(e,t){try{console.log("\uD83D\uDD0D ACL Office24: Getting post with comments for modal display");let a=await this.getPostCommentsForModal(t),l={id:"".concat(e.postId,"-caption"),userId:e.author.companyId.toString(),userName:e.author.companyName,avatar:e.author.logoUrl,content:e.content,timestamp:e.postedAt||new Date().toISOString()},n=(0,o.JV)(e,[l,...a]);return console.log("â
ACL Office24: Successfully transformed post with ".concat(a.length," comments for modal display")),n}catch(e){c("getPostWithCommentsForModal for post ".concat(t),e)}},async addPostComment(e,t){try{console.log("\uD83D\uDD0D ACL Office24: Making request to POST /post/".concat(e,"/comment")),console.log('\uD83D\uDD0D ACL Office24: Comment content: "'.concat(t,'"'));let a=await n.Ay.post("/post/".concat(e,"/comment"),{content:t.trim()});return console.log("â
ACL Office24: Add comment API response received:",a.status),console.log("\uD83D\uDD0D ACL Office24: Response data:",a.data),console.log("â
ACL Office24: Successfully added comment to post ".concat(e)),a.data}catch(t){c("addPostComment for post ".concat(e),t)}},async getFollowing(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{let t=e.type||"for_you",a=new URLSearchParams({type:t,page:"1",limit:"1"});console.log("\uD83D\uDD0D ACL Office24: Making request to /feed with params:",Object.fromEntries(a.entries()));let l=await n.Ay.get("/feed?".concat(a));return console.log("â
ACL Office24: Feed API response received:",l.status),r("Raw response data structure",l.data),console.log("\uD83D\uDD0D ACL Office24: Validating and transforming response..."),l.data.data[0].author.isFollowed}catch(e){i("getFollowing",e)}},async toggleFollowCompany(e){try{console.log("\uD83D\uDD0D ACL Office24: Making request to POST /company/".concat(e,"/follow"));let t=await n.Ay.post("/company/".concat(e,"/follow"));return console.log("\uD83D\uDD0D ACL Office24: Response status:",t.data),console.log("â
ACL Office24: Successfully followed/unfollowed company ".concat(e)),t.data}catch(t){c("toggleFollowCompany for company ".concat(e),t)}},async getCompanyFollowStatus(e){try{var t,a;console.log("\uD83D\uDD0D ACL Office24: Making request to GET /user/company/".concat(e,"/follow-status"));let l=await n.Ay.get("/user/company/".concat(e,"/follow-status"));console.log("â
ACL Office24: Company follow status API response received:",l.status),console.log("\uD83D\uDD0D ACL Office24: Follow status data:",l.data);let s=(null==(a=l.data)||null==(t=a.data)?void 0:t.isFollowing)||!1;return console.log("â
ACL Office24: Company ".concat(e," follow status: ").concat(s?"following":"not following")),s}catch(t){c("getCompanyFollowStatus for company ".concat(e),t)}}}},20394:(e,t,a)=>{"use strict";a.d(t,{a:()=>n});var l=a(7620);function n(){let[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let e=()=>{t(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),e}},20488:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var l=a(54568),n=a(80308);a(7620);var s=a(66869),o=a(21511);let r=e=>{let{onClick:t,withBg:a=!0,className:r}=e,{t:i}=(0,s.B)();return(0,l.jsx)("div",{className:(0,o.cn)("w-full",a?"bg-white border border-neutral-300 rounded-lg shadow-sm p-4":"",r),children:(0,l.jsxs)(n.$n,{variant:"tertiary","data-testid":"write-review-button",size:"md",onClick:t,className:"w-full justify-center items-center gap-2 px-4 py-2.5 text-sm font-medium text-neutral-900 bg-white border border-neutral-200 rounded-lg hover:bg-gray-50 shadow-sm transition-all duration-200",children:[(0,l.jsx)(n.BL,{name:"PencilAltIcon",className:"w-5 h-5 flex-shrink-0 text-neutral-900",variant:"outline"}),(0,l.jsx)(n.qb,{fontWeight:"medium",children:i("component.write_review_button.write_a_review")})]})})}},26745:(e,t,a)=>{"use strict";a.d(t,{A:()=>
1o});var l=a(54568),n=a(80308);a(7620);var s=a(62776);let o=e=>{let{socialStats:t,onLike:a,onComment:o,onShare:r,onBookmark:i,isLiked:c,isBookmarked:d,postId:m,likedUsers:u,onViewLikedUsers:h,isShowBookmark:p=!0,readOnly:x=!1}=e;return(0,l.jsxs)("div",{className:"flex items-center justify-between","data-testid":"social-actions",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)(s.A,{icon:"HeartIcon",count:t.likes,onClick:a,isActive:null!=c&&c,likedUsers:u,postId:m,onViewLikedUsers:h,readOnly:x,"data-testid":"like-button"}),(0,l.jsx)(s.A,{icon:"ChatAltIcon",count:t.comments,onClick:o,isActive:!1,readOnly:x,"data-testid":"comment-button"}),(0,l.jsx)(s.A,{icon:"PaperAirplaneIcon",count:t.shares,onClick:r,isActive:!1,postId:m,readOnly:x,"data-testid":"share-button"})]}),p&&!x&&(0,l.jsx)("button",{className:"p-1 hover:bg-neutral-100 rounded text-neutral-700",onClick:e=>{e.stopPropagation(),null==i||i()},"data-testid":"bookmark-button",children:(0,l.jsx)(n.BL,{name:"BookmarkIcon",className:"h-5 w-5 cursor-pointer ".concat(d?"fill-neutral-500":"")}
1)})]})}},33177:(e,t,a)=>{"use strict";a.d(t,{l:()=>s});var l=a(7620);let n={mobile:768,tablet:1024};function s(){let[e,t]=(0,l.useState)({width:0,height:0,isMobile:!1,isTablet:!1,isDesktop:!1});return(0,l.useEffect)(()=>{let e=()=>{let e=window.innerWidth;t({width:e,height:window.innerHeight,isMobile:e<n.mobile,isTablet:e>=n.mobile&&e<n.tablet,isDesktop:e>=n.tablet})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),e}},34671:(e,t,a)=>{"use strict";a.d(t,{b:()=>d});var l=a(62942),n=a(7620),s=a(4701),o=a(94244),r=a(13877),i=a(42735),c=a(47275);function d(e){var t;let{companyId:a,companyUuid:d,companyName:m,locale:u,accessToken:h,targetWorkExperienceId:p,writeReviewPath:x,onUnauthenticated:f,noWorkExperiencePath:g,enabled:v=!0}=e,y=(0,l.useRouter)(),w=(0,s.CL)(),{data:j}=(0,r.z)({enabled:!!h}),{setEntrySource:b,setContext:N,entrySource:k,context:C}=(0,i.B)(),[S,I]=(0,n.useState)(!1),L=null!=(t=C.companyId)?t:"",D="write-review"===k&&!!a&&(L===a||!!d&&L===d),_=(0,c.c)({companyId:Number(a)||0,companyUuid:d,companyName:m,enabled:v&&!!h&&!p}),A=(0,n.useCallback)(e=>{var t;b("write-review"),N({...e?{workExperienceId:e}:{},companyId:null!=d?d:a,companyLegacyId:a,companyName:null!=m?m:""});let l=e?"?workExperienceId=".concat(encodeURIComponent(e)):"";y.push("/".concat(u).concat(null!=(t=null==w?void 0:w.beforeProfile)?t:"").concat(l))},[a,m,d,u,y,w,N,b]),E=(0,n.useCallback)(e=>{if(!(0,o.cl)(null==j?void 0:j.sectionCompletion))return void A(e);let t=new URLSearchParams({workExperienceId:e});d&&t.set("companyUuid",d),y.push("".concat(x,"?").concat(t.toString()))},[d,A,null==j?void 0:j.sectionCompletion,y,x]),T=(0,n.useCallback)(()=>{if(!h){null==f||f();return}return(0,o.cl)(null==j?void 0:j.sectionCompletion)?p?void E(p):void(a?I(!0):g&&y.push(g)):void A(null!=p?p:void 0)},[h,a,E,A,g,f,null==j?void 0:j.sectionCompletion,y,p]),P=(0,n.useCallback)((e,t)=>{let l=function(e,t,a){if(!Array.isArray(e))return;let l=e.filter(e=>e.companyId===t||a&&e.companyId===a);return[...l.length>0?l:e].sort((e,t)=>{if(e.isCurrentlyWorking!==t.isCurrentlyWorking)return e.isCurrentlyWorking?-1:1;let a=Number(e.startYear)||0,l=Number(t.startYear)||0;return a!==l?l-a:(Number(t.startMonth)||0)-(Number(e.startMonth)||0)})[0]}(t,a,d);I(!1),(null==l?void 0:l.id)&&E(l.id)},[a,d,E]);return{handleWriteReview:T,invitedToThisCompany:D,isAddWorkExperienceOpen:S,setIsAddWorkExperienceOpen:I,addWorkExperienceContext:(0,n.useMemo)(()=>({mode:"add",resumeType:"full",existingData:_.existingData,lockedFields:_.lockedFields}),[_.existingData,_.lockedFields]),handleWorkExperienceAdded:P}}},47275:(e,t,a)=>{"use strict";a.d(t,{c:()=>m});var l=a(67933),n=a(23654),s=a(7620),o=a(88914),r=a(47279),i=a(52463);let c=e=>(null!=e?e:"").trim().toLowerCase(),d={th:11,en:38};function m(e){var t;let{companyId:a,companyUuid:m,companyName:u,enabled:h=!0}=e,p=h&&a>0,x=(0,n.Ym)(),{data:f,isLoading:g}=(0,i.B0)({idEmp:a,idLanguage:null!=(t=d[x])?t:d.en,draft:0},{enabled:p}),{data:v,isLoading:y}=(0,r.useWorkExperienceMasterData)(),w=(0,s.useMemo)(()=>{var e,t;let a=c(null==f?void 0:f.countryName);if(a)return null==v||null==(t=v.countries)||null==(e=t.find(e=>c(e.name)===a))?void 0:e.id},[null==f?void 0:f.countryName,null==v?void 0:v.countries]),{data:j,isLoading:b}=(0,l.useQuery)({queryKey:["work-experience","provinces",w],queryFn:()=>o.v.getProvinces(String(w)),enabled:p&&!!w&&!!c(null==f?void 0:f.provinceName)}),N=(0,s.useMemo)(()=>{var e;let t=c(null==f?void 0:f.provinceName);if(t)return null==j||null==(e=j.find(e=>c(e.name)===t))?void 0:e.id},[null==f?void 0:f.provinceName,j]);return(0,s.useMemo)(()=>{let e={company:null!=u?u:"",companyId:null!=m?m:String(a)},t=["company"];return w&&(e.countryId=w,t.push("country")),N&&(e.companyProvinceId=N,t.push("companyProvince")),{existingData:e,lockedFields:t,isLoading:p&&(g||y||b)}},[a,u,N,m,w,y,p,g,b])}},47279:(e,t,a)=>{"use strict";a.r(t),a.d(t,{useCreateWorkExperience:()=>u,useCreateWorkExperienceOptimistic:()=>h,useDeleteWorkExperience:()=>x,usePrefetchWorkExperience:()=>g,useUpdateHaveWorkExperience:()=>f,useUpdateWorkExperience:()=>p,useWorkExperienceData:()=>d,useWorkExperienceMasterData:()=>m});var l=a(67933),n=a(87606),s=a(16258),o=a(23654),r=a(67734),i=a(2759),c=a(39924);function d(e){return(0,l.useQuery)({queryKey:r.w.queryKeys.workExperience.data(),queryFn:()=>r.w.getWorkExperienceData(),staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:3,retryDelay:e=>Math.min(1e3*2**e,3e4),...e})}function m(){let e=(0,o.Ym)();return(0,l.useQuery)({queryKey:[...r.w.queryKeys.workExperience.master,e],queryFn:()=>r.w.getMasterData(),staleTime:1/0,gcTime:1/0})}function u(){let e=(0,n.useQueryClient)(),{syncWorkExperience:t}=(0,c.g)();return(0,s.useMutation)({mutationFn:e=>
1r.w.createWorkExperience(e),onSuccess:a=>{e.setQueryData(r.w.queryKeys.workExperience.data(),e=>{if(!e)return a?[...a]:e;let t=[...e];return a.forEach(e=>{let a=t.findIndex(t=>t.id===e.id);a>=0?t[a]=e:t.push(e)}),[...t].sort(i.zB)}),t(a)},onError:e=>{console.error("Failed to create work experience:",e)}})}function h(){let e=(0,n.useQueryClient)();return(0,s.useMutation)({mutationFn:e=>r.w.createWorkExperience(e),onMutate:async t=>{let a=r.w.queryKeys.workExperience.data();await e.cancelQueries({queryKey:a});let l=e.getQueryData(a);return e.setQueryData(a,e=>[...e||[],{...t,id:"temp-".concat(Date.now())}]),{previousData:l}},onError:(t,a,l)=>{e.setQueryData(r.w.queryKeys.workExperience.data(),null==l?void 0:l.previousData),console.error("Optimistic update failed, rolled back:",t)},onSettled:()=>{e.invalidateQueries({queryKey:r.w.queryKeys.workExperience.data()}).catch(()=>{})}})}function p(){let e=(0,n.useQueryClient)(),{syncWorkExperience:t}=(0,c.g)();return(0,s.useMutation)({mutationFn:e=>{let{id:t,updates:a}=e;return console.log("updates",a),r.w.updateWorkExperience(t,a)},onSuccess:a=>{e.setQueryData(r.w.queryKeys.workExperience.data(),e=>{if(!e)return a?[...a]:e;let t=[...e];return a.forEach(e=>{let a=t.findIndex(t=>t.id===e.id);a>=0?t[a]=e:t.push(e)}),t.sort(i.zB)}),t(a)},onError:e=>{console.error("Failed to update work experience:",e)}})}function x(){let e=(0,n.useQueryClient)(),{syncWorkExperienceDelete:t}=(0,c.g)();return(0,s.useMutation)({mutationFn:e=>r.w.deleteWorkExperience(e),onSuccess:a=>{e.setQueryData(r.w.queryKeys.workExperience.data(),e=>{if(!e)return e;let t=new Set(a.map(e=>e.id));return e.filter(e=>!t.has(e.id))}),t(a)},onError:e=>{console.error("Failed to delete work experience:",e)}})}function f(){return(0,s.useMutation)({mutationFn:e=>r.w.updateHaveWorkExperience(e)})}function g(){let e=(0,n.useQueryClient)();return()=>{e.prefetchQuery({queryKey:r.w.queryKeys.workExperience.data(),queryFn:()=>r.w.getWorkExperienceData(),staleTime:3e5}).catch(()=>{})}}},54289:(e,t,a)=>{"use strict";a.d(t,{HrSayPage:()=>ej});var l=a(54568),n=a(62942),s=a(23654),o=a(7620),r=a(66869),i=a(52463),c=a(47279),d=a(68913),m=a(80308);let u=e=>{let{companyOverview:t,showEdit:a=!1,onEdit:n=()=>{},editLabel:s="Edit"}=e,{t:o}=(0,r.B)();return(0,l.jsxs)("div",{className:"w-full min-w-0",children:[(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 py-2 mb-2",children:[(0,l.jsx)("h2",{className:"m-0 p-0 min-w-0",children:(0,l.jsx)(m.R0,{className:"font-semibold min-w-0",children:o("component.company_overview.company_overview")})}),a&&(0,l.jsx)(m.$n,{variant:"tertiary",className:"flex items-center shrink-0",leftIcon:(0,l.jsx)(m.BL,{name:"PencilIcon",className:"w-5 h-5"}),onClick:n,children:s})]}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:gap-6",children:[t.aboutCompany&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 min-w-0",children:[(0,l.jsx)(m.qb,{fontWeight:"semibold",className:"text-neutral-700",children:o("component.company_overview.about_company")}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-700 whitespace-pre-line break-words",children:t.aboutCompany})]}),t.vision&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 min-w-0",children:[(0,l.jsx)(m.qb,{fontWeight:"semibold",className:"text-neutral-700",children:o("component.company_overview.vision")}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-700 whitespace-pre-line break-words",children:t.vision})]}),t.mission&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 min-w-0",children:[(0,l.jsx)(m.qb,{fontWeight:"semibold",className:"text-neutral-700",children:o("component.company_overview.mission")}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-700 whitespace-pre-line break-words",children:t.mission})]}),(t.companySize||t.industry||t.location)&&(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:flex-wrap gap-4 sm:gap-6 md:gap-8",children:[t.companySize&&(0,l.jsxs)("div",{className:"flex flex-col justify-center items-start gap-2 min-w-0 flex-1 sm:min-w-[140px]",children:[(0,l.jsx)(m.qb,{fontWeight:"semibold",className:"text-neutral-700",children:o("component.company_overview.company_
1size")}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-700 break-words",children:t.companySize})]}),t.industry&&(0,l.jsxs)("div",{className:"flex flex-col justify-center items-start gap-2 min-w-0 flex-1 sm:min-w-[140px]",children:[(0,l.jsx)(m.qb,{fontWeight:"semibold",className:"text-neutral-700",children:o("component.company_overview.company_industry")}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-700 break-words",children:t.industry})]}),t.location&&(0,l.jsxs)("div",{className:"flex flex-col justify-center items-start gap-2 min-w-0 flex-1 sm:min-w-[140px]",children:[(0,l.jsx)(m.qb,{fontWeight:"semibold",className:"text-neutral-700",children:o("component.company_overview.location")}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-700 break-words",children:t.location})]})]}),t.website&&(0,l.jsxs)("div",{className:"flex flex-col gap-2 min-w-0",children:[(0,l.jsx)(m.qb,{fontWeight:"semibold",className:"text-neutral-700",children:o("component.company_overview.website")}),(0,l.jsx)("a",{href:t.website.startsWith("http")?t.website:"https://".concat(t.website.replace(/^\/\//,"")),target:"_blank",rel:"noopener noreferrer",className:"text-neutral-700 underline decoration-from-font hover:text-neutral-900 break-all",children:(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-700",children:t.website})})]})]})]})},h=e=>{let{name:t,avatar:a,jobTitle:n,experienceText:s}=e;return(0,l.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,l.jsx)("div",{className:"w-[84px] h-[84px] shrink-0 rounded-full overflow-hidden",children:(0,l.jsx)(m.eu,{name:t,src:a,size:"xl"})}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)(m.jz,{"data-testid":"employee-name",fontWeight:"medium",children:t}),(0,l.jsx)(m.qb,{"data-testid":"employee-job-title",fontWeight:"normal",className:"text-neutral-700",children:n}),(0,l.jsx)(m.Ex,{"data-testid":"employee-experience",shape:"pilled",type:"neutral",variant:"accent",size:"sm",className:"font-normal mt-1",children:s})]})]})},p=e=>{let{onClose:t}=e,{t:a}=(0,r.B)();return(0,l.jsxs)("header",{className:"mb-4",children:[(0,l.jsxs)("div",{className:"flex min-h-8 flex-row items-center justify-between gap-3",children:[(0,l.jsx)(m.wt,{className:"flex min-h-8 min-w-0 flex-1 items-center text-left",children:(0,l.jsx)(m.jz,{className:"text-neutral-900 font-semibold leading-6",children:a("component.employee_voice_modal.title")})}),(0,l.jsx)(m.vY,{asChild:!0,children:(0,l.jsx)(m.$n,{type:"button",variant:"link",onClick:()=>null==t?void 0:t(),className:"!min-h-8 !h-8 !w-8 !p-0 shrink-0 inline-flex items-center justify-center text-neutral-900 hover:bg-neutral-50 hover:text-neutral-500","aria-label":"Close",children:(0,l.jsx)(m.BL,{name:"XIcon",width:20,height:20,className:"pointer-events-none block shrink-0"})})})]}),(0,l.jsx)("div",{className:"mt-4 h-px w-full bg-neutral-200",role:"presentation"})]})},x=e=>{let{name:t,avatar:a,jobTitle:n,experienceText:s,gallery:o,reviewText:i,onClose:c}=e,{t:d}=(0,r.B)();return(0,l.jsxs)("div",{"data-testid":"employee-voice-modal",className:"flex flex-col w-full min-w-0 p-4 rounded-lg bg-white border border-neutral-300 h-full",children:[(0,l.jsx)(h,{name:t,avatar:a,jobTitle:n,experienceText:s}),(0,l.jsx)("div",{className:"flex-1 flex flex-col gap-4",children:(0,l.jsxs)("div",{children:[(0,l.jsx)(m.qb,{"data-testid":"employee-review",className:"text-neutral-700 break-normal line-clamp-3 mb-2",children:i}),(0,l.jsxs)(m.aF,{children:[(0,l.jsx)(m.g6,{asChild:!0,children:(0,l.jsx)(m.$n,{variant:"link","data-testid":"read-more-trigger",className:"!p-0 mt-0 h-auto min-h-0 text-neutral-900 hover:text-neutral-500 justify-start",children:(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-900",children:d("component.employee_voice_modal.read_more")})})}),(0,l.jsx)(m.Q$,{children:(0,l.jsx)(m.sK,{showCloseButton:!1,className:"min-w-[343px] sm:w-[620px] sm:min-w-[620px] sm:max-w-[620px]",children:(0,l.jsxs)(m.cw,{children:[(0,l.jsx)(p,{onClose:c}),(0,l.jsx)(h,{name:t,avatar:a,jobTitle:n,experienceText:s}),(0,l.jsx)("div",{className:"flex flex-col gap-4",children:(0,l.jsx)(m.qb,{className:"text-neutral-900 break-normal",children:i})}),(0,l.jsx)(m.Z2,{photos:o,gap:8,column:2,className:"mt-4",photoClassName:"rounded-lg"})]})})})]})]})}),(0,l.jsx)("div",{className:"mt-auto pt-4 flex flex-col gap-4",children:(0,l.jsx)(m.Z2,{photos:o.slice(0,2),gap:8,column:2,className:"sm:mt-0",photoClassName:"rounded-lg"})})]})},f=e=>
1{let{employeeVoices:t,currentPage:a,totalPages:n,isLoading:s,onPageChange:i,showEdit:c=!1,onEdit:d=()=>{},editLabel:u="Edit"}=e,{t:h}=(0,r.B)(),p=()=>{console.log("Translate to English clicked")},f=(0,o.useRef)(null),[g,v]=(0,o.useState)(!0),y=e=>({name:"".concat(e.firstName," ").concat(e.lastName),avatar:e.profilePictureUrl,jobTitle:e.occupation,experienceText:String(e.workExpY)+" "+h("component.employee_voice_section.years_label")+(e.workExpM>0?" "+String(e.workExpM)+" "+h("common.months"):""),gallery:e.photoUrl.map(e=>({id:e.order,src:e.url,type:"image",col:1,row:1})),reviewText:e.content,translateOnClick:p});(0,o.useEffect)(()=>{let e=f.current;if(!e||!(null==t?void 0:t.length))return;let a=()=>{let a=e.clientWidth;v(310*t.length+(t.length-1)*16>a)};a();let l=new ResizeObserver(a);return l.observe(e),()=>l.disconnect()},[null==t?void 0:t.length]);let w=e=>e.hidden?(0,l.jsx)("div",{"data-testid":"employee-voice-hidden-overlay","aria-hidden":!0,className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center rounded-lg bg-white/60",children:(0,l.jsx)("span",{className:"rounded-full bg-white px-3 py-1.5 text-sm font-semibold text-neutral-900 shadow-sm",children:e.hiddenLabel})}):null;return(0,l.jsxs)("div",{className:"w-full min-w-0 overflow-hidden",children:[(0,l.jsxs)("div",{className:"mt-2 mb-6 flex items-center justify-between",children:[(0,l.jsx)("h2",{className:"m-0 p-0",children:(0,l.jsx)(m.R0,{fontWeight:"semibold",children:h("component.employee_voice_section.employee_voices")})}),c&&(0,l.jsx)(m.$n,{variant:"tertiary",className:"flex items-center",leftIcon:(0,l.jsx)(m.BL,{name:"PencilIcon",className:"w-5 h-5"}),onClick:d,children:u})]}),(0,l.jsxs)("div",{className:"flex flex-col justify-between flex-1 min-h-[400px]",children:[(0,l.jsx)("div",{ref:f,className:"lg:hidden w-full overflow-hidden",children:s?(0,l.jsx)("div",{className:"flex gap-[16px]",children:[void 0,void 0].map((e,t)=>(0,l.jsxs)("div",{className:"w-[310px] min-w-[310px] max-w-[310px] h-[407px] shrink-0 sm:min-w-0 sm:max-w-none sm:w-auto sm:flex-1 sm:h-auto flex flex-col p-4 rounded-lg bg-white border border-neutral-300 min-h-0 animate-pulse",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,l.jsx)("div",{className:"w-[84px] h-[84px] rounded-full bg-neutral-200"}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("div",{className:"h-5 w-40 bg-neutral-200 rounded mb-1"}),(0,l.jsx)("div",{className:"h-4 w-20 bg-neutral-200 rounded mb-1"}),(0,l.jsx)("div",{className:"h-5 w-24 bg-neutral-200 rounded-full mt-1"})]})]}),(0,l.jsx)("div",{className:"flex-1 flex flex-col gap-4",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("div",{className:"h-4 w-full bg-neutral-200 rounded"}),(0,l.jsx)("div",{className:"h-4 w-5/6 bg-neutral-200 rounded"}),(0,l.jsx)("div",{className:"h-4 w-4/6 bg-neutral-200 rounded"}),(0,l.jsx)("div",{className:"h-4 w-3/6 bg-neutral-200 rounded"}),(0,l.jsx)("div",{className:"h-4 w-2/6 bg-neutral-200 rounded"})]}),(0,l.jsx)("div",{className:"h-6 w-16 bg-neutral-200 rounded mt-1"})]})}),(0,l.jsx)("div",{className:"mt-auto pt-4 flex flex-col gap-4",children:(0,l.jsx)("div",{className:"h-10 w-40 bg-neutral-200 rounded-lg flex items-center"})})]},t))}):(()=>{let e=e=>{var t;return"".concat(e.firstName,"-").concat(e.lastName,"-").concat(null!=(t=e.occupation)?t:"")};return g?(0,l.jsx)(m.FN,{opts:{align:"start",loop:!0},className:"w-full",orientation:"horizontal",showDots:!0,dotsPlacement:"outside",children:(0,l.jsx)(m.Wk,{className:"gap-4 pl-4 -ml-4",children:t.map(t=>(0,l.jsx)(m.A7,{className:"basis-[310px] sm:basis-[calc(50%-8px)] pl-0",children:(0,l.jsxs)("div",{className:"relative w-full min-w-[310px] max-w-[310px] h-[407px] overflow-hidden sm:min-w-0 sm:max-w-none sm:h-auto min-h-0",children:[(0,l.jsx)(x,{...y(t)}),w(t)]})},e(t)))})}):(0,l.jsx)("div",{className:"flex gap-[16px]",children:t.map(t=>(0,l.jsxs)("div",{className:"relative w-[310px] min-w-[310px] max-w-[310px] h-[407px] shrink-0 sm:min-w-0 sm:max-w-none sm:w-auto
1sm:flex-1 sm:h-auto min-h-0",children:[(0,l.jsx)(x,{...y(t)}),w(t)]},e(t)))})})()}),(0,l.jsx)("div",{className:"hidden lg:grid grid-cols-2 gap-[16px]",children:s?(0,l.jsx)(l.Fragment,{children:["skeleton-grid-1","skeleton-grid-2"].map(e=>(0,l.jsxs)("div",{className:"flex flex-col w-full p-4 rounded-lg bg-white border border-neutral-300 h-full animate-pulse",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4 mb-4",children:[(0,l.jsx)("div",{className:"w-[84px] h-[84px] rounded-full bg-neutral-200"}),(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("div",{className:"h-5 w-40 bg-neutral-200 rounded mb-1"}),(0,l.jsx)("div",{className:"h-4 w-20 bg-neutral-200 rounded mb-1"}),(0,l.jsx)("div",{className:"h-5 w-24 bg-neutral-200 rounded-full mt-1"})]})]}),(0,l.jsx)("div",{className:"flex-1 flex flex-col gap-4",children:(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("div",{className:"h-4 w-full bg-neutral-200 rounded"}),(0,l.jsx)("div",{className:"h-4 w-5/6 bg-neutral-200 rounded"}),(0,l.jsx)("div",{className:"h-4 w-4/6 bg-neutral-200 rounded"}),(0,l.jsx)("div",{className:"h-4 w-3/6 bg-neutral-200 rounded"}),(0,l.jsx)("div",{className:"h-4 w-2/6 bg-neutral-200 rounded"})]}),(0,l.jsx)("div",{className:"h-6 w-16 bg-neutral-200 rounded mt-1"})]})}),(0,l.jsx)("div",{className:"mt-auto pt-4 flex flex-col gap-4",children:(0,l.jsx)("div",{className:"h-10 w-40 bg-neutral-200 rounded-lg flex items-center"})})]},e))}):t.map((e,t)=>(0,l.jsxs)("div",{className:"relative w-full h-full min-h-0",children:[(0,l.jsx)(x,{...y(e)}),w(e)]},"".concat(e.firstName,"-").concat(e.lastName,"-").concat(t)))}),n>1&&(0,l.jsx)("div",{className:"w-full rounded-b-lg border-t border-t-gray-300 flex flex-col-reverse md:flex-row justify-between pt-4 items-start md:items-end mt-4",children:(0,l.jsx)(m.dK,{className:"w-full md:w-auto md:flex-1 h-auto sm:h-[37px] gap-2 sm:gap-3 md:gap-[12px] justify-start md:justify-end",children:(0,l.jsxs)(m.Iu,{className:"text-xs sm:text-sm",children:[1!==a&&(0,l.jsx)(m.cU,{children:(0,l.jsx)(m.Eb,{className:"text-xs sm:text-sm px-2 sm:px-3 py-1 sm:py-2",onClick:()=>{i(Math.max(1,a-1))}})}),[...Array(n)].map((e,t)=>(0,l.jsx)(m.cU,{children:(0,l.jsx)(m.n$,{className:"text-xs sm:text-sm px-2 sm:px-3 py-1 sm:py-2 min-w-[32px] sm:min-w-[36px]",isActive:a===t+1,onClick:()=>{i(t+1)},children:t+1})},t+1)),a!==n&&(0,l.jsx)(m.cU,{children:(0,l.jsx)(m.WA,{className:"text-xs sm:text-sm px-2 sm:px-3 py-1 sm:py-2",onClick:()=>{i(Math.min(n,a+1))}})})]})})})]})]})};var g=a(99718),v=a(91668),y=a(27261),w=a.n(y),j=a(61773),b=a(67933),N=a(14882),k=a(65837);function C(e){var t,a,l;let n=e.media.find(e=>"video"===e.type);return n?null!=(a=n.thumbnailUrl)?a:n.url:null!=(l=null==(t=e.media[0])?void 0:t.url)?l:null}function S(e){var t;let{data:a}=(0,b.useQuery)({queryKey:["office24CompanyFeedTeaser",String(e),8],queryFn:()=>N.f.getCompanyFeed({companyId:e,page:1,limit:8}),enabled:k.y&&!!e}),l=(null!=(t=null==a?void 0:a.gridData)?t:[]).map(C).filter(e=>!!e);return{thumbs:l,shouldShow:k.y&&l.length>=4}}function I(e){let{thumb:t,className:a}=e;return(0,l.jsx)("div",{className:"relative overflow-hidden rounded-lg bg-neutral-100 ".concat(null!=a?a:"aspect-square"),children:(0,l.jsx)(j.default,{src:t,alt:"",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 33vw, 20vw"})})}function L(e){let{className:t}=e,{t:a}=(0,r.B)();return(0,l.jsxs)("div",{className:"flex flex-row items-center justify-center gap-1 rounded-lg bg-[#1B3B32] ".concat(null!=t?t:"aspect-square"),children:[(0,l.jsx)(m.qb,{fontWeight:"medium",className:"text-white",children:a("page.you_say.office_feed.see_more")}),(0,l.jsx)(m.BL,{name:"ChevronRightIcon",className:"h-4 w-4 text-white"})]})}let D=e=>{let{companyId:t,href:a}=e,{t:n}=(0,r.B)(),{thumbs:s,shouldShow:o}=S(t);return o?(0,l.jsxs)(w(),{href:a,className:"block",children:[(0,l.jsx)(m.R0,{fontWeight:"semibold",className:"text-neutral-900",children:"Office24"}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"mt-2 text-neutral-700",children:n("page.you_say.office_feed.teaser_description")}),(0,l.jsxs)("div",{className:"mt-4 flex flex-row gap-1.5 sm:hidden",children:[(0,l.jsx)(I,{thumb:s[0],className:"aspect-square flex-1"}),(0,l.jsxs)("div",{className:"flex flex-1 flex-col gap-1.5",children:[(0,l.jsxs)("div",{className:"flex flex-1 flex-row gap-1.5",children:[(0,l.jsx)(I,{thumb:s[1],className:"aspect-square flex-1"}),(0,l.jsx)(I,{thumb:s[2],className:"aspect-square flex-1"})]}),(0,l.jsxs)("div",{className:"flex flex-1 flex-row gap-1.5",children:[(0,l.jsx)(I,{thumb:s[3],className:"aspect-square flex-1"}),(0,l.jsx)(L,{className:"flex-1"})]})]})]}
1),(0,l.jsxs)("div",{className:"mt-4 hidden grid-cols-5 gap-1.5 sm:grid",children:[s.slice(0,4).map((e,t)=>(0,l.jsx)(I,{thumb:e},t)),(0,l.jsx)(L,{})]})]}):null};var _=a(89223),A=a(84007),E=a(98053);let T=[{title:"HR SAY (Company Review)",suggestedContent:"Share authentic employee experiences and company culture that reflects your workplace values, for example:",content:['"Real employee testimonials about work-life balance and company culture"','"Behind-the-scenes content showing daily office life and team interactions"','"Employee success stories and career growth opportunities"','"Company values in action through employee experiences"','"Workplace environment and facilities that support employee well-being"'],photos:"/image/see-suggestion/hr-say.png",photoDescription:"Showcase genuine moments of employees collaborating, celebrating achievements, and experiencing your company culture firsthand."},{title:"Why Join Us?",suggestedContent:"âTo create sustainable change that truly serves our customers, different from competitors, achieving continuous results in 4 areas that make our company even stronger,â for example:",content:["âThere is a shared vision with clear goals and objectivesâ","âThere is a Start-up spirit, embracing new challengesâ","âThere is an organization that effectively collaborates with the community and takes responsibility for results, not just making excusesâ","âThere is a service that truly responds to customer needs and continuously improves without complacencyâ"],photos:"/images/see-suggestion/2.png",photoDescription:"To choose the right photo/video that reflects the essence of organizational culture in each department: Agile Team, Office Life, Work"},{title:"Good Life",suggestedContent:"âTo create content that helps enhance work quality of life, such as cleanliness, safety, and being a good role model,â for example:",content:["âOffice equipment that reduces fatigueâ","âTime and location that allows flexible Work From Homeâ","âConveying cleanliness and tidiness in the workplace, such as having a cafeteria, restrooms, or meeting roomsâ","âCommunication such as free food, recreational activities, organizing community welfare activitiesâ","âInnovation that helps with work, time management, strategy-planningâ"],photos:"/images/see-suggestion/3.png",photoDescription:"âOver the weekend, we went diving to explore the underwater world with friends. The diving course cost 12,000 baht, but we only paid 6,000 because the company helped support the expenses.â"},{title:"Good Work",suggestedContent:"âTo present information about work quality or content that creates advancement opportunities for employees,â for example:",content:["âEmployee development trainingâ,âSystem for submitting work proposalsâ","âOpening opportunities for job rotationsâ","âTeamworkâ, âCommunication for warnings/advancementâ","âCommunication for warnings/advancementâ,âPerformance evaluationâ","âCommunication, meetings and challenges in workâ"],photos:"/images/see-suggestion/4.png",photoDescription:"âWork that involves challenges since DAY 1, requiring collaboration in brainstorming and organizing.â"},{title:"Good Pay",suggestedContent:"âList the effects of mental stress on the heart and nervous systemâ for examples:",content:["âMoney helps with various statistics such as accident rates, accident statistics, gold fund investment dataâ","âDebt collection money onlineâ","âMoney matters such as lotto, gambling, sports bettingâ"],photos:"/images/see-suggestion/5.png",photoDescription:"âIf the work performance is good, you can get double the salary within 2 years.â"},{title:"Good Community",suggestedContent:"âDescribe the war situation, conflicts, and casualties of soldiers in organizationsâ for examples:",content:["âInfrastructure of organizations in various forms, referencing military managementâ","âNo politics in the office.â","âActivities that build relationships such as camping, adventure trips, travel programs, recreational activities such as team building activities, training courses such as those of government agencies, of educational institutions, government agencies, children, etc.â"],photos:"/images/see-suggestion/6.png",photoDescription:"âFor this year's company trip, our whole gang went together - everyone had so much fun.â"}],P=e=>{let{title:t}=e,{t:a}=(0,r.B)(),n=T.find(e=>e.title===t);if(!n)return null;let{suggestedContent:s,content:o=[],photos:i,photoDescription:c}=n;return(0,l.jsxs)(m.aF,{children:[(0,l.jsx)(m.g6,{asChild:!0,children:(0,l.jsx)(m.$n,{radius:"default",size:"md",variant:"link",rightIcon:(0,l.jsx)(m.BL,{name:"PencilIcon",className:"w-4 h-4"}),children:a("employer.see_suggestion.see_suggestions")})}),(0,l.jsxs)(m.Q$,{children:[(0,l.jsx)(m.mH,{className:"bg-transparent"}),(0,l.jsxs)(m.sK,{showOverlay:!1,size:"xl",className:"max-w-[600px] max-h-[90vh] w-[95vw] sm:w-full",children:[(0,l.jsx)(m.rQ,{children:(0,l.jsxs)(m.wt,{className:"flex flex-row items-center gap-4",children:[(0,l.jsx)(m.vY,{asChild:!0,children:(0,l.jsx)(m.BL,{name:"ChevronLeftIcon",className:"w-10 h-10 text-neutral-800 bg-neutral-100 rounded-full p-2 cursor-pointer",variant:"solid"})}),t]})}),(0,l.jsx)(m.cw,{children:(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-500",children:a("employer.see_suggestion.suggested_content")}),(0,l.jsx)(m.jz,{fontWeight:"semibold",className:"text-neutral-900",children:s})]}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"p-2 text-neutral-500",children:o.map((e,t)=>(0,l.jsxs)("div",{children:["⢠",e]},t))}),(0,l.jsx)(m.jz,{fontWeight:"semibold",className:"text-neutral-900",children:a("employer.see_suggestion.photos_videos")}),i&&(0,l.jsxs)("div",{className:"flex flex-col border border-neutral-300 rounded-sm h-auto",children:[(0,l.jsx)(j.default,{src:i,alt:"Suggestion photo",width:600,height:360,className:"max-h-[360px] w-full object-cover rounded-t-sm"}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-500 p-4 gap-2",children:c})]})]})})]})]})]})};var O=function(e){return e.WHY_JOIN_US="Why Join Us?",e.GOOD_LIFE="Good Life",e.GOOD_WORK="Good Work",e.GOOD_PAY="Good Pay",e.GOOD_COMMUNITY="Good Community",e}({});let F=e=>{let{photos:t,photoDescription:a,index:n}=e,{t:s}=(0,r.B)(),[i,c]=(0,o.useState)(!1);return(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2 items-center",children:[(0,l.jsx)(m.qb,{fontWeight:"medium",className:"text-neutral-900",children:n+1}),(0,l.jsx)(m.BL,{name:"MenuIcon",className:"w-4 h-4 text-neutral-300"})]}),(0,l.jsx)("div",{className:"flex-1 relative overflow-hidden group",children:(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsxs)("div",{className:"absolute inset-0 flex justify-between items-start z-10 p-2 pointer-events-none",children:[(0,l.jsx)(m.$n,{radius:"default",size:"md",variant:"tertiary",leftIcon:(0,l.jsx)(m.BL,{name:"PencilIcon",className:"w-5 h-5",variant:"solid"}),className:"px-2 py-1 pointer-events-auto",children:s("employer.edit_4d.edit")}),(0,l.jsx)(m.$n,{radius:"default",size:"md",variant:"tertiary",className:"px-2 py-1 pointer-events-auto",children:(0,l.jsx)(m.BL,{name:"XIcon",className:"w-5 h-5",variant:"solid"})})]}),(0,l.jsx)(j.default,{src:t,alt:"Photo",className:"w-full h-auto max-h-[300px] object-cover rounded-sm",width:400,height:300})]}),(0,l.jsxs)("div",{className:"flex flex-col justify-start items-start",children:[(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-900 ".concat(i?"":"line-clamp-2"),children:a}),a&&a.length>100&&(0,l.jsx)(m.$n,{onClick:()=>{c(!i)},className:"p-0 z-20",radius:"default",size:"md",variant:"link",children:s(i?"employer.edit_4d.show_less":"employer.edit_4d.show_more")})]})]})})]})},q=e=>{let{title:t,summary:a,setSummary:n,topics:s,setTopics:o,explain:i,setExplain:c,photos:d,photoDescription:u}=e,{t:h}=(0,r.B)();return(0,l.jsxs)("div",{className:"flex flex-col gap-2 items-start",children:[(0,l.jsx)("div",{className:"flex flex-col w-full",children:(0,l.jsx)(m.fs,{autoResize:!0,label:t===O.WHY_JOIN_US?h("employer.edit_4d.summarize_why_join_us"):h("employer.edit_4d.summarize_sentence",{title:t}),value:a,placeholder:"",onChange:e=>{n(e)},variant:"boxed",limit:240,rows:t===O.WHY_JOIN_US?3:1})}),t!==O.WHY_JOIN_US&&(0,l.jsxs)("div",{className:"flex flex-col w-full",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2 py-3",children:[(0,l.jsx)(m.qb,{fontWeight:"medium",className:"text-neutral-800",children:h("employer.edit_4d.explain_sentence",{title:t})}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-500",children:h("employer.edit_4d.answer_sentence",{title:t.toLowerCase()})})]}),(0,l.jsx)(m.fs,{autoResize:!0,value:s,placeholder:"",onChange:e=>{o(e)},variant:"boxed",rows:1}),(0,l.jsx)(m.fs,{autoResize:!0,value:i,placeholder:"",onChange:e=>{c(e)},limit:240,variant:"boxed"})]}),t!==O.WHY_JOIN_US&&(0,l.jsx)(m.$n,{radius:"default",size:"md",variant:"link",leftIcon:(0,l.jsx)(m.BL,{name:"PlusIcon",className:"w-4 h-4"}),children:h("employer.edit_4d.add_explanation_topics")}),(0,l.jsx)("div",{className:"border border-t-neutral-200 w-full my-4"}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[(0,l.jsx)(m.jz,{fontWeight:"semibold",className:"text-neutral-900",children:h("employer.edit_4d.photos_videos")}),(0,l.jsx)(m.Ih,{fontWeight:"normal",className:"text-neutral-700",children:h("employer.edit_4d.arrange_items")}),(0,l.jsxs)("div",{className:"flex flex-col gap-4 w-full border border-neutral-200 rounded-lg p-4",children:[d.map((e,t)=>(0,l.jsxs)("div",{children:[(0,l.jsx)(F,{photos:e,photoDescription:u[t],index:t},t),t<d.length-1&&(0,l.jsx)("div",{className:"border border-t-neutral-200 w-full my-4"})]},t)),(0,l.jsxs)("div",{className:"flex flex-col border border-neutral-200 rounded-md p-15 ga
1p-4 items-center justify-center",children:[(0,l.jsx)(m.BL,{name:"CloudUploadIcon",className:"w-8 h-8"}),(0,l.jsxs)(m.jz,{fontWeight:"normal",children:[(0,l.jsx)("span",{className:"text-primary-500",children:"Upload a file "}),"or drag and drop"]}),(0,l.jsx)(m.qb,{fontWeight:"normal",className:"text-neutral-500",children:"PNG, JPG, GIF up to 5MB"})]})]})]})]})},B=e=>{let{title:t,summary:a,topics:n,explain:s,photos:i=[],photoDescription:c=[],onClose:d,isOpen:u}=e,{t:h}=(0,r.B)(),[p]=(0,o.useState)(t),[x,f]=(0,o.useState)(a),[g,v]=(0,o.useState)(n),[y,w]=(0,o.useState)(s),j=t===O.WHY_JOIN_US?""!==x.trim():""!==x.trim()&&""!==g.trim()&&""!==y.trim(),b=()=>{d&&d()};return void 0!==u?(0,l.jsx)(m.aF,{open:u,onOpenChange:e=>{e||b()},children:(0,l.jsx)(m.Q$,{children:(0,l.jsxs)(m.sK,{size:"xl",className:"max-w-[600px] max-h-[90vh] w-[95vw] sm:w-full",children:[(0,l.jsx)(m.rQ,{children:(0,l.jsx)(m.wt,{children:t})}),(0,l.jsx)(m.cw,{className:"px-1 pb-1",children:(0,l.jsx)(q,{title:p,summary:x,setSummary:f,topics:g,setTopics:v,explain:y,setExplain:w,photos:i,photoDescription:c})}),(0,l.jsxs)(m.jl,{className:"flex flex-row justify-between",children:[(0,l.jsx)(P,{title:t}),(0,l.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,l.jsx)(m.$n,{radius:"default",size:"md",variant:"tertiary",onClick:b,children:h("employer.edit_4d.cancel")}),(0,l.jsx)(m.$n,{radius:"default",size:"md",variant:"primary",disabled:!j,onClick:b,children:h("employer.edit_4d.save_changes")})]})]})]})})}):(0,l.jsxs)(m.aF,{children:[(0,l.jsx)(m.g6,{asChild:!0,children:(0,l.jsx)(m.$n,{variant:"tertiary",size:"md",state:"default",leftIcon:(0,l.jsx)(m.BL,{name:"PencilIcon",className:"w-4 h-4"}),children:h("employer.edit_4d.edit")})}),(0,l.jsx)(m.Q$,{children:(0,l.jsxs)(m.sK,{size:"xl",className:"max-w-[600px] max-h-[90vh] w-[95vw] sm:w-full",children:[(0,l.jsx)(m.rQ,{children:(0,l.jsx)(m.wt,{children:t})}),(0,l.jsx)(m.cw,{className:"px-1 pb-1",children:(0,l.jsx)(q,{title:p,summary:x,setSummary:f,topics:g,setTopics:v,explain:y,setExplain:w,photos:i,photoDescription:c})}),(0,l.jsxs)(m.jl,{className:"flex flex-row justify-between",children:[(0,l.jsx)(P,{title:t}),(0,l.jsx)(m.vY,{asChild:!0,children:(0,l.jsxs)("div",{className:"flex flex-row gap-2",children:[(0,l.jsx)(m.$n,{radius:"default",size:"md",variant:"tertiary",children:h("employer.edit_4d.cancel")}),(0,l.jsx)(m.$n,{radius:"default",size:"md",variant:"primary",disabled:!j,children:h("employer.edit_4d.save_changes")})]})})]})]})})]})};var W=a(676);let M=e=>{let{featureName:t,mainText:a,gallery:n,detailTextList:i,isLoadingSocialInfo:c=!1,onLike:d,onLikeCountClick:u,onComment:h,onShare:p,onSelectIndex:x,showEdit:f=!1,headerAction:g,showTranslateButton:v=!1,isTranslated:y=!1,onTranslate:w,editModalProps:j}=e,[b,N]=(0,o.useState)(!1),[k,C]=(0,o.useState)(0),S=Math.min(k,Math.max(n.length-1,0)),I=n[S],{t:L}=(0,r.B)(),D=(0,s.Ym)();return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:(0,l.jsxs)("div",{className:"flex items-start justify-between",children:[(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsxs)("div",{className:"flex flex-col-reverse md:flex-row md:items-center justify-between",children:[(0,l.jsx)("h2",{className:"m-0 p-0",children:(0,l.jsx)(m.R0,{fontWeight:"semibold",children:t})}),v&&(0,l.jsxs)("button",{type:"button",className:"flex gap-2 items-center cursor-pointer shrink-0 md:mb-0 mb-2 bg-transparent border-none p-0",onClick:()=>null==w?void 0:w(),children:[(0,l.jsx)(m.BL,{name:"TranslateIcon",className:"w-4 h-4"}),(0,l.jsx)(m.qb,{className:"text-gray-700",fontWeight:"medium",children:"th"===(y?"th"===D?"en":"th":D)?"Translate to English":"à¹à¸à¸¥à¹à¸à¹à¸à¸ าษาà¹à¸à¸¢"})]})]}),(0,l.jsx)("div",{className:"text-neutral-700",children:(0,l.jsx)(m.qb,{className:"whitespace-pre-wrap",children:(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:a}})})})]}),f&&(0,l.jsx)("div",{className:"ml-4",children:(0,l.jsx)(m.$n,{variant:"tertiary",leftIcon:(0,l.jsx)(m.BL,{name:"PencilIcon",className:"w-4 h-4"}),onClick:()=>{N(!0)},children:L("employer.edit_4d.edit")})}),g?(0,l.jsx)("div",{className:"ml-4 shrink-0",children:g}):null]})}),i.length>0&&(0,l.jsx)("div",{className:"mb-4",children:(0,l.jsx)(m._I,{className:"border-none",collapsible:!0,type:"single",children:(0,l.jsxs)(m.As,{className:"bg-neutral-100 rounded-xl border-none",value:"details",children:[(0,l.jsx)(m.$m,{children:(0,l.jsx)(m.qb,{className:"text-neutral-700",fontWeight:"medium",children:L("component.hr_say_feature_section_post.more_details")})}),(0,l.jsx)(m.ub,{className:"space-y-4",children:i.map(e=>{let t=e.description.split("\n").map(e=>
1e.trim()).filter(Boolean),a=t.length>1&&t.every(e=>/^[â¢\-\u2022]/.test(e)),n=Math.ceil(t.length/2);return(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsx)(m.qb,{className:"text-neutral-700",fontWeight:"semibold",children:e.content}),a?(0,l.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-6",children:[(0,l.jsx)(m.qb,{className:"text-neutral-700 whitespace-pre-line",children:t.slice(0,n).join("\n")}),(0,l.jsx)(m.qb,{className:"text-neutral-700 whitespace-pre-line",children:t.slice(n).join("\n")})]}):(0,l.jsx)(m.qb,{className:"text-neutral-700 whitespace-pre-line",children:(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:e.description}})})]},e.content)})})]})})}),n.length>0&&I&&(0,l.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row",children:[(0,l.jsx)("div",{className:"w-full ".concat(n.length>1?"sm:w-3/4":""," h-[300px] sm:h-[456px]"),children:(0,l.jsx)(W.RK,{post:I,isLoading:c,onLike:()=>{d(String(I.postId),I.reactions.isLikedByCurrentUser?"0":"1")},onLikeCountClick:()=>{u(String(I.postId))},onComment:()=>{h(String(I.postId))},onShare:()=>{p(String(I.postId))}})}),n.length>1&&(0,l.jsx)("div",{className:"w-full sm:w-1/4 h-[128px] sm:h-[456px] select-none",children:(0,l.jsx)(W.CU,{gallery:n,selectedIndex:S,setSelectedIndex:e=>{C(e),null==x||x(e)}})})]}),(0,l.jsx)(B,{isOpen:b,title:null==j?void 0:j.title,summary:(null==j?void 0:j.summary)||"",topics:(null==j?void 0:j.topics)||"",explain:(null==j?void 0:j.explain)||"",photos:(null==j?void 0:j.photos)||[],photoDescription:(null==j?void 0:j.photoDescription)||[],onClose:()=>{N(!1),console.log("onClose")}})]})};var U=a(74143),R=a(84671);function Y(e){let t=/^feature-(\d+)-(\d+)/.exec(String(e));return{idFeature:t?Number(t[1]):0,idDetail:t?Number(t[2]):0}}function z(e){let t=/^feature-(\d+)-(\d+)/.exec(String(e));return{idGalleryTitle:t?Number(t[1]):0,idGallery:t?Number(t[2]):0}}let G=e=>{var t,a,n,s;let{section:r,idEmp:i,type:c,onShare:d,onComment:m,showTranslateButton:u,isTranslated:h,onTranslate:p}=e,[x,f]=(0,o.useState)(0),{data:g,status:v}=(0,_.useSession)(),y="loading"!==v,w="feature"===c,j=(null==g||null==(t=g.user)?void 0:t.token)||(0,U.fp)(),b=(0,A.useQueries)({queries:w?r.gallery.map(e=>{let{idFeature:t,idDetail:a}=Y(e.postId);return{queryKey:R.Y.queryKeys.featureSocialInfo(i,t,a),queryFn:()=>R.Y.getFeatureSocialInfo({idEmp:i,idFeature:t,idDetail:a,service:"getFeatureSocialInfo",like:"1",accessToken:j}),enabled:!!i&&!!a&&y}}):[]}),N=(0,A.useQueries)({queries:w?[]:r.gallery.map(e=>{let{idGalleryTitle:t,idGallery:a}=z(e.postId);return{queryKey:R.Y.queryKeys.gallerySocialInfo(i,a,t),queryFn:()=>R.Y.getGallerySocialInfo({idEmp:i,idGallery:a,idGalleryTitle:t,service:"getGallerySocialInfo",accessToken:j}),enabled:!!i&&!!a&&y}})}),k=w?b:N,{mutate:C}=(0,E.vq)(),{mutate:S}=(0,E.Hc)(),I=null!=(s=null==(a=k[x])?void 0:a.isLoading)&&s,[L,D]=(0,o.useState)(null);(0,o.useEffect)(()=>{D(null)},[x]);let T=null==(n=k[x])?void 0:n.data;(0,o.useEffect)(()=>{T&&D(null)},[T]);let P=(0,o.useMemo)(()=>r.gallery.map((e,t)=>{var a,l,n,s;let o=null==(a=k[t])?void 0:a.data,r=t===x&&L?{...o,...L}:o;return r?{...e,reactions:{...e.reactions,likes:null!=(l=r.totalLikes)?l:e.reactions.likes,comments:null!=(n=r.totalComments)?n:e.reactions.comments,shares:null!=(s=r.totalShares)?s:e.reactions.shares,isLikedByCurrentUser:r.isLiked}}:e}),[r.gallery,k,x,L]);return(0,l.jsx)(M,{featureName:r.featureName,mainText:r.mainText,detailTextList:r.detailTextList,gallery:P,isLoadingSocialInfo:I,showTranslateButton:u,isTranslated:h,onTranslate:p,onLike:(e,t)=>{var a;let l=L?{...T,...L}:T,n=!(null==l?void 0:l.isLiked),s=null!=(a=null==l?void 0:l.totalLikes)?a:0;if(D({isLiked:n,totalLikes:n?s+1:Math.max(0,s-1)}),w){let{idFeature:a,idDetail:l}=Y(e);if(!l)return void D(null);C({idEmp:i,idFeature:a,idDetail:l,service:"toggleLikeFeature",like:null!=t?t:"1",accessToken:j},{onError:()=>D(null)})}else{let{idGalleryTitle:a,idGallery:l}=z(e);if(!l)return void D(null);S({idEmp:i,idGallery:l,idGalleryTitle:a,service:"toggleLikeGallery",like:null!=t?t:"1",accessToken:j},{onError:()=>D(null)})}},onLikeCountClick:()=>{},onComment:e=>null==m?void 0:m(e),onShare:d,onSelectIndex:f})};var K=a(61297),$=a(63721),Q=a(4964),H=a(62589);function J(e){void 0!==globalThis.window&&globalThis.sessionStorage.setItem("brandsdna-preselect-story-id",e)}function V(e){let{articleId:t}=e,a=(0,s.Ym)(),{data:n}=(0,Q.Cz)(t,a),o=(null==n?void 0:n.date)?(0,K.hX)(n.date,a):null;return o?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(m.qb,{className:"text-neutral-300 mt-auto md:hidden",children:o}),(0,l.jsx)(m.Ih,{className:"text-neutral-300 mt-auto hidden md:block",children:o})]}):null}let X=e=>{var t;let{companyNews:a,companyName:n="Company",companyArticlesPath:s,companyArticlesExternal:o=!1,isLoading:i=!1}=e,c=null==(t=a[0])?void 0:t.companyId,{t:d}=(0,r.B)(),u=null!=s?s:c?(0,v.w4)("en",n,c,"hr-say/article"):"#",h=o?{target:"_blank",rel:"noopener noreferrer"}:{},p=(0,l.jsxs)(w(),{href:u,className:"flex items-center text-neutral-900 font-medium",...h,children:[d("component.company_news.more_stories"),(0,l.jsx)(m.BL,{name:"ChevronRightIcon",className:"w-4 h-4 sm:w-5 sm:h-5 ml-1"})]});return(0,l.jsxs)("div",{className:"w-full min-w-0 overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)("h2",{className:"m-0 p-0",children:(0,l.jsxs)(m.R0,{className:"font-semibold",children:[(0,l.jsx)("span",{className:"text-neutral-900",children:"Brands"}),(0,l.jsx)("span",{className:"text-[var(--color-secondary-400)]",children:"DNA"})]})}),(0,l.jsx)("span",{className:"hidden md:inline",children:p})]}),(0,l.jsxs)("div",{className:"mt-[30px] w-full overflow-hidden md:hidden",children:[i?(0,l.jsx)(m.FN,{opts:{align:"start",loop:!0},className:"w-full",showDots:!0,dotsPlacement:"outside",orientation:"horizontal",children:(0,l.jsx)(m.Wk,{className:"gap-4 pl-4 -ml-4",children:["skeleton-carousel-a","skeleton-carousel-b","skeleton-carousel-c"].map(e=>(0,l.jsx)(m.A7,{className:"basis-[265px] pl-0",children:(0,l.jsxs)("div",{className:"w-[265px] min-w-[265px] h-[253px] overflow-hidden rounded-lg border border-neutral-200 bg-white flex flex-col transition-shadow",children:[(0,l.jsx)(m.EA,{className:"!h-[140px] !rounded-none !rounded-t-lg flex-shrink-0"}),(0,l.jsxs)("div",{className:"mt-3 flex-1 flex flex-col gap-1 p-3 min-h-0",children:[(0,l.jsx)(m.EA,{className:"!h-4 !rounded-md mb-1"}),(0,l.jsx)(m.EA,{className:"!h-4 !rounded-md mb-1"}),(0,l.jsx)(m.EA,{className:"!h-4 !rounded-md mb-1"})]})]})},e))})}):(0,l.jsx)(m.FN,{opts:{align:"start",loop:!0},className:"w-full",showDots:!0,dotsPlacement:"outside",orientation:"horizontal",children:(0,l.jsx)(m.Wk,{className:"gap-4 pl-4 -ml-4",children:a.slice(0,3).map(e=>{var t;return(0,l.jsx)(m.A7,{className:"basis-[265px] pl-0",children:(0,l.jsxs)(w(),{href:(0,H.i$)(u,e.id,e.title,null!=(t=e.publishedDate)?t:e.date,e.slug),onClick:()=>J(e.id),className:"w-[265px] min-w-[265px] h-[253px] overflow-hidden rounded-lg border border-neutral-200 bg-white flex flex-col transition-shadow hover:shadow-md",...h,children:[e.image&&(0,l.jsx)("div",{className:"relative w-full h-[140px] flex-shrink-0 bg-neutral-100 rounded-t-lg overflow-hidden",children:(0,l.jsx)($.K,{src:e.image,alt:e.title,className:"w-full h-full object-cover rounded-t-lg",fill:!0,fallback:(0,l.jsx)("div",{className:"w-full h-full bg-neutral-100 flex items-center justify-center",children:(0,l.jsx)(m.BL,{name:"PhotographIcon",className:"w-10 h-10 text-neutral-300"})})})}),(0,l.jsxs)("div",{className:"mt-3 flex-1 flex flex-col gap-1 p-3 min-h-0",children:[(0,l.jsx)(m.qb,{fontWeight:"medium",className:"text-base line-clamp-2 text-neutral-900",children:e.title}),(0,l.jsx)(V,{articleId:e.id})]})]})},e.id)})})}),(0,l.jsx)("div",{className:"mt-4 pl-4",children:p})]}),(0,l.jsx)("div",{className:"mt-[30px] hidden md:grid md:grid-cols-3 gap-4 overflow-hidden",children:i?Array.from({length:3}).map((e,t)=>(0,l.jsxs)("div",{className:"min-w-0 overflow-hidden rounded-lg border border-neutral-200 bg-white flex flex-col transition-shadow",children:[(0,l.jsx)(m.EA,{className:"!h-40 !rounded-none !rounded-t-lg flex-shrink-0"}),(0,l.jsxs)("div",{className:"mt-4 flex-1 flex flex-col gap-1 p-4 min-h-0",children:[(0,l.jsx)(m.EA,{className:"!h-4 !rounded-md mb-1"}),(0,l.jsx)(m.EA,{className:"!h-4 !rounded-md mb-1"}),(0,l.jsx)(m.EA,{className:"!h-4 !rounded-md mb-1"})]})]},t)):a.slice(0,3).map(e=>{var t;return(0,l.jsxs)(w(),{href:(0,H.i$)(u,e.id,e.title,null!=(t=e.publishedDate)?t:e.date,e.slug),onClick:()=>J(e.id),className:"min-w-0 overflow-hidden rounded-lg border border-neutral-200 bg-white flex flex-col transition-shadow hover:shadow-md",...h,children:[e.image&&(0,l.jsx)("div",{className:"relative w-full h-40 flex-shrink-0 bg-neutral-100 rounded-t-lg overflow-hidden",children:(0,l.jsx)($.K,{src:e.image,alt:e.title,className:"w-full h-full object-cover rounded-t-lg",fill:!0,fallback:(0,l.jsx)("div",{className:"w-full h-full bg-neutral-100 flex items-center justify-center",children:(0,l.jsx)(m.BL,{name:"PhotographIcon",className:"w-10 h-10 text-neutral-300"})})})}),(0,l.jsxs)("div",{className:"mt-4 flex-1 flex flex-col gap-1 p-4 min-h-0",children:[(0,l.jsx)(m.qb,{fontWeight:"medium",className:"text-base line-clamp-2 text-neutral-900",children:e.title}),(0,l.jsx)(V,{articleId:e.id})]})]},e.id)})})]})};var Z=a(20394);let ee=e=>{let{imageList:t,isLoading:a=!1}=e,[n,s]=(0,o.useState)(!1),[i,c]=(0,o.useState)(!1),[d,u]=(0,o.useState)(0),h=(0,Z.a)(),{t:p}=(0,r.B)(),x=(0,o.useCallback)(()=>{u(e=>e>0?e-1:t.length-1)},[t.length]),f=(0,o.useCallback)(()=>{u(e=>e<t.length-1?e+1:0)},[t.length]);(0,o.useEffect)(()=>
1{if(!i)return;let e=e=>{"Escape"===e.key&&c(!1),"ArrowLeft"===e.key&&x(),"ArrowRight"===e.key&&f()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[i,x,f]);let g=n?Math.ceil(t.length/(h?2:5)):1,v=h?2:5,y=e=>{u(e),c(!0)};return(0,l.jsxs)("div",{className:"flex flex-col gap-[16px]",children:[(0,l.jsx)("h2",{className:"m-0 p-0",children:(0,l.jsx)(m.R0,{className:"font-semibold py-[8px]",children:p("component.employee_photo_section.employee_photos")})}),(0,l.jsx)("div",{className:"overflow-hidden transition-all duration-300",style:{maxHeight:167*g},children:a?(0,l.jsx)("div",{className:"grid sm:grid-cols-5 grid-cols-2 gap-[8px]",children:Array.from({length:v}).map((e,t)=>(0,l.jsx)(m.EA,{className:"!h-[159px] w-[159px] !rounded-[8px]"},t))}):(0,l.jsx)("div",{className:"grid sm:grid-cols-5 grid-cols-2 gap-[8px]",children:t.map((e,t)=>(0,l.jsx)("img",{src:e,alt:"Employee photo ".concat(t+1),className:"h-[159px] !w-[159px] object-cover rounded-[8px] bg-neutral-300 transition-opacity duration-300 cursor-pointer"+(!n&&t>=v?" opacity-0 pointer-events-none":" opacity-100"),style:{transitionDelay:"0ms"},onClick:()=>{y(t)}},t))})}),t.length>v&&(0,l.jsx)(m.$n,{variant:"tertiary","data-testid":"load-more-button",onClick:()=>{s(!n)},children:n?(0,l.jsxs)(l.Fragment,{children:[p("component.employee_photo_section.see_less")," ",(0,l.jsx)(m.BL,{name:"ChevronUpIcon",className:"w-[16px] ml-[8px] text-neutral-900"})]}):(0,l.jsxs)(l.Fragment,{children:[p("component.employee_photo_section.load_more")," ",(0,l.jsx)(m.BL,{name:"ChevronDownIcon",className:"w-[16px] ml-[8px] text-neutral-900"})]})}),(0,l.jsx)(m.aF,{open:i,onOpenChange:c,children:(0,l.jsx)(m.Q$,{children:(0,l.jsx)(m.sK,{showCloseButton:!1,className:"!max-w-[90vw] !w-auto !p-0 !bg-transparent !shadow-none",children:(0,l.jsxs)(m.cw,{className:"relative flex items-center justify-center p-0",children:[t.length>1&&(0,l.jsx)("button",{onClick:x,className:"absolute left-2 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors","aria-label":"Previous image",children:(0,l.jsx)(m.BL,{name:"ChevronLeftIcon",className:"w-5 h-5"})}),(0,l.jsx)("img",{src:t[d],alt:"Employee photo ".concat(d+1),className:"max-h-[80vh] max-w-[80vw] rounded-lg object-contain"}),t.length>1&&(0,l.jsx)("button",{onClick:f,className:"absolute right-2 z-10 flex h-10 w-10 items-center justify-center rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors","aria-label":"Next image",children:(0,l.jsx)(m.BL,{name:"ChevronRightIcon",className:"w-5 h-5"})}),(0,l.jsx)(m.vY,{className:"absolute top-2 right-2 flex h-8 w-8 items-center justify-center rounded-full bg-black/50 text-white hover:bg-black/70 transition-colors cursor-pointer",children:"\xd7"}),(0,l.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/50 px-3 py-1 text-sm text-white",children:[d+1," / ",t.length]})]})})})})]})};var et=a(10501),ea=a(20488),el=a(84497),en=a(34671),es=a(50481),eo=a(33177),er=a(58226),ei=a(89635),ec=a(26745);let ed=e=>{let{setIsOpen:t,onDelete:a,onCancel:n}=e;return(0,l.jsx)(m.Q$,{children:(0,l.jsxs)(m.sK,{className:"min-w-[343px] sm:min-w-[460px]",children:[(0,l.jsx)(m.rQ,{children:(0,l.jsx)(m.wt,{className:"text-title-2-mobile sm:text-title-2-desktop",children:"Delete Comment?"})}),(0,l.jsx)(m.cw,{className:"!pt-6",children:(0,l.jsx)(m.jz,{className:"text-neutral-700",children:"Are you sure you want to delete your comment?"})}),(0,l.jsxs)(m.jl,{className:"!pt-0",children:[(0,l.jsx)(m.$n,{"data-testid":"confirm-delete-modal-cancel-button",variant:"outline",className:"!border-neutral-200 !text-neutral-700 !px-4 !py-2.5",onClick:()=>{null==n||n(),t(!1)},children:"Cancel"}),(0,l.jsx)(m.$n,{"data-testid":"confirm-delete-modal-delete-button",destructive:!0,className:"!px-4 !py-2.5",onClick:()=>{a(),t(!1)},children:"Delete"})]})]})})},em=e=>{var t;let{isOpen:a,onClose:n,postData:s,galleryPosts:i,onPostNavigate:c,onLike:d,onComment:u,onCommentAdded:h,onShare:p,onBookmark:x,onFollow:f,onCompanyClick:g,onViewLikedUsers:v,likedUsers:y,currentUserId:w,onDeleteComment:j}=e,[b,N]=(0,o.useState)(0),[k,C]=(0,o.useState)(""),[S,I]=(0,o.useState)(!1),[L,D]=(0,o.useState)(!1),[_,A]=(0,o.useState)(null),[E,T]=(0,o.useState)(s.comments.length),[P,O]=(0,o.useState)(!1),[F,q]=(0,o.useState)(!1),[B,M]=(0,o.useState)(null),U=(0,o.useRef)(null),R=(0,o.useRef)(null),Y=(0,o.useRef)(null),{t:z}=(0,r.B)(),G=()=>{q(!1),setTimeout(()=>O(!1),300)},K=null!=(t=null==i?void 0:i.findIndex(e=>e.postId===s.id))?t:-1,$=i&&i.length>1&&-1!==K,Q=$&&K>0,H=$&&K<i.length-1;(0,o.useEffect)(()=>{let e=P?R:U;s.comments.length>E&&e.current&&(e.current.scrollTop=e.current.scrollHeight),T(s.comments.length)},[s.comments.length,E,P]);let J=()=>{if(k.trim()&&!L){D(!0),A("");try{u&&u(k.trim()),C(""),h&&h()}catch(e){console.error("Error submitting comment:",e),A(e instanceof Error?e.message:z("component.o24_post_modal.comment_error",{defaultValue:"Failed to post comment. Please try again."}))}finally{D(!1)}}},V=(0,o.useCallback)(()=>{B&&j&&j(B),M(null)},[B,j]),X=s.media[b],Z=(null==X?void 0:X.type)==="video",ee=!!s.description,et=(ee?s.comments:s.comments.slice(1)).sort((e,t)=>
1new Date(e.timestamp).getTime()-new Date(t.timestamp).getTime()),ea=ee?s.comments.length:Math.max(0,s.comments.length-1),el=(0,l.jsxs)("div",{className:"w-full sm:w-[53%] h-full sm:h-[720px] relative bg-black overflow-hidden flex items-center justify-center",children:[X&&(0,l.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(()=>{if(!X)return null;if("video"===X.type){var e;return X.url.endsWith(".mpd")?(0,l.jsx)(W.Ns,{url:X.url,poster:X.thumbnailUrl,controls:!0,autoPlay:!0,className:"w-[calc(100%-2px)] h-full object-contain"}):(0,l.jsx)("video",{src:X.url,poster:X.thumbnailUrl,controls:!0,autoPlay:!0,muted:!0,loop:null==(e=X.loop)||e,playsInline:!0,preload:"metadata",className:"w-[calc(100%-2px)] h-full object-contain",onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),children:z("component.hr_say_feature_section_post.video_error",{defaultValue:"Your browser does not support the video tag."})},X.url)}return(0,l.jsx)("img",{src:X.url,alt:"Post media ".concat(b+1),className:"w-full h-full object-contain"})})()}),(s.media.length>1||$)&&(0,l.jsxs)(l.Fragment,{children:[(s.media.length>1||Q)&&(0,l.jsx)("button",{onClick:s.media.length>1?()=>{N(e=>0===e?s.media.length-1:e-1)}:()=>{Q&&c&&(N(0),c(i[K-1].postId))},disabled:s.media.length<=1&&!Q,className:"absolute left-3 top-1/2 -translate-y-1/2 text-black bg-white rounded-full p-2 hover:bg-gray-200 disabled:opacity-30 disabled:cursor-not-allowed transition-opacity",children:(0,l.jsx)(m.BL,{name:"ChevronLeftIcon",className:"w-5 h-5"})}),(s.media.length>1||H)&&(0,l.jsx)("button",{onClick:s.media.length>1?()=>{N(e=>e===s.media.length-1?0:e+1)}:()=>{H&&c&&(N(0),c(i[K+1].postId))},disabled:s.media.length<=1&&!H,className:"absolute right-3 top-1/2 -translate-y-1/2 text-black bg-white rounded-full p-2 hover:bg-gray-200 disabled:opacity-30 disabled:cursor-not-allowed transition-opacity",children:(0,l.jsx)(m.BL,{name:"ChevronRightIcon",className:"w-5 h-5"})})]}),s.media.length>1&&(0,l.jsx)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex items-center justify-center gap-2 transition-opacity ".concat(Z&&S?"opacity-0":"opacity-100"),children:s.media.map((e,t)=>(0,l.jsx)("button",{onClick:()=>N(t),className:"w-2 h-2 rounded-full transition-colors ".concat(t===b?"bg-white":"bg-white/50")},t))}),$&&(0,l.jsxs)("div",{className:"absolute top-3 right-3 bg-black/60 text-white text-xs px-2.5 py-1 rounded-full",children:[K+1," / ",i.length]})]}),en=(0,l.jsxs)("div",{ref:Y,className:"px-4 pb-4 pt-2",children:[_&&(0,l.jsx)("div",{className:"mb-2 text-sm text-red-600",children:_}),(0,l.jsx)(m.J2,{value:k,onChange:e=>{let t=e.target.value;t.length<=100&&C(t)},placeholder:z("component.o24_post_modal.add_comment_placeholder"),buttonLabel:L?z("component.o24_post_modal.posting"):z("component.o24_post_modal.post"),onButtonClick:J,buttonDisabled:!k.trim()||L,className:"w-full",buttonClassName:"text-neutral-900 disabled:text-neutral-500",onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),J())}})]});return(0,l.jsxs)(m.aF,{open:a,onOpenChange:n,children:[(0,l.jsx)(m.Q$,{children:(0,l.jsxs)(m.sK,{showCloseButton:!1,onOpenAutoFocus:e=>e.preventDefault(),className:"!w-[100vw] sm:!w-[95vw] !max-w-[1135px] !max-h-[100vh] sm:!max-h-[90vh] overflow-hidden border-0 !rounded-none sm:!rounded-lg !p-0",children:[(0,l.jsx)(m.wt,{className:"hidden"}),(0,l.jsxs)(m.cw,{className:"p-0",children:[(0,l.jsxs)("div",{className:"flex flex-col sm:hidden h-[100dvh] bg-white",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-black",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-9 h-9 rounded-full bg-neutral-100 overflow-hidden shrink-0",children:(0,l.jsx)("img",{src:s.company.logo,alt:s.company.name,className:"w-full h-full object-cover"})}),(0,l.jsx)("div",{className:"cursor-pointer hover:opacity-80 transition-opacity",onClick:g,children:(0,l.jsx)(m.R0,{className:"font-semibold text-white leading-tight",children:s.company.name})})]}),(0,l.jsx)("button",{onClick:n,className:"p-1 text-white bg-transparent border-none!",children:(0,l.jsx)(m.BL,{name:"XIcon",className:"w-6 h-6 text-white bg-transparent border-none!"})})]}),(0,l.jsx)("div",{className:"flex-1 min-h-0 max-h-[60vh] relative",children:el}),(0,l.jsxs)("div",{className:"shrink-0 bg-white overflow-y-auto",children:[(0,l.jsx)("div",{className:"px-4 pt-3 pb-2",children:(0,l.jsx)(ec.A,{socialStats:{likes:s.likes,comments:ea,shares:s.shares},onLike:d,onComment:()=>{O(!0),requestAnimationFrame(()=>q(!0))},onShare:p,onBookmark:x,isLiked:s.isLiked,isBookmarked:s.isBookmarked,onViewLikedUsers:v,likedUsers:y,isShowBookmark:!1})}
1),(s.description||s.comments.length>0&&s.comments[0].content)&&(0,l.jsxs)("div",{className:"flex flex-col gap-1 px-4 pb-2",children:[(0,l.jsxs)(m.qb,{className:"text-neutral-900 leading-relaxed",children:["â",s.description||s.comments[0].content,"â"]}),s.comments.length>0&&(0,l.jsx)(m.qb,{className:"text-neutral-700",children:(0,ei.tb)(s.comments[0].timestamp,z)})]}),en]}),P&&(0,l.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end",children:[(0,l.jsx)("div",{className:"absolute inset-0 bg-black/40 transition-opacity duration-300 ".concat(F?"opacity-100":"opacity-0"),onClick:G}),(0,l.jsxs)("div",{className:"relative w-full bg-white rounded-t-2xl max-h-[70vh] flex flex-col transition-transform duration-300 ease-out ".concat(F?"translate-y-0":"translate-y-full"),children:[(0,l.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-neutral-200",children:[(0,l.jsx)(m.EP,{fontWeight:"bold",children:z("component.o24_post_modal.comments",{defaultValue:"Comments"})}),(0,l.jsx)("button",{onClick:G,className:"p-1 text-neutral-900",children:(0,l.jsx)(m.BL,{name:"XIcon",className:"w-5 h-5"})})]}),(0,l.jsx)("div",{ref:R,className:"flex-1 overflow-y-auto scroll-smooth",children:0===et.length?(0,l.jsx)("div",{className:"p-8 text-center",children:(0,l.jsx)(m.qb,{className:"text-neutral-700",children:z("component.o24_post_modal.no_comments",{defaultValue:"No comments yet"})})}):et.map(e=>(0,l.jsx)("div",{className:"px-4 py-3 border-b border-neutral-100 last:border-b-0",children:(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)("div",{className:"shrink-0",children:(0,l.jsx)(m.eu,{src:e.avatar,name:e.userName,size:"sm"})}),(0,l.jsxs)("div",{className:"flex-1 flex flex-col gap-0.5",children:[(0,l.jsxs)(m.qb,{className:"text-neutral-900",children:[(0,l.jsx)("span",{className:"font-medium",children:e.userName})," ",e.content]}),(0,l.jsx)(m.qb,{className:"text-neutral-700",children:(0,ei.tb)(e.timestamp,z)})]}),null!=w&&e.userId===String(w)&&(0,l.jsx)("button",{className:"shrink-0 self-center p-1",onClick:()=>M(e.id),children:(0,l.jsx)(m.BL,{name:"TrashIcon",variant:"outline",className:"w-5 h-5 text-neutral-700"})})]})},e.id))}),en]})]})]}),(0,l.jsxs)("div",{className:"hidden sm:flex sm:flex-row overflow-hidden rounded-lg",children:[el,(0,l.jsxs)("div",{className:"w-[47%] h-[720px] bg-white flex flex-col",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-neutral-200",children:[(0,l.jsxs)("div",{className:"flex items-center gap-4",children:[(0,l.jsx)("div",{className:"w-[30px] h-[30px] rounded-full bg-neutral-100 overflow-hidden shrink-0",children:(0,l.jsx)("img",{src:s.company.logo,alt:s.company.name,className:"w-full h-full object-cover"})}),(0,l.jsx)(m.cR,{className:"font-semibold text-neutral-900",children:s.company.name})]}),(0,l.jsx)(m.$n,{variant:"tertiary",size:"sm",onClick:n,className:"p-2! border-0! hover:bg-neutral-100 shrink-0",children:(0,l.jsx)(m.BL,{name:"XIcon",className:"w-6 h-6 text-neutral-900"})})]}),(s.description||s.comments.length>0&&s.comments[0].content)&&(0,l.jsx)("div",{className:"p-4 border-b border-neutral-100",children:(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(m.qb,{className:"text-neutral-900 leading-relaxed",children:["â",s.description||s.comments[0].content,"â"]}),s.comments.length>0&&(0,l.jsx)(m.qb,{className:"text-neutral-700",children:(0,ei.tb)(s.comments[0].timestamp,z)})]})}),(0,l.jsx)("div",{ref:U,className:"flex-1 overflow-y-auto scroll-smooth","data-testid":"comments-container-".concat(s.id),children:0===et.length?(0,l.jsx)("div",{className:"p-8 text-center",children:(0,l.jsx)(m.qb,{className:"text-neutral-700",children:z("component.o24_post_modal.no_comments")})}):et.map(e=>(0,l.jsx)("div",{className:"p-4 border-b border-neutral-100 last:border-b-0",children:(0,l.jsxs)("div",{className:"flex gap-3",children:[(0,l.jsx)("div",{className:"shrink-0",children:(0,l.jsx)(m.eu,{src:e.avatar,name:e.userName,size:"sm"})}),(0,l.jsx)("div",{className:"flex-1",children:(0,l.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,l.jsxs)(m.qb,{className:"text-neutral-900",children:[(0,l.jsx)("span",{className:"font-medium",children:e.userName})," ",e.content]}
1),(0,l.jsx)(m.qb,{className:"text-neutral-700",children:(0,ei.tb)(e.timestamp,z)})]})}),null!=w&&e.userId===String(w)&&(0,l.jsx)("button",{className:"shrink-0 self-center p-1",onClick:()=>M(e.id),children:(0,l.jsx)(m.BL,{name:"TrashIcon",variant:"outline",className:"w-5 h-5 text-neutral-700"})})]})},e.id))}),(0,l.jsxs)("div",{className:"border-t border-neutral-200",children:[(0,l.jsx)("div",{className:"p-4 pb-3",children:(0,l.jsx)(ec.A,{socialStats:{likes:s.likes,comments:ea,shares:s.shares},onLike:d,onComment:()=>{var e,t;null==(t=Y.current)||null==(e=t.querySelector("input"))||e.focus()},onShare:p,onBookmark:x,isLiked:s.isLiked,isBookmarked:s.isBookmarked,onViewLikedUsers:v,likedUsers:y,isShowBookmark:!1})}),en]})]})]})]})]})}),B&&(0,l.jsx)(m.aF,{open:!!B,onOpenChange:()=>M(null),children:(0,l.jsx)(ed,{setIsOpen:()=>M(null),onDelete:V})})]})},eu={5:{en:"Why Join Us",th:"à¸à¸³à¹à¸¡à¸à¹à¸à¸à¸£à¹à¸§à¸¡à¸à¸²à¸à¸à¸±à¸à¹à¸£à¸²"},6:{en:"Good Life",th:"à¸à¸µà¸§à¸´à¸à¸à¸µ"},7:{en:"Good Work",th:"à¸à¸²à¸à¸à¸µ"},8:{en:"Good Pay",th:"à¹à¸à¸´à¸à¸à¸µ"},9:{en:"Good Community",th:"สัà¸à¸à¸¡à¸à¸µ"}},eh=[5,6,7,8,9];function ep(e){return eh.includes(Number(e))}function ex(e){return e?e.startsWith("http")?e:"".concat("https://api.yousayhrsay.com/yousayapi").concat(e):""}function ef(e){var t;if(e.thumbnailUrl)return e.thumbnailUrl;let a=null==(t=/videodelivery\.net\/([^/]+)/.exec(e.url))?void 0:t[1];if(a)return"https://videodelivery.net/".concat(a,"/thumbnails/thumbnail.jpg?time=1.5s")}function eg(e){let[t,a,l]=e.split("-");if("feature"!==t)throw Error("Invalid postId");return{idFeature:a,idDetail:l}}function ev(e){let t=/^feature-(\d+)-(\d+)/.exec(e);return{idGalleryTitle:t?Number(t[1]):0,idGallery:t?Number(t[2]):0}}function ey(e){return(null!=e?e:"").replace(/<\/?[a-z][^>]*>/gi," ").replace(/\s+/g," ").trim()}function ew(e,t,a,l){let n=ey(e),s=ey(t);if(n&&s)return"".concat(n," â ").concat(s);if(s)return s;let o=n||ey(l);return o?"".concat(o," (").concat(a,")"):""}let ej=e=>{var t,a,m,h,p,x,y,w,j,b,N,k,C,I,L,A,T,P,O,F;let{isShowWriteReviewButton:q=!0,shareBaseUrl:B,companiesBasePath:W="companies",withCPrefix:M=!0,noWorkExperiencePath:R}=e,{showMiniBanner:Y,getScrollToOffset:z}=(0,er.MZ)(),{isDesktop:K}=(0,eo.l)(),{t:$}=(0,r.B)(),H=(0,s.Ym)(),J=(0,n.useRouter)(),V=(0,n.usePathname)(),Z=(0,n.useParams)()["company-slug-c-id"],ei=(0,v.f1)(Z,{withCPrefix:M})||"",[ec,ed]=(0,o.useState)(0);(0,o.useEffect)(()=>{ed(+("1"===new URLSearchParams(window.location.search).get("preview")))},[]);let eh=Number(ei)||0,{shouldShow:ey}=S(eh),{data:ej,status:eb}=(0,_.useSession)(),eN=(null==ej||null==(t=ej.user)?void 0:t.token)||"",ek=null!=(b=null==ej||null==(a=ej.user)?void 0:a.idJsk)?b:null,eC="authenticated"===eb&&eN?eN:(0,U.fp)(),[eS,eI]=(0,o.useState)([]),[eL,eD]=(0,o.useState)([]),[e_,eA]=(0,o.useState)(""),[eE,eT]=(0,o.useState)(!1),[eP,eO]=(0,o.useState)(!1),[eF,eq]=(0,o.useState)(null),eB=(0,o.useRef)(null),eW=(0,o.useRef)("feature"),[eM,eU]=(0,o.useState)(null),[eR,eY]=(0,o.useState)("feature"),[ez,eG]=(0,o.useState)(!1),eK=ez?"th"===H?"en":"th":H,e$=(0,i.cp)({idEmp:eh,idFeature:5,draft:ec},void 0,eK),eQ=(0,i.cp)({idEmp:eh,idFeature:6,draft:ec},void 0,eK),eH=(0,i.cp)({idEmp:eh,idFeature:7,draft:ec},void 0,eK),eJ=(0,i.cp)({idEmp:eh,idFeature:8,draft:ec},void 0,eK),eV=(0,i.cp)({idEmp:eh,idFeature:9,draft:ec},void 0,eK),eX=[e$,eQ,eH,eJ,eV].some(e=>{var t,a;return"th"===H?null==(t=e.data)?void 0:t.hasContentEn:null==(a=e.data)?void 0:a.hasContentTh}),eZ=(0,i.rh)(eh),e0=(0,o.useMemo)(()=>{let e=eZ.data,t="th"===H?(null==e?void 0:e.nameTh)||(null==e?void 0:e.nameEn)||"":(null==e?void 0:e.nameEn)||(null==e?void 0:e.nameTh)||"",a=ex((null==e?void 0:e.logo)||"");return[{id:5,data:e$.data},{id:6,data:eQ.data},{id:7,data:eH.data},{id:8,data:eJ.data},{id:9,data:eV.data}].filter(e=>!!e.data&&(!!e.data.description||e.data.gallery.length>0)).map(e=>{var l,n;let s=("th"===H?null==(l=eu[e.id])?void 0:l.th:null==(n=eu[e.id])?void 0:n.en)||"Feature ".concat(e.id);return{featureId:String(e.id),featureName:s,mainText:e.data.description||"",detailTextList:e.data.detailTextList,gallery:function(e,t,a,l,n,s){return e.gallery.filter(e=>!!e.url).map((e,o)=>{var r;return{postId:"feature-".concat(null!=(r=e.idFeature)?r:t,"-").concat(e.idDetail),author:{companyId:a,companyName:l,logoUrl:n,isFollowed:!1},media:[{type:e.type||"image",url:ex(e.url),thumbnailUrl:ef(e)}],tag:"",title:"",alt:ew(s,e.caption,o+1,l),content:e.caption||"",reactions:{likes:0,comments:0,shares:0,isLikedByCurrentUser:!1,isSavedByCurrentUser:!1}}})}(e.data,e.id,ei,t,a,s)}})},[e$.data,eQ.data,eH.data,eJ.data,eV.data,ei,eZ.data,H]),e1=(0,i.B6)({idEmp:eh,idLanguage:38,draft:ec},void 0,H),e4=(0,i.yk)({idEmp:eh,draft:ec}),e2=(0,i.sf)({idEmp:eh,draft:ec}),e3=(0,i.B0)({idEmp:eh,idLanguage:38,draft:ec}),{mutate:e6}=(0,E.iz)(),{mutate:e5}=(0,E.qk)(),{mutate:e8}=(0,E.qY)(),{mutate:e7}=(0,E.QM)(),{mutate:e9}=(0,E.IV)(),{mutate:te}=(0,E.SP)(),{data:tt,isLoading:ta}=(0,Q.Kw)(ei||null,1,3),tl=(0,o.useMemo)(()=>
1{if(!e1.data)return[];let e=eZ.data,t="th"===H?(null==e?void 0:e.nameTh)||(null==e?void 0:e.nameEn)||"":(null==e?void 0:e.nameEn)||(null==e?void 0:e.nameTh)||"",a=ex((null==e?void 0:e.logo)||"");return e1.data.filter(e=>!!e.description||e.gallery.length>0).map(e=>({featureId:String(e.idGalleryTitle),featureName:e.title,mainText:e.description||"",detailTextList:[],gallery:function(e,t,a,l){return e.gallery.filter(e=>!!e.url).map((n,s)=>({postId:"feature-".concat(n.idGalleryTitle,"-").concat(n.idGallery),author:{companyId:t,companyName:a,logoUrl:l,isFollowed:!1},media:[{type:n.type||"image",url:ex(n.url),thumbnailUrl:ef(n)}],tag:"",title:"",alt:ew(e.title,n.caption,s+1,a),content:n.caption||"",reactions:{likes:0,comments:0,shares:0,isLikedByCurrentUser:!1,isSavedByCurrentUser:!1}}))}(e,ei,t,a)}))},[e1.data,ei,eZ.data,H]),tn=(0,o.useMemo)(()=>[...e0,...tl],[e0,tl]),ts=(0,o.useMemo)(()=>e2.data?e2.data.map(e=>{let t=e.author.name.trim().split(/\s+/);return{firstName:t[0]||"",lastName:t.slice(1).join(" "),occupation:e.author.position,workExpY:e.author.yearsAtCompany,workExpM:0,content:e.description||"",profilePictureUrl:ex(e.author.avatarUrl||""),photoUrl:(e.gallery||[]).map((e,t)=>({order:t,url:ex(e.url)}))}}):[],[e2.data]),to=(0,o.useMemo)(()=>{var e;if(!e3.data)return null;let t=e3.data,a=eZ.data,l=(null==a?void 0:a.totalEmployee)||t.companySize||"",n=((null==a||null==(e=a.industries)?void 0:e.length)?a.industries.map(e=>"th"===H?e.nameTh||e.nameEn:e.nameEn||e.nameTh).join(", "):"")||t.industry||"";return{aboutCompany:t.aboutCompany||"",vision:t.vision||"",mission:t.mission||"",companySize:l,industry:n,location:t.location||"",website:t.website||""}},[e3.data,eZ.data,H]),tr=[...eS.map(e=>e.featureId),"EmployeePhotoSection","EmployeeVoiceSection","EmployeeCompanyOverviewSection","EmployeeCompanyArticleSection"],ti=(0,o.useRef)({}),tc=(0,o.useRef)(null),td=(0,o.useRef)(null);tr.forEach(e=>{var t,a;null!=(t=ti.current)[e]||(t[e]=null)});let tm=(0,o.useMemo)(()=>{if("feature"!==eR||!(null==eM?void 0:eM.startsWith("feature-")))return null;try{let{idFeature:e,idDetail:t}=eg(eM);return{idFeature:Number(e),idDetail:Number(t)}}catch(e){return null}},[eM,eR]),tu=(0,o.useMemo)(()=>{if("gallery"!==eR||!(null==eM?void 0:eM.startsWith("feature-")))return null;let{idGalleryTitle:e,idGallery:t}=ev(eM);return t?{idGalleryTitle:e,idGallery:t}:null},[eM,eR]),{mutate:th}=(0,E.vq)(),{mutate:tp}=(0,E.Hc)(),{data:tx}=(0,E.HZ)({idEmp:eh,idFeature:null!=(N=null==tm?void 0:tm.idFeature)?N:0,idDetail:null!=(k=null==tm?void 0:tm.idDetail)?k:0,service:"getFeatureSocialInfo",like:"1",accessToken:eC},{enabled:!!tm}),{data:tf}=(0,E.cF)({idEmp:eh,idFeature:null!=(C=null==tm?void 0:tm.idFeature)?C:0,idDetail:null!=(I=null==tm?void 0:tm.idDetail)?I:0,service:"getFeatureComments",accessToken:eC},{enabled:!!tm}),{data:tg}=(0,E.tC)({idEmp:eh,idGallery:null!=(L=null==tu?void 0:tu.idGallery)?L:0,idGalleryTitle:null!=(A=null==tu?void 0:tu.idGalleryTitle)?A:0,service:"getGallerySocialInfo",accessToken:eC},{enabled:!!tu}),{data:tv}=(0,E.kx)({idEmp:eh,idGallery:null!=(T=null==tu?void 0:tu.idGallery)?T:0,idGalleryTitle:null!=(P=null==tu?void 0:tu.idGalleryTitle)?P:0,service:"getGalleryComments",accessToken:eC},{enabled:!!tu}),ty=(0,o.useMemo)(()=>{var e,t,a,l;if(!eM)return null;let n=tn.find(e=>e.gallery.some(e=>String(e.postId)===eM)),s=null==n?void 0:n.gallery.find(e=>String(e.postId)===eM);if(!s)return null;let o="gallery"===eR?tg:tx,r="gallery"===eR?tv:tf,i=null!=ek&&null!=(e=null==o?void 0:o.likedBy.some(e=>e.id===ek))&&e,c=void 0!==globalThis.window,d=null;c&&(d=null!=ek?String(ek):(0,U.fp)());let m=null!=d?"post_liked_".concat(eM,"_").concat(d):null,u=c&&null!=m&&"true"===localStorage.getItem(m),h=null!=(t=null==o?void 0:o.isLiked)&&t||i||u;return{id:String(s.postId),media:s.media,hashtag:s.tag,company:{name:s.author.companyName||"",logo:s.author.logoUrl||"",isFollowing:s.author.isFollowed},postedBy:"",description:s.content||s.title||"",likes:null!=(a=null==o?void 0:o.totalLikes)?a:s.reactions.likes,comments:(null!=r?r:[]).map(e=>{var t,a;return{id:e.id,userId:String(e.authorId),userName:null!=(t=e.authorName)?t:"",avatar:null!=(a=e.authorPhoto)?a:"",content:e.comment,timestamp:e.datetime}}),shares:null!=(l=null==o?void 0:o.totalShares)?l:s.reactions.shares,isBookmarked:s.reactions.isSavedByCurrentUser,isLiked:h}},[eM,tn,eR,tx,tf,tg,tv,ek]),tw=()=>{let e=tc.current,t=td.current;if(!e||!t)return 0;let{paddingTop:a,paddingBottom:l}=getComputedStyle(e);return t.offsetHeight+parseFloat(a)+parseFloat(l)},tj=e=>{let t=ti.current[e];if(t){var a;tk.current=!0,tC.current&&clearTimeout(tC.current);let e=t.getBoundingClientRect(),l=window.pageYOffset||document.documentElement.scrollTop,n=e.top+l,s=window.innerWidth>=1024,o=null!=(a=null==z?void 0:z(n,l,s?0:tw()))?a:er.kd;window.scrollTo({top:n-o,behavior:"smooth"}),tC.current=setTimeout(()=>{tk.current=!1},800)}},tb=(e,t)=>{eB.current=t,eW.current=ep(e)?"feature":"gallery",eq(t),eO(!0)},tN=e=>{let t=tn.find(t=>t.gallery.some(t=>String(t.postId)===e));eY(t&&ep(t.featureId)?"feature":"gallery"),eU(e),eT(!0)};(0,o.useEffect)(()=>{tn.length>0&&eI(tn.map(e=>({featureId:e.featureId,featureName:e.featureName})))},[tn]),(0,o.useEffect)(()=>
1{let e=[ey?{key:"Office24Section",label:"Office24",onClick:()=>{tj("Office24Section")}}:null].filter(Boolean),t=[e4.data&&e4.data.photos.length>0?{key:"EmployeePhotoSection",label:$("component.employee_photo_section.employee_photos"),onClick:()=>{tj("EmployeePhotoSection")}}:null,ts.length>0?{key:"EmployeeVoiceSection",label:$("component.employee_voice_section.employee_voices"),onClick:()=>{tj("EmployeeVoiceSection")}}:null,to?{key:"EmployeeCompanyOverviewSection",label:$("component.company_overview.company_overview"),onClick:()=>{tj("EmployeeCompanyOverviewSection")}}:null,(null==tt?void 0:tt.articles)&&tt.articles.length>0?{key:"EmployeeCompanyArticleSection",label:$("component.company_news.company_news"),onClick:()=>{tj("EmployeeCompanyArticleSection")}}:null].filter(Boolean),a=[...e,...eS.map(e=>({key:e.featureId,label:e.featureName,onClick:()=>{tj(e.featureId)}})),...t];eD(a),a.length>0&&eA(a[0].key)},[ey,eS,e4.data,ts,to,ei,tt,$]);let tk=(0,o.useRef)(!1),tC=(0,o.useRef)(null);(0,o.useEffect)(()=>{let e=ti.current,t=eL.map(e=>e.key);if(0===t.length)return;let a=new IntersectionObserver(a=>{if(tk.current)return;let l=a.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top);if(l.length>0){let a=l[0],n=t.find(t=>e[t]===a.target);n&&eA(n)}},{rootMargin:"-100px 0px -60% 0px",threshold:0});return t.forEach(t=>{let l=e[t];l&&a.observe(l)}),()=>a.disconnect()},[eL]);let tS=(0,d.nM)(),{data:tI}=(0,c.useWorkExperienceData)({enabled:q&&!!tS}),{data:tL}=(0,el.iI)(void 0,{enabled:q&&!!tS}),tD=null==(m=eZ.data)?void 0:m.companyUuid,t_=(0,o.useMemo)(()=>ei&&tI?tI.filter(e=>e.companyId===ei||tD&&e.companyId===tD):[],[ei,tD,tI]),tA=(0,o.useMemo)(()=>!!tL&&0!==t_.length&&t_.some(e=>{let t=tL.find(t=>t.id===e.id);return(null==t?void 0:t.completeStatus)===!0}),[t_,tL]),tE=(0,o.useMemo)(()=>{if(0===t_.length)return null;if(1===t_.length)return t_[0];let e=t_.find(e=>{let t=null==tL?void 0:tL.find(t=>t.id===e.id);return t&&!t.completeStatus});return e||[...t_].sort((e,t)=>{if(e.isCurrentlyWorking!==t.isCurrentlyWorking)return e.isCurrentlyWorking?-1:1;let a=Number(e.startYear)||0,l=Number(t.startYear)||0;if(a!==l)return l-a;let n=Number(e.startMonth)||0;return(Number(t.startMonth)||0)-n})[0]},[t_,tL]),tT="th"===H?(null==(h=eZ.data)?void 0:h.nameTh)||(null==(p=eZ.data)?void 0:p.nameEn)||"":(null==(x=eZ.data)?void 0:x.nameEn)||(null==(y=eZ.data)?void 0:y.nameTh)||"",{handleWriteReview:tP,invitedToThisCompany:tO,isAddWorkExperienceOpen:tF,setIsAddWorkExperienceOpen:tq,addWorkExperienceContext:tB,handleWorkExperienceAdded:tW}=(0,en.b)({companyId:ei,companyUuid:tD,companyName:tT,locale:H,accessToken:tS,targetWorkExperienceId:null==tE?void 0:tE.id,writeReviewPath:"/".concat(H,"/").concat(W,"/write-review"),enabled:q}),tM=q&&!tA&&(t_.length>0||tO),tU=q&&!tA&&!tM&&!!R;return(0,l.jsxs)("div",{className:"flex flex-col lg:flex-row gap-0 lg:gap-8 xl:gap-10 items-start self-stretch w-full",children:[(0,l.jsxs)("div",{ref:tc,className:"shrink-0 z-10 h-fit max-h-[calc(100vh-8rem)] overflow-y-auto w-full lg:w-[248px] flex flex-col gap-4 bg-neutral-100 px-4 py-4 lg:px-0 lg:py-0 transition-[top] duration-300 lg:sticky lg:self-start ".concat(Y?"sticky self-start":""),style:{top:K?"var(--sticky-banner-offset-desktop, 96px)":"var(--sticky-banner-offset, 96px)"},children:[(tM||tU)&&(!Y||K)&&(0,l.jsx)(ea.A,{onClick:tM?tP:()=>{if(R){if(!tS)return void J.push("/".concat(H,"/sign-in?callbackUrl=").concat(encodeURIComponent(R)));J.push(R)}},withBg:K,className:"border-neutral-200"}),eL.length>1&&(0,l.jsx)("div",{ref:td,children:(0,l.jsx)(et.C,{menuItems:eL,currentSection:e_})})]}),(0,l.jsx)("div",{className:"flex-1 w-full min-w-0 overflow-hidden",children:(0,l.jsxs)("div",{className:"bg-white border border-neutral-200 rounded-lg p-4 md:p-6 lg:p-8 space-y-8",children:[ey&&(0,l.jsx)("section",{ref:e=>{ti.current.Office24Section=e},id:"Office24Section",className:"scroll-mt-4",children:(0,l.jsx)(D,{companyId:eh,href:"/".concat(H,"/").concat(W,"/").concat(Z,"/office-24")})}),tn.map((e,t)=>(0,l.jsx)("section",{ref:t=>{ti.current[e.featureId]=t},id:e.featureId,className:"scroll-mt-4",children:(0,l.jsx)(G,{section:e,idEmp:eh,type:ep(e.featureId)?"feature":"gallery",showTranslateButton:0===t&&eX,isTranslated:ez,onTranslate:()=>eG(e=>!e),onShare:t=>tb(e.featureId,t),onComment:tN})},e.featureId)),e4.data&&e4.data.photos.length>0&&(0,l.jsx)("section",{ref:e=>{ti.current.EmployeePhotoSection=e},id:"EmployeePhotoSection",className:"scroll-mt-4",children:(0,l.jsx)(ee,{isLoading:e4.isLoading,imageList:e4.data.photos.map(e=>ex(e.url))})}),ts.length>0&&(0,l.jsx)("section",{ref:e=>{ti.current.EmployeeVoiceSection=e},id:"EmployeeVoiceSection",className:"scroll-mt-4",children:(0,l.jsx)(f,{isLoading:e2.isLoading,employee
1Voices:ts,currentPage:1,totalPages:1,onPageChange:()=>{}})}),to&&(0,l.jsx)("section",{ref:e=>{ti.current.EmployeeCompanyOverviewSection=e},id:"EmployeeCompanyOverviewSection",className:"scroll-mt-4",children:(0,l.jsx)(u,{companyOverview:to})}),ei&&(null!=(O=null==tt||null==(w=tt.articles)?void 0:w.length)?O:0)>0&&(0,l.jsx)("section",{ref:e=>{ti.current.EmployeeCompanyArticleSection=e},id:"EmployeeCompanyArticleSection",className:"scroll-mt-4",children:(0,l.jsx)(X,{companyNews:null!=(F=null==tt?void 0:tt.articles)?F:[],companyName:"Company",companyArticlesPath:"/".concat(H,"/").concat(W,"/").concat(Z,"/brandsdna"),isLoading:ta})})]})}),eE&&ty&&(0,l.jsx)(em,{isOpen:eE,onClose:()=>{eT(!1),eU(null)},postData:ty,galleryPosts:null==(j=tn.find(e=>e.gallery.some(e=>String(e.postId)===ty.id)))?void 0:j.gallery.map(e=>({postId:String(e.postId),media:e.media,title:e.title,content:e.content})),onPostNavigate:e=>{eU(e)},onLike:()=>{if(eM){if(void 0!==globalThis.window){let t=null!=ek?String(ek):(0,U.fp)();if(t){var e;let a="post_liked_".concat(eM,"_").concat(t);null!=(e=null==ty?void 0:ty.isLiked)&&e?localStorage.removeItem(a):localStorage.setItem(a,"true")}}"gallery"===eR&&tu?tp({idEmp:eh,idGallery:tu.idGallery,idGalleryTitle:tu.idGalleryTitle,service:"toggleLikeGallery",like:"1",accessToken:eC}):tm&&th({idEmp:eh,idFeature:tm.idFeature,idDetail:tm.idDetail,service:"toggleLikeFeature",like:"1",accessToken:eC})}},onComment:e=>{if(e.trim()){if(!ej){let e=encodeURIComponent(V);J.push("/".concat(H,"/sign-in?callbackUrl=").concat(e));return}"gallery"===eR&&tu?e9({idEmp:eh,idGallery:tu.idGallery,idGalleryTitle:tu.idGalleryTitle,service:"addGalleryComment",comment:e.trim(),accessToken:eN}):tm&&e5({idEmp:eh,idFeature:tm.idFeature,idDetail:tm.idDetail,service:"addFeatureComment",comment:e.trim(),accessToken:eN})}},currentUserId:ek,onDeleteComment:e=>{if(e){if("gallery"===eR&&tu)return void te({idEmp:eh,idFeature:tu.idGallery,idDetail:tu.idGalleryTitle,id:e,approved:2,service:"updateGalleryComment",accessToken:eN});tm&&e8({idEmp:eh,idFeature:tm.idFeature,idDetail:tm.idDetail,id:e,approved:2,service:"updateFeatureComment",accessToken:eN})}},onShare:()=>{var e;let t=tn.find(e=>e.gallery.some(e=>String(e.postId)===ty.id));tb(null!=(e=null==t?void 0:t.featureId)?e:"",ty.id)}}),eP&&eF&&(0,l.jsx)(g.A,{open:eP,onOpenChange:eO,postId:eF,locale:H,companySlugCId:Z,onShare:e=>{let t=eB.current;if(t)if("gallery"===eW.current){let{idGalleryTitle:a,idGallery:l}=ev(t);e7({idEmp:eh,idGallery:l,idGalleryTitle:a,accessToken:(0,U.fp)(),service:"addGalleryShared",media:e})}else{let{idFeature:a,idDetail:l}=eg(t);e6({idEmp:eh,idFeature:Number(a),idDetail:Number(l),accessToken:(0,U.fp)(),service:"addFeatureShared",media:e})}},shareBaseUrl:B}),!!ei&&(0,l.jsx)(es.J,{isOpen:tF,onOpenChange:tq,context:tB,onSubmit:tW})]})}},54642:(e,t,a)=>{"use strict";a.d(t,{D:()=>r});var l=a(54568),n=a(80308);let s=e=>{let{name:t,src:a,onClick:s}=e;return(0,l.jsxs)("div",{className:"flex items-center px-5 py-2 sm:py-4 bg-gradient-to-b from-transparent from-[99%] to-grey-200 to-[99%]",children:[(0,l.jsx)(n.eu,{name:t,src:a,containerClassName:"!w-12 !h-12",imageClassName:"!w-12 !h-12",onClick:s}),(0,l.jsx)(n.$n,{className:"!p-0 !rounded-full !bg-transparent !border-none !shadow-none",onClick:s,children:(0,l.jsx)(n.jz,{className:"text-grey-900 ml-4",children:t})})]})};a(2693);var o=a(66869);let r=e=>{let{likes:t,likedUsers:a,anonymousLikes:r,open:i,onOpenChange:c}=e,{t:d}=(0,o.B)();return(0,l.jsxs)(n.aF,{open:i,onOpenChange:c,children:[(0,l.jsx)(n.g6,{asChild:!0,children:(0,l.jsx)(n.$n,{className:"!bg-transparent !border-none !p-0 !m-0 !text-neutral-700","data-testid":"like-modal-trigger",children:t})}),(0,l.jsx)(n.Q$,{children:(0,l.jsxs)(n.sK,{fullScreenMobile:!0,className:"w-full h-full md:w-[460px] md:h-fit !gap-0",children:[(0,l.jsx)(n.rQ,{children:(0,l.jsx)(n.wt,{children:d("component.like_modal.likes")})}),(0,l.jsxs)(n.cw,{className:"!py-4",children:[(0,l.jsx)("div",{className:"h-[320px] sm:h-[400px] overflow-y-scroll scrollbar-custom",children:a.map((e,t)=>(0,l.jsx)(s,{...e},t))}),r>0&&(0,l.jsx)("div",{className:"text-neutral-900 pt-4",children:(0,l.jsx)(n.jz,{children:d("component.like_modal.anonymous_likes",{count:r})})})]})]})})]})}},57043:(e,t,a)=>{"use strict";function l(e){if(console.log("\uD83D\uDD04 Social Transformer: Transforming feed data to PostGrid format..."),!(null==e?void 0:e.data)||!Array.isArray(e.data))return console.warn("â ï¸ Social Transformer: Invalid feed data structure"),[];let t=e.pagination,a=!!t&&t.currentPage===t.maxPage,l=e.data.map((e,t)=>{let l;l=e.postId?"string"==typeof e.postId?e.postId:String(e.postId):"fallback-".concat(t);let n=[];return e.media&&Array.isArray(e.media)&&e.media.length>0?n=e.media.map((e,a)=>{let l={type:e.type||"image",url:e.url,thumbnailUrl:e.thumbnailUrl};return"video"!==e.type||e.thumbnailUrl||(l.thumbnailUrl="https://images.unsplash.com/photo-".concat(16e11+t+a,"?w=400&h=300&fit=crop")),l}):n.push({type:"image",url:"https://images.unsplash.com/photo-".concat(16e11+t,"?w=400&h=300&fit=crop"),thumbnailUrl:"https://images.unsplash.com/photo-".concat(16e11+t,"?w=200&h=150&fit=crop")}),{postId:l,media:n,isLastPage:a}});return console.log("â
Social Transformer: Transformed ".concat(l.length," posts for PostGrid")),console.log("\uD83D\uDD0D Social Transformer: Sample transformed data:",l[0]),l}function n(e){console.log("\uD83D\uDD0D Social Transformer: Validating and transforming feed response...");try{return l(e)}catch(e){return console.warn("â ï¸ Social Transformer: Transformation failed:",e),[]}}function s(e){return{id:e.postId,media:e.media.map(e=>({type:"video"===e.type?"video":"image",url:e.url,thumbnailUrl:e.thumbnailUrl,autoPlay:"video"===e.type||void 0,muted:"video"===e.type||void 0,loop:"video"===e.type||void 0})),hashtag:e.tag,company:{name:e.author.companyName,logo:e.author.logoUrl,isFollowing:e.author.isFollowed},postedBy:e.author.team||"Team Member",likes:e.reactions.likes,comments:[],shares:e.reactions.shares,isBookmarked:e.reactions.isSavedByCurrentUser,isLiked:e.reactions.isLikedByCurrentUser,commentsLoading:!0,commentsError:void 0}}function o(e){return Array.isArray(e)?e.map(e=>{var t,a,l,n;return{id:e.commentId||e.id||crypto.randomUUID(),userId:(null==(t=e.user)?void 0:t.userId)||e.userId||"unknown",userName:(null==(a=e.user)?void 0:a.userDisplayName)||e.userName||"Anonymous",avatar:(null==(l=e.user)?void 0:l.userAvatarUrl)||e.avatar||"https://i.pravatar.cc/150?u=".concat((null==(n=e.user)?void 0:n.userId)||"default"),content:e.content||"",timestamp:e.timestamp||new Date().toISOString()}}):[]}function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return{id:e.postId,media:e.media.map(e=>({type:e.type,url:e.url,autoPlay:"video"===e.type,muted:"video"===e.type,loop:"video"===e.type})),hashtag:e.tag,company:{name:e.author.companyName,logo:e.author.logoUrl,isFollowing:e.author.isFollowed},postedBy:e.author.team||e.author.companyName,description:e.content||"",likes:e.reactions.likes,comments:t,shares:e.reactions.shares,isBookmarked:!1,isLiked:e.reactions.isLikedByCurrentUser}}function i(e){var t,a;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"explore";console.log("\uD83D\uDD04 Social Transformer: Transforming to extended social feed data...");let s=l(e);return{gridData:s,fullData:function(e){if(console.log("\uD83D\uDD04 Social Transformer: Transforming feed data to full post format..."),!(null==e?void 0:e.data)||!Array.isArray(e.data))return console.warn("â ï¸ Social Transformer: Invalid feed data structure"),[];let t=e.data.map((e,t)=>{var a,l,n,s,o,r,i,c,d,m,u;
1let h="string"==typeof e.postId?e.postId:String(e.postId),p=[];return e.media&&Array.isArray(e.media)&&e.media.length>0?p=e.media.map((e,a)=>{let l={type:e.type||"image",url:e.url,thumbnailUrl:e.thumbnailUrl};return"video"!==e.type||e.thumbnailUrl||(l.thumbnailUrl="https://images.unsplash.com/photo-".concat(16e11+t+a,"?w=400&h=300&fit=crop")),l}):p.push({type:"image",url:"https://images.unsplash.com/photo-".concat(16e11+t,"?w=400&h=300&fit=crop"),thumbnailUrl:"https://images.unsplash.com/photo-".concat(16e11+t,"?w=200&h=150&fit=crop")}),{postId:h,author:{companyId:(null==(a=e.author)?void 0:a.companyId)||"0",companyName:(null==(l=e.author)?void 0:l.companyName)||"Unknown Company",logoUrl:(null==(n=e.author)?void 0:n.logoUrl)||"https://images.unsplash.com/photo-".concat(16e11+t,"?w=40&h=40&fit=crop&face"),isFollowed:(null==(s=e.author)?void 0:s.isFollowed)||!1,isAuthor:null==(o=e.author)?void 0:o.isAuthor,team:null==(r=e.author)?void 0:r.team},media:p,tag:e.tag||"#explore",title:e.title||"",content:e.content||"",reactions:{likes:(null==(i=e.reactions)?void 0:i.likes)||0,comments:(null==(c=e.reactions)?void 0:c.comments)||0,shares:(null==(d=e.reactions)?void 0:d.shares)||0,isLikedByCurrentUser:(null==(m=e.reactions)?void 0:m.isLikedByCurrentUser)||!1,isSavedByCurrentUser:(null==(u=e.reactions)?void 0:u.isSavedByCurrentUser)||!1},postedAt:e.postedAt}});return console.log("â
Social Transformer: Transformed ".concat(t.length," posts to full format")),t}(e),pagination:{currentPage:(null==(t=e.pagination)?void 0:t.currentPage)||1,maxPage:(null==(a=e.pagination)?void 0:a.maxPage)||1,totalItems:s.length},metadata:{feedType:n,lastUpdated:new Date}}}a.d(t,{$O:()=>o,JV:()=>r,Kq:()=>s,e0:()=>n,xD:()=>i})},62776:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var l=a(54568),n=a(80308);a(7620);var s=a(54642),o=a(99718);let r=e=>{var t;let{icon:a,count:r,onClick:i,isActive:c,postId:d,likedUsers:m,onViewLikedUsers:u,readOnly:h=!1,"data-testid":p}=e,x=()=>"HeartIcon"===a&&c?"solid":"outline";return h?(0,l.jsxs)("div",{className:"flex items-center gap-1","data-testid":p,children:[(0,l.jsx)(n.BL,{name:a,variant:x(),className:"w-6 h-6 ".concat(c?"text-pink-400":"text-gray-600")}),(0,l.jsx)(n.qb,{className:"text-gray-900 font-medium",children:r})]}):(0,l.jsxs)("div",{className:"flex items-center gap-1 transition-opacity",children:["PaperAirplaneIcon"===a?(0,l.jsx)("div",{"data-testid":p,children:(0,l.jsx)(o.A,{postId:null!=d?d:""})}):(0,l.jsx)("button",{onClick:i,className:"cursor-pointer hover:opacity-70","data-testid":p,children:(0,l.jsx)(n.BL,{name:a,variant:x(),className:"w-6 h-6 ".concat(c?"text-pink-400":"text-gray-600")})}),(0,l.jsx)("div",{onClick:"HeartIcon"===a?()=>{u&&(!m||0===m.length)&&u()}:void 0,children:"HeartIcon"===a?(0,l.jsx)("div",{className:"cursor-pointer",children:(0,l.jsx)(s.D,{likes:r,likedUsers:null!=m?m:[],anonymousLikes:Math.max(0,r-(null!=(t=null==m?void 0:m.length)?t:0))})}):(0,l.jsx)(n.qb,{className:"text-gray-900 font-medium",children:r})})]})}},81702:(e,t,a)=>{Promise.resolve().then(a.bind(a,54779)),Promise.resolve().then(a.bind(a,84915)),Promise.resolve().then(a.bind(a,54289)),Promise.resolve().then(a.bind(a,76206)),Promise.resolve().then(a.bind(a,91728)),Promise.resolve().then(a.bind(a,57175)),Promise.resolve().then(a.bind(a,34577)),Promise.resolve().then(a.bind(a,26388)),Promise.resolve().then(a.bind(a,87606)),Promise.resolve().then(a.bind(a,24199)),Promise.resolve().then(a.bind(a,99757)),Promise.resolve().then(a.bind(a,63339)),Promise.resolve().then(a.bind(a,16258)),Promise.resolve().then(a.bind(a,4049)),Promise.resolve().then(a.bind(a,84007)),Promise.resolve().then(a.bind(a,67933)),Promise.resolve().then(a.bind(a,3149)),Promise.resolve().then(a.bind(a,82613)),Promise.resolve().then(a.bind(a,38237)),Promise.resolve().then(a.t.bind(a,44760,23))},84497:(e,t,a)=>{"use strict";a.d(t,{Gf:()=>m,iI:()=>h,FP:()=>u});var l=a(67933),n=a(16258),s=a(23654),o=a(43982),r=a(76800);let i=async(e,t,a,l,n,s)=>{var i;let c={sort:"newest"===a?"timestamp":a||"timestamp",...n&&{vpp:n},...s&&{accessToken:s}},d=function(e){if(e&&0!==e.length&&2!==e.length){if(e.includes("1"))return["a","c"];if(e.includes("0"))return["b","d"]}}(null==l?void 0:l.grade),m={...(null==l||null==(i=l.idJobfields)?void 0:i.length)&&{idJobfield:l.idJobfields},...d&&{grade:d}};console.log("[getReviewYousay] url:",r.YSHS_ENDPOINTS.list(e,t),"params:",c,"body:",m);let u=await o.Ay.post(r.YSHS_ENDPOINTS.list(e,t),m,{params:c});return console.log("[getReviewYousay] response:",JSON.stringify(u.data)),r.PostYsReviewListResponseSchema.parse(u.data)},c=async e=>{let t=await o.Ay.post(r.YSHS_ENDPOINTS.toggleLike,e),a=r.ToggleReviewLikeResponseSchema.safeParse(t.data);return a.success?a.data:(console.warn("[toggleReviewLike] schema mismatch (ignoring):",a.error.flatten()),t.data)};var d=a(84878);function m(e,t){var a,n;
1let{companyId:s,currentPage:o,itemsPerPage:r,sortBy:c,filterBy:d,accessToken:m,isAuthenticated:u}=e;return(0,l.useQuery)({queryKey:["ys-reviews",(a={companyId:s,page:o,itemsPerPage:r,sortBy:c,filterBy:d}).companyId,a.page,a.itemsPerPage,null!=(n=a.sortBy)?n:"total",a.filterBy],queryFn:()=>i(s,o,c,d,r,m),enabled:!!s,...t,staleTime:3e5*!u})}function u(){return(0,n.useMutation)({mutationKey:["ys-toggle-review-like"],mutationFn:c})}function h(e,t){let a=(0,s.Ym)();return(0,l.useQuery)({queryKey:[...d.j.queryKeys.list(e),a],queryFn:()=>d.j.getReviewList(e),staleTime:3e4,...t})}},84878:(e,t,a)=>{"use strict";a.d(t,{j:()=>d});var l=a(88980),n=a(43982),s=a(72074);function o(e){var t,a,l,n,s,o,r;return{id:e.workExperienceId,idWork:e.legacyId,idReview:e.idReview,idEmp:e.idEmp,company:{companyId:null!=(o=e.companyId)?o:e.idEmp.toString(),companyName:e.companyName,companyLogo:null!=(r=e.companyLogo)?r:null,companyRating:0,companyReviewCount:0,dreamCompany:null,openPositions:0},jobPosition:e.jobTitle,jobField:null!=(t=e.jobfieldId)?t:"",employmentType:e.employmentType,employmentDurationFormatted:e.displayDuration,startMonth:e.startMonth,startYear:e.startYear,endMonth:e.endMonth,endYear:e.endYear,isJobCurrent:e.isCurrentlyWorking,currentSalary:e.currentSalary,salaryCurrency:null!=(a=e.salaryCurrency)?a:"",salaryPeriod:null!=(l=e.salaryPeriod)?l:"",jobStartDate:null,jobEndDate:null,jobType:0,currencyId:0,salaryFrequencyId:0,lockReview:!1,completeStatus:e.completeStatus,statusReview:e.statusReview,status:function(e){switch(e){case"NOT_REVIEWED":return null;case"DRAFT":return"draft";case"PENDING":return"pending";case"PUBLISHED":return"published";case"REJECTED":return"rejected";case"RETURN_TO_EDIT":return"updated";case"NOT_COMPANY":return"not_company";case"NOT_SURE":return"not_sure";default:return"other"}}(e.tabStatus),summary:null!=(n=e.comment21)?n:void 0,content:null!=(s=e.comment22)?s:void 0}}let r={list:"/api/v1/bff/yousay-review-serv/api-yousay/getReviewList"},i=l.Ik({workExperienceId:l.Yj(),companyName:l.Yj(),companyId:l.Yj().nullable(),idReview:l.ai(),idEmp:l.ai(),statusReview:l.Yj().nullable(),completeStatus:l.zM(),tabStatus:l.Yj(),id:l.Yj(),jobTitle:l.Yj(),predictedCompanyId:l.Yj().nullable().optional(),isCurrentlyWorking:l.zM(),startDate:l.Yj().optional(),startMonth:l.Yj(),startYear:l.Yj(),endDate:l.Yj().optional(),endMonth:l.Yj().optional(),endYear:l.Yj().optional(),displayDuration:l.Yj(),tenureMonths:l.ai(),employmentType:l.Yj(),currentSalary:l.ai(),startSalary:l.ai().nullable().optional(),startPosition:l.Yj().nullable().optional(),salaryCurrency:l.Yj().nullable(),salaryPeriod:l.Yj().nullable(),responsibilities:l.Yj().nullable().optional(),keyAchievement:l.Yj().nullable().optional(),numberOfSubordinates:l.ai().nullable().optional(),legacyId:l.ai(),jobfieldId:l.Yj().nullable(),subjobfieldId:l.Yj().nullable().optional(),refCountryCompanyCode:l.Yj().nullable().optional(),refProvinceCompanyCode:l.Yj().nullable().optional(),refCompanySizeCode:l.Yj().nullable().optional(),otherCompanyProvince:l.Yj().nullable().optional(),companyBusiness:l.Yj().nullable().optional(),createdAt:l.Yj().optional(),updatedAt:l.Yj().optional(),comment21:l.Yj().nullable().optional(),comment22:l.Yj().nullable().optional(),companyLogo:l.Yj().nullable().optional()}),c=l.Ik({data:l.YO(i),success:l.ai()}),d={async getReviewList(e){try{let t=await n.H2.get(r.list,{params:e?{tab:e}:void 0});return c.parse(t.data).data.map(o)}catch(e){throw(0,s.yO)(e)}},queryKeys:{all:["reviews-written"],list:e=>["reviews-written","list",null!=e?e:"all"]},endpoints:r}},89635:(e,t,a)=>{"use strict";function l(e,t){let a=new Date(e),l=Math.floor(Math.floor((new Date().getTime()-a.getTime())/1e3)/60),n=Math.floor(l/60),s=Math.floor(n/24),o=Math.floor(s/7),r=Math.floor(s/30.44),i=Math.floor(s/365);return i>=1?"".concat(i," ").concat(t(1===i?"common.year":"common.years")).concat(t("common.ago")):r>=1?"".concat(r," ").concat(t(1===r?"common.month":"common.months")).concat(t("common.ago")):o>=1?"".concat(o," ").concat(t(1===o?"common.week":"common.weeks")).concat(t("common.ago")):s>=1?"".concat(s," ").concat(t(1===s?"common.day":"common.days")).concat(t("common.ago")):n>=1?"".concat(n," ").concat(t(1===n?"common.hour":"common.hours")).c
1oncat(t("common.ago")):l>=1?"".concat(l," ").concat(t(1===l?"common.minute":"common.minutes")).concat(t("common.ago")):t("common.just_now")}a.d(t,{tb:()=>l})},99718:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var l=a(54568),n=a(80308),s=a(7620),o=a(66869),r=a(66554);let i=e=>{var t,a;let{companySlugCId:i,locale:c="en",shareUrl:d,open:m,onOpenChange:u,onShare:h,shareBaseUrl:p}=e,x=(null!=p?p:(0,r.$C)()).replace(/\/$/,""),f=i?"".concat(x,"/").concat(c,"/companies/").concat(i):null,[g,v]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(d||f||void 0===globalThis.window)return;let{origin:e,pathname:t,search:a}=globalThis.location;v("".concat(e).concat(t).concat(a))},[d,f]);let y=null!=(a=null!=(t=null!=d?d:f)?t:g)?a:"".concat(x,"/").concat(c),[w,j]=(0,s.useState)(!1),{t:b}=(0,o.B)();return(0,l.jsxs)(n.aF,{open:m,onOpenChange:u,children:[(0,l.jsx)(n.g6,{asChild:!0,children:(0,l.jsx)(n.BL,{name:"PaperAirplaneIcon",className:"w-[24px] h-[24px] cursor-pointer text-gray-600 rotate-90"})}),(0,l.jsxs)(n.sK,{showCloseButton:!0,position:"center",fullScreenMobile:!1,className:"w-full max-w-[90vw] h-auto mx-auto md:max-w-[460px] md:max-h-[90vh] md:mx-0 md:w-[460px]",children:[(0,l.jsx)(n.rQ,{children:(0,l.jsx)(n.wt,{children:b("component.company_banner.company_share.share_you_say_hr_say")})}),(0,l.jsx)(n.cw,{className:"flex flex-col gap-[16px]",children:(0,l.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[(0,l.jsx)(n.qb,{className:"font-medium",children:b("component.share_modal.shared_link")}),(0,l.jsx)(n.J2,{value:y,placeholder:"url",buttonLabel:b(w?"component.share_modal.copied":"component.share_modal.copy"),buttonClassName:"text-body-3-desktop cursor-pointer",buttonIcon:(0,l.jsx)(n.BL,{name:"DocumentDuplicateIcon",className:"w-[20px] h-[20px]"}),onButtonClick:()=>{var e,t;null==(t=navigator)||null==(e=t.clipboard)||e.writeText(y),j(!0),null==h||h("copy"),setTimeout(()=>{j(!1)},1500)},autoFocus:!1,readOnly:!0,tabIndex:-1})]})})]})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.