PageSourceSearch

https://thai.fit/static/js/5.0338e5e6.chunk.js

js thai.fit collected 2026-10-07 02:41:43 UTC 36,512 bytes, 1 lines download raw bytes

1(this["webpackJsonpfit-web"]=this["webpackJsonpfit-web"]||[]).push([[5],{1266:function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));r(1);var a=r(0);const s={success:"text-[color:var(--tf-success)] bg-[color:var(--tf-success-bg)]",warning:"text-[color:var(--tf-warning)] bg-[color:var(--tf-warning-bg)]",danger:"text-[color:var(--tf-danger)]  bg-[color:var(--tf-danger-bg)]",info:"text-[color:var(--tf-info)]    bg-[color:var(--tf-info-bg)]",primary:"text-[color:var(--tf-primary)] bg-[color:var(--tf-primary-light)]",accent:"text-amber-700 bg-amber-50",neutral:"text-[color:var(--tf-text-secondary)] bg-[color:var(--tf-bg)]"},c={sm:"text-xs px-2 py-0.5",md:"text-sm px-2.5 py-1"};function n(e){let{variant:t="neutral",size:r="sm",children:n,className:o=""}=e;return Object(a.jsx)("span",{className:"inline-flex items-center gap-1 font-semibold rounded-[var(--tf-radius-badge)] ".concat(s[t]," ").concat(c[r]," ").concat(o),children:n})}},1276:function(e,t,r){"use strict";var a=r(2),s=r(1),c=r(3),n=r(6),o=r(0);const l=()=>Object(o.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[Object(o.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),Object(o.jsx)("polyline",{points:"17 8 12 3 7 8"}),Object(o.jsx)("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),i=()=>Object(o.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round","aria-hidden":"true",children:[Object(o.jsx)("polyline",{points:"3 6 5 6 21 6"}),Object(o.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),Object(o.jsx)("path",{d:"M10 11v6M14 11v6"})]});t.a=e=>{let{value:t,onChange:r,namePrefix:d="image",aspectRatio:b,hint:x}=e;const h=Object(s.useRef)(null),[j,u]=Object(s.useState)(!1),[f,m]=Object(s.useState)(0),[p,v]=Object(s.useState)(""),g=async e=>{if(e)if(e.type.startsWith("image/")){v(""),u(!0),m(0);try{const t="".concat(d,"-").concat(Date.now()),{data:a}=await Object(n.i)({url:c.a.apis.zone.image.upload(),file:e,name:t,resize:"xl",onUploadProgress:e=>{e.total&&m(Math.round(e.loaded/e.total*100))}}),s=c.a.apis.zone.image.view({name:a.name});r(s)}catch(t){v("\u0e2d\u0e31\u0e1b\u0e42\u0e2b\u0e25\u0e14\u0e44\u0e21\u0e48\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08 \u0e01\u0e23\u0e38\u0e13\u0e32\u0e25\u0e2d\u0e07\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07")}finally{u(!1),h.current&&(h.current.value="")}}else v("\u0e01\u0e23\u0e38\u0e13\u0e32\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e44\u0e1f\u0e25\u0e4c\u0e23\u0e39\u0e1b\u0e20\u0e32\u0e1e\u0e40\u0e17\u0e48\u0e32\u0e19\u0e31\u0e49\u0e19")};return Object(o.jsxs)("div",{children:[Object(o.jsx)("input",{ref:h,type:"file",accept:"image/*",style:{display:"none"},onChange:e=>g(e.target.files[0])}),t?Object(o.jsxs)("div",{style:b?{position:"relative",width:"100%",maxWidth:360,aspectRatio:b}:{position:"relative",display:"inline-block"},children:[Object(o.jsx)("img",{src:"".concat(t,"?size=lg"),alt:"preview",style:b?{width:"100%",height:"100%",objectFit:"cover",borderRadius:12,border:"1px solid var(--tf-border)",display:"block"}:{width:"100%",maxWidth:360,maxHeight:200,objectFit:"cover",borderRadius:12,border:"1px solid var(--tf-border)",display:"block"},onError:e=>{e.currentTarget.src=t}}),Object(o.jsxs)("div",{style:{position:"absolute",top:8,right:8,display:"flex",gap:6},children:[Object(o.jsxs)("button",{type:"button",onClick:()=>{var e;return null===(e=h.current)||void 0===e?void 0:e.click()},style:{padding:"5px 10px",borderRadius:8,background:"rgba(0,0,0,0.55)",backdropFilter:"blur(4px)",color:"#fff",fontSize:12,fontWeight:600,border:"none",cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[Object(o.jsx)(l,{})," \u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e23\u0e39\u0e1b"]}),Object(o.jsx)("button",{type:"button",onClick:()=>r(""),style:{width:30,height:30,borderRadius:8,background:"rgba(227,30,36,0.85)",backdropFilter:"blur(4px)",color:"#fff",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},"aria-label":"\u0e25\u0e1a\u0e23\u0e39\u0e1b",children:Object(o.jsx)(i,{})})]})]}):Object(o.jsx)("div",{onDrop:e=>{e.preventDefault();const t=e.dataTransfer.files[0];t&&g(t)},onDragOver:e=>e.preventDefault(),onClick:()=>{var e;return!j&&(null===(e=h.current)||void 0===e?void 0:e.click())},style:Object(a.a)(Object(a.a)({width:"100%",maxWidth:360},b?{aspectRatio:b}:{height:140}),{},{border:"2px dashed ".concat(j?"var(--tf-primary)":"var(--tf-border)"),borderRadius:12,background:j?"var(--tf-primary-light)":"var(--tf-bg)",cursor:j?"default":"pointer",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,transition:"all 0.2s"}),children:j?Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{style:{width:"60%",height:6,background:"var(--tf-border)",borderRadius:3,overflow:"hidden"},children:Object(o.jsx)("div",{style:{height:"100%",width:"".concat(f,"%"),background:"var(--tf-primary)",borderRadius:3,transition:"width 0.2s"}})}),Object(o.jsxs)("div",{style:{fontSize:12,color:"var(--tf-primary)",fontWeight:600},children:["\u0e01\u0e33\u0e25\u0e31\u0e07\u0e2d\u0e31\u0e1b\u0e42\u0e2b\u0e25\u0e14 ",f,"%"]})]}):Object(o.jsxs)(o.Fragment,{children:[Object(o.jsx)("div",{style:{width:40,height:40,borderRadius:"50%",background:"var(--tf-primary-light)",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--tf-primary)"},children:Object(o.jsx)(l,{})}),Object(o.jsxs)("div",{style:{textAlign:"center"},children:[Object(o.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"var(--tf-text-primary)"},children:"\u0e04\u0e25\u0e34\u0e01\u0e2b\u0e23\u0e37\u0e2d\u0e25\u0e32\u0e01\u0e23\u0e39\u0e1b\u0e20\u0e32\u0e1e\u0e21\u0e32\u0e27\u0e32\u0e07\u0e17\u0e35\u0e48\u0e19\u0e35\u0e48"}),Object(o.jsx)("div",{style:{fontSize:11,color:"var(--tf-text-secondary)",marginTop:2},children:x||"PNG, JPG, WEBP \u2014 \u0e41\u0e19\u0e30\u0e19\u0e33 1200\xd7630px"})]})]})}),p&&Object(o.jsx)("div",{style:{marginTop:4,fontSize:12,color:"var(--tf-danger)"},children:p})]})}},1331:function(e,t,r){"use strict";var a=r(1),s=r(68),c=r(3),n=r(6),o=r(0);const l=e=>{if(!e)return"-";const t=e.userId;return null!=t?"FIT-".concat(String(t).padStart(8,"0")):"-"},i=e=>{const t=e.profile;if(!t)return"-";
1return[t.firstname,t.lastname].filter(Boolean).join(" ")||"-"},d=e=>{let{user:t}=e;const r=t.profile,a=r&&r.photoFile;if(a){const e=c.a.apis.user.image.view({name:a});return Object(o.jsx)("img",{src:"".concat(e,"?size=sm"),alt:"",className:"w-9 h-9 rounded-full object-cover flex-shrink-0 bg-gray-100"})}const s=(r&&r.firstname||t.email||"?")[0].toUpperCase();return Object(o.jsx)("div",{className:"w-9 h-9 rounded-full flex-shrink-0 flex items-center justify-center bg-[color:var(--tf-primary-light)] text-[color:var(--tf-primary)] text-sm font-bold",children:s})};t.a=e=>{let{open:t,onClose:r,initialSelected:b=[],onConfirm:x}=e;const[h,j]=Object(a.useState)(""),[u,f]=Object(a.useState)(1),[m,p]=Object(a.useState)([]),[v,g]=Object(a.useState)(0),[O,y]=Object(a.useState)(!1),[N,w]=Object(a.useState)([]),C=Object(a.useRef)(null),k=Object(a.useRef)(null);Object(a.useEffect)((()=>{t&&(w(b||[]),j(""),f(1),p([]),g(0),setTimeout((()=>{var e;return null===(e=C.current)||void 0===e?void 0:e.focus()}),50))}),[t]);const I=Object(a.useCallback)(((e,t)=>{y(!0);const r=/^\d+$/.test(e.trim());Object(n.g)({url:c.a.apis.user.user[r?"searchlike2":"searchlike"](),data:r?{userId:e.trim()}:{search:e.trim()}}).then((e=>{let{data:r}=e;const a=r.users||[];g(a.length),p(a.slice(7*(t-1),7*t))})).catch((()=>{p([]),g(0)})).finally((()=>y(!1)))}),[]),A=e=>{f(e),h.trim()&&I(h,e)},S=e=>N.some((t=>t._id===e._id)),T=Math.max(1,Math.ceil(v/7));return t?Object(s.createPortal)(Object(o.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[Object(o.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:r}
1),Object(o.jsxs)("div",{className:"relative w-full max-w-3xl bg-[color:var(--tf-surface)] rounded-[var(--tf-radius-card)] shadow-[var(--tf-shadow-lg)] flex flex-col max-h-[90vh] overflow-hidden",children:[Object(o.jsxs)("div",{className:"flex items-center justify-between px-6 pt-5 pb-4 border-b border-[color:var(--tf-border)]",children:[Object(o.jsxs)("div",{children:[Object(o.jsx)("h2",{className:"text-base font-bold text-[color:var(--tf-text-primary)]",children:"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49"}),Object(o.jsx)("p",{className:"text-xs text-[color:var(--tf-text-secondary)] mt-0.5",children:"\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e14\u0e49\u0e27\u0e22\u0e0a\u0e37\u0e48\u0e2d, \u0e2d\u0e35\u0e40\u0e21\u0e25 \u0e2b\u0e23\u0e37\u0e2d FIT ID"})]}),Object(o.jsx)("button",{onClick:r,className:"w-9 h-9 flex items-center justify-center rounded-full hover:bg-[color:var(--tf-bg)] text-[color:var(--tf-text-secondary)]",children:Object(o.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5","aria-hidden":"true",children:Object(o.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),Object(o.jsx)("div",{className:"px-6 py-3 border-b border-[color:var(--tf-border)]",children:Object(o.jsxs)("div",{className:"relative",children:[Object(o.jsxs)("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-[color:var(--tf-text-secondary)]",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[Object(o.jsx)("circle",{cx:"11",cy:"11",r:"8"}),Object(o.jsx)("path",{d:"m21 21-4.35-4.35"})]}),Object(o.jsx)("input",{ref:C,type:"text",value:h,onChange:e=>(e=>{if(j(e),f(1),clearTimeout(k.current),!e.trim())return p([]),void g(0);k.current=setTimeout((()=>I(e,1)),350)})(e.target.value),placeholder:"\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e14\u0e49\u0e27\u0e22\u0e0a\u0e37\u0e48\u0e2d, \u0e2d\u0e35\u0e40\u0e21\u0e25 \u0e2b\u0e23\u0e37\u0e2d FIT ID",className:"w-full pl-9 pr-4 py-2 text-sm border border-[color:var(--tf-border)] rounded-[var(--tf-radius-input)] bg-[color:var(--tf-surface)] focus:outline-none focus:ring-2 focus:ring-[color:var(--tf-primary)] focus:border-transparent"})]})}),Object(o.jsxs)("div",{className:"flex flex-1 min-h-0 divide-x divide-[color:var(--tf-border)]",children:[Object(o.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[Object(o.jsx)("div",{className:"px-4 py-2 text-xs font-semibold text-[color:var(--tf-text-secondary)] border-b border-[color:var(--tf-border)] bg-[color:var(--tf-bg)]",children:v>0?"\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e17\u0e35\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e44\u0e14\u0e49 (".concat(v.toLocaleString()," \u0e04\u0e19)"):"\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e49\u0e19\u0e2b\u0e32"}),Object(o.jsx)("div",{className:"flex-1 overflow-y-auto",children:O?Object(o.jsx)("div",{className:"py-8 text-center text-sm text-[color:var(--tf-text-secondary)]",children:"\u0e01\u0e33\u0e25\u0e31\u0e07\u0e04\u0e49\u0e19\u0e2b\u0e32..."}):0===m.length?Object(o.jsx)("div",{className:"py-8 text-center text-sm text-[color:var(--tf-text-secondary)]",children:h?"\u0e44\u0e21\u0e48\u0e1e\u0e1a\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49":"\u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e0a\u0e37\u0e48\u0e2d/\u0e2d\u0e35\u0e40\u0e21\u0e25/FIT ID \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e49\u0e19\u0e2b\u0e32"}):Object(o.jsx)("div",{className:"divide-y divide-[color:var(--tf-border)]",children:m.map((e=>Object(o.jsxs)("label",{className:"flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-[color:var(--tf-bg)] transition-colors",children:[Object(o.jsx)("input",{type:"checkbox",checked:S(e),onChange:()=>(e=>{w((t=>S(e)?t.filter((t=>t._id!==e._id)):[...t,e]))})(e),className:"w-4 h-4 accent-[color:var(--tf-primary)] cursor-pointer"}),Object(o.jsx)(d,{user:e}),Object(o.jsxs)("div",{className:"flex-1 min-w-0",children:[Object(o.jsx)("div",{className:"text-sm font-medium text-[color:var(--tf-text-primary)] truncate",children:i(e)}),Object(o.jsx)("div",{className:"text-xs text-[color:var(--tf-text-secondary)] truncate",children:e.email})]}),Object(o.jsx)("div",{className:"text-xs text-[color:var(--tf-text-secondary)] flex-shrink-0",children:l(e)})]},e._id)))})}),T>1&&Object(o.jsxs)("div",{className:"flex items-center justify-center gap-1 px-4 py-2 border-t border-[color:var(--tf-border)]",children:[Object(o.jsx)("button",{onClick:()=>A(Math.max(1,u-1)),disabled:1===u,className:"w-7 h-7 rounded text-sm disabled:opacity-30 hover:bg-[color:var(--tf-bg)
1]",children:"\u2039"}),Array.from({length:Math.min(T,7)},((e,t)=>{const r=u<=4?t+1:u-3+t;return r<1||r>T?null:Object(o.jsx)("button",{onClick:()=>A(r),className:"w-7 h-7 rounded text-xs font-medium\n                                                ".concat(r===u?"bg-[color:var(--tf-primary)] text-white":"hover:bg-[color:var(--tf-bg)] text-[color:var(--tf-text-secondary)]"),children:r},r)})),T>7&&Object(o.jsx)("span",{className:"text-xs text-[color:var(--tf-text-secondary)] px-1",children:"..."}),T>7&&Object(o.jsx)("button",{onClick:()=>A(T),className:"w-7 h-7 rounded text-xs hover:bg-[color:var(--tf-bg)] text-[color:var(--tf-text-secondary)]",children:T}),Object(o.jsx)("button",{onClick:()=>A(Math.min(T,u+1)),disabled:u===T,className:"w-7 h-7 rounded text-sm disabled:opacity-30 hover:bg-[color:var(--tf-bg)]",children:"\u203a"})]})]}),Object(o.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 px-3 py-4 bg-[color:var(--tf-bg)]",children:[Object(o.jsx)("button",{onClick:()=>{m.forEach((e=>{S(e)||w((t=>[...t,e]))}))},className:"px-3 py-1.5 rounded-[var(--tf-radius-btn)] bg-[color:var(--tf-primary)] text-white text-xs font-semibold hover:opacity-90 whitespace-nowrap",children:"\u0e40\u0e1e\u0e34\u0e48\u0e21 \u2192"}),Object(o.jsx)("button",{onClick:()=>{const e=new Set(m.map((e=>e._id)));w((t=>t.filter((t=>!e.has(t._id)))))},className:"px-3 py-1.5 rounded-[var(--tf-radius-btn)] border border-[color:var(--tf-danger)] text-[color:var(--tf-danger)] text-xs font-semibold hover:bg-[color:var(--tf-danger-bg)] whitespace-nowrap",children:"\u2190 \u0e25\u0e1a\u0e2d\u0e2d\u0e01"})]}),Object(o.jsxs)("div",{className:"w-64 flex flex-col min-h-0",children:[Object(o.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b border-[color:var(--tf-border)] bg-[color:var(--tf-bg)]",children:[Object(o.jsxs)("span",{className:"text-xs font-semibold text-[color:var(--tf-text-secondary)]",children:["\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e17\u0e35\u0e48\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e41\u0e25\u0e49\u0e27 (",N.length," \u0e04\u0e19)"]}),N.length>0&&Object(o.jsx)("button",{onClick:()=>w([]),className:"text-xs text-[color:var(--tf-primary)] hover:underline",children:"\u0e25\u0e49\u0e32\u0e07\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14"})]}),Object(o.jsx)("div",{className:"flex-1 overflow-y-auto divide-y divide-[color:var(--tf-border)]",children:0===N.length?Object(o.jsx)("div",{className:"py-8 text-center text-xs text-[color:var(--tf-text-secondary)]",children:"\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e40\u0e25\u0e37\u0e2d\u0e01"}):N.map((e=>Object(o.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2",children:[Object(o.jsx)(d,{user:e}),Object(o.jsxs)("div",{className:"flex-1 min-w-0",children:[Object(o.jsx)("div",{className:"text-xs font-medium text-[color:var(--tf-text-primary)] truncate",children:i(e)}),Object(o.jsx)("div",{className:"text-[11px] text-[color:var(--tf-text-secondary)] truncate",children:e.email}),Object(o.jsx)("div",{className:"text-[11px] text-[color:var(--tf-text-secondary)]",children:l(e)})]}),Object(o.jsx)("button",{onClick:()=>{return t=e._id,w((e=>e.filter((e=>e._id!==t))));var t},className:"flex-shrink-0 w-5 h-5 rounded-full hover:bg-[color:var(--tf-bg)] flex items-center justify-center text-[color:var(--tf-text-secondary)]",children:Object(o.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:Object(o.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]},e._id)))})]})]}),Object(o.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-t border-[color:var(--tf-border)]",children:[Object(o.jsx)("div",{className:"text-sm text-[color:var(--tf-text-secondary)]",children:N.length>0?"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e41\u0e25\u0e49\u0e27 ".concat(N.length," \u0e04\u0e19"):"\u0e22\u0e31\u0e07\u0e44\u0e21\u0e48\u0e44\u0e14\u0e49\u0e40\u0e25\u0e37\u0e2d\u0e01"}),Object(o.jsxs)("div",{className:"flex gap-3",children:[Object(o.jsx)("button",{onClick:r,className:"px-4 py-2.5 rounded-[var(--tf-radius-btn)] border border-[color:var(--tf-border)] text-sm font-semibold hover:bg-[color:var(--tf-bg)
1] transition-colors min-h-[44px]",children:"\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01"}),Object(o.jsxs)("button",{onClick:()=>{x(N),r()},disabled:0===N.length,className:"px-5 py-2.5 rounded-[var(--tf-radius-btn)] bg-[color:var(--tf-primary)] text-white text-sm font-semibold hover:opacity-90 transition-opacity min-h-[44px] disabled:opacity-40",children:["\u0e22\u0e37\u0e19\u0e22\u0e31\u0e19\u0e01\u0e32\u0e23\u0e40\u0e25\u0e37\u0e2d\u0e01 (",N.length,")"]})]})]})]})]}),document.body):null}},1348:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return s})),r.d(t,"d",(function(){return c})),r.d(t,"c",(function(){return n})),r.d(t,"e",(function(){return o}));const a={DRAFT:{th:"\u0e09\u0e1a\u0e31\u0e1a\u0e23\u0e48\u0e32\u0e07",en:"Draft",variant:"neutral"},SCHEDULED:{th:"\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e40\u0e27\u0e25\u0e32",en:"Scheduled",variant:"warning"},PUBLISHED:{th:"\u0e40\u0e1c\u0e22\u0e41\u0e1e\u0e23\u0e48\u0e41\u0e25\u0e49\u0e27",en:"Published",variant:"success"},EXPIRED:{th:"\u0e2b\u0e21\u0e14\u0e2d\u0e32\u0e22\u0e38",en:"Expired",variant:"neutral"},ARCHIVED:{th:"\u0e40\u0e01\u0e47\u0e1a\u0e16\u0e32\u0e27\u0e23",en:"Archived",variant:"neutral"}},s={NOTIFICATION:{th:"\u0e41\u0e08\u0e49\u0e07\u0e40\u0e15\u0e37\u0e2d\u0e19",en:"Notification"},POPUP:{th:"\u0e1b\u0e4a\u0e2d\u0e1b\u0e2d\u0e31\u0e1e",en:"Popup"},BOTH:{th:"\u0e17\u0e31\u0e49\u0e07\u0e2a\u0e2d\u0e07",en:"Both"}},c={ALL_USERS:{th:"\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14",en:"All Users"},STRAVA_CONNECTED:{th:"\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49 Strava",en:"Strava Connected"},ACTIVITY_PARTICIPANTS:{th:"\u0e1c\u0e39\u0e49\u0e40\u0e02\u0e49\u0e32\u0e23\u0e48\u0e27\u0e21\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21",en:"Activity Participants"},CUSTOM_USERS:{th:"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49",en:"Custom Users"}},n={DRAFT:"neutral",SCHEDULED:"warning",PUBLISHED:"success",EXPIRED:"neutral",ARCHIVED:"neutral"},o=e=>e?new Date(e).toLocaleDateString("th-TH",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}):"-"},1349:function(e,t,r){"use strict";var a=r(2),s=r(1),c=r(68),n=r(3),o=r(6),l=r(1331),i=r(1276),d=r(0);const b=["ALL_USERS","STRAVA_CONNECTED","ACTIVITY_PARTICIPANTS","CUSTOM_USERS"],x=["NOTIFICATION","POPUP","BOTH"],h={create:"\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28\u0e43\u0e2b\u0e21\u0e48",edit:"\u0e41\u0e01\u0e49\u0e44\u0e02\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28",duplicate:"\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01\u0e1b\u0e23\u0e30\u0e01\u0e32\u0e28"},j=e=>{let{label:t,children:r,hint:a}=e;return Object(d.jsxs)("div",{className:"space-y-1",children:[Object(d.jsx)("label",{className:"block text-sm font-medium text-[color:var(--tf-text-primary)]",children:t}),r,a&&Object(d.jsx)("p",{className:"text-xs text-[color:var(--tf-text-secondary)]",children:a})]})},u="w-full border border-[color:var(--tf-border)] rounded-[var(--tf-radius-input)]\n    px-3 py-2 text-sm text-[color:var(--tf-text-primary)] bg-[color:var(--tf-surface)]\n    focus:outline-none focus:ring-2 focus:ring-[color:var(--tf-primary)] focus:border-transparent",f=()=>Object(d.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"animate-spin","aria-hidden":"true",children:[Object(d.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.25"}),Object(d.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]});t.a=e=>{let{open:t,mode:r="create",sourceId:m=null,onClose:p,onDone:v}=e;const[g,O]=Object(s.useState)({title:{th:"",en:""},shortDescription:{th:"",en:""},content:{th:"",en:""},imageUrl:"",actionUrl:"",displayType:"NOTIFICATION",status:"DRAFT",target:{type:"ALL_USERS",userIds:[],challengeIds:""},startAt:"",endAt:""}),[y,N]=Object(s.useState)([]),[w,C]=Object(s.useState)(!1),[k,I]=Object(s.useState)(null),[A,S]=Object(s.useState)(!1),[T,D]=Object(s.useState)(!1),[R,E]=Object(s.useState)(""),[U,_]=Object(s.useState)(""),[P,L]=Object(s.useState)(!1),M="edit"===r,F=Object(s.useCallback)((async()=>
1{if(m&&"create"!==r){L(!0),E("");try{const{data:e}=await Object(o.b)({url:n.a.apis.zone.admin.announcement.get({id:m})}),t=e.announcement,a=((e,t)=>{var r,a,s,c,n;return{title:t?{th:"(\u0e2a\u0e33\u0e40\u0e19\u0e32) ".concat((null===(r=e.title)||void 0===r?void 0:r.th)||""),en:null!==(a=e.title)&&void 0!==a&&a.en?"(Copy) ".concat(e.title.en):""}:e.title||{th:"",en:""},shortDescription:e.shortDescription||{th:"",en:""},content:e.content||{th:"",en:""},imageUrl:e.imageUrl||"",actionUrl:e.actionUrl||"",displayType:e.displayType||"NOTIFICATION",status:t?"DRAFT":e.status||"DRAFT",target:{type:(null===(s=e.target)||void 0===s?void 0:s.type)||"ALL_USERS",userIds:(null===(c=e.target)||void 0===c?void 0:c.userIds)||[],challengeIds:((null===(n=e.target)||void 0===n?void 0:n.challengeIds)||[]).join("\n")},startAt:t?"":e.startAt?e.startAt.slice(0,16):"",endAt:t?"":e.endAt?e.endAt.slice(0,16):""}})(t,"duplicate"===r);O(a),I(null),_("");const s=a.target.userIds;if(s.length){const e=await(async e=>e&&0!==e.length?(await Promise.allSettled(e.map((e=>Object(o.b)({url:n.a.apis.user.user.getDetail({_id:e})}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value.data.user||e.value.data)).filter(Boolean):[])(s),t=new Set(e.map((e=>e._id))),r=s.filter((e=>!t.has(e))).map((e=>({_id:e,email:e,profile:null})));N([...e,...r])}else N([])}catch(e){E("\u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e44\u0e21\u0e48\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08")}finally{L(!1)}}}),[m,r]);Object(s.useEffect)((()=>{t&&("create"===r?(O({title:{th:"",en:""},shortDescription:{th:"",en:""},content:{th:"",en:""},imageUrl:"",actionUrl:"",displayType:"NOTIFICATION",status:"DRAFT",target:{type:"ALL_USERS",userIds:[],challengeIds:""},startAt:"",endAt:""}),N([]),I(null),_(""),E("")):F())}),[t,r,F]),Object(s.useEffect)((()=>{if(!t)return;const e=e=>{"Escape"!==e.key||w||p()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[t,p,w]);const z=(e,t)=>{O((r=>{const s=Object(a.a)({},r),c=e.split(".");let n=s;for(let e=0;e<c.length-1;e++)n[c[e]]=Object(a.a)({},n[c[e]]),n=n[c[e]];return n[c[c.length-1]]=t,s}))},B=()=>({type:g.target.type,userIds:"CUSTOM_USERS"===g.target.type?y.map((e=>e._id)):[],challengeIds:"ACTIVITY_PARTICIPANTS"===g.target.type?g.target.challengeIds.split(/[\n,]+/).map((e=>e.trim())).filter(Boolean):[]}),H=async e=>{S(!0),_("");try{const t=Object(a.a)({},Object(a.a)(Object(a.a)({},g),{},{target:B(),startAt:g.startAt||void 0,endAt:g.endAt||void 0}));e&&(t.status=e);const{data:r}=await(e=>M?Object(o.h)({url:n.a.apis.zone.admin.announcement.update({id:m}),data:{announcement:e}}):Object(o.g)({url:n.a.apis.zone.admin.announcement.create(),data:{announcement:e}}))(t);return r.announcement&&r.announcement._id||m}catch(t){throw _("\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e44\u0e21\u0e48\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08 \u0e01\u0e23\u0e38\u0e13\u0e32\u0e25\u0e2d\u0e07\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07"),new Error("save failed")}finally{S(!1)}};if(!t)return null;const W=A||T||P,V=T?"\u0e01\u0e33\u0e25\u0e31\u0e07\u0e40\u0e1c\u0e22\u0e41\u0e1e\u0e23\u0e48...":g.startAt?"\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e40\u0e27\u0e25\u0e32":"\u0e40\u0e1c\u0e22\u0e41\u0e1e\u0e23\u0e48\u0e17\u0e31\u0e19\u0e17\u0e35",Y=Object(d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center sm:p-6",children:[Object(d.jsx)("div",{className:"absolute inset-0 bg-black/50",onClick:W?void 0:p,"aria-hidden":"true"}),Object(d.jsxs)("div",{className:"relative sm:max-w-xl bg-[color:var(--tf-surface)] rounded-t-2xl sm:rounded-2xl shadow-[var(--tf-shadow-lg)] flex flex-col h-[92vh] sm:h-auto sm:max-h-[80vh]",style:{maxHeight:"90vh"},children:[Object(d.jsxs)("div",{className:"flex items-center justify-between px-5 sm:px-6 py-4 border-b border-[color:var(--tf-border)] flex-shrink-0",children:[Object(d.jsxs)("div",{children:[Object(d.jsx)("h2",{className:"text-base font-bold text-[color:var(--tf-text-primary)]",children:h[r]}),"duplicate"===r&&Object(d.jsx)("p",{className:"text-xs text-[color:var(--tf-text-secondary)] mt-0.5",children:"\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32\u0e04\u0e31\u0e14\u0e25\u0e2d\u0e01\u0e21\u0e32\u0e08\u0e32\u0e01\u0e15\u0e49\u0e19\u0e09\u0e1a\u0e31\u0e1a \u2014 \u0e41\u0e01\u0e49\u0e44\u0e02\u0e01\u0e48\u0e2d\u0e19\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e44\u0e14\u0e49\u0e40\u0e25\u0e22"})]}),Object(d.jsx)("button",{type:"button",onClick:p,disabled:W,className:"w-9 h-9 flex items-center justify-center rounded-full hover:bg-[color:var(--tf-bg)
1] text-[color:var(--tf-text-secondary)] transition-colors disabled:opacity-40","aria-label":"\u0e1b\u0e34\u0e14",children:Object(d.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round","aria-hidden":"true",children:Object(d.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),Object(d.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 sm:px-6 py-5 space-y-5",children:[P&&Object(d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-[color:var(--tf-text-secondary)]",children:[Object(d.jsx)(f,{})," \u0e01\u0e33\u0e25\u0e31\u0e07\u0e42\u0e2b\u0e25\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25..."]}),R&&Object(d.jsx)("div",{className:"p-3 rounded-[var(--tf-radius-btn)] bg-[color:var(--tf-danger-bg)] text-[color:var(--tf-danger)] text-sm",children:R}),U&&Object(d.jsx)("div",{className:"p-3 rounded-[var(--tf-radius-btn)] bg-[color:var(--tf-danger-bg)] text-[color:var(--tf-danger)] text-sm",children:U}),Object(d.jsxs)("section",{className:"bg-[color:var(--tf-bg)] rounded-[var(--tf-radius-card)] border border-[color:var(--tf-border)] p-4 sm:p-5 space-y-4 mb-3",children:[Object(d.jsx)("h3",{className:"text-sm font-semibold text-[color:var(--tf-text-primary)]",children:"\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d"}),Object(d.jsx)(j,{label:"\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d (TH) *",children:Object(d.jsx)("input",{className:u,value:g.title.th,onChange:e=>z("title.th",e.target.value)})}),Object(d.jsx)(j,{label:"\u0e2b\u0e31\u0e27\u0e02\u0e49\u0e2d (EN)",children:Object(d.jsx)("input",{className:u,value:g.title.en,onChange:e=>z("title.en",e.target.value)})}),Object(d.jsx)(j,{label:"\u0e04\u0e33\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e22\u0e48\u0e2d (TH)",children:Object(d.jsx)("input",{className:u,value:g.shortDescription.th,onChange:e=>z("shortDescription.th",e.target.value)})}),Object(d.jsx)(j,{label:"\u0e04\u0e33\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e22\u0e48\u0e2d (EN)",children:Object(d.jsx)("input",{className:u,value:g.shortDescription.en,onChange:e=>z("shortDescription.en",e.target.value)})})]}),Object(d.jsxs)("section",{className:"bg-[color:var(--tf-bg)] rounded-[var(--tf-radius-card)] border border-[color:var(--tf-border)] p-4 sm:p-5 space-y-4 mb-3",children:[Object(d.jsx)("h3",{className:"text-sm font-semibold text-[color:var(--tf-text-primary)]",children:"\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32"}),Object(d.jsx)(j,{label:"\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32 (TH)",children:Object(d.jsx)("textarea",{rows:4,className:u,value:g.content.th,onChange:e=>z("content.th",e.target.value)})}),Object(d.jsx)(j,{label:"\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32 (EN)",children:Object(d.jsx)("textarea",{rows:4,className:u,value:g.content.en,onChange:e=>z("content.en",e.target.value)})}),Object(d.jsx)(j,{label:"\u0e23\u0e39\u0e1b\u0e20\u0e32\u0e1e",hint:"\u0e41\u0e2a\u0e14\u0e07\u0e43\u0e19\u0e1b\u0e4a\u0e2d\u0e1b\u0e2d\u0e31\u0e1e (\u0e44\u0e21\u0e48\u0e1a\u0e31\u0e07\u0e04\u0e31\u0e1a)",children:Object(d.jsx)(i.a,{value:g.imageUrl,namePrefix:"announcement",onChange:e=>z("imageUrl",e)})}),Object(d.jsx)(j,{label:"Action URL",hint:"\u0e25\u0e34\u0e07\u0e01\u0e4c\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e01\u0e14 '\u0e14\u0e39\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14' (\u0e44\u0e21\u0e48\u0e1a\u0e31\u0e07\u0e04\u0e31\u0e1a)",children:Object(d.jsx)("input",{className:u,value:g.actionUrl,onChange:e=>z("actionUrl",e.target.value),placeholder:"/challenge/..."})})]}),Object(d.jsxs)("section",{className:"bg-[color:var(--tf-bg)] rounded-[var(--tf-radius-card)] border border-[color:var(--tf-border)] p-4 sm:p-5 space-y-4 mb-3",children:[Object(d.jsx)("h3",{className:"text-sm font-semibold text-[color:var(--tf-text-primary)]",children:"\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25 & \u0e01\u0e25\u0e38\u0e48\u0e21\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22"}),Object(d.jsx)(j,{label:"\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25",children:Object(d.jsx)("div",{className:"flex flex-wrap gap-4",children:x.map((e=>Object(d.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm",children:[Object(d.jsx)("input",{type:"radio",name:"displayType-".concat(r),value:e,checked:g.displayType===e,onChange:()=>z("displayType",e)}),"NOTIFICATION"===e?"\u0e41\u0e08\u0e49\u0e07\u0e40\u0e15\u0e37\u0e2d\u0e19":"POPUP"===e?"\u0e1b\u0e4a\u0e2d\u0e1b\u0e2d\u0e31\u0e1e":"\u0e17\u0e31\u0e49\u0e07\u0e2a\u0e2d\u0e07"]},e)))})}),Object(d.jsx)(j,{label:"\u0e01\u0e25\u0e38\u0e48\u0e21\u0e40\u0e1b\u0e49\u0e32\u0e2b\u0e21\u0e32\u0e22",children:Object(d.jsx)("select",{className:u,value:g.target.type,onCh
1ange:e=>z("target.type",e.target.value),children:b.map((e=>Object(d.jsx)("option",{value:e,children:"ALL_USERS"===e?"\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14":"STRAVA_CONNECTED"===e?"\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e17\u0e35\u0e48\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d Strava":"ACTIVITY_PARTICIPANTS"===e?"\u0e1c\u0e39\u0e49\u0e40\u0e02\u0e49\u0e32\u0e23\u0e48\u0e27\u0e21\u0e01\u0e34\u0e08\u0e01\u0e23\u0e23\u0e21":"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49"},e)))})}),"CUSTOM_USERS"===g.target.type&&Object(d.jsxs)(j,{label:"\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e17\u0e35\u0e48\u0e40\u0e25\u0e37\u0e2d\u0e01",children:[Object(d.jsxs)("div",{className:"flex items-center gap-3",children:[Object(d.jsxs)("button",{type:"button",onClick:()=>C(!0),className:"flex items-center gap-2 px-4 py-2 rounded-[var(--tf-radius-btn)] border-2 border-dashed border-[color:var(--tf-primary)] text-[color:var(--tf-primary)] text-sm font-semibold hover:bg-[color:var(--tf-primary-light)] transition-colors",children:[Object(d.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[Object(d.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),Object(d.jsx)("circle",{cx:"9",cy:"7",r:"4"}),Object(d.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),Object(d.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),"\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49"]}),y.length>0&&Object(d.jsxs)("span",{className:"text-sm text-[color:var(--tf-text-secondary)]",children:["\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e41\u0e25\u0e49\u0e27 ",Object(d.jsx)("strong",{className:"text-[color:var(--tf-text-primary)]",children:y.length})," \u0e04\u0e19"]})]}),y.length>0&&Object(d.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[y.slice(0,5).map((e=>Object(d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs bg-[color:var(--tf-primary-light)] text-[color:var(--tf-primary)]",children:[e.profile?"".concat(e.profile.firstname||""," ").concat(e.profile.lastname||"").trim()||e.email:e.email||e._id,Object(d.jsx)("button",{type:"button",onClick:()=>N((t=>t.filter((t=>t._id!==e._id)))),className:"ml-0.5 hover:opacity-70",children:"\xd7"})]},e._id))),y.length>5&&Object(d.jsxs)("span",{className:"px-2 py-1 text-xs text-[color:var(--tf-text-secondary)]",children:["+",y.length-5," \u0e04\u0e19"]})]})]}),"ACTIVITY_PARTICIPANTS"===g.target.type&&Object(d.jsx)(j,{label:"Challenge IDs (\u0e2b\u0e19\u0e36\u0e48\u0e07 ID \u0e15\u0e48\u0e2d\u0e1a\u0e23\u0e23\u0e17\u0e31\u0e14)",children:Object(d.jsx)("textarea",{rows:3,className:u,value:g.target.challengeIds,onChange:e=>z("target.challengeIds",e.target.value)})}),Object(d.jsxs)("div",{className:"flex items-center gap-3",children:[Object(d.jsx)("button",{type:"button",onClick:()=>{Object(o.g)({url:n.a.apis.zone.admin.announcement.targetPreview(),data:{target:B()}}).then((e=>{let{data:t}=e;return I(t.count)})).catch((()=>I("?")))},className:"text-sm text-[color:var(--tf-primary)] hover:underline",children:"\u0e14\u0e39\u0e08\u0e33\u0e19\u0e27\u0e19\u0e1c\u0e39\u0e49\u0e23\u0e31\u0e1a"}),null!==k&&Object(d.jsxs)("span",{className:"text-sm font-semibold text-[color:var(--tf-text-primary)]",children:["\u2248 ",k," \u0e04\u0e19"]})]})]}),Object(d.jsxs)("section",{className:"bg-[color:var(--tf-bg)] rounded-[var(--tf-radius-card)] border border-[color:var(--tf-border)] p-4 sm:p-5 space-y-4",children:[Object(d.jsx)("h3",{className:"text-sm font-semibold text-[color:var(--tf-text-primary)]",children:"\u0e15\u0e32\u0e23\u0e32\u0e07\u0e40\u0e27\u0e25\u0e32"}),Object(d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[Object(d.jsx)(j,{label:"\u0e40\u0e23\u0e34\u0e48\u0e21\u0e41\u0e2a\u0e14\u0e07",hint:"\u0e40\u0e27\u0e49\u0e19\u0e27\u0e48\u0e32\u0e07\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e1c\u0e22\u0e41\u0e1e\u0e23\u0e48\u0e17\u0e31\u0e19\u0e17\u0e35",children:Object(d.jsx)("input",{type:"datetime-local",className:u,value:g.startAt,onCh
1ange:e=>z("startAt",e.target.value)})}),Object(d.jsx)(j,{label:"\u0e2a\u0e34\u0e49\u0e19\u0e2a\u0e38\u0e14",hint:"\u0e40\u0e27\u0e49\u0e19\u0e27\u0e48\u0e32\u0e07\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e44\u0e21\u0e48\u0e21\u0e35\u0e27\u0e31\u0e19\u0e2b\u0e21\u0e14\u0e2d\u0e32\u0e22\u0e38",children:Object(d.jsx)("input",{type:"datetime-local",className:u,value:g.endAt,onChange:e=>z("endAt",e.target.value)})})]})]})]}),Object(d.jsxs)("div",{className:"flex items-center justify-end gap-3 px-5 sm:px-6 py-4 border-t border-[color:var(--tf-border)] flex-shrink-0",children:[Object(d.jsx)("button",{type:"button",onClick:p,disabled:W,className:"px-4 py-2.5 rounded-[var(--tf-radius-btn)] border border-[color:var(--tf-border)] text-sm font-semibold hover:bg-[color:var(--tf-bg)] transition-colors disabled:opacity-40",children:"\u0e22\u0e01\u0e40\u0e25\u0e34\u0e01"}),Object(d.jsxs)("button",{type:"button",onClick:async()=>{try{const e=await H();v&&v(e)}catch(e){}},disabled:W,className:"px-4 py-2.5 rounded-[var(--tf-radius-btn)] border border-[color:var(--tf-border)] text-sm font-semibold hover:bg-[color:var(--tf-bg)] transition-colors disabled:opacity-40 flex items-center gap-2",children:[A&&!T&&Object(d.jsx)(f,{}),A&&!T?"\u0e01\u0e33\u0e25\u0e31\u0e07\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01...":"\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e23\u0e48\u0e32\u0e07"]}),Object(d.jsxs)("button",{type:"button",onClick:async()=>{D(!0);try{const e=await H();await Object(o.g)({url:n.a.apis.zone.admin.announcement.publish({id:e}),data:g.startAt||g.endAt?{schedule:{startAt:g.startAt||void 0,endAt:g.endAt||void 0}}:{}}),v&&v(e)}catch(e){_("\u0e40\u0e1c\u0e22\u0e41\u0e1e\u0e23\u0e48\u0e44\u0e21\u0e48\u0e2a\u0e33\u0e40\u0e23\u0e47\u0e08 \u0e01\u0e23\u0e38\u0e13\u0e32\u0e25\u0e2d\u0e07\u0e2d\u0e35\u0e01\u0e04\u0e23\u0e31\u0e49\u0e07")}finally{D(!1)}},disabled:W,className:"px-4 py-2.5 rounded-[var(--tf-radius-btn)] bg-[color:var(--tf-primary)] text-white text-sm font-semibold hover:opacity-90 transition-opacity disabled:opacity-40 flex items-center gap-2",children:[T&&Object(d.jsx)(f,{}),V]})]})]}),Object(d.jsx)(l.a,{open:w,onClose:()=>C(!1),initialSelected:y,onConfirm:e=>N(e)})]});return Object(c.createPortal)(Y,document.body)}}}]);

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.