1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3433],{44179:function(e,t,n){"use strict";var i=n(64836);t.Z=void 0;var a=i(n(64938)),r=n(85893);t.Z=(0,a.default)((0,r.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"}),"CheckCircleOutlineOutlined")},51161:function(e,t,n){"use strict";var i=n(64836);t.Z=void 0;var a=i(n(64938)),r=n(85893);t.Z=(0,a.default)((0,r.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"}),"ErrorOutlineOutlined")},1386:function(e,t,n){"use strict";n(67294);var i=n(1905),a=n(51161),r=n(85893);t.Z=function(e){var t=e.show,n=e.onHide,s=e.size,c=e.text,l=e.cancel_btn,o=e.ref_id,d=e.onConfirm;return(0,r.jsx)(i.Z,{className:"modal-alert",centered:!0,show:t,onHide:n,size:s,children:(0,r.jsx)(i.Z.Body,{children:(0,r.jsx)("form",{children:(0,r.jsxs)("div",{className:"row mt-4 justify-content-center",children:[(0,r.jsx)("div",{className:"col-12",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)(a.Z,{color:"error",sx:{fontSize:90}})})}),(0,r.jsx)("div",{className:"col-12 my-4",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("h4",{children:c})})}),(0,r.jsx)("div",{className:"col-12 mb-4",children:(0,r.jsxs)("div",{className:"text-center",children:[l&&(0,r.jsx)("button",{type:"button",className:"buttonSecondary",onClick:n,children:"Cancel"}),(0,r.jsx)("button",{type:"button",className:"buttonPrimary",onClick:function(e){d?(d(o||null),n()):n()},children:"Confirm"})]})})]})})})})}},51229:function(e,t,n){"use strict";n(67294);var i=n(1905),a=n(11163),r=n(44179),s=n(85893);t.Z=function(e){var t=e.route,n=e.onHide,c=e.clickRoute,l=e.otherModal,o=function(e){t?(a.default.push(t),n(),l&&l()):(n(),l&&l())};return(0,s.jsx)(i.Z,{className:"modal-alert",centered:!0,show:e.show,onHide:c||o,size:e.size,children:(0,s.jsx)(i.Z.Body,{children:(0,s.jsx)("form",{children:(0,s.jsxs)("div",{className:"row mt-4 justify-content-center",children:[(0,s.jsx)("div",{className:"col-12",children:(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)(r.Z,{color:"primary",sx:{fontSize:90}})})}),(0,s.jsx)("div",{className:"col-12 my-4",children:(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)("h4",{children:e.text})})}),(0,s.jsx)("div",{className:"col-12 mb-4",children:(0,s.jsx)("div",{className:"text-center",children:(0,s.jsx)("button",{type:"button",className:"buttonPrimary",onClick:c||o,children:"OK"})})})]})})})})}},83678:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return N}});var i=n(67294),a=n(11163),r=n(85260),s=n(41664),c=n(53023),l=n(1386),o=(n(6929),n(8677)),d=n(63906),u=n(9573),h=n(56011),g=n(3694),x=n(46926),m=n(38732),v=n(85893),j=function(e){var t=(0,i.useState)(!1),n=t[0],a=t[1],r=(0,i.useState)(!1),j=r[0],f=r[1],p=e.query.page_id,N=(0,i.useState)(!1),b=(N[0],N[1]),_=(0,i.useState)(25),y=_[0],Z=(_[1],(0,i.useState)(1)),S=Z[0],w=(Z[1],(0,i.useState)({})),D=w[0],C=(w[1],function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.page=S,e.limit=y,D.orderby&&(e.orderby=D.orderby),D.op&&(e.op=D.op),b(!0),c.Z.getSubPageAll(e,p).then((function(e){var t=e.data.sub_page;f(t),b(!1)})).catch((function(e){console.log(e),console.log(e.response),b(!1)}))});(0,i.useEffect)((function(){C()}),[p,y,S,D]);var z=(0,i.useState)(),k=z[0],M=z[1];return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(d.Z,{sx:{width:"100%",overflowX:"auto"},children:(0,v.jsxs)(u.Z,{children:[(0,v.jsx)(h.Z,{children:(0,v.jsxs)(g.Z,{children:[(0,v.jsx)(x.Z,{children:"#"}),(0,v.jsx)(x.Z,{children:"Detail"}),(0,v.jsx)(x.Z,{children:"Name"}),(0,v.jsx)(x.Z,{children:"Slug"}),(0,v.jsx)(x.Z,{style:{textAlign:"center"},colSpan:4,children:"Manage"})]})}),(0,v.jsx)(m.Z,{children:j?null===j||void 0===j?void 0:j.map((function(t,n){return(0,v.jsxs)(g.Z,{hover:!0,children:[(0,v.jsx)(x.Z,{children:n+1}),(0,v.jsx)(x.Z,{children:(0,o.VQ)(null===t||void 0===t?void 0:t.trans,"th","name")}),(0,v.jsx)(x.Z,{children:(0,o.VQ)(null===t||void 0===t?void 0:t.trans,"en","name")}),(0,v.jsx)(x.Z,{children:null===t||void 0===t?void 0:t.slug}),(0,v.jsx)(x.Z,{style:{textAlign:"right"},children:(0,v.jsx)(s.default,{href:"/backend/page_customize/sub_page/".concat(e.query.page_id,"/contents/").concat(t.sub_page_id),children:(0,v.jsxs)("a",{className:"buttonSecondary",children:["Customize ",(0,v.jsx)("i",{className:"fa fa-pencil-alt"})]})})}),(0,v.jsx)(x.Z,{style:{textAlign:"right"},children:(0,v.jsx)(s.default,{href:"/backend/page_customize/sub_page/".concat(e.query.page_id,"/edit/").concat(t.sub_page_id),children:(0,v.jsxs)("a",{className:"buttonSecondary",children:["Edit ",(0,v.jsx)("i",{className:"fa fa-pencil-alt"})]})})}),(0,v.jsx)(x.Z,{style:{textAlign:"right"},children:(0,v.jsxs)("a",{className:"buttonDelete",onClick:function(){return function(e){M(e),a(!0)}(t.sub_page_id)}
1,children:["Delete ",(0,v.jsx)("i",{className:"fa fa-trash"})]})})]},n)})):[]})]})}),(0,v.jsx)(l.Z,{show:n,text:"Do you confirm to delete this ?",size:"md",cancel_btn:!0,onConfirm:function(){k&&c.Z.delSubPage(k).then((function(e){e.data,C(),a(!1)})).catch((function(e){console.log(e.response)}))},ref_id:k,onHide:function(){return a(!1)}})]})},f=(n(51229),n(34155)),p=function(e){var t=e.query,n=(0,a.useRouter)().query.page_id,i=(0,o.ju)(n);return(0,v.jsx)(v.Fragment,{children:(0,v.jsx)(r.Z,{title:i.title,pageProps:{mainPage:"thainamthip",page:i.page,subpage:i.subpage},pageTopNav:i.title,dataBreadcrumb:[{name:i.title,href:"/backend/page_customize",as:"/backend/page_customize",active:!1}],children:(0,v.jsx)("div",{className:"main-content",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)("div",{className:"row justify-content-end mb-4",children:(0,v.jsx)("div",{className:"col-6",children:(0,v.jsx)("div",{className:"text-right",children:"dev"==f.env.NEXT_PUBLIC_NODE_ENV&&(0,v.jsx)(s.default,{href:"/backend/page_customize/sub_page/".concat(n,"/create"),children:(0,v.jsx)("a",{className:"buttonPrimary",children:"Create"})})})})}),(0,v.jsx)("div",{className:"divider"}),(0,v.jsx)("div",{className:"row justify-content-center mx-0",children:(0,v.jsx)("div",{className:"col-12 px-0",children:(0,v.jsx)(j,{query:t})})})]})})})})};p.getInitialProps=function(e){return{query:e.query}};var N=p},6929:function(e,t){"use strict";t.Z={formatDate:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"th",s=new Date(e),c="en-US";if("th"==r&&(c="th-TH"),t){var l={month:i?"short":"long",day:"2-digit"};return a&&(l.year="numeric"),n&&(l.hour="2-digit",l.minute="2-digit"),s.toLocaleDateString(c,l)}l={month:"2-digit",day:"2-digit"};return a&&(l.year="numeric"),n&&(l.hour="2-digit",l.minute="2-digit"),s.toLocaleDateString(c,l).replace(/\//g,"-")},formatNumber:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return!isNaN(e)&&e>=1?(e=parseFloat(e)).toFixed(t).replace(",",".").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,"):parseFloat(0).toFixed(t).replace(",",".").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")},formatNumberGlobal:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e=parseFloat(e)).toFixed(t).replace(",",".").replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")},formatDateThai:function(e){var t=new Date(e),n=(t.getMonth()+1).toString().padStart(2,"0");return[t.getDate().toString().padStart(2,"0"),n,(t.getFullYear()+543).toString()].join("/")},getDate:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"-",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"th",i=new Date(e),a=""+(i.getMonth()+1),r=""+i.getDate(),s=i.getFullYear();i.getHours();r.length<2&&(r="0"+r),a.length<2&&(a="0"+a);var c=[r,a,"th"==n?s+543:s].join(t);return c},getTime:function(e){var t=new Date(e),n=""+t.getHours(),i=""+t.getMinutes();t.getSeconds();return n.length<2&&(n="0"+n),i.length<2&&(i="0"+i),[n,i].join(":")},setDate:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Date(e),i=""+(n.getMonth()+1),a=""+n.getDate(),r=n.getFullYear(),s=""+n.getHours(),c=""+n.getMinutes();a.length<2&&(a="0"+a),i.length<2&&(i="0"+i),s.length<2&&(s="0"+s),c.length<2&&(c="0"+c);var l=[r,i,a].join("-"),o=[s,c].join(":");return l+(t?" "+o:"")},dateOrder:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Date(e),i=""+(n.getMonth()+1),a=""+n.getDate(),r=n.getFullYear(),s=""+n.getHours(),c=""+n.getMinutes();a.length<2&&(a="0"+a),i.length<2&&(i="0"+i),s.length<2&&(s="0"+s),c.length<2&&(c="0"+c);var l=[r,i,a].join("-"),o=[s,c].join(":");return l+(t?", "+o:"")},dateOrderPrint:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new Date(e),i=""+(n.getMonth()+1),a=""+n.getDate(),r=n.getFullYear(),s=""+n.getHours(),c=""+n.getMinutes();a.length<2&&(a="0"+a),i.length<2&&(i="0"+i),s.length<2&&(s="0"+s),c.length<2&&(c="0"+c);var l=[a,i,r].join("/"),o=[s,c].join(":");return l+(t?", "+o:"")}}},63406:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/backend/page_customize/sub_page/[page_id]",function(){return n(83678)}])}},function(e){e.O(0,[9774,4636,4170,9704,9125,3066,6233,5260,2888,179],(function(){return t=63406,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
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.