1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9187],{3632:function(e,l,s){s.d(l,{Z:function(){return a}});var t=s(85893),i=s(41664),n=s.n(i),r=s(11163);function a(e){let{paths:l}=e,s=(0,r.useRouter)();return(0,t.jsx)("nav",{className:"text-gray-500 text-sm overflow-x-auto whitespace-nowrap custom-scroll",children:(0,t.jsx)("div",{className:"max-w-screen-xl mx-auto px-4",children:(0,t.jsxs)("div",{className:"flex space-x-2 items-center",children:[(0,t.jsx)("img",{src:"/icons/home.png",alt:"Profile",className:"w-4 h-4"}),l.filter(e=>e.label).map((e,i)=>(0,t.jsxs)("div",{className:"flex items-center space-x-2 mt-2",children:[i>0&&(0,t.jsx)("span",{className:"text-gray-400",children:"/"}),i===l.length-1?(0,t.jsx)("span",{className:"text-black font-semibold",children:e.label}):e.link?(0,t.jsx)(n(),{href:e.link,legacyBehavior:!0,locale:s.locale,children:(0,t.jsx)("a",{className:"text-gray-400 hover:text-gray-600",children:e.label})}):(0,t.jsx)("div",{className:"text-gray-400 line-clamp-1",children:e.label})]},i))]})})})}},94612:function(e,l,s){s.d(l,{Z:function(){return u}});var t=s(85893),i=s(67294),n=s(5152),r=s.n(n),a=s(45697),c=s.n(a);let d=e=>new Promise((l,s)=>{if(document.querySelector('script[src="'.concat(e,'"]'))){l();return}let t=document.createElement("script");t.src=e,t.async=!0,t.onload=l,t.onerror=s,document.body.appendChild(t)});var o=function(e,l){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!e.current||"true"!==e.current.dataset.dflipInitialized)return(async()=>{try{let s=e.current;if(!s||!l||"true"===s.dataset.dflipInitialized)return;if(window.jQuery||await d("/dflip/js/libs/jquery.min.js"),window.PDFJS=window.PDFJS||{},window.PDFJS.pdfjsWorkerSrc="/pdf.worker.min.js",window.PDFJS.workerSrc="/pdf.worker.min.js",await new Promise(e=>requestAnimationFrame(()=>e())),window.DFLIP||await d("/dflip/js/dflip.min.js"),await new Promise(e=>requestAnimationFrame(()=>e())),await new Promise(e=>setTimeout(e,50)),!window.jQuery||!window.DFLIP)throw Error("dFlip not ready");s.dataset.dflipInitialized="true",t.current=window.jQuery(s).flipBook(l,{webgl:!0,direction:1,duration:800,maxTextureSize:4096,autoEnableOutline:!1,autoEnableThumbnail:!1,overwritePDFOutline:!1,onReady:()=>console.log("dFlip ready"),onError:e=>console.error("dFlip error",e)})}catch(e){console.error("initFlipbook failed:",e)}})(),()=>{t.current&&(t.current.dispose&&t.current.dispose(),t.current._removeZoomListener&&t.current._removeZoomListener(),e.current&&(e.current.dataset.dflipInitialized="false"))}},[e,l,s]),t.current};let m=e=>{let{file:l,options:s={}}=e,n=(0,i.useRef)(null);return o(n,l,s),(0,t.jsx)("div",{ref:n,className:"_df_book","data-pdf-url":l,"data-mode":"pdf","data-webgl":"false",style:{width:"100%",height:"600px"}})};m.propTypes={file:c().string,options:c().object};var u=r()(()=>Promise.resolve(m),{ssr:!1})},66392:function(e,l,s){s.d(l,{Z:function(){return g}});var t=s(85893),i=s(93886);s(24985),s(71061);var n=s(41664),r=s.n(n),a=s(94612),c=s(63805),d=s(66308),o=s(67294),m=s(68341),u=s.n(m),x=s(25675),h=s.n(x),p=s(69740),v=s(53488);function f(e){let{fileUrl:l}=e,[s,i]=o.useState(!1),[n,r]=o.useState(!1),[a,c]=o.useState(""),[d,m]=o.useState(""),[u,x]=o.useState(null),[h,p]=o.useState([]),[v,f]=o.useState(""),j=()=>window.XLSX;o.useEffect(()=>{if(j()){i(!0);return}let e=setInterval(()=>{j()&&(i(!0),clearInterval(e))},200);return()=>clearInterval(e)},[]);let w=o.useCallback((e,l)=>{let s=j(),t=null!=l?l:e.SheetNames[0],i=e.Sheets[t];m(s.utils.sheet_to_html(i,{id:"sheetjs-table"})),f(t),p(e.SheetNames)},[]),g=o.useCallback(async()=>{if(s&&l){r(!0),c("");try{let e=await fetch(l);if(!e.ok)throw Error("à¹à¸«à¸¥à¸ URL à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸ (".concat(e.status,")"));let s=await e.arrayBuffer(),t=j().read(s,{cellDates:!0});x(t),w(t)}catch(l){var e;c(null!==(e=null==l?void 0:l.message)&&void 0!==e?e:"à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸«à¸¥à¸à¸à¸²à¸ URL à¹à¸à¹")}finally{r(!1)}}},[s,l,w]);o.useEffect(()=>{g()},[g]);let b=o.useCallback(async e=>
1{if(u)try{let l=j(),s=u.Sheets[e];m(l.utils.sheet_to_html(s,{id:"sheetjs-table"})),f(e),p(u.SheetNames)}catch(e){var l;c(null!==(l=null==e?void 0:e.message)&&void 0!==l?l:"à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¸¥à¸±à¸à¸à¸µà¸à¹à¸à¹")}},[u]);return(0,t.jsxs)("div",{className:"mx-auto p-6 space-y-4",children:[!s&&(0,t.jsx)("div",{className:"text-sm text-gray-600",children:"à¸à¸³à¸¥à¸±à¸à¹à¸à¸£à¸µà¸¢à¸¡ SheetJS à¹à¸«à¹à¸à¸£à¹à¸à¸¡à¹à¸à¹à¸à¸²à¸..."}),n&&(0,t.jsx)("div",{className:"text-sm text-gray-600",children:"à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¹à¸¥à¸°à¸à¸£à¸°à¸¡à¸§à¸¥à¸à¸¥à¹à¸à¸¥à¹..."}),a&&(0,t.jsx)("div",{className:"text-sm text-red-600",children:a}),h.length>1&&(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("label",{className:"text-sm font-medium",children:"à¹à¸¥à¸·à¸à¸à¸à¸µà¸"}),(0,t.jsx)("select",{value:v,onChange:e=>b(e.target.value),className:"rounded-md border border-gray-300 px-2 py-1",children:h.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]}),(0,t.jsx)("div",{id:"sheetjs-html",dangerouslySetInnerHTML:{__html:d}})]})}var j=function(e){var l;let{file:s,...i}=e,n=null==s?void 0:null===(l=s.ext)||void 0===l?void 0:l.toLowerCase(),r=".pdf"===n,c=[".xlsx",".xls",".csv"].includes(n);return s?(0,t.jsxs)("div",{...i,children:[c&&(0,t.jsx)(f,{fileUrl:null==s?void 0:s.url}),r&&(0,t.jsx)(a.Z,{file:null==s?void 0:s.url})]}):null};let w=e=>{let{files:l}=e,s=[".pdf",".csv",".xlsx",".xls"],t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return s.includes(e.toLowerCase())},[i,n]=(0,o.useState)(null),r=(0,o.useMemo)(()=>{let e=[];return Array.isArray(l)?e=l:l&&(e=[l]),e.map(e=>({...e,isViewable:t(e.ext)}))},[l]);return{currentViewFile:(0,o.useMemo)(()=>i||(Array.isArray(l)?l.find(e=>t(e.ext))||null:l&&t(l.ext)?l:null),[r,i]),fileList:r,handleSelectFile:e=>{n(e)}}};function g(e){var l,s,n,a,o,m,x,f,g;let{post:b,category:N,onShare:y,paths:C,description:k="",title:_=""}=e,S=w({files:null==b?void 0:b.file_pdf}),F=w({files:null==b?void 0:b.file_other}),I=e=>{if(!e)return;let l=e.split("/").pop(),s=document.createElement("a");s.href=e,s.download=l,s.target="_blank",s.rel="noopener noreferrer",document.body.appendChild(s),s.click(),document.body.removeChild(s)};return(0,t.jsxs)("div",{className:"max-w-screen-lg mx-auto mt-4 md:mt-8 px-4",children:[(0,t.jsx)(d.Z,{title:_||b.title,description:k||b.title,image:(null==b?void 0:null===(l=b.image)||void 0===l?void 0:l.url)||"/images/ditpimage.png",keywords:null==N?void 0:N.name,breadcrumbs:C}),(0,t.jsxs)("div",{className:"flex flex-col w-full",children:[(0,t.jsx)("div",{className:"shrink-0 mx-auto",children:(0,t.jsx)(h(),{className:"object-cover aspect-[2/1]",src:(null==b?void 0:null===(s=b.image)||void 0===s?void 0:s.url)&&(0,p.gU)(b.image.url)?b.image.url:"/images/ditpimage.png",alt:b.title,width:600,height:300,priority:!0})}),(0,t.jsxs)("div",{className:"mt-4",children:[(0,t.jsxs)("div",{className:"border-b pb-4",children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold text-gradient mb-2",children:b.title}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 mt-4",children:[(null==N?void 0:N.name)&&(0,t.jsx)("div",{className:"border rounded-xl bg-violet-100 px-4",children:(0,t.jsx)(r(),{href:"/category/".concat(encodeURIComponent(N.name)),children:(0,t.jsx)("div",{children:N.name})})}),(null==b?void 0:null===(n=b.category_post)||void 0===n?void 0:n.name)&&(0,t.jsx)("div",{className:"border rounded-xl bg-violet-100 px-4",children:(0,t.jsx)(r(),{href:"/category/posts/".concat(encodeURIComponent(null==b?void 0:null===(a=b.category_post)||void 0===a?void 0:a.name)),children:(0,t.jsx)("div",{className:"border rounded-xl bg-violet-100 px-4",children:(0,t.jsx)("div",{children:null==b?void 0:null===(o=b.category_post)||void 0===o?void 0:o.name})})})}),null==b?void 0:null===(m=b.tag)||void 0===m?void 0:m.map((e,l)=>(0,t.jsx)(r(),{href:"/post/tags/".concat(encodeURIComponent(null==e?void 0:e.tag_name)),children:(0,t.jsx)("div",{className:"border rounded-xl bg-violet-100 px-4",children:(0,t.jsx)("div",{children:e.tag_name})})},l))]})]}),(0,t.jsxs)("div",{className:"flex md:flex-row justify-between md:items-center mt-4",children:[(0,t.jsxs)("div",{className:"md:flex text-sm md:space-x-1",children:[(0,t.jsxs)("div",{className:"flex space-x-2 font-semibold",children:[(0,t.jsx)("div",{children:"à¹à¸à¸¢ "}),(0,t.jsx)(r(),{href:"/author/".concat(encodeURIComponent(null==b?void 0:null===(x=b.createdBy)||void 0===x?void 0:x.username)),children:null===(f=b.createdBy)||void 0===f?void 0:f.username})," ",(0,t.jsx)("div",{className:"hidden md:block",children:"â¢"})]}),(0,t.jsxs)("div",{children:["ลà¸à¹à¸¡à¸·à¹à¸"," ",(0,c.DO)((null==b?void 0:b.publish_date)||(null==b?void 0:b.current_publish)||(null==b?void 0:b.createdAt),b.locale)]})]}),(0,t.jsxs)("div",{className:"flex space-x-6",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-[15px] h-[15px] fill-[#8e8e8e]",viewBox:"0 0 576 512",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"})}),(0,t.jsx)("div",{className:"text-sm ml-2",children:b.number_read})]}),(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)("svg",{className:"w-w-[15p
1x] h-[15px]",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M307 34.8c-11.5 5.1-19 16.6-19 29.2v64H176C78.8 128 0 206.8 0 304C0 417.3 81.5 467.9 100.2 478.1c2.5 1.4 5.3 1.9 8.1 1.9c10.9 0 19.7-8.9 19.7-19.7c0-7.5-4.3-14.4-9.8-19.5C108.8 431.9 96 414.4 96 384c0-53 43-96 96-96h96v64c0 12.6 7.4 24.1 19 29.2s25 3 34.4-5.4l160-144c6.7-6.1 10.6-14.7 10.6-23.8s-3.8-17.7-10.6-23.8l-160-144c-9.4-8.5-22.9-10.6-34.4-5.4z"})}),(0,t.jsx)("div",{className:"text-sm ml-2",children:b.number_share})]})]})]}),(null==b?void 0:b.content_html)&&(0,t.jsx)("div",{className:"mt-8 border-b pb-6",children:(0,t.jsx)("div",{className:"break-words",children:u()(b.content_html)})}),(null===(g=S.currentViewFile)||void 0===g?void 0:g.url)&&(0,t.jsxs)("div",{className:"z-20 mt-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"text-sm text-gray-600",children:["à¸à¸³à¸¥à¸±à¸à¹à¸à¸´à¸à¸à¸¹: ",(0,t.jsxs)("span",{className:"font-medium",children:[S.currentViewFile.name," "]})]}),(0,t.jsx)("a",{href:S.currentViewFile.url,target:"_blank",rel:"noopener noreferrer",className:"text-sm text-[#10143C] underline",children:"à¹à¸à¸´à¸à¹à¸à¹à¸à¹à¸à¹à¸«à¸¡à¹"})]}),(0,t.jsx)(j,{file:S.currentViewFile})]}),S.fileList.length>0&&(0,t.jsx)("div",{className:"mt-4",role:"list","aria-label":"รายà¸à¸²à¸£à¹à¸à¸¥à¹ PDF",children:S.fileList.map((e,l)=>{var s;let i=e.documentId===(null===(s=S.currentViewFile)||void 0===s?void 0:s.documentId);return(0,t.jsxs)("div",{role:"listitem",className:"flex items-center space-x-4 mt-2",children:[(0,t.jsxs)("div",{className:"line-clamp-1 md:w-[944px] ".concat(i?"text-[#10143C] font-medium":""),children:[e.name,i&&(0,t.jsx)("span",{className:"ml-2 text-xs text-[#10143C] bg-violet-100 rounded px-2 py-0.5",children:"à¸à¸³à¸¥à¸±à¸à¹à¸à¸´à¸à¸à¸¹"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[e.isViewable&&(0,t.jsx)("button",{onClick:()=>!i&&S.handleSelectFile(e),"aria-current":i?"true":"false","aria-pressed":i,title:i?"à¸à¸³à¸¥à¸±à¸à¹à¸à¸´à¸à¸à¸¹à¹à¸à¸¥à¹à¸à¸µà¹":"à¹à¸à¸´à¸à¸à¸¹à¹à¸à¸¥à¹à¸à¸µà¹",className:"py-3 px-4 border rounded-full text-white bg-[#10143C] border-[#10143C] ".concat(i?"pointer-events-none opacity-60":"hover:bg-violet-50"),children:(0,t.jsx)("div",{className:"text-center",children:(0,t.jsx)(v.Z,{size:20})})}),(0,t.jsx)("button",{onClick:()=>I(null==e?void 0:e.url),className:"w-[350px] bg-[#10143C] py-3 px-4 border border-gray-200 rounded-full md:w-[155px]",children:(0,t.jsx)("div",{className:"text-center text-white",children:"à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸"})})]})]},l)})}),F.fileList.length>0&&(0,t.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,t.jsx)("div",{className:"font-semibold",children:"Other files"}),F.fileList.map((e,l)=>(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,t.jsx)("div",{className:"line-clamp-1 md:w-[944px]",children:e.name}),(0,t.jsx)("div",{className:"flex items-center space-x-2",children:(0,t.jsx)("button",{onClick:()=>I(null==e?void 0:e.url),className:"w-[350px] bg-[#10143C] py-3 px-4 border border-gray-200 rounded-full md:w-[155px]",children:(0,t.jsx)("div",{className:"text-center text-white",children:"à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸"})})})]},l))]}),(0,t.jsx)(i.Z,{onShare:y})]})]})]})}},93886:function(e,l,s){var t=s(85893),i=s(11163),n=s(67294),r=s(41664),a=s.n(r);l.Z=e=>{let{onShare:l}=e;(0,i.useRouter)();let[s,r]=(0,n.useState)("");(0,n.useEffect)(()=>{r(window.location.href)},[]);let c=e=>{window.open(e,"_blank"),l&&l()};return(0,t.jsxs)("div",{className:"mt-6",children:[(0,t.jsx)("div",{className:"font-semibold",children:"Share :"}),(0,t.jsxs)("div",{className:"flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>c("https://www.facebook.com/sharer/sharer.php?u=".concat(encodeURIComponent(s))),children:(0,t.jsx)("img",{src:"/social/facebook.png",alt:"Facebook",className:"w-9 h-9"})}),(0,t.jsx)("button",{onClick:()=>c("https://social-plugins.line.me/lineit/share?url=".concat(encodeURIComponent(s))),children:(0,t.jsx)("img",{src:"/social/line.png",alt:"Line",className:"w-9 h-9 rounded-full"})}),(0,t.jsx)("button",{onClick:()=>c("https://twitter.com/intent/tweet?url=".concat(encodeURIComponent(s))),children:(0,t.jsx)("img",{src:"/social/x.jpg",alt:"X",className:"w-9 h-9 rounded-full"})}),(0,t.jsx)("button",{onClick:()=>c("https://www.linkedin.com/shareArticle?mini=true&url=".concat(encodeURIComponent(s))),children:(0,t.jsx)("img",{src:"/social/in.png",alt:"LinkedIn",className:"w-9 h-9"})}),(0,t.jsx)("button",{onClick:()=>
1c("https://api.whatsapp.com/send?text=".concat(encodeURIComponent(s))),children:(0,t.jsx)("img",{src:"/social/whatsapp.png",alt:"WhatsApp",className:"w-9 h-9 rounded-full"})}),(0,t.jsx)(a(),{href:"https://www.instagram.com/",target:"_blank",children:(0,t.jsx)("div",{children:(0,t.jsx)("img",{src:"/social/instagram.png",alt:"Instagram",className:"w-10 h-10 rounded-full"})})})]})]})}}}]);
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.