PageSourceSearch

https://xinerge.com/static/js/569.e8499415.chunk.js

js xinerge.com collected 2026-10-04 18:56:23 UTC 137,513 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkvocechat_web=globalThis.webpackChunkvocechat_web||[]).push([[569],{1346:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{A:()=>MyAccount});var react__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(64131),react_hot_toast__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(25293),react_i18next__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(79574),_app_services_user__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(42687),_app_services_server__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(75111),_app_store__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(68812),_components_AvatarUploader__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(65368),_components_styled_Button__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(77338),_ProfileBasicEditModal__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(8123),_RemoveAccountConfirmModal__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(6619),_UpdatePasswordModal__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(11154),_PasskeyManagement__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(17036),react_redux__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(51612),_components_ServerVersionChecker__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__(15676),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__(82979);function MyAccount(){const{t:t}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.Bd)("member"),{t:ct}=(0,react_i18next__WEBPACK_IMPORTED_MODULE_2__.Bd)(),[passwordModal,setPasswordModal]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[editModal,setEditModal]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(""),[removeConfirmVisible,setRemoveConfirmVisible]=(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(!1),[uploadAvatar,{isSuccess:uploadSuccess}]=(0,_app_services_user__WEBPACK_IMPORTED_MODULE_3__.pl)(),{data:loginConfig}=(0,_app_services_server__WEBPACK_IMPORTED_MODULE_4__.T7)(),EditModalInfo={name:{label:t("username"),title:t("change_name"),intro:t("change_name_desc")},email:{label:t("email"),title:t("change_email"),intro:t("change_email_desc")}},loginUser=(0,_app_store__WEBPACK_IMPORTED_MODULE_5__.GV)((e=>{var s;return e.users.byId[(null===(s=e.authData.user)||void 0===s?void 0:s.uid)||0]}),react_redux__WEBPACK_IMPORTED_MODULE_12__.bN);(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)((()=>{uploadSuccess&&react_hot_toast__WEBPACK_IMPORTED_MODULE_1__.Ay.success(ct("tip.update"))}),[uploadSuccess]);const handleBasicEdit=e=>{const{edit:s}=e.currentTarget.dataset;setEditModal(s)},closeBasicEditModal=()=>{setEditModal("")},togglePasswordModal=()=>{setPasswordModal((e=>!e))},toggleRemoveAccountModalVisible=()=>{setRemoveConfirmVisible((e=>!e))};if(!loginUser)return null;const{uid:uid,avatar:avatar,name:name,email:email}=loginUser;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div",{className:"flex flex-col items-start gap-8",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div",{className:"md:p-6 flex flex-col items-center w-full md:w-[512px] md:bg-gray-100 md:dark:bg-gray-800 md:rounded-2xl",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_components_AvatarUploader__WEBPACK_IMPORTED_MODULE_6__.A,{url:avatar,name:name,uploadImage:uploadAvatar}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div",{className:"mt-2 mb-16 font-bold text-lg text-gray-800 dark:text-white",children:[name," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("span",{className:"font-normal text-gray-500",children:["#",uid]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div",{className:"w-full flex items-start justify-between mb-6",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div",{className:"flex flex-col text-gray-500 dark:text-gray-50",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("span",{className:"text-xs uppercase  font-semibold",children:t("email")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("span",{className:"text-sm",children:email})]})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div",{className:"w-full flex items-start justify-between mb-6",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div",{className:"flex flex-col text-gray-500 dark:text-gray-50",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("span",{className:"text-xs uppercase  font-semibold",children:t("username")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("span",{className:"text-sm ",children:[name," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("span",{className:"text-gray-600 dark:text-gray-400",children:[" #",uid]})]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_components_styled_Button__WEBPACK_IMPORTED_MODULE_7__.A,{"data-edit":"name",onClick:handleBasicEdit,className:"",children:ct("action.edit")})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div",{className:"w-full flex items-start justify-between mb-6",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div",{className:"flex flex-col text-gray-500 dark:text-gray-50",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("span",{className:"text-xs uppercase  font-semibold",children:t("password")}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("span",{className:"text-sm",children:"*********"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_components_styled_Button__WEBPACK_IMPORTED_MODULE_7__.A,{onClick:togglePasswordModal,children:ct("action.edit")})]})]}),(null===loginConfig||void 0===loginConfig?void 0:loginConfig.passkey)&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_components_ServerVersionChecker__WEBPACK_IMPORTED_MODULE_13__.A,{empty:!0,version:"0.5.5",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div",{className:"w-full md:w-[512px] md:p-6 md:bg-gray-100 md:dark:bg-gray-800 md:rounded-2xl",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_PasskeyManagement__WEBPACK_IMPORTED_MODULE_11__.A,{})})}),1!=uid&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_components_styled_Button__WEBPACK_IMPORTED_MODULE_7__.A,{className:"danger",onClick:toggleRemoveAccountModalVisible,children:t("delete_account")}
1)]}),editModal&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_ProfileBasicEditModal__WEBPACK_IMPORTED_MODULE_8__.A,{type:"email"==editModal?"email":"text",valueKey:editModal,...EditModalInfo[editModal],value:eval(editModal),closeModal:closeBasicEditModal}),passwordModal&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_UpdatePasswordModal__WEBPACK_IMPORTED_MODULE_10__.A,{closeModal:togglePasswordModal}),removeConfirmVisible&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_RemoveAccountConfirmModal__WEBPACK_IMPORTED_MODULE_9__.A,{closeModal:toggleRemoveAccountModalVisible})]})}},6619:(e,s,t)=>{t.d(s,{A:()=>x});var a=t(64131),r=t(25293),i=t(79574),l=t(13370),n=t(1393),c=t(77338),d=t(45891),o=t(64655),u=t(82979);const x=({closeModal:e})=>{const{t:s}=(0,i.Bd)("member"),[t,{isLoading:x,isSuccess:m}]=(0,l.fe)(),{clearLocalData:g}=(0,o.A)();return(0,a.useEffect)((()=>{m&&g(!0)}),[m]),(0,u.jsx)(n.A,{id:"modal-modal",children:(0,u.jsx)(d.A,{title:s("remove_account"),description:s("remove_account_desc"),buttons:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(c.A,{onClick:e,children:s("action.cancel",{ns:"common"})}),(0,u.jsx)(c.A,{disabled:x,onClick:async()=>{try{await t()}catch(e){console.error(e),r.Ay.error("Remove Account Failed!")}},className:"danger",children:s("remove")})]})})})}},8123:(e,s,t)=>{t.d(s,{A:()=>x});var a=t(64131),r=t(25293),i=t(79574),l=t(42687),n=t(1393),c=t(77338),d=t(91428),o=t(45891),u=t(82979);const x=({label:e="Username",valueKey:s="name",value:t="",type:x="text",title:m="Change your username",intro:g="Enter a new username and your existing password.",closeModal:p})=>{const j=(0,a.useRef)(null),{t:h}=(0,i.Bd)(),[M,N]=(0,a.useState)(t),[y,{isLoading:_,isSuccess:f}]=(0,l.sU)();return(0,a.useEffect)((()=>{f&&(r.Ay.success(h("tip.update")),p())}),[f]),(0,u.jsx)(n.A,{id:"modal-modal",children:(0,u.jsx)(o.A,{title:m,description:g,buttons:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(c.A,{className:"cancel",onClick:p,children:h("action.cancel")}),(0,u.jsx)(c.A,{onClick:()=>{if(!j||!j.current)return;const e=j.current;e.checkValidity()?y({[s]:M}):e.reportValidity()},children:_?"Updating":h("action.done")})]}),children:(0,u.jsxs)("form",{ref:j,className:"flex flex-col gap-2 w-full",action:"/",children:[(0,u.jsx)("label",{htmlFor:s,className:"text-sm text-left text-gray-500",children:e}),(0,u.jsx)(d.A,{name:s,value:M,onChange:e=>{N(e.target.value)},type:x,required:!0})]})})})}},11154:(e,s,t)=>{t.d(s,{A:()=>x});var a=t(64131),r=t(25293),i=t(79574),l=t(13370),n=t(1393),c=t(77338),d=t(91428),o=t(45891),u=t(82979);const x=({closeModal:e})=>{const{t:s}=(0,i.Bd)("member"),{t:t}=(0,i.Bd)(),{data:x}=(0,l.kU)(),[m,g]=(0,a.useState)({current:"",newPassword:"",confirmPassword:""}),[p,{isLoading:j,isSuccess:h}]=(0,l.zo)(),M=e=>{const{type:s}=e.target.dataset;g((t=>({...t,[s]:e.target.value})))};(0,a.useEffect)((()=>{h&&(r.Ay.success(t("tip.update")),e())}),[h]);const{current:N,newPassword:y,confirmPassword:_}=m,f=(null===x||void 0===x?void 0:x.password)&&!N||!y||!_||y!==_||j,v="my-4 w-full flex flex-col items-start gap-2",b="text-gray-400 font-semibold";return(0,u.jsx)(n.A,{id:"modal-modal",children:(0,u.jsxs)(o.A,{title:s("change_pwd"),description:s("change_pwd_desc"),buttons:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(c.A,{className:"cancel",onClick:e,children:s("action.cancel",{ns:"common"})}),(0,u.jsx)(c.A,{disabled:f,onClick:()=>{const{current:e,newPassword:s}=m;p({old_password:e,new_password:s})},children:j?"Updating":s("action.update",{ns:"common"})})]}),children:[(null===x||void 0===x?void 0:x.password)&&(0,u.jsxs)("div",{className:v,children:[(0,u.jsx)("label",{className:b,htmlFor:"current",children:s("current_pwd")}),(0,u.jsx)(d.A,{type:"password",id:"current",name:"current",value:N,"data-type":"current",onChange:M})]}),(0,u.jsxs)("div",{className:v,children:[(0,u.jsx)("label",{className:b,htmlFor:"newPassword",children:s("new_pwd")}),(0,u.jsx)(d.A,{type:"password",name:"newPassword",value:y,"data-type":"newPassword",onChange:M})]}),(0,u.jsxs)("div",{className:v,children:[(0,u.jsx)("label",{className:b,htmlFor:"confirmPassword",children:s("confirm_new_pwd")}),(0,u.jsx)(d.A,{onBlur:()=>{const{newPassword:e,confirmPassword:s}=m;e!==s&&r.Ay.error("Not same with new password")},type:"password",name:"confirmPassword",value:_,"data-type":"confirmPassword",onChange:M})]})]})})}},17036:(e,s,t)=>{t.d(s,{A:()=>g});var a=t(64131),r=t(25293),i=t(79574),l=t(13370),n=t(66169),c=t(77338),d=t(91428),o=t(1393),u=t(45891),x=t(68812),m=t(82979);function g(){const{t:e}=(0,i.Bd)("setting"),{t:s}=(0,i.Bd)(),[t,g]=(0,a.useState)(!1),[p,j]=(0,a.useState)(""),[h,M]=(0,a.useState)(!1),{data:N,refetch:y}=(0,l.eD)(),[_]=(0,l.Wk)(),[f]=(0,l.Bq)(),[v]=(0,l.Qe)(),b=(0,x.GV)((e=>e.authData.user));return(0,m.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("h3",{className:"text-lg font-semibold text-gray-800 dark:text-white",children:e("passkey.title")}),(0,m.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:e("passkey.desc")})]}),(0,m.jsx)(c.A,{onClick:()=>M(!0),disabled:t,children:e(t?"passkey.adding":"passkey.add")})]}),(0,m.jsx)("div",{className:"space-y-2",children:N&&N.length>0?N.map((s=>(0,m.jsxs)("div",{className:"flex items-center justify-between p-4 bg-gray-50 dark:bg-gray-700 rounded-lg",children:[(0,m.jsxs)("div",{className:"flex flex-col",children:[(0,m.jsx)("span",{className:"text-sm font-medium text-gray-800 dark:text-white",children:s.name}),(0,m.jsxs)("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:[e("passkey.created"),": ",new Date(s.created_at).toLocaleDateString(),s.last_used_at&&` \u2022 ${e("passkey.last_used")}: ${new Date(s.last_used_at).toLocaleDateString()}`]})]}),(0,m.jsx)(c.A,{className:"danger",onClick:()=>(async s=>{if(confirm(e("passkey.delete_confirm")))try{await v(s).unwrap(),r.Ay.success(e("passkey.success_delete")),y()}catch(t){r.Ay.error(e("passkey.error_delete")),console.error("Passkey deletion error:",t)}})(s.credential_id),children:e("passkey.delete")})]},s.credential_id))):(0,m.jsx)("div",{className:"text-center py-8 text-gray-500 dark:text-gray-400",children:e("passkey.no_passkeys")})}),h&&(0,m.jsx)(o.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:e("passkey.add"),description:e("passkey.enter_name")||"Enter a name for this passkey",buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(c.A,{className:"cancel",onClick:()=>{M(!1),j("")},children:s("action.cancel")}),(0,m.jsx)(c.A,{onClick:async()=>
1{if((0,n.Bz)())if(null!==b&&void 0!==b&&b.name)if(p.trim()){g(!0),M(!1);try{const{challenge_id:s,options:t}=await _({name:b.name}).unwrap(),a=await(0,n.Go)(t);await f({challenge_id:s,attestation:a,name:p.trim()}).unwrap(),r.Ay.success(e("passkey.success_add")),j(""),y()}catch(s){"NotAllowedError"===s.name?r.Ay.error(e("passkey.error_cancelled")):"InvalidStateError"===s.name?r.Ay.error(e("passkey.error_exists")):r.Ay.error(e("passkey.error_add")),console.error("Passkey registration error:",s)}finally{g(!1)}}else r.Ay.error(e("passkey.enter_name")||"Please enter a name for this passkey");else r.Ay.error("User information not available");else r.Ay.error(e("passkey.error_not_supported"))},disabled:t,children:t?e("passkey.adding"):s("action.done")})]}),children:(0,m.jsx)(d.A,{autoFocus:!0,placeholder:e("passkey.enter_name")||"Passkey name",value:p,onChange:e=>j(e.target.value)})})})]})}},19033:(e,s,t)=>{t.d(s,{A:()=>h});var a=t(66574),r=(t(79631),t(30001)),i=t(68812),l=t(14651),n=t(51612),c=t(82979);const d=({uid:e,popover:s=!0,cid:t,textOnly:a=!1,fallback:d=`@${e}`})=>{var o;const u=(0,i.GV)((e=>e.users.byId),n.bN)[e];return null!==u&&void 0!==u&&null!==(o=u.name)&&void 0!==o&&o.trim()?a?(0,c.jsx)(c.Fragment,{children:`@${u.name}`}):s?(0,c.jsx)(r.Ay,{interactive:!0,placement:"top",trigger:"click",content:(0,c.jsx)(l.A,{uid:e,type:"card",cid:t}),children:(0,c.jsx)("span",{className:"px-0.5 text-primary-400 cursor-pointer",children:`@${u.name}`})}):(0,c.jsx)("span",{className:"px-0.5 text-primary-400",children:`@${u.name}`}):(0,c.jsx)(c.Fragment,{children:d})};var o=t(64131),u=t(20657),x=t(386);const m="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAMAAAC5zwKfAAAA51BMVEUAAABGiMdGiMdGiMdOiMdHicdHh8dGh8dGiMdGiMZGh8dGh8dGh8dHiMdGh8dGiMdGh8dHiMdGh8dGiMdGichHisRHiMZEhsZGh8hHiMZHh8dHiMff8P5HiMdKisnc7v3a7PzU6PpYlM5UkcxNjMqHtN+/2vOaweWpy+qew+aNuOFgmdB/rtx8rdt4qtqmyunP5fjK4vey0u50p9hrodXC3PNlndNblc9QjsuWvuRwpNa82PGCsN3D3fSTvOJon9RhmtFdmNCgxefF3/W21O+v0O2QuuKEst6jx+iJteDV6vuszey31fCy8/ecAAAAHHRSTlMAMP34CD21kdnn5O/t0szAq31nUSAenQ83i4B6ZYuUjgAABgtJREFUWMPVWGlj2jAMHdBjPdaWbm13+JmEhPsqJdxnD2C0+/+/Z7FskaxQepAv0wcIWHmyJFuW36f/XnZ2zy+/HCXgS+Loy+X57s42aN9/nibwTBKnP79/DO1b8jNIXK8Fp993MPZckHxOfns3XOwsDjhpYJK3slIOhWhKmbVqEyDtAPGz2Pvg9gC3POrAyQshepgJX4po+J95B51RWQJ7b4e82o/DzVzngKrtQ9zDfVSAjy6G/pddBXK2byx+efU2vK8HkAtbzICcUDJARpBkMKfvHDAT9kLi4Otb1sk+0MoKMYJ8otdTHdxrwHt0UvSQl+gKMfSAy51Xc3sCWVDvMJ64wUQYmeBBP0wlfqupSpy8ku/YIdJZXzVLbxiPuww4wsA83cEltTYONuZm9wg9lQDrFhlGSbPHvpNI8+McJUtlyMPR7ga8BKoWrRClzoFzxFIc1M2TNcGMvqtIvIgYO8IgJchhmWWM36gEgFUORKCTKuMo9kI+DlBNkc4ERcFSwV0AWAihFzHR2lU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wunykMpEe0h9hxPNMRqL/KBnSaIcSSsSfbMUfTvHEkMEEou+JV7ftJc3Ne1T8pFltL5pNyVnvN214sfqxSdn1EofufgcXm26mrU3XM2ya65mfbqarbk82qxYe+HyaElprU7QTmN//fV2bPEU33O9tTy63q7Kt8PQBXx91Aoor17AG3wBX0cRlEmnKdF/B0VwHHsPiVF/gcQoGRKjgcTuRprFs7X6fDPNMljSLMe7rxFBfeWQi7tNRFABbnMzEcRycQKZo0wjv0JVlUJUVd5QVRevkmk/4kSmdSHzK2SaEybTmmMm016n+5AJ0X3z53Rfl+i+DHDI++MNk5TzMCFp04Zwcc+E5HXRRXz/6h2UqQ9ZUZRpjUpYMaBMa4oyrUjE92IfI3VLtYDUbVq10gdIXc73L0M7y/HY0M5jaWjnXxcfJMaT64jxZGxr6v5YwcYTx5q6/9/lLwwJNCus1PtUAAAAAElFTkSuQmCC";function g({url:e=""}){const s=(0,n.wA)(),[t,a]=(0,o.useState)(""),[r,{isLoading:l}]=(0,u.Q5)(),d=(0,i.GV)((s=>s.footprint.og[e]),n.bN),[g,p]=(0,o.useState)(null);(0,o.useEffect)((()=>
1{if(d){var s;const e=(null===d||void 0===d?void 0:d.title)||(null===d||void 0===d?void 0:d.site_name)||"",t=(null===d||void 0===d?void 0:d.description)||"",r=(null===d||void 0===d||null===(s=d.images.find((e=>!!e.url)))||void 0===s?void 0:s.url)||"",i=(null===d||void 0===d?void 0:d.favicon_url)||m;a(i),p({title:e,description:t,ogImage:r})}else e&&r(e)}),[e,d]);if(l)return(0,c.jsx)("div",{className:"h-28"});if(!e||!g||!g.title)return null;const{title:j,description:h,ogImage:M}=g,N="flex items-center border border-solid border-gray-300 dark:border-gray-600 box-border rounded-md w-[80%] md:w-[380px]";return M?(0,c.jsxs)("a",{className:`${N} flex-col !items-start p-3`,href:e,target:"_blank",rel:"noreferrer",children:[(0,c.jsx)("h3",{className:"text-primary-500 w-full truncate",children:j}),(0,c.jsx)("p",{className:"text-xs text-gray-400 mb-2 w-full truncate",children:h}),(0,c.jsx)("div",{className:"w-full h-[180px]",children:(0,c.jsx)("img",{className:"w-full h-full object-cover",onError:()=>{s((0,x.M3)({key:e,value:{...d,images:[]}}))},src:M,alt:"og image"})})]}):(0,c.jsxs)("a",{className:`${N} gap-2  px-2 py-3`,href:e,target:"_blank",rel:"noreferrer",children:[t&&(0,c.jsx)("div",{className:"flex rounded",children:(0,c.jsx)("img",{className:"object-contain w-12 h-12",onError:()=>{a(m)},src:t,alt:"favicon"})}),(0,c.jsxs)("div",{className:"flex flex-col",children:[(0,c.jsx)("h3",{className:"text-sm text-gray-900 dark:text-gray-100",children:j}),(0,c.jsx)("p",{className:"hidden md:block text-xs text-gray-500 w-[288px] truncate",children:h}),(0,c.jsx)("span",{className:"text-[10px] text-gray-500 w-[288px] truncate",children:e})]})]})}var p=t(71995),j=t(83051);const h=({url:e=!0,mention:s=!0,mentionTextOnly:t=!1,mentionPopOver:r=!0,linkPreview:i=!0,text:l,cid:n}
1)=>{const{getExtSetting:o}=(0,p.A)({successTip:!1,key:j.hp}),u=o()&&i;return(0,c.jsx)(a.A,{options:{render:{email:({content:e,attributes:{href:s}})=>t?(0,c.jsx)(c.Fragment,{children:e}):(0,c.jsx)("a",{className:"text-primary-500",href:s,rel:"noreferrer",children:e}),url:({content:s,attributes:{href:t}})=>e&&s.startsWith("http")?(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("a",{className:"text-primary-500",target:"_blank",href:t,rel:"noreferrer",children:s}),u&&(0,c.jsx)(g,{url:t})]}):(0,c.jsx)(c.Fragment,{children:s}),mention:({content:e})=>{if(!s)return(0,c.jsx)(c.Fragment,{children:e});if(/^@[0-9]+$/.test(e)){const s=Number(e.slice(1));return Number.isSafeInteger(s)?(0,c.jsx)(d,{uid:s,cid:n,popover:r,textOnly:t,fallback:e}):(0,c.jsx)(c.Fragment,{children:e})}return(0,c.jsx)(c.Fragment,{children:e})}}},children:l})}},21814:(e,s,t)=>{t.d(s,{A:()=>n});var a,r=t(64131);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},i.apply(null,arguments)}const l=({title:e,titleId:s,...t},l)=>r.createElement("svg",i({width:24,height:24,viewBox:"0 0 24 24",fill:"#667085",xmlns:"http://www.w3.org/2000/svg",ref:l,"aria-labelledby":s},t),e?r.createElement("title",{id:s},e):null,a||(a=r.createElement("path",{d:"M13.7036 5.75927L18.2405 10.2962L9.33146 19.2052C9.08325 19.4534 8.77457 19.6325 8.43593 19.7249L3.84998 20.9756C3.34808 21.1124 2.88755 20.6519 3.02443 20.15L4.27515 15.5641C4.3675 15.2254 4.54664 14.9167 4.79484 14.6685L13.7036 5.75927ZM20.0604 3.93956C21.3132 5.19232 21.3132 7.22343 20.0604 8.47618L19.1907 9.34506L14.6538 4.80903L15.5238 3.93956C16.7766 2.68681 18.8077 2.68681 20.0604 3.93956Z"}))),n=(0,r.forwardRef)(l)},22804:(e,s,t)=>{t.d(s,{N:()=>c});const a="https://install.voce.chat/script.js",r="121f1469-bdce-4326-8fa3-7b820837c916";let i=!1,l=!1;const n=[];async function c(e,s){await new Promise((e=>{if(i)return void e();if(n.push(e),l)return;l=!0;const s=document.createElement("script");s.async=!0,s.defer=!0,s.src=a,s.setAttribute("data-website-id",r),s.setAttribute("data-auto-track","false"),s.onload=()=>{i=!0,l=!1,n.splice(0).forEach((e=>e()))},s.onerror=()=>{l=!1,n.splice(0).forEach((e=>e()))},document.head.appendChild(s)}));const t=window.umami;null!==t&&void 0!==t&&t.track&&t.track(e,s)}},31032:(e,s,t)=>{t.d(s,{A:()=>n});var a,r=t(64131);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},i.apply(null,arguments)}const l=({title:e,titleId:s,...t},l)=>r.createElement("svg",i({width:16,height:16,viewBox:"0 0 16 16",fill:"#6C737F",xmlns:"http://www.w3.org/2000/svg",ref:l,"aria-labelledby":s},t),e?r.createElement("title",{id:s},e):null,a||(a=r.createElement("path",{d:"M8.11904 0C3.91105 0 0.5 3.41105 0.5 7.61905C0.5 11.827 3.91105 15.2381 8.11904 15.2381C12.3271 15.2381 15.7381 11.827 15.7381 7.61905C15.7381 3.41105 12.3263 0 8.11904 0ZM11.7053 10.128L10.628 11.2053L8.11904 8.69714L5.61009 11.2053L4.53277 10.128L7.04095 7.61905L4.532 5.1101L5.60934 4.03353L8.11829 6.54248L10.6272 4.03353L11.7045 5.1101L9.19638 7.61905L11.7053 10.128Z"}))),n=(0,r.forwardRef)(l)},33162:(e,s,t)=>{t.d(s,{A:()=>c});var a=t(64131),r=t(75111),i=t(68812),l=t(51612),n=t(14234);const c=(e=!1)=>{var s;const t=(0,l.wA)(),c=(0,i.GV)((e=>e.users.ids.length),l.bN),d=(0,i.GV)((e=>e.server.upgraded),l.bN),o=(0,i.GV)((e=>e.authData.guest),l.bN),{data:u,refetch:x,isLoading:m}=(0,r.xI)(void 0,{refetchOnMountOrArgChange:e,skip:o}),[g,{isLoading:p,isSuccess:j}]=(0,r._8)(),[h,{isSuccess:M,isLoading:N,reset:y}]=(0,r.bb)();(0,a.useEffect)((()=>{M&&(x(),y())}),[M]);const _=null!==(s=null===u||void 0===u?void 0:u.user_limit)&&void 0!==s?s:Number.MAX_SAFE_INTEGER;return(0,a.useEffect)((()=>{_>20&&t((0,n.CI)({upgraded:!0}))}),[_]),{upgraded:d,reachLimit:c>=_,license:u,checked:j,isLoading:m,checking:p,upserting:N,upserted:M,checkLicense:e=>{g(e)},upsertLicense:async e=>{const s=await g(e);return!(!("data"in s)||!s.data.sign)&&await h(e)}}}},50203:(e,s,t)=>{t.d(s,{A:()=>n});var a,r=t(64131);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},i.apply(null,arguments)}const l=({title:e,titleId:s,...t},l)=>r.createElement("svg",i({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:l,"aria-labelledby":s},t),e?r.createElement("title",{id:s},e):null,a||(a=r.createElement("path",{d:"M12 3.25C13.4346 3.25 14.6126 4.34848 14.7388 5.75019L19 5.75C19.4142 5.75 19.75 6.08579 19.75 6.5C19.75 6.8797 19.4678 7.19349 19.1018 7.243
115L19 7.25H18.417L17.1499 18.2292C17.0335 19.2384 16.179 20 15.1631 20H8.83688C7.821 20 6.9665 19.2384 6.85006 18.2292L5.582 7.25H5C4.6203 7.25 4.30651 6.96785 4.25685 6.60177L4.25 6.5C4.25 6.1203 4.53215 5.80651 4.89823 5.75685L5 5.75L9.26119 5.75019C9.38741 4.34848 10.5654 3.25 12 3.25ZM10.5 9.5C10.2545 9.5 10.0504 9.65477 10.0081 9.85886L10 9.9375V16.0625L10.0081 16.1411C10.0504 16.3452 10.2545 16.5 10.5 16.5C10.7455 16.5 10.9496 16.3452 10.9919 16.1411L11 16.0625V9.9375L10.9919 9.85886C10.9496 9.65477 10.7455 9.5 10.5 9.5ZM13.5 9.5C13.2545 9.5 13.0504 9.65477 13.0081 9.85886L13 9.9375V16.0625L13.0081 16.1411C13.0504 16.3452 13.2545 16.5 13.5 16.5C13.7455 16.5 13.9496 16.3452 13.9919 16.1411L14 16.0625V9.9375L13.9919 9.85886C13.9496 9.65477 13.7455 9.5 13.5 9.5ZM12 4.75C11.3952 4.75 10.8908 5.17947 10.775 5.75005H13.225C13.1092 5.17947 12.6048 4.75 12 4.75Z",fill:"#D92D20"}))),n=(0,r.forwardRef)(l)},66169:(e,s,t)=>{function a(e){const s=atob(e.replace(/-/g,"+").replace(/_/g,"/")),t=new Uint8Array(s.length);for(let a=0;a<s.length;a++)t[a]=s.charCodeAt(a);return t.buffer}function r(e){const s=new Uint8Array(e);let t="";for(let a=0;a<s.byteLength;a++)t+=String.fromCharCode(s[a]);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function i(){return void 0!==window.PublicKeyCredential&&void 0!==navigator.credentials}async function l(e){var s;if(!i())throw new Error("WebAuthn not supported");const t={...e.publicKey.authenticatorSelection||{},residentKey:"required",requireResidentKey:!0,userVerification:(null===(s=e.publicKey.authenticatorSelection)||void 0===s?void 0:s.userVerification)||"preferred"},l=await navigator.credentials.create({publicKey:{...e.publicKey,challenge:a(e.publicKey.challenge),user:{...e.publicKey.user,id:a(e.publicKey.user.id)},authenticatorSelection:t}});if(!l)throw new Error("Failed to create credential");const n=l.response;return{id:l.id,rawId:r(l.rawId),response:{clientDataJSON:r(n.clientDataJSON),attestationObject:r(n.attestationObject)},type:l.type}}async function n(e){var s;if(!i())throw new Error("WebAuthn not supported");const t=await navigator.credentials.get({publicKey:{...e.publicKey,challenge:a(e.publicKey.challenge),allowCredentials:null===(s=e.publicKey.allowCredentials)||void 0===s?void 0:s.map((e=>({...e,id:a(e.id)})))}});if(!t)throw new Error("Failed to get credential");const l=t.response;return{id:t.id,rawId:r(t.rawId),response:{clientDataJSON:r(l.clientDataJSON),authenticatorData:r(l.authenticatorData),signature:r(l.signature),userHandle:l.userHandle?r(l.userHandle):null},type:t.type}}t.d(s,{Bz:()=>i,Cn:()=>n,Go:()=>l})},80629:(e,s,t)=>{t.r(s),t.d(s,{default:()=>Es});var a=t(64131),r=t(79574),i=t(26634),l=t(50924),n=t(25293),c=t(1393),d=t(77338),o=t(73709),u=t(45891),x=t(64655),m=t(82979);const g=({closeModal:e})=>{const{t:s}=(0,r.Bd)("auth"),{t:t}=(0,r.Bd)(),[i,l]=(0,a.useState)(!1),{logout:g,exited:p,exiting:j,clearLocalData:h}=(0,x.A)();return(0,a.useEffect)((()=>{p&&(i&&h(),n.Ay.success(t("tip.logout")))}),[p,i]),(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:s("logout.title"),description:s("logout.desc"),buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{className:"cancel",onClick:e,children:t("action.cancel")}),(0,m.jsx)(d.A,{onClick:()=>{g()},className:"danger",children:j?"Logging out":t("action.logout")})]}),children:(0,m.jsxs)("div",{className:"text-sm text-gray-400 flex justify-end items-center",children:[(0,m.jsx)("label",{htmlFor:"clear_cb",className:"cursor-pointer text-orange-500 mr-3",children:s("logout.clear_local")}),(0,m.jsx)(o.A,{className:" cursor-pointer",name:"clear_cb",checked:i,onChange:e=>{l(e.target.checked)}})]})})})};var p=t(68812),j=t(96996),h=t(94989),M=t(78117),N=t.n(M),y=t(18405),_=t(51612),f=t(5436);const v=()=>{var e;const s=(0,p.GV)((e=>e.server.version),_.bN),[t,i]=(0,a.useState)(!1),{t:l}=(0,r.Bd)("setting",{keyPrefix:"version"}),n=null!==(e="1788848610")?e:0;return(0,m.jsxs)("ul",{className:"flex flex-col gap-2 dark:text-white",children:[(0,m.jsxs)("li",{children:[l("client_version"),": ","0.9.122"]}),(0,m.jsxs)("li",{children:[l("server_version"),": ",s]}),(0,m.jsxs)("li",{children:[l("build_time"),": ",n," ",(0,m.jsxs)("span",{className:"text-gray-700 dark:text-gray-300",children:["(",N()(1e3*n).fromNow(),")"]})]}),(0,m.jsx)("li",{children:(0,m.jsx)(d.A,{disabled:t,onClick:()=>{i(!0),(0,y.h)(),setTimeout((()=>{(0,f.Mm)()}),2e3)},children:t?(0,m.jsx)(h.A,{size:18,color:"#fff"}):l("sync")})})]})};var b=t(30001),w=t(63473),D=t(75111),k=t(91428),A=t(83702),I=t(76221);let T;function L(e="smtp"){const{t:s}=(0,r.Bd)(),[t,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(void 0),[d,{isSuccess:o,isLoading:u}]=(0,D.n6)(),[x,{isSuccess:m,isLoading:g}]=(0,D.q)(),[p,{isSuccess:j,isLoading:h}]=(0,D.u9)(),[M,{isSuccess:N,isLoading:y}]=(0,D.rV)(),[_,{isSuccess:f,isLoading:v}]=(0,D.JW)(),{refetch:b,data:w}=(0,D.ud)(void 0,{skip:"agora"!==e}),{refetch:k,data:A}=(0,D.$o)(void 0,{skip:"vocespace"!==e}),{refetch:L,data:E}=(0,D.T7)(void 0,{skip:"login"!==e}),{refetch:C,data:O}=(0,D.Mu)(void 0,{skip:"smtp"!==e}),{refetch:z,data:S}=(0,D.rt)(void 0,{skip:"firebase"!==e}),U={login:d,smtp:x,agora:p,firebase:_,vocespace:M}[e],P={smtp:C,agora:b,firebase:z,login:L,vocespace:k}[e],B={login:o,smtp:m,agora:j,firebase:f,vocespace:N}[e],Y={login:u,smtp:g,agora:h,firebase:v,vocespace:y}[e];return(0,a.useEffect)((()=>{B&&(n.Ay.success(s("tip.update")),P())}),[B]),(0,a.useEffect)((()=>{const e=O||S||E||w||A;e&&(T=e,c(e))}),[O,S,E,w,A]),(0,a.useEffect)((()=>{l&&0!=Object.keys(l).length&&((0,I.isEqual)(T,l)?i(!1):i(!0))}),[l]),{originalValues:T,updating:Y,updated:B,reset:()=>{c(T?{...T}:void 0)},changed:t,updateConfig:U,agoraConfig:w,values:l,setValues:c,toggleEnable:()=>{c((e=>e&&"enabled"in e?{...e,enabled:!e.enabled}:e))},refetch:P}}function E(){const{t:e}=(0,r.Bd)("setting"),{t:s}=(0,r.Bd)(),{updateConfig:t,values:i}=L("login"),{data:l}=(0,D.B)(),[c,{data:o,isSuccess:u,isLoading:x}]=(0,D.jJ)();(0,a.useEffect)((()=>{u&&((0,w.cJ)(),n.Ay.success(s("tip.update")))}),[u]);const g=null===i||void 0===i?void 0:i.third_party;return(0,m.jsxs)("div",{className:"max-w-[500px] flex flex-col gap-4 items-start",children:[(0,m.jsx)(A.A,{onClick:(e=>{t({...i,...e})}).bind(null,{third_party:!g}),checked:g}),(0,m.jsxs)("div",{className:"w-full flex flex-col items-start gap-2",children:[(0,m.jsxs)("label",{htmlFor:"secret",className:"text-sm text-gray-500 dark:text-gray-100",children:[" ",e("third_a
1pp.key"),":"]}),(0,m.jsx)(k.A,{disabled:!g,type:"password",id:"secret",value:o||l})]}),(0,m.jsx)(b.Ay,{interactive:!0,placement:"right-start",trigger:"click",content:(0,m.jsxs)("div",{className:"p-3 rounded-lg border border-orange-400 border-solid flex flex-col gap-3 w-[250px] bg-white",children:[(0,m.jsx)("div",{className:"text-orange-500 text-xs",children:e("third_app.update_tip")}),(0,m.jsxs)("div",{className:"flex justify-end gap-3 w-full",children:[(0,m.jsx)(d.A,{onClick:()=>(0,w.cJ)(),className:"cancel mini",children:s("action.cancel")}),(0,m.jsx)(d.A,{disabled:x,className:"mini danger",onClick:()=>c(),children:s("action.yes")})]})]}),children:(0,m.jsxs)(d.A,{disabled:!g,children:[" ",e("third_app.update")]})}),(0,m.jsxs)("div",{className:"text-xs text-orange-400",children:[e("third_app.key_tip"),(0,m.jsxs)("a",{className:"text-primary-500 font-bold",href:"https://doc.voce.chat/login-with-other-account",target:"_blank",rel:"noopener noreferrer",children:["\ud83d\udd17 ",e("third_app.how_to")]})]})]})}var C=t(85369),O=t(87862);const z=`${location.origin}/api/swagger`,S=()=>{const e=(0,p.GV)((e=>e.authData.token),_.bN),{copy:s}=(0,O.A)(),{t:t}=(0,r.Bd)("setting");return(0,m.jsxs)("section",{className:"flex flex-col justify-start items-start gap-4",children:[(0,m.jsx)("div",{className:"font-semibold dark:text-white",children:t("api_doc.desc")}),(0,m.jsx)("div",{className:"flex flex-col gap-2 w-full",children:(0,m.jsxs)("h2",{className:"text-gray-700 dark:text-white text-lg font-semibold flex gap-1",children:[t("api_doc.access"),(0,m.jsx)("a",{href:z,target:"_blank",rel:"noopener noreferrer",className:"underline text-primary-600",children:z})]})}),(0,m.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[(0,m.jsx)("h2",{className:"text-gray-700 dark:text-white text-lg font-semibold",children:t("api_doc.use_method")}),(0,m.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,m.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,m.jsx)("h3",{className:"text-gray-700 dark:text-white ",children:t("api_doc.step_1")}),(0,m.jsx)("img",{className:"border border-solid rounded-md border-gray-300 shadow-lg md:w-[50%]",src:"https://s.voce.chat/web_client/assets/img/api.doc.step1.png",alt:"step 1"})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,m.jsxs)("h3",{className:"text-gray-700 dark:text-white flex flex-col items-start gap-2",children:[t("api_doc.step_2")," ",(0,m.jsxs)("span",{className:"text-gray-400 dark:text-white text-xs",children:["(",t("api_doc.step_2_desc"),")"]})]}),(0,m.jsx)("div",{className:"flex flex-col border border-solid border-green-500 bg-green-100 rounded-md p-2 w-fit break-words text-sm relative",children:(0,m.jsxs)("p",{className:"break-all md:max-w-4xl font-bold",children:[e,(0,m.jsx)(C.A,{onClick:()=>{s(e)},className:"absolute right-2 bottom-2 cursor-pointer"})]})}),(0,m.jsx)("img",{className:"border border-solid rounded-md border-gray-300 shadow-lg md:w-[85%]",src:"https://s.voce.chat/web_client/assets/img/api.doc.step2.jpg",alt:"step 2"})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,m.jsx)("h3",{className:"text-gray-700 dark:text-white flex items-center gap-2",children:t("api_doc.last")}),(0,m.jsx)("img",{className:"border border-solid rounded-md border-gray-300 shadow-lg md:w-[85%]",src:"https://s.voce.chat/web_client/assets/img/api.doc.step3.png",alt:"step 3"})]})]})]})]})};var U=t(83051),P=t(42687),B=t(65368),Y=t(50203),R=t(22404),Q=t(95087);const G=({closeModal:e,uid:s})=>{const{copy:t}=(0,O.A)(),[i,{error:l,isSuccess:o,isLoading:x,data:g=""}]=(0,P.zr)(),p=(0,a.useRef)(null),{t:j}=(0,r.Bd)("setting",{keyPrefix:"bot"}),{t:h}=(0,r.Bd)();(0,a.useEffect)((()=>{if(l)switch(l.status){case 406:n.oR.error("Invalid Webhook URL!");break;case 409:n.oR.error("Name Already Exists!")}}),[l]);return(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:j("create_key_title"),description:j("create_key_desc"),buttons:o?(0,m.jsx)(d.A,{onClick:()=>{t(g),n.oR.success("API Key Copied!"),e()},children:j("key_copy_and_close")}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{className:"cancel",onClick:e,children:h("action.cancel")}),(0,m.jsx)(d.A,{onClick:()=>{var e;if(!p||!p.current)return;const t=p.current;t.checkValidity()?i({uid:s,name:(null===(e=t.querySelector("input"))||void 0===e?void 0:e.value)||""}):t.reportValidity()},children:x?"...":h("action.done")})]}),children:o?(0,m.jsxs)("div",{className:"flex flex-col gap-2 text-sm",children:[(0,m.jsx)("div",{className:"border-green-600 bg-green-200/50 rounded border border-solid p-2 max-w-md w-full whitespace-pre-wrap break-all",children:g})," ",(0,m.jsxs)("div",{className:"text-red-400",children:["\u26a0\ufe0f ",j("create_key_warning")]})]}):(0,m.jsx)("form",{ref:p,className:"w-full flex flex-col gap-2 items-center",action:"/",children:(0,m.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,m.jsx)("label",{htmlFor:"name",className:"text-sm text-gray-500",children:"Name"}),(0,m.jsx)(k.A,{name:"name",required:!0,defaultValue:"My first key",placeholder:"Please input API Key name"})]})})})})},V=({closeModal:e,uid:s,kid:t})=>{const[i,{isSuccess:l,isLoading:o}]=(0,P.fM)(),{t:x}=(0,r.Bd)("setting",{keyPrefix:"bot"}),{t:g}=(0,r.Bd)();return(0,a.useEffect)((()=>{l&&(n.oR.success(g("tip.delete")),e())}),[l]),(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:`${x("delete_key_title")} ${name}`,description:x("delete_key_desc"),buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{className:"cancel",onClick:e,children:g("action.cancel")}),(0,m.jsx)(d.A,{className:"danger",onClick:()=>{i({uid:s,kid:t})},children:o?"Deleting":g("action.done")})]})})})},W="p-1 whitespace-nowrap text-xs text-gray-500 dark:text-gray-200 align-middle px-1",K=({uid:e})=>{const{t:s}=(0,r.Bd)("setting",{keyPrefix:"bot"}),[t,i]=(0,a.useState)(),[l,n]=(0,a.useState)(),{data:c,refetch:d}=(0,P.Xf)(e),o=e=>{e||d(),i(e)},u=e=>{e||d(),n(e)};if(!c)return null;const x=["w-20","w-[166px]","w-36","w-15","w-10"];return(0,m.jsxs)("div",{className:"flex flex-col gap-2 items-start",children:[(0,m.jsxs)("div",{className:"border-t border-solid border-b border-gray-100 dark:border-gray-500 py-2 w-full",children:[(0,m.jsxs)("table",{className:"min-w-full table-fixed font-mono",children:[(0,m.jsx)("thead",{children:(0,m.jsx)("tr",{children:[s("col_key_name"),s("col_key_value"),s("col_key_create_time"),s("col_key_last_used"),""].map(((e,s)=>(0,m.jsx)("th",{scope:"col",className:(0,R.A)("text-xs text-gray-900 dark:text-gray-50 px-1 text-left pb-2",x[s]),children:e},e)))})}),(0,m.jsx)("tbody",{children:c.length>0?c.map((s=>{const{id:t,name:a,key:r,created_at:i,last_used:l}=s;return(0,m.jsxs)("tr",{className:"group",children:[(0,m.jsx)("td",{className:W,children:a}),(0,m.jsx)("td",{className:`${W} w-40`,children:`${r.slice(0,4)} ... ... ${r.slice(-6)}`}),(0,m.jsx)("td",{className:W,children:N()(i).format("YYYY-MM-DD HH:mm:ss")}),(0,m.jsx)("td",{className:W,children:l?N()(l).format("YYYY-MM-DD HH:mm:ss"):"Unused"}),(0,m.jsx)("td",{className:`${W} invisible group-hover:visible`,children:(0,m.jsx)("button",{onClick:u.bind(null,{kid:t,uid:e}),children:(0,m.jsx)(Y.A,{})})})]},t)})):(0,m.jsx)("tr",{children:(0,m.jsx)("td",{colSpan:4,className:"text-center text-xs text-gray-400 py-2",children:s("no_api_key")})})})]}),(0,m.jsxs)("button",{onClick:o.bind(null,e),className:"text-green-600 text-xs py-0.5 flex items-center gap-1 m-auto my-2 bg-green-50 rounded-full px-2 ",children:[(0,m.jsx)(Q.A,{className:"!w-4 !h-4 fill-green-600"})," ",s("add_api_key")]})]}),t&&(0,m.jsx)(G,{uid:t,closeModal:o.bind(null,void 0)}),l&&(0,m.jsx)(V,{uid:l.uid,kid:l.kid,closeModal:u.bind(null,void 0)})]})},F=({closeModal:e})=>{const[s,{isSuccess:t,isLoading:i,error:l}]=(0,P.i0)(),{t:o}=(0,r.Bd)("setting",{keyPrefix:"bot"}),[x,g]=(0,a.useState)({name:"",webhook_url:""}),{t:p}=(0,r.Bd)(),j=e=>{const{value:s}=e.target,{name:t=""}=e.target.dataset;g((e=>({...e,[t]:s})))};(0,a.useEffect)((()=>
1{if(l)switch(l.status){case 406:n.oR.error("Invalid Webhook URL!");break;case 409:n.oR.error("Name conflict with existed username, try the proposed name below."),g((e=>({...e,name:`${e.name}-bot`})))}}),[l]),(0,a.useEffect)((()=>{t&&(n.oR.success("Create Bot Successfully!"),e())}),[t]);const{name:h,webhook_url:M}=x;return(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:o("create_title"),description:o("create_desc"),buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{className:"cancel",onClick:e,children:p("action.cancel")}),(0,m.jsx)(d.A,{disabled:!x.name,onClick:()=>{if(""===x.name.trim())return;const{name:e,webhook_url:t}=x,a=new URL(U.tx).hostname;s({is_bot:!0,is_admin:!1,gender:1,email:`bot_${(new Date).getTime()}@${a}`,password:"",name:e,webhook_url:""===t.trim()?void 0:t})},children:i?"Creating":p("action.done")})]}),children:(0,m.jsxs)("div",{className:"w-full flex flex-col gap-2",children:[(0,m.jsxs)("div",{className:"flex flex-col items-start gap-1 w-full",children:[(0,m.jsx)("label",{htmlFor:"name",className:"text-sm text-gray-500",children:"Name"}),(0,m.jsx)(k.A,{onChange:j,value:h,"data-name":"name",placeholder:"Please input bot name"})]}),(0,m.jsxs)("div",{className:"flex flex-col items-start gap-1 w-full",children:[(0,m.jsx)("label",{htmlFor:"webhook_url",className:"text-sm text-gray-500",children:"Webhook URL (Optional)"}),(0,m.jsx)(k.A,{onChange:j,value:M,"data-name":"webhook_url",type:"url",placeholder:"Please input webhook url"})]})]})})})},H=({closeModal:e,uid:s,name:t})=>{const[i,{isSuccess:l,isLoading:o}]=(0,P.Gv)(),{t:x}=(0,r.Bd)("setting",{keyPrefix:"bot"}),{t:g}=(0,r.Bd)();return(0,a.useEffect)((()=>{l&&(n.oR.success(g("tip.delete")),e())}),[l]),(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:`${x("delete_title")} ${t}`,description:x("delete_desc"),buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{className:"cancel",onClick:e.bind(null),children:g("action.cancel")}),(0,m.jsx)(d.A,{className:"danger",onClick:()=>{i(s)},children:o?"Deleting":g("action.done")})]})})})};var Z,q=t(4287),J=t(31032),X=t(21814);function $(){return $=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},$.apply(null,arguments)}const ee=({title:e,titleId:s,...t},r)=>a.createElement("svg",$({width:24,height:24,viewBox:"0 0 24 24",stroke:"#616161",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":s},t),e?a.createElement("title",{id:s},e):null,Z||(Z=a.createElement("path",{d:"M17 21V13H7V21M7 3V8H15M19 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V5C3 4.46957 3.21071 3.96086 3.58579 3.58579C3.96086 3.21071 4.46957 3 5 3H16L21 8V19C21 19.5304 20.7893 20.0391 20.4142 20.4142C20.0391 20.7893 19.5304 21 19 21Z",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}))),se=(0,a.forwardRef)(ee),te=({uid:e})=>{const s=(0,a.useRef)(null),[t,r]=(0,a.useState)(!1),[i,l]=(0,a.useState)(""),{data:c,isSuccess:d,refetch:o}=(0,P.pR)(e),[u,{isSuccess:x,isLoading:g}]=(0,P.H7)();(0,a.useEffect)((()=>{d&&c&&l(c.name||"")}),[c,d]),(0,a.useEffect)((()=>{x&&o()}),[x]);const p=async()=>{if(t&&s){const t=s.current;if(null===t||void 0===t||!t.checkValidity())return void(null===t||void 0===t||t.reportValidity());const a=new FormData(t).get("name"),r=await u({id:e,name:a});if("error"in r){if(409===r.error.status)n.oR.error("Conflict with existed username");return}}r((e=>!e))};return(0,m.jsxs)("div",{className:"flex gap-2",children:[(0,m.jsx)("form",{action:"/",ref:s,onSubmit:e=>{e.preventDefault(),p()},children:(0,m.jsx)("input",{readOnly:!t,required:!0,autoFocus:!0,name:"name",defaultValue:i,className:(0,R.A)("text-gray-900 dark:text-gray-100 w-auto",t?"ring-1 ring-gray-500 bg-gray-50 px-2 py-1 dark:bg-slate-900":"bg-transparent")})}),(0,m.jsx)("button",{type:"button",title:"edit name",disabled:g,onClick:p,children:g?(0,m.jsx)(q.A,{size:16}):t?(0,m.jsx)(se,{className:"stroke-gray-500 !w-5 !h-5"}):(0,m.jsx)(X.A,{className:"fill-gray-500 !w-5 !h-5"})}),t&&!g&&(0,m.jsx)("button",{type:"button",disabled:g,onClick:()=>{r(!1);const e=s.current;if(e){e.querySelector("input").value=(null===c||void 0===c?void 0:c.name)||""}},children:(0,m.jsx)(J.A,{className:"!w-5 !h-5 fill-gray-500"})})]})},ae=({uid:e})=>{const{data:s,isSuccess:t,refetch:i}=(0,P.pR)(e),[l,{isSuccess:c,isLoading:d}]=(0,P.H7)(),o=(0,p.GV)((e=>{var s,t;return null!==(s=null===(t=e.server.loginConfig)||void 0===t?void 0:t.guest)&&void 0!==s&&s}),_.bN),{t:u}=(0,r.Bd)("setting",{keyPrefix:"bot"}),{t:x}=(0,r.Bd)();(0,a.useEffect)((()=>{c&&(n.oR.success(x("tip.update")),i())}),[c]);const g=t&&!(null===s||void 0===s||!s.is_public);return(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(A.A,{onClick:()=>{!d&&t&&s&&l({id:e,is_public:!s.is_public})},checked:g}
1),g&&!o&&(0,m.jsx)("span",{className:"text-xs text-orange-400 whitespace-normal max-w-[180px]",children:u("public_guest_off_tip")})]})},re=({uid:e})=>{const s=(0,a.useRef)(null),[t,r]=(0,a.useState)(!1),[i,l]=(0,a.useState)(""),{data:c,isSuccess:d,refetch:o}=(0,P.pR)(e),[u,{isSuccess:x,isLoading:g}]=(0,P.H7)();(0,a.useEffect)((()=>{d&&c&&l(c.webhook_url||"")}),[c,d]),(0,a.useEffect)((()=>{x&&o()}),[x]);const p=async()=>{if(t&&s){const t=s.current;if(null===t||void 0===t||!t.checkValidity())return void(null===t||void 0===t||t.reportValidity());const a=new FormData(t).get("webhook"),r=await u({id:e,webhook_url:a});if("error"in r){if(406===r.error.status)n.oR.error("Not Valid URL!");return}}r((e=>!e))};return(0,m.jsx)("div",{children:i||t||x?(0,m.jsxs)("div",{className:"flex gap-2",children:[(0,m.jsx)("form",{action:"/",ref:s,onSubmit:e=>{e.preventDefault(),p()},children:(0,m.jsx)("input",{readOnly:!t,required:!0,autoFocus:!0,type:"url",name:"webhook",defaultValue:i,className:(0,R.A)("text-sm text-gray-400 dark:text-gray-100 dark:bg-slate-900 px-2 py-1",t?"ring-1 ring-gray-500 bg-gray-50":"bg-transparent")})}),(0,m.jsx)("button",{type:"button",disabled:g,onClick:p,children:g?(0,m.jsx)(q.A,{size:16}):t?(0,m.jsx)(se,{className:"stroke-gray-500 !w-5 !h-5"}):(0,m.jsx)(X.A,{className:"fill-gray-500 !w-5 !h-5"})}),t&&!g&&(0,m.jsx)("button",{type:"button",disabled:g,onClick:()=>{r(!1);const e=s.current;if(e){e.querySelector("input").value=(null===c||void 0===c?void 0:c.webhook_url)||""}},children:(0,m.jsx)(J.A,{className:"!w-5 !h-5 fill-gray-500"})})]}):(0,m.jsx)("button",{type:"button",className:"rounded-full bg-primary-50 text-green-600 text-xs py-0.5 px-2",onClick:()=>{r(!0)},children:"Set Webhook"})})},ie=({uid:e,webhook:s,closeModal:t})=>{const[i,l]=(0,a.useState)(s),[o,{isSuccess:x,isLoading:g}]=(0,P.H7)(),p=(0,a.useRef)(null),{t:j}=(0,r.Bd)("setting",{keyPrefix:"bot"}),{t:h}=(0,r.Bd)();return(0,a.useEffect)((()=>{x&&(n.oR.success(h("tip.update")),t())}),[x]),(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:j("webhook_title"),description:j("webhook_desc"),buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{className:"cancel",onClick:t.bind(null,void 0),children:h("action.cancel")}),(0,m.jsx)(d.A,{disabled:!i,onClick:()=>{var s;if(!p||!p.current)return;const t=p.current;if(!t.checkValidity())return void t.reportValidity();const a=(null===(s=new FormData(t).get("webhook"))||void 0===s?void 0:s.toString())||"";o({id:e,webhook_url:a})},children:g?"Updating":h("action.done")})]}),children:(0,m.jsxs)("form",{ref:p,className:"w-full flex flex-col gap-2",action:"/",children:[(0,m.jsx)("label",{htmlFor:"webhook",className:"text-sm text-gray-500",children:"Webhook URL"}),(0,m.jsx)(k.A,{name:"webhook",value:i,onChange:e=>{l(e.target.value)},type:"url"})]})})})},le=({title:e,desc:s})=>(0,m.jsxs)("div",{className:"flex flex-col text-sm",children:[(0,m.jsx)("h2",{className:"font-semibold dark:text-white",children:e}),(0,m.jsx)("p",{className:"text-gray-400 text-xs",children:s})]}),ne="p-6 whitespace-nowrap text-sm font-medium text-gray-900 dark:text-gray-100 align-top";function ce(){const[e,{isSuccess:s}]=(0,P.tt)(),[t,i]=(0,a.useState)(!1),[l,c]=(0,a.useState)(void 0),[o,u]=(0,a.useState)(void 0),x=(0,p.GV)((e=>Object.values(e.users.byId).filter((e=>!!e.is_bot))),_.bN),g=(0,p.GV)((e=>e.server.version),_.bN),j=(0,a.useMemo)((()=>!!g&&(0,f.Gm)(g,U.U4)>=0),[g]),{t:h}=(0,r.Bd)("setting",{keyPrefix:"bot"}),{t:M}=(0,r.Bd)(),N=()=>{i((e=>!e))},y=e=>{u(e)};return(0,a.useEffect)((()=>{s&&n.oR.success(M("tip.update"))}),[s]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"flex flex-col justify-start items-start gap-4",children:[(0,m.jsxs)("div",{className:"flex flex-col gap-4 max-w-[634px] mb-4",children:[(0,m.jsx)(le,{title:h("bot_tip_title"),desc:h("bot_tip_desc")}),(0,m.jsx)(le,{title:h("webhook_tip_title"),desc:h("webhook_tip_desc")})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsxs)("h2",{className:"font-semibold flex gap-4 items-center dark:text-white",children:[h("manage"),(0,m.jsxs)("a",{href:"https://doc.voce.chat/bot/bot-and-webhook",target:"_blank",className:"text-sm text-blue-400 underline-offset-1 underline",rel:"noopener noreferrer",children:["\ud83d\udd17 ",h("how_to_use")]})]}),(0,m.jsx)("p",{className:"text-gray-400 text-xs",children:h("manage_desc")})]}),(0,m.jsx)("div",{className:"w-full md:w-fit overflow-auto md:overflow-hidden",children:(0,m.jsxs)("table",{className:"min-w-full table-auto",children:[(0,m.jsx)("thead",{className:"border-b dark:border-b-gray-500 bg-gray-50 dark:bg-gray-600",children:(0,m.jsx)("tr",{children:[h("col_avatar"),h("col_name"),h("col_api_key"),h("col_webhook"),...j?[h("col_public")]:[],h("col_opt")].map((e=>(0,m.jsx)("th",{scope:"col",className:"text-sm font-bold text-gray-900 dark:text-gray-100 px-6 py-4 text-left",children:e},e)))})}),(0,m.jsx)("tbody",{children:x.map((s=>{const{uid:t,name:a,avatar:r}=s;return(0,m.jsxs)("tr",{className:"bg-white dark:bg-gray-800 border-b dark:border-b-gray-500 transition duration-300 ease-in-out md:hover:bg-gray-100 dark:md:hover:bg-transparent",children:[(0,m.jsx)("td",{className:"px-4 py-2",children:(0,m.jsx)(B.A,{size:60,uid:t,url:r,uploadImage:e,name:a})}),(0,m.jsxs)("td",{className:`${ne}`,children:[(0,m.jsx)(te,{uid:t}),(0,m.jsxs)("div",{className:"text-xs text-gray-500",children:["#",t]})]}),(0,m.jsx)("td",{className:`${ne} py-2`,children:(0,m.jsx)(K,{uid:t})}),(0,m.jsx)("td",{className:ne,children:(0,m.jsx)(re,{uid:t})}),j&&(0,m.jsx)("td",{className:ne,children:(0,m.jsx)(ae,{uid:t})}),(0,m.jsx)("td",{className:ne,children:(0,m.jsx)("button",{type:"button",onClick:y.bind(null,{uid:t,name:a}),children:(0,m.jsx)(Y.A,{className:"hover:opacity-80"})})})]},t)}))})]})}),(0,m.jsx)("div",{className:"flex gap-4",children:(0,m.jsx)(d.A,{onClick:N,className:"small",children:M("action.add")})})]}),t&&(0,m.jsx)(F,{closeModal:N}),l&&(0,m.jsx)(ie,{closeModal:e=>{c(e)},...l}),o&&(0,m.jsx)(H,{closeModal:y,...o})]})}var de=t(15676),oe=t(22804);function ue(){const{t:e}=(0,r.Bd)("setting",{keyPrefix:"cloudflared"}),s=(0,p.GV)((e=>e.server.version),_.bN),t=!!s&&(0,f.Gm)(s,"0.5.19")>=0,[i,l]=(0,a.useState)("idle"),[c,o]=(0,a.useState)(null),[u,x]=(0,a.useState)(null),[g,j]=(0,a.useState)(0),[h,M]=(0,a.useState)([]),[N,y]=(0,a.useState)(!1),v=(0,a.useRef)(null),[b]=(0,D.Lk)(),[w,{isLoading:k}]=(0,D.wQ)();(0,a.useEffect)((()=>{t&&b().then((e=>{e.data&&(l(e.data.status),o(e.data.url),x(e.data.error))}))}),[t]);const A=e=>{var s;switch(s=e.message,M((e=>[...e.slice(-29),s])),e.event){case"downloading":l("downloading"),null!=e.progress&&j(e.progress);break;case"progress":l("starting");break;case"url":case"already_running":l("running"),o(e.url);break;case"error":l("error"),x(e.message);break;case"stopped":l("idle")}},I="running"===i||"downloading"===i||"starting"===i;return(0,m.jsx)(de.A,{version:"0.5.19",children:(0,m.jsxs)("div",{className:"setting-container max-md:w-full flex flex-col gap-6",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("h3",{className:"text-lg font-bold text-gray-800 dark:text-white",children:e("title")}),(0,m.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:e("desc")})]}),(0,m.jsx)("div",{className:"flex items-center gap-2",children:(0,m.jsx)("span",{className:`px-2.5 py-0.5 rounded-full text-xs font-semibold ${{idle:"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300",downloading:"bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300",starting:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/40 dark:text-yellow-300",running:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",error:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"}[i]}`,children:e(`status.${i}`)})}),"downloading"===i&&(0,m.jsxs)("div",{children:[(0,m.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 dark:text-gray-400 mb-1",children:[(0,m.jsx)("span",{children:e("downloading_binary")}),(0,m.jsxs)("span",{children:[g,"%"]})]}),(0,m.jsx)("div",{className:"w-full bg-gray-200 dark:bg-gray-700 rounded-full h-2",children:(0,m.jsx)("div",{className:"bg-blue-500 h-2 rounded-full transition-all duration-300",style:{width:`${g}%`}})})]}),"running"===i&&c&&(0,m.jsxs)("div",{className:"flex items-center gap-2 p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-700 rounded-lg",children:[(0,m.jsx)("a",{href:c,target:"_blank",rel:"noreferrer",className:"text-sm text-green-700 dark:text-green-300 font-mono break-all flex-1 hover:underline",children:c}),(0,m.jsx)("button",{onClick:()=>{c&&(navigator.clipboard.writeText(c),n.Ay.success(e("url_copied")))},className:"shrink-0 text-xs px-2 py-1 rounded bg-green-200 dark:bg-green-700 text-green-800 dark:text-green-100 hover:bg-green-300 dark:hover:bg-green-600 transition-colors",children:e("copy")})]}),"error"===i&&u&&(0,m.jsx)("div",{className:"p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-700 rounded-lg text-sm text-red-700 dark:text-red-300 break-all",children:u}),h.length>0&&(0,m.jsx)("div",{className:"p-3 bg-gray-50 dark:bg-gray-800 rounded-lg font-mono text-xs text-gray-500 dark:text-gray-400 max-h-44 overflow-y-auto flex flex-col gap-0.5",children:h.map(((e,s)=>(0,m.jsx)("div",{children:e},s)))}),(0,m.jsxs)("div",{className:"flex gap-3",children:[!I&&(0,m.jsx)(d.A,{disabled:N,onClick:async()=>
1{if(N)return;(0,oe.N)("create_tunnel_settings"),y(!0),l("starting"),M([]),o(null),x(null),j(0);const e=new AbortController;v.current=e;try{const{token:t}=(0,f.AJ)(),a=await fetch(`${U.tx}/api/admin/cloudflared/start`,{method:"POST",headers:{[U.tf]:t},signal:e.signal});if(!a.ok||!a.body)return l("error"),x(`HTTP ${a.status}`),void y(!1);const r=a.body.getReader(),i=new TextDecoder;let n="";for(;;){var s;const{done:e,value:t}=await r.read();if(e)break;n+=i.decode(t,{stream:!0});const a=n.split("\n\n");n=null!==(s=a.pop())&&void 0!==s?s:"";for(const s of a){const e=s.trim();if(e.startsWith("data:"))try{const s=JSON.parse(e.slice(5).trim());if(A(s),["url","error","stopped","already_running"].includes(s.event))return r.cancel(),void y(!1)}catch{}}}}catch(t){"AbortError"!==(null===t||void 0===t?void 0:t.name)&&(l("error"),x(String(t)))}finally{y(!1),v.current=null}},children:e("start")}),I&&(0,m.jsx)("button",{onClick:async()=>{var e;null===(e=v.current)||void 0===e||e.abort(),await w(),l("idle"),o(null),M([])},disabled:k,className:"px-4 py-2 rounded bg-red-500 hover:bg-red-600 disabled:opacity-50 text-white text-sm font-medium transition-colors",children:e(k?"stopping":"stop")})]})]})})}var xe=t(6696),me=t(91682),ge=t(54386);const pe=({link:e,text:s})=>(0,m.jsxs)("div",{className:"tip",children:[(0,m.jsx)(ge.A,{className:"dark:fill-gray-300"}),(0,m.jsx)("a",{href:e,target:"_blank",className:"link",rel:"noreferrer",children:s})]});var je=t(74385);function he(){const{t:e}=(0,r.Bd)("setting",{keyPrefix:"vocespace"}),[s,t]=(0,a.useState)(new Map),i=(0,p.GV)((e=>e.server.version),_.bN),l=(0,a.useMemo)((()=>(0,f.Gm)(i,"0.5.8")>=0),[i]),[c]=(0,D.Cv)();if(!l)return(0,m.jsx)("div",{className:"setting-container",style:{paddingBottom:172,height:"fit-content"},children:(0,m.jsx)(me.A,{children:e("old")})});const{changed:o,reset:u,values:x,setValues:g,toggleEnable:j,updateConfig:h,refetch:M}=L("vocespace"),N=e=>{const s=e.target.value,{type:t=""}=e.target.dataset;g((e=>e?{...e,[t]:s}:e))},y=async s=>{var a;(null===(a=(await c({url:s})).data)||void 0===a?void 0:a.check)||!1?s===x.url?g((e=>e?{...e,state:"success"}:e)):t((e=>{const t=new Map(e);return t.has(s)&&t.set(s,!0),g((e=>e?{...e,additional_domains:t}:e)),t})):n.Ay.error(`${s} ${e("failed")}`)};if((0,a.useEffect)((()=>{if(!x)return;const{additional_domains:e}=x;if(console.warn("vocespace additional_domains:",e),e){const s=e instanceof Map?e:new Map(Object.entries(e));t(s)}}),[x]),!x)return null;const{url:v,license:b,enabled:w=!1,password:I,state:T,server_type:E,additional_domains:C}=x;return(0,m.jsxs)("div",{className:"setting-container",style:{paddingBottom:172,height:"fit-content"},children:[(0,m.jsx)(le,{title:e("desc"),desc:`${e("sub_desc")}`}),(0,m.jsxs)("div",{className:"inputs",children:[(0,m.jsxs)("div",{className:"input row",children:[(0,m.jsxs)(me.A,{style:{color:"#fff",display:"flex",flexWrap:"wrap"},children:[(0,m.jsx)(me.A,{style:{display:"inline",width:"100%"},children:"Enable"}),(0,m.jsx)("div",{className:"text-gray-400",style:{fontSize:12},children:e("how_to")})]}),(0,m.jsx)(A.A,{onClick:j,checked:w})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)(me.A,{className:"list-disc list-inside text-sm",style:{fontWeight:700},children:e("prerequisite.0")}),(0,m.jsxs)("ol",{className:"list-disc list-inside text-sm text-gray-400 mb-4",style:{fontSize:12,margin:0},children:[(0,m.jsx)("li",{children:e("prerequisite.1")}),(0,m.jsx)("li",{children:e("prerequisite.2")}),(0,m.jsx)("li",{children:e("prerequisite.3")}),(0,m.jsxs)("li",{children:["VoceSpace Doc:"," ",(0,m.jsx)("a",{href:"https://doc.vocespace.com/",target:"_blank",className:"underline",children:"doc.vocespace.com"})]})]})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)("div",{className:"flex flex-col text-sm",children:(0,m.jsx)(me.A,{htmlFor:"url",style:{position:"relative",width:"100%"},children:"Server Type"})}),(0,m.jsxs)("div",{children:[(0,m.jsx)("a",{style:{fontSize:12},className:"mb-2 block text-gray-400 underline",href:"https://vocespace.com/local_deploy/"+("nas"===E?"nas.mp4":"vps.mp4"),target:"_blank",children:"https://vocespace.com/local_deploy/"+("nas"===E?"nas.mp4":"vps.mp4")}),(0,m.jsx)("video",{src:"https://vocespace.com/local_deploy/"+("nas"===E?"nas.mp4":"vps.mp4"),controls:!0,style:{width:"100%",borderRadius:8,backgroundColor:"#ddd"}})]}),(0,m.jsx)(je.A,{disabled:!w,options:["NAS","VPS","Other"],values:["nas","vps","other"],value:E||"vps",onChange:e=>{g((s=>s?{...s,server_type:e}:s))}}),(0,m.jsxs)("div",{className:"flex flex-col text-sm",children:[(0,m.jsxs)(me.A,{htmlFor:"url",style:{position:"relative",width:"100%"},children:[""===v.trim()&&w&&(0,m.jsx)("span",{style:{color:"red",position:"absolute",top:-4,left:-8,fontSize:16},children:"*"}),"Custom domain for VoceSpace"]}),(0,m.jsx)("p",{className:"text-gray-400 text-xs",children:e("domain_desc")})]}),(0,m.jsxs)("div",{className:"flex gap-2",style:{width:"100%"},children:[(0,m.jsx)(k.A,{className:"flex-1",disabled:!w,"data-type":"url",onChange:N,value:v,name:"url",placeholder:`https://video.${window.location.hostname} or http://1.2.3.4:8080`}),(0,m.jsx)(d.A,{style:{height:38,backgroundColor:"success"===T?"#00ff00dd":void 0},onClick:async()=>await y(v),disabled:!w,children:e("success"===T?"checked":"check")}),(0,m.jsx)(d.A,{style:{height:38},onClick:()=>{t((e=>{const s=e instanceof Map?new Map(e):new Map;return s.set("",!1),g((e=>e?{...e,additional_domains:s}:e)),s}))},disabled:!w,children:e("add")})]}),s&&s.size>0&&s.entries().map((([s,a],r)=>(0,m.jsxs)("div",{className:"flex gap-2 mt-2",style:{width:"100%"},children:[(0,m.jsx)(k.A,{className:"flex-1",disabled:!w,"data-type":"url",onChange:e=>((e,s)=>{const a=e.target.value;t((e=>{const t=e instanceof Map?new Map(e):new Map;let r=0;
1for(let i of t.keys()){if(r===s){t.delete(i),t.set(a,!1);break}r++}return g((e=>e?{...e,additional_domains:t}:e)),t}))})(e,r),value:s,placeholder:`https://video.${window.location.hostname} or http://1.2.3.4:8080`}),(0,m.jsx)(d.A,{style:{height:38,backgroundColor:a?"#00ff00dd":void 0},onClick:async()=>await y(s),disabled:!w,children:e(a?"checked":"check")})]},r)))]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"password",children:"Redis Password (Optional)"}),(0,m.jsx)(k.A,{disabled:!w,"data-type":"password",onChange:N,value:I,name:"password",placeholder:"This is optional field"})]})]}),(0,m.jsxs)("div",{children:[T&&(0,m.jsx)("div",{style:{fontSize:12},children:"success"===T?(0,m.jsx)(Me,{color:"#00ff00",className:"text-green-400",word:"VoceSpace deployed successfully."}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Me,{color:"gray",className:"text-gray-400",word:"VoceSpace is not deployed yet or failed."}),w&&(0,m.jsxs)("span",{className:"text-red-500",children:["please run the deploy_vocespace.sh in your vps or server ",(0,m.jsx)("br",{})," ",(0,m.jsx)("pre",{children:"chmod +x deploy_vocespace.sh && sh ./deploy_vocespace.sh"})]})]})}),(0,m.jsx)("div",{className:"list-disc list-inside text-sm text-gray-400 mb-4",style:{fontSize:12,margin:0,paddingTop:8},children:e("prerequisite.4")})]}),o&&(0,m.jsx)(xe.A,{saveHandler:async()=>{const e=x;if(""===e.url.trim()&&e.enabled)return void alert("Custom domain is required when enabling Vocespace.");e.server_type||(e.server_type="vps");const s={...e,additional_domains:e.additional_domains instanceof Map?Object.fromEntries(e.additional_domains):e.additional_domains},t=await h(s);if(t.error)n.Ay.error(`Auto Deploy Failed: ${t.error}`);else{let{data:e}=t;if("deployed"===e)return;{const s=document.createElement("a");const t=new Blob([e],{type:"text/plain"});s.href=URL.createObjectURL(t),s.download="deploy_vocespace.sh",document.body.appendChild(s),s.click()}}},resetHandler:u})]})}function Me({color:e,className:s,word:t}){return(0,m.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12},className:s,children:[(0,m.jsx)("div",{style:{display:"inline-block",height:12,width:12,backgroundColor:e,borderRadius:"50%"}}),t]})}function Ne(){const{t:e}=(0,r.Bd)("setting",{keyPrefix:"agora"}),[s,t]=(0,a.useState)(!1),i=(0,p.GV)((e=>e.server.version),_.bN),l=(0,a.useMemo)((()=>(0,f.Gm)(i,"0.5.6")>=0),[i]);(0,a.useEffect)((()=>{t(!l)}),[l]);const{changed:n,reset:c,values:d,setValues:o,toggleEnable:u,updateConfig:x}=L("agora"),g=e=>(0,R.A)("cursor-pointer p-2 box-border flex-center",e&&"border border-solid border-primary-400 shadow rounded-lg"),j=e=>{const s=e.target.value,{type:t=""}=e.target.dataset;o((e=>e?{...e,[t]:s}:e))};if(!d)return null;const{url:h,project_id:M,app_id:N,app_certificate:y,customer_id:v,customer_secret:b,enabled:w=!1}=d,D=h||"https://api.agora.io";return(0,m.jsxs)("div",{className:"setting-container",children:[l&&(0,m.jsxs)("ul",{className:"hidden md:flex border border-solid dark:border-gray-400 shadow rounded-lg box-border",style:{width:"fit-content"},children:[(0,m.jsx)("li",{className:g(!s),"data-view":"item",onClick:()=>t(!1),children:(0,m.jsx)(me.A,{children:"VoceSpace"})}),(0,m.jsx)("li",{className:g(s),"data-view":"grid",onClick:()=>t(!0),children:(0,m.jsx)(me.A,{children:"Agora"})})]}),s?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(le,{title:e("desc"),desc:e("sub_desc")}),(0,m.jsxs)("div",{className:"inputs",children:[(0,m.jsxs)("div",{className:"input row",children:[(0,m.jsxs)(me.A,{className:"flex items-center gap-2",children:["Enable",(0,m.jsx)(pe,{link:"https://doc.voce.chat/setting/setting-agora",text:e("how_to")})]}),(0,m.jsx)(A.A,{onClick:u,checked:w})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"url",children:"Agora URL"}),(0,m.jsx)(k.A,{disabled:!w,"data-type":"url",onChange:j,value:D,name:"url",placeholder:"Agora URL"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"project_id",children:"Project ID"}),(0,m.jsx)(k.A,{spellCheck:!1,disabled:!w,"data-type":"project_id",onChange:j,value:M,name:"project_id",placeholder:"Project ID"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"app_id",children:"App ID"}),(0,m.jsx)(k.A,{spellCheck:!1,disabled:!w,"data-type":"app_id",onChange:j,value:N,name:"app_id",placeholder:"APP ID"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"app_certificate",children:"APP Certificate"}),(0,m.jsx)(k.A,{spellCheck:!1,disabled:!w,"data-type":"app_certificate",onCh
1ange:j,value:y,name:"app_certificate",placeholder:"APP Certificate"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"customer_id",children:"Customer ID"}),(0,m.jsx)(k.A,{spellCheck:!1,disabled:!w,"data-type":"customer_id",onChange:j,value:v,name:"customer_id",placeholder:"Customer ID for RESTful API"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"customer_secret",children:"Customer Secret"}),(0,m.jsx)(k.A,{spellCheck:!1,disabled:!w,"data-type":"customer_secret",onChange:j,value:b,name:"customer_secret",placeholder:"Customer Secret for RESTful API"})]})]}),n&&(0,m.jsx)(xe.A,{saveHandler:()=>{const e=d;e.url||(e.url="https://api.agora.io"),x(e)},resetHandler:c})]}):(0,m.jsx)(he,{})]})}var ye=t(94784);function _e(){const{values:e,setValues:s,updateConfig:t,changed:a,reset:i}=L("firebase"),{t:l}=(0,r.Bd)("setting"),n={disable:l("firebase.disable"),official:l("firebase.use_official"),custom:l("firebase.custom")};let c="";if(e){const{use_official:s,enabled:t=!1}=e;c=t?s?"official":"custom":"disable"}const d=e=>{const t=e.target.value,{type:a=""}=e.target.dataset;s((e=>e?{...e,[a]:t}:e))};if(!e)return null;const{token_url:o,project_id:u,private_key:x,client_email:g}=e;return(0,m.jsxs)("div",{className:"setting-container max-md:w-full max-md:h-auto",children:[(0,m.jsx)(le,{title:l("firebase.desc"),desc:l("firebase.sub_desc")}),(0,m.jsx)(je.A,{options:Object.values(n),values:Object.keys(n),value:c,onChange:t=>{let a=null;switch(t){case"custom":a={...e,enabled:!0,use_official:!1};break;case"official":a={...e,enabled:!0,use_official:!0};break;case"disable":a={...e,enabled:!1}}a&&s(a)}}),(0,m.jsxs)("fieldset",{className:"inputs",disabled:"custom"!==c,children:[(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"name",children:l("firebase.token_url")}),(0,m.jsx)(k.A,{"data-type":"token_url",onChange:d,value:o,name:"token_url",placeholder:l("firebase.token_url")})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"project_id",children:l("firebase.project_id")}),(0,m.jsx)(k.A,{"data-type":"project_id",onChange:d,value:u,name:"project_id",placeholder:l("firebase.project_id")})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"private_key",children:l("firebase.private_key")}),(0,m.jsx)(ye.A,{rows:10,spellCheck:!1,"data-type":"private_key",onChange:d,value:x,name:"private_key",placeholder:l("firebase.private_key")})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"client_email",children:l("firebase.client_email")}),(0,m.jsx)(k.A,{"data-type":"client_email",onChange:d,value:g,name:"client_email",placeholder:l("firebase.client_email")})]})]}),a&&(0,m.jsx)(xe.A,{saveHandler:()=>{t(e)},resetHandler:()=>{i()}})]})}var fe,ve=t(54170);function be(){return be=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},be.apply(null,arguments)}const we=({title:e,titleId:s,...t},r)=>a.createElement("svg",be({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":s},t),e?a.createElement("title",{id:s},e):null,fe||(fe=a.createElement("path",{d:"M8.00004 1.33301C4.32004 1.33301 1.33337 4.31967 1.33337 7.99967C1.33337 11.6797 4.32004 14.6663 8.00004 14.6663C11.68 14.6663 14.6667 11.6797 14.6667 7.99967C14.6667 4.31967 11.68 1.33301 8.00004 1.33301ZM11.3334 8.66634H4.66671V7.33301H11.3334V8.66634Z",fill:"#D0D5DD"}))),De=(0,a.forwardRef)(we),ke=JSON.parse('[{"title":"Google","value":"accounts.google.com","selected":false,"icon":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwXzE1OTA1XzI0Njk1KSI+CjxwYXRoIGQ9Ik0yMy43NjYgMTIuMjc2M0MyMy43NjYgMTEuNDYwNSAyMy42OTk5IDEwLjY0MDQgMjMuNTU4OCA5LjgzNzg5SDEyLjI0VjE0LjQ1ODlIMTguNzIxN0MxOC40NTI4IDE1Ljk0OTIgMTcuNTg4NSAxNy4yNjc2IDE2LjMyMyAxOC4xMDU0VjIxLjEwMzdIMjAuMTlDMjIuNDYwOCAxOS4wMTM3IDIzLjc2NiAxNS45MjcyIDIzLjc2NiAxMi4yNzYzWiIgZmlsbD0iIzQyODVGNCIvPgo8cGF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&i.value)||!(null!==i&&void 0!==i&&i.title)||e.some((e=>e.domain===n));return(0,m.jsx)("div",{className:"py-4 w-full flex flex-col gap-4",children:(0,m.jsxs)("ul",{className:"flex flex-col gap-4",children:[e.map((({enable:t,favicon:a,domain:r})=>(0,m.jsxs)("li",{className:"flex items-center justify-between gap-10",children:[(0,m.jsxs)("div",{className:"flex-1 flex items-center justify-between",children:[(0,m.jsx)(De,{className:"cursor-pointer",onClick:()=>{s(e.filter((e=>e.domain!==r)))}}),(0,m.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[Boolean(a)&&(0,m.jsx)("img",{src:a,alt:"logo",className:"w-8 h-8"}),(0,m.jsx)(k.A,{readOnly:!0,value:r,prefix:"https://",placeholder:"Issuer Domain",className:"w-[280px]"})]})]}),(0,m.jsx)("div",{className:"w-14 flex justify-end",children:(0,m.jsx)(A.A,{checked:t,onClick:()=>{s(e.map((e=>({...e,enable:e.domain===r?!t:e.enable}))))}})})]},r))),(0,m.jsxs)("li",{className:"flex items-center justify-between gap-10 cursor-pointer",children:[(0,m.jsxs)("div",{className:"flex-1 flex items-center justify-between",children:[(0,m.jsx)(ve.A,{options:ke.map((s=>({...s,selected:e.some((e=>e.domain===s.value))}))),current:i,updateSelect:l}),(0,m.jsx)("div",{className:"flex items-center justify-between gap-4",children:(0,m.jsx)(k.A,{onChange:e=>{c(e.target.value)},readOnly:!(null===i||void 0===i||!i.value),value:(null===i||void 0===i?void 0:i.value)||n,prefix:"https://",placeholder:"domain.com",className:"w-[280px]"})})]}),(0,m.jsx)("div",{className:"w-14 flex justify-end",children:(0,m.jsx)(d.A,{disabled:o,onClick:()=>{const t=ke.find((e=>e.value===(null===i||void 0===i?void 0:i.value)));if(!t)return;const{icon:a,value:r}=t;s(e.concat({enable:!0,favicon:a||"",domain:r||n})),l(null),c("")},children:t("action.add")})})]})]})})};t(83750);const Ie=({to:e,newTab:s=!0,children:t})=>(0,m.jsx)("a",{href:e,className:"text-primary-500",target:s?"_blank":"_self",rel:"noreferrer",children:t});function Te({link:e="#"}){return(0,m.jsx)(b.Ay,{delay:[0,500],interactive:!0,arrow:w.qO,placement:"bottom",content:(0,m.jsx)("div",{className:"py-2 px-3 bg-gray-800 text-xs text-white rounded-lg",children:(0,m.jsx)(r.x6,{ns:"setting",i18nKey:"login.more_details",children:(0,m.jsx)(Ie,{to:e})})}),children:(0,m.jsx)(ge.A,{className:"icon"})})}function Le(){const{t:e}=(0,r.Bd)("setting",{keyPrefix:"login"}),{t:s}=(0,r.Bd)(),{changed:t,clientId:i,updateClientId:l,updateClientIdToServer:c}=function(){const[e,s]=(0,a.useState)(!1),[t,r]=(0,a.useState)(""),{data:i}=(0,D.LX)(void 0,{refetchOnMountOrArgChange:!0}),[l,{isSuccess:n}]=(0,D.pA)();return(0,a.useEffect)((()=>{i&&r(i.client_id)}),[i]),(0,a.useEffect)((()=>{s(!n&&(null===i||void 0===i?void 0:i.client_id)!==t)}),[i,t,n]),{config:i,changed:e,clientId:t,updateClientId:r,updateClientIdToServer:async()=>{t&&await l({client_id:t})},updateGoogleAuthConfig:l,isSuccess:n}}(),{config:d,changed:o,updateGithubAuthConfigToServer:u,updateGithubAuthConfig:x}=function(){const[e,s]=(0,a.useState)(!1),[t,r]=(0,a.useState)(),{data:i}=(0,D.Hx)(void 0,{refetchOnMountOrArgChange:!0}),[l,{isSuccess:n}]=(0,D.Vi)();return(0,a.useEffect)((()=>{i&&r(i)}),[i]),(0,a.useEffect)((()=>{s(!n&&JSON.stringify(i)!==JSON.stringify(t))}),[i,t,n]),{config:t,changed:e,updateGithubAuthConfig:e=>{r((s=>s?{...s,...e}:e))},updateGithubAuthConfigToServer:async()=>{t&&await l(t)},isSuccess:n}}(),{values:g,updateConfig:p,setValues:j,reset:h,changed:M}=L("login"),N=e=>{const{key:s}=e.target.dataset;s&&x({[s]:e.target.value})},y=e=>{j((s=>s?{...s,...e}:s))};if(!g)return null;const{google:_,magic_link:f,github:v,metamask:b,password:w,passkey:I,oidc:T=[]}=g,E=t||M||o;return(0,m.jsxs)("div",{className:"setting-container max-md:w-full max-md:h-auto",children:[(0,m.jsxs)("div",{className:"inputs",children:[(0,m.jsx)("div",{className:"input",children:(0,m.jsxs)("div",{className:"row",children:[(0,m.jsxs)("div",{className:"title",children:[(0,m.jsx)("div",{className:"txt",children:(0,m.jsx)(me.A,{children:e("password")})}),(0,m.jsx)("span",{className:"desc dark:!text-gray-400",children:e("password_desc")})]}),(0,m.jsx)(A.A,{onClick:y.bind(null,{password:!w}),checked:w})]})}),(0,m.jsx)("div",{className:"input",children:(0,m.jsxs)("div",{className:"row",children:[(0,m.jsxs)("div",{className:"title",children:[(0,m.jsx)("div",{className:"txt",children:(0,m.jsx)(me.A,{children:e("magic_link")})}),(0,m.jsx)("span",{className:"desc dark:!text-gray-400",children:e("magic_link_desc")})]}),(0,m.jsx)(A.A,{onClick:y.bind(null,{magic_link:!f}),checked:f})]})}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsxs)("div",{className:"row",children:[(0,m.jsxs)("div",{className:"title",children:[(0,m.jsxs)("div",{className:"txt",children:[(0,m.jsx)(me.A,{children:e("google")}),(0,m.jsx)(Te,{link:"https://doc.voce.chat/setting/third_login/login-google"})]}),(0,m.jsx)("span",{className:"desc dark:!text-gray-400",children:e("google_desc")})]}),(0,m.jsx)(A.A,{onClick:y.bind(null,{google:!_}),checked:_})]}),(0,m.jsx)("div",{className:"row",children:(0,m.jsx)(k.A,{disabled:!_,onChange:e=>{l(e.target.value)},placeholder:"Client ID",value:i})})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsxs)("div",{className:"row",children:[(0,m.jsxs)("div",{className:"title",children:[(0,m.jsxs)("div",{className:"txt",children:[(0,m.jsx)(me.A,{children:e("github")}),(0,m.jsx)(Te,{link:"https://doc.voce.chat/setting/third_login/login-github"})]}),(0,m.jsx)("span",{className:"desc dark:!text-gray-400",children:e("github_desc")})]}),(0,m.jsx)(A.A,{onClick:y.bind(null,{github:!v}),checked:v})]}),(0,m.jsxs)("div",{className:"row inputs",children:[(0,m.jsx)(k.A,{disabled:!v,"data-key":"client_id",onChange:N,placeholder:"GitHub Client ID",value:null===d||void 0===d?void 0:d.client_id}),(0,m.jsx)(k.A,{disabled:!v,"data-key":"client_secret",onChange:N,placeholder:"GitHub Client Secret",value:null===d||void 0===d?void 0:d.client_secret})]})]}),(0,m.jsx)("div",{className:"input",children:(0,m.jsxs)("div",{className:"row",children:[(0,m.jsxs)("div",{className:"title",children:[(0,m.jsxs)("div",{className:"txt",children:[(0,m.jsx)(me.A,{children:e("metamask")}),(0,m.jsx)(Te,{link:"https://doc.voce.chat/setting/third_login/login-metamask"})]}),(0,m.jsx)("span",{className:"desc dark:!text-gray-400",children:e("metamask_desc")})]}),(0,m.jsx)(A.A,{onClick:y.bind(null,{metamask:!b}),checked:b})]})}),(0,m.jsx)(de.A,{empty:!0,version:"0.5.5",children:(0,m.jsx)("div",{className:"input",children:(0,m.jsxs)("div",{className:"row",children:[(0,m.jsxs)("div",{className:"title",children:[(0,m.jsx)("div",{className:"txt",children:(0,m.jsx)(me.A,{children:e("passkey")})}),(0,m.jsx)("span",{className:"desc dark:!text-gray-400",children:e("passkey_desc")})]}),(0,m.jsx)(A.A,{onClick:y.bind(null,{passkey:!I}),checked:I})]})})}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)("div",{className:"row",children:(0,m.jsxs)("div",{className:"title",children:[(0,m.jsxs)("div",{className:"txt",children:[(0,m.jsx)(me.A,{children:e("oidc")}),(0,m.jsx)(Te,{link:"https://doc.voce.chat/setting/third_login/login-webid"})]}),(0,m.jsx)("span",{className:"desc dark:!text-gray-400",children:e("oidc_de
1sc")})]})}),(0,m.jsx)("div",{className:"row",children:(0,m.jsx)(Ae,{issuers:T,onChange:e=>{j((s=>s?{...s,oidc:e}:s))}})})]})]}),E&&(0,m.jsx)(xe.A,{saveHandler:async()=>{const{google:e}=g;M&&p(g),e&&t&&(await c(),M||n.Ay.success(s("tip.update"))),v&&o&&(await u(),M||n.Ay.success(s("tip.update")))},resetHandler:h})]})}function Ee(){const{t:e}=(0,r.Bd)("setting",{keyPrefix:"smtp"}),[s,t]=(0,a.useState)(""),[i,{isSuccess:l,isError:c}]=(0,D.lg)(),{reset:o,updateConfig:u,values:x,originalValues:g,setValues:p,changed:j,toggleEnable:h}=L("smtp"),M=e=>{const s=e.target.value,{type:t=""}=e.target.dataset;p((e=>e?{...e,[t]:s}:e))};if((0,a.useEffect)((()=>{l&&n.Ay.success("Send Test Email Successfully"),c&&n.Ay.error("Send Test Email Fail")}),[l,c]),!x)return null;const{host:N,port:y,from:_,username:f,password:v,enabled:b=!1}=x;return(0,m.jsxs)("div",{className:"setting-container max-md:w-full",children:[(0,m.jsx)(le,{title:(0,m.jsx)(r.x6,{ns:"setting",i18nKey:"smtp.desc",children:(0,m.jsx)(Ie,{newTab:!1,to:"/#/setting/license"})}),desc:e("sub_desc")}),(0,m.jsxs)("div",{className:"inputs",children:[(0,m.jsxs)("div",{className:"input row",children:[(0,m.jsxs)(me.A,{className:"flex items-center gap-2",children:[e("enable")," ",(0,m.jsx)(pe,{link:"https://doc.voce.chat/setting/smtp/smtp-gmail",text:e("how_to")})]}),(0,m.jsx)(A.A,{onClick:h,checked:b})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"host",children:e("host")}),(0,m.jsx)(k.A,{disabled:!b,"data-type":"host",onChange:M,value:N,name:"host",placeholder:"SMTP Host"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"port",children:e("port")}),(0,m.jsx)(k.A,{disabled:!b,type:"number","data-type":"port",onChange:M,value:y,name:"port",placeholder:"SMTP Port"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"from",children:e("from")}),(0,m.jsx)(k.A,{disabled:!b,"data-type":"from",onChange:M,value:_,name:"from",placeholder:"SMTP From"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"username",children:e("username")}),(0,m.jsx)(k.A,{disabled:!b,"data-type":"username",onChange:M,value:f,name:"username",placeholder:"SMTP Username"})]}),(0,m.jsxs)("div",{className:"input",children:[(0,m.jsx)(me.A,{htmlFor:"password",children:e("password")}),(0,m.jsx)(k.A,{type:"password",disabled:!b,"data-type":"password",onChange:M,value:v,name:"password",placeholder:"SMTP Password"})]})]}),(0,m.jsxs)("div",{className:"flex gap-4 whitespace-nowrap mt-6",children:[(0,m.jsx)(k.A,{type:"email",disabled:!g.enabled,onChange:e=>{const s=e.target.value;t(s)},value:s,name:"email",placeholder:"[email protected]"}),(0,m.jsx)(d.A,{disabled:!b||!s,onClick:()=>{i({to:s,subject:"test title",content:"test content"})},children:e("send_test_email")})]}),j&&(0,m.jsx)(xe.A,{saveHandler:()=>{var e;u({...x,port:Number(null!==(e=null===x||void 0===x?void 0:x.port)&&void 0!==e?e:0)})},resetHandler:o})]})}var Ce=t(38219);const Oe=()=>{const e=(0,p.GV)((e=>{var s;return null!==(s=e.server.max_file_expiry_mode)&&void 0!==s?s:"Off"}),_.bN),{t:s}=(0,r.Bd)("setting",{keyPrefix:"data.auto_delete_file"}),{t:t}=(0,r.Bd)(),{refetch:i}=(0,D.Mv)(),[l,o]=(0,a.useState)(e),[x,{isSuccess:g,isLoading:j}]=(0,D.u3)();(0,a.useEffect)((()=>{g&&(i(),n.oR.success(t("tip.update")))}),[g]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Ce.A,{title:s("title"),desc:s("desc"),children:(0,m.jsx)(je.A,{options:[s("off"),s("day1"),s("day7"),s("day30"),s("day90"),s("day180")],values:["Off","Day1","Day7","Day30","Day90","Day180"],value:e,onChange:e=>{o(e)}})}),l!==e&&(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:"Are you sure?",description:"Off"==l?"":s("confirm_desc"),buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{className:"cancel",onClick:()=>{o(e)},children:t("action.cancel")}),(0,m.jsx)(d.A,{onClick:()=>{x({max_file_expiry_mode:l})},className:"danger",children:j?"Updating":t("action.yes")})]})})})]})},ze=({context:e,title:s,desc:t,closeModal:i})=>{const{t:l}=(0,r.Bd)(),[o,{isLoading:x,isSuccess:g}]=(0,D.J9)(),[p,{isLoading:j,isSuccess:h}]=(0,D.kw)(),M=g||h;(0,a.useEffect)((()=>{M&&(n.Ay.success("Clear success"),i())}),[M]);const N=j||x;return(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{title:s,description:t,buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{className:"cancel",onClick:i,children:l("action.cancel")}),(0,m.jsx)(d.A,{onClick:()=>{switch(e){case"chat":p();break;case"files":o()}},className:"danger",children:N?"Clearing":l("action.remove")})]})})})};function Se(){const[e,s]=(0,a.useState)(null),{t:t}=(0,r.Bd)("setting"),i=e=>{s(e)},l={chat:t("data.clear_msgs.desc"),files:t("data.clear_files.desc")};return(0,m.jsxs)("div",{className:"relative w-full md:w-[512px] flex flex-col gap-6",children:[(0,m.jsx)(de.A,{version:"0.3.10",empty:!0,children:(0,m.jsx)(Ce.A,{title:t("data.clear_msgs.title"),desc:t("data.clear_msgs.desc"),children:(0,m.jsx)(d.A,{onClick:i.bind(null,"chat"),className:"danger",children:t("data.clear_msgs.btn")})})}),(0,m.jsx)(Ce.A,{title:t("data.clear_files.title"),desc:t("data.clear_files.desc"),children:(0,m.jsx)(d.A,{onClick:i.bind(null,"files"),className:"danger",children:t("data.clear_files.btn")})}),(0,m.jsx)(Oe,{}),e&&(0,m.jsx)(ze,{closeModal:i.bind(null,null),context:e,title:"Are you sure?",desc:l[e]})]})}var Ue=t(33162),Pe=t(31859);const Be=e=>{const s=N()();let t=s;switch(e){case"year":t=s.add(100,"year");break;case"month":t=s.add(1,"month");break;case"quarter":t=s.add(3,"month")}return t.format("YYYY-MM-DD")},Ye=(0,U.JZ)(),Re=({closeModal:e})=>{const{t:s}=(0,r.Bd)("setting"),{t:t}=(0,r.Bd)(),[i,{isLoading:l,isSuccess:o}]=(0,D.Bh)(),[x,g]=(0,a.useState)(location.hostname),[p,j]=(0,a.useState)(!1),[h,M]=(0,a.useState)(`${Ye[0].pid}|${Ye[0].limit}|${Ye[0].type}|${Ye[0].sub_dur||""}`),N=()=>{j((e=>!e))},y=h.includes("booking");return(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{footer:(0,m.jsx)("div",{className:"text-sm text-gray-400 dark:text-gray-100 mt-3",children:s("vocespace.prerequisite.4")}),title:s("license.renew"),description:s("license.renew_select"),buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{onClick:e,className:"ghost",children:t("action.cancel")}),y?(0,m.jsx)(d.A,{className:"text-sm text-white bg-primary-400 break-keep shadow rounded-lg px-3.5 py-2.5 md:hover:bg-primary-500 active:bg-primary-500 disabled:bg-gray-300",onClick:()=>{window.open("https://buy.stripe.com/bJeaEX9ex2PUer2aLe6c00O","_blank")},children:s("license.renew")}):(0,m.jsx)(b.Ay,{visible:p,interactive:!0,placement:"top-end",offset:[-50,-40],trigger:"click",content:(0,m.jsxs)("div",{className:"p-3 rounded-lg border border-solid border-gray-200 dark:border-gray-900 flex flex-col items-start gap-3 w-[430px] bg-white dark:bg-gray-800 shadow shadow-gray-200 dark:shadow-gray-900 drop-shadow-xl",children:[(0,m.jsx)("div",{className:"text-gray-500 text-sm",children:s("license.tip_domain")}),(0,m.jsx)(k.A,{value:x,onChange:e=>{g(e.target.value)}}),(0,m.jsxs)("div",{className:"flex justify-between items-center w-full mt-4",children:[(0,m.jsxs)("span",{className:"text-xs text-orange-500 text-left",children:[" ",s("license.tip_port")]}),(0,m.jsxs)("div",{className:"flex gap-3 whitespace-nowrap",children:[(0,m.jsx)(d.A,{className:"mini cancel",onClick:N,children:t("action.cancel")}),(0,m.jsx)(d.A,{className:"mini",disabled:l||o,onClick:async()=>{const e=`https://${x}`;if(!Pe.t6(e))return void n.Ay.error("Invalid Host");if(""!==new URL(e).port||x.endsWith(":443"))return void n.Ay.error(s("license.tip_port"));const[t,a,r,l="month"]=h.split("|"),c={user_limit:Number(a),expire:Be("subscription"==r?l:"year"),domain:x.startsWith("localhost")?"*":x},d=await i({type:r,priceId:t,metadata:c,cancel_url:location.href,success_url:`${location.origin}/#/cb/payment_success`});"error"in d?n.Ay.error("Payment link initialized failed!"):(d.data,location.href=d.data.session_url)},children:l?"Initialize Payment URL":o?"Redirecting":s("license.tip_confirm")})]})]})]}),children:(0,m.jsxs)("button",{onClick:N,className:"text-sm text-white bg-primary-400 break-keep shadow rounded-lg px-3.5 py-2.5 md:hover:bg-primary-500 active:bg-primary-500 disabled:bg-gray-300",children:[" ",s("license.renew")]})})]}),children:(0,m.jsx)(je.A,{options:Ye.map((({title:e,desc:s,price:t})=>`${e} ${s?`[${s}]`:""}${t?`[${t}]`:""}`)),values:Ye.map((({pid:e,limit:s,type:t="payment",sub_dur:a="month"})=>`${e}|${s}|${t}|${a}`)),value:h,onChange:e=>{M(e)}})})})},Qe=({closeModal:e,updateLicense:s,updating:t,updated:i})=>{const[l,o]=(0,a.useState)(""),{t:x}=(0,r.Bd)("setting"),{t:g}=(0,r.Bd)();return(0,a.useEffect)((()=>
1{i&&(n.Ay.success(g("tip.update")),e())}),[i]),(0,m.jsx)(c.A,{id:"modal-modal",children:(0,m.jsx)(u.A,{buttons:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(d.A,{onClick:e,className:"ghost",children:g("action.cancel")}),(0,m.jsx)(d.A,{disabled:t||i||!l,onClick:async()=>{const e=await s(l);"boolean"!=typeof e||e||n.Ay.error("Check License Invalid!")},children:t?"Updating":i?"Update Successfully":x("license.update")})]}),children:(0,m.jsx)(ye.A,{rows:18,placeholder:x("license.update_placeholder"),value:l,onChange:e=>{o(e.target.value)}})})})},Ge=({label:e,data:s,foldable:t=!1,...a})=>{const r=(0,R.A)("font-bold w-full cursor-pointer dark:text-green-500",t?"truncate":"whitespace-pre-wrap break-all");return s?(0,m.jsxs)("div",{className:"whitespace-nowrap  flex flex-col items-start justify-start text-lg",children:[(0,m.jsx)("span",{className:"text-sm text-green-500",children:e}),Array.isArray(s)?(0,m.jsx)("ul",{className:r,children:s.map((e=>(0,m.jsx)("li",{children:e},e)))}):(0,m.jsx)("span",{className:r,...a,children:s})]}):null};function Ve(){var e;const{t:s,i18n:t}=(0,r.Bd)("setting"),{license:i,reachLimit:l,upsertLicense:n,upserting:c,upserted:o}=(0,Ue.A)(!0),[u,x]=(0,a.useState)(!1),[g,p]=(0,a.useState)(!1),[j,h]=(0,a.useState)(!0),M=()=>{x((e=>!e))},y=()=>{p((e=>!e))};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"max-w-3xl flex flex-col justify-start items-start gap-4",children:[(0,m.jsxs)("div",{className:(0,R.A)("relative w-full p-3 rounded border-solid border flex flex-col gap-4 shadow",l?"border-red-600 bg-red-200/50":"border-green-600 bg-green-100 dark:bg-green-900"),children:[(0,m.jsx)(Ge,{label:s("license.signed"),data:null!==i&&void 0!==i&&i.sign?"Yes":"Not Yet"}),(0,m.jsx)(Ge,{label:s("license.domain"),data:null===i||void 0===i?void 0:i.domains}),(0,m.jsx)(Ge,{label:s("license.user_limit"),data:(null!==(e=null===i||void 0===i?void 0:i.user_limit)&&void 0!==e?e:0)>=999999?"No Limit":null===i||void 0===i?void 0:i.user_limit}),(0,m.jsx)(Ge,{label:s("license.expire"),data:N()(null===i||void 0===i?void 0:i.expired_at).format("YYYY-MM-DD h:mm:ss A")}),(0,m.jsx)(Ge,{label:s("license.create"),data:N()(null===i||void 0===i?void 0:i.created_at).format("YYYY-MM-DD h:mm:ss A")}),(0,m.jsx)(Ge,{label:s("license.value"),data:null===i||void 0===i?void 0:i.base58,foldable:j,title:j?"Click to see full text":"Click to fold text",onClick:()=>{h((e=>!e))}})]}),(0,m.jsxs)("div",{className:"flex gap-2",children:[(0,m.jsx)(d.A,{onClick:M,children:s("license.renew")}),(0,m.jsx)(d.A,{onClick:y,className:"ghost",children:s("license.update")})]}),(0,m.jsxs)("div",{className:"flex flex-col gap-4 bg-primary-500 text-white rounded drop-shadow-xl p-5",children:[(0,m.jsxs)("h2",{className:"text-2xl font-bold",children:[s("license.tip.title")," \ud83c\udf81"]}),(0,m.jsxs)("p",{className:"flex flex-col",children:[(0,m.jsx)("span",{children:s("license.tip.user_test")}),(0,m.jsxs)("span",{children:[s("license.tip.contact"),t.language.startsWith("zh")?"Privoce":(0,m.jsx)("a",{className:"underline text-lg text-green-200",href:"https://calendly.com/hansu/han-meeting",target:"_blank",rel:"noopener noreferrer",children:"https://calendly.com/hansu/han-meeting"})]})]})]})]}),u&&(0,m.jsx)(Re,{closeModal:M}),g&&(0,m.jsx)(Qe,{updated:o,updating:c,updateLicense:n,closeModal:y})]})}var We=t(1346),Ke=t(20379);const Fe=[{type:"telegram",name:"Telegram Bot",description:"Telegram Bot API with media support",fields:[{name:"bot_token",type:"text",label:"Bot Token",placeholder:"123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11",required:!0,description:"Get from @BotFather"},{name:"chat_id",type:"text",label:"Chat ID",placeholder:"@your_channel or user_id",required:!0,description:"Channel username or user ID"},{name:"parse_mode",type:"select",label:"Parse Mode",required:!1,description:"Message formatting mode",options:[{value:"",label:"None"},{value:"Markdown",label:"Markdown"},{value:"MarkdownV2",label:"MarkdownV2"},{value:"HTML",label:"HTML"}]}]},{type:"discord",name:"Discord Webhook",description:"Discord webhook notifications with rich embeds",fields:[{name:"webhook_url",type:"url",label:"Webhook URL",placeholder:"https://discord.com/api/webhooks/...",required:!0,description:"Discord webhook URL"},{name:"username",type:"text",label:"Username",placeholder:"VoceChat Bot",required:!1,description:"Override webhook username"},{name:"avatar_url",type:"url",label:"Avatar URL",placeholder:"https://example.com/avatar.png",required:!1,description:"Override webhook avatar"}]},{type:"feishu",name:"Feishu Bot",description:"Feishu (Lark) webhook notifications",fields:[{name:"webhook_url",type:"url",label:"Webhook URL",placeholder:"https://open.feishu.cn/open-apis/bot/v2/hook/...",required:!0,description:"Feishu webhook URL"},{name:"sign_secret",type:"text",label:"Sign Secret",placeholder:"Optional signing secret",required:!1,description:"For signature verification"}]},{type:"dingtalk",name:"DingTalk Bot",description:"DingTalk webhook notifications",fields:[{name:"webhook_url",type:"url",label:"Webhook URL",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",required:!0,description:"DingTalk webhook URL"},{name:"sign_secret",type:"text",label:"Sign Secret",placeholder:"Optional signing secret",required:!1,description:"For signature verification"}]},{type:"wecombot",name:"WeCom Bot",description:"WeCom (WeChat Work) webhook notifications",fields:[{name:"webhook_url",type:"url",label:"Webhook URL",placeholder:"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=...",required:!0,description:"WeCom webhook URL"}]},{type:"bark",name:"Bark",description:"Bark iOS notification service",fields:[{name:"server_url",type:"url",label:"Server URL",placeholder:"https://api.day.app",required:!0,description:"Bark server URL"},{name:"device_key",type:"text",label:"Device Key",placeholder:"Your device key",required:!0,description:"Device key from Bark app"},{name:"sound",type:"text",label:"Sound",placeholder:"default",required:!1,description:"Notification sound name"}]},{type:"gotify",name:"Gotify",description:"Gotify self-hosted notification server",fields:[{name:"server_url",type:"url",label:"Server URL",placeholder:"https://gotify.example.com",required:!0,description:"Gotify server URL"},{name:"app_token",type:"text",label:"App Token",placeholder:"Application token",required:!0,description:"Application token from Gotify"},{name:"priority",type:"number",label:"Priority",placeholder:"5",required:!1,description:"Message priority (0-10)"}]},{type:"serverchan",name:"Server Chan",description:"Server Chan notification service",fields:[{name:"send_key",type:"text",label:"SendKey",placeholder:"Your SendKey",required:!0,description:"SendKey from Server Chan"}]},{type:"pushdeer",name:"PushDeer",description:"PushDeer notification service",fields:[{name:"server_url",type:"url",label:"Server URL",placeholder:"https://api2.pushdeer.com",required:!0,description:"PushDeer server URL"},{name:"push_key",type:"text",label:"Push Key",placeholder:"Your push key",required:!0,description:"Push key from PushDeer"}]},{type:"matrix",name:"Matrix",description:"Matrix protocol notifications",fields:[{name:"homeserver_url",type:"url",label:"Homeserver URL",placeholder:"https://matrix.org",required:!0,description:"Matrix homeserver URL"},{name:"access_token",type:"text",label:"Access Token",placeholder:"Your access token",required:!0,description:"Matrix access token"},{name:"room_id",type:"text",label:"Room ID",placeholder:"!roomid:matrix.org",required:!0,description:"Matrix room ID"}]}
1,{type:"custom_json",name:"Custom JSON Webhook",description:"Custom HTTP webhook with JSON payload",fields:[{name:"webhook_url",type:"url",label:"Webhook URL",placeholder:"https://example.com/webhook",required:!0,description:"HTTP endpoint URL"},{name:"method",type:"select",label:"HTTP Method",required:!0,description:"HTTP request method",options:[{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"PATCH",label:"PATCH"}]},{name:"headers",type:"textarea",label:"Custom Headers",placeholder:'{"Authorization": "Bearer token"}',required:!1,description:"JSON object with custom headers"},{name:"body_template",type:"textarea",label:"Body Template",placeholder:'{"message": "{{content}}", "user": "{{sender}}"}',required:!1,description:"JSON template with placeholders"}]}];function He(e){return Fe.find((s=>s.type===e))}function Ze(){const{t:e}=(0,r.Bd)("setting",{keyPrefix:"notification"}),[s,t]=(0,a.useState)(null),[i,l]=(0,a.useState)(null),[c,u]=(0,a.useState)({}),x=(0,p.GV)((e=>e.server.version),_.bN),g=(0,a.useMemo)((()=>x&&(0,f.Gm)(x,"0.5.11")>=0),[x]),{data:j=[],isLoading:h}=(0,Ke.$9)(void 0,{skip:!g}),{data:M=[],isLoading:N}=(0,Ke.Jm)(void 0,{skip:!g}),y=(0,p.GV)((e=>Object.values(e.channels.byId)),_.bN),[v,{isLoading:b}]=(0,Ke.$H)(),[w,{isLoading:D}]=(0,Ke.QI)(),[I,{isLoading:T}]=(0,Ke.aE)(),[L]=(0,Ke.TL)(),E=()=>{t(null),l(null),u({})},C=(e,s)=>{u((t=>({...t,config:{...t.config,[e]:s}})))};if(h||N)return(0,m.jsx)("div",{className:"setting-container max-md:w-full",children:(0,m.jsx)("div",{className:"text-gray-500",children:e("loading")})});if(0===j.length)return(0,m.jsxs)("div",{className:"setting-container max-md:w-full",children:[(0,m.jsx)(le,{title:e("desc")}),(0,m.jsx)("div",{className:"text-gray-500 mt-4",children:e("no_channels")})]});const O=c.channel_type?He(c.channel_type):null,z=null!==s||null!==i;return(0,m.jsx)(de.A,{version:"0.5.11",children:(0,m.jsxs)("div",{className:"setting-container max-md:w-full",children:[(0,m.jsx)(le,{title:e("desc")}),M.length>0&&(0,m.jsxs)("div",{className:"mt-6",children:[(0,m.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-4",children:e("my_channels")}),(0,m.jsx)("div",{className:"space-y-3",children:M.map((s=>{const a=He(s.channel_type);return(0,m.jsx)("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-white dark:bg-gray-800",children:(0,m.jsxs)("div",{className:"flex items-start justify-between",children:[(0,m.jsxs)("div",{className:"flex-1",children:[(0,m.jsx)("h4",{className:"font-semibold text-gray-900 dark:text-gray-100",children:s.name}),(0,m.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-1",children:(null===a||void 0===a?void 0:a.name)||s.channel_type}),(0,m.jsxs)("p",{className:"text-sm text-gray-600 dark:text-gray-300 mt-2",children:[e("status"),":"," ",(0,m.jsx)("span",{className:s.enabled?"text-green-600 dark:text-green-400":"text-gray-500",children:s.enabled?e("enabled"):e("disabled")})]})]}),(0,m.jsxs)("div",{className:"flex gap-2 ml-4",children:[(0,m.jsx)(d.A,{className:"mini",onClick:()=>(e=>{t(e.id),u({channel_type:e.channel_type,name:e.name,enabled:e.enabled,config:e.config,trigger_on_all_messages:e.trigger_on_all_messages,trigger_on_mentions:e.trigger_on_mentions,trigger_on_groups:e.trigger_on_groups,skip_when_online:e.skip_when_online,rate_limit_rps:e.rate_limit_rps})})(s),children:e("edit")}),(0,m.jsx)(d.A,{className:"mini",onClick:()=>(async s=>{try{await L(s).unwrap(),n.Ay.success(e("test_success"))}catch(t){n.Ay.error(e("test_error")),console.error("Failed to test channel:",t)}})(s.id),children:e("test")}),(0,m.jsx)(d.A,{className:"mini danger",onClick:()=>(async s=>{try{await I(s).unwrap(),n.Ay.success(e("delete_success"))}catch(t){n.Ay.error(e("delete_error")),console.error("Failed to delete channel:",t)}})(s.id),disabled:T,children:e("delete")})]})]})},s.id)}))})]}),!z&&(0,m.jsxs)("div",{className:"mt-8",children:[(0,m.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-4",children:e("available_types")}),(0,m.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:j.map((s=>{He(s.id);return(0,m.jsxs)("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-white dark:bg-gray-800 flex flex-col",children:[(0,m.jsx)("h4",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-2",children:s.name}),(0,m.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-4 flex-1",children:s.description}),(0,m.jsx)(d.A,{onClick:()=>{return e=s.id,l(e),void u({channel_type:e,name:"",enabled:!0,config:{},trigger_on_all_messages:!1,trigger_on_mentions:!0,trigger_on_groups:[],skip_when_online:!0});var e},className:"w-full",children:e("create_channel")})]},s.id)}))})]}),z&&c.channel_type&&(0,m.jsxs)("div",{className:"mt-8 border border-gray-200 dark:border-gray-700 rounded-lg p-6 bg-white dark:bg-gray-800",children:[(0,m.jsx)("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100 mb-6",children:e(s?"edit_channel":"create_channel")}),(0,m.jsxs)("div",{className:"space-y-4 max-h-[60vh] overflow-y-auto",children:[(0,m.jsxs)("div",{children:[(0,m.jsxs)(me.A,{className:"block mb-2",children:[e("channel_name")," *"]}),(0,m.jsx)(k.A,{value:c.name||"",onChange:e=>u({...c,name:e.target.value}),placeholder:"My Notification Channel",className:"w-full"})]}),O&&O.fields.length>0&&(0,m.jsxs)("div",{className:"pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,m.jsx)(me.A,{className:"block font-semibold mb-3",children:e("channel_c
1onfig")}),(0,m.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-4",children:O.description}),O.fields.map((e=>{var s,t,a,r;return(0,m.jsxs)("div",{className:"mb-3",children:[(0,m.jsxs)(me.A,{className:"block mb-2",children:[e.label," ",e.required&&"*"]}),"textarea"===e.type?(0,m.jsx)(ye.A,{value:(null===(s=c.config)||void 0===s?void 0:s[e.name])||"",onChange:s=>C(e.name,s.target.value),placeholder:e.placeholder,className:"w-full",rows:3}):"select"===e.type?(0,m.jsx)(ve.A,{value:(null===(t=c.config)||void 0===t?void 0:t[e.name])||"",onChange:s=>C(e.name,s.target.value),className:"w-full",children:null===(a=e.options)||void 0===a?void 0:a.map((e=>(0,m.jsx)("option",{value:e.value,children:e.label},e.value)))}):(0,m.jsx)(k.A,{type:e.type,value:(null===(r=c.config)||void 0===r?void 0:r[e.name])||"",onChange:s=>C(e.name,s.target.value),placeholder:e.placeholder,className:"w-full"}),e.description&&(0,m.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1",children:e.description})]},e.name)}))]}),(0,m.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,m.jsx)(me.A,{children:e("enable_notifications")}),(0,m.jsx)(A.A,{checked:c.enabled||!1,onClick:()=>u({...c,enabled:!c.enabled})})]}),(0,m.jsxs)("div",{className:"space-y-3 pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,m.jsx)(me.A,{className:"block font-semibold",children:e("trigger_conditions")}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(o.A,{checked:c.trigger_on_all_messages||!1,onClick:()=>u({...c,trigger_on_all_messages:!c.trigger_on_all_messages})}),(0,m.jsx)("span",{className:"text-sm",children:e("trigger_on_all_messages")})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(o.A,{checked:c.trigger_on_mentions||!1,onClick:()=>u({...c,trigger_on_mentions:!c.trigger_on_mentions})}),(0,m.jsx)("span",{className:"text-sm",children:e("trigger_on_mentions")})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(o.A,{checked:c.skip_when_online||!1,onClick:()=>u({...c,skip_when_online:!c.skip_when_online})}),(0,m.jsx)("span",{className:"text-sm",children:e("skip_when_online")})]})]}),y.length>0&&(0,m.jsxs)("div",{className:"space-y-2 pt-4 border-t border-gray-200 dark:border-gray-700",children:[(0,m.jsx)(me.A,{className:"block font-semibold",children:e("select_groups")}),(0,m.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:y.map((e=>(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(o.A,{checked:(c.trigger_on_groups||[]).includes(e.gid),onClick:()=>{return s=e.gid,void u((e=>{const t=e.trigger_on_groups||[],a=t.includes(s)?t.filter((e=>e!==s)):[...t,s];return{...e,trigger_on_groups:a}}));var s}}),(0,m.jsx)("span",{className:"text-sm",children:e.name})]},e.gid)))})]})]}),(0,m.jsxs)("div",{className:"flex gap-2 pt-6 mt-6 border-t border-gray-200 dark:border-gray-700",children:[(0,m.jsx)(d.A,{onClick:async()=>{var t;if(null===(t=c.name)||void 0===t||!t.trim())return void n.Ay.error("Channel name is required");const a=He(c.channel_type);if(a){const e=a.fields.filter((e=>{var s;return e.required&&!(null!==(s=c.config)&&void 0!==s&&s[e.name])})).map((e=>e.label));if(e.length>0)return void n.Ay.error(`Missing required fields: ${e.join(", ")}`)}try{s?(await w({id:s,...c}).unwrap(),n.Ay.success(e("save_success"))):(await v(c).unwrap(),n.Ay.success(e("create_success"))),E()}catch(r){n.Ay.error(e(s?"save_error":"create_error")),console.error("Failed to save channel:",r)}},disabled:b||D,children:e(b||D?"saving":"save")}),(0,m.jsx)(d.A,{onClick:E,disabled:b||D,children:e("cancel")})]})]})]})})}const qe=()=>{const e=(0,p.GV)((e=>{var s;return null!==(s=e.server.chat_layout_mode)&&void 0!==s?s:"Left"}),_.bN),{t:s}=(0,r.Bd)("setting",{keyPrefix:"overview.chat_layout"}),{t:t}=(0,r.Bd)(),{refetch:i}=(0,D.Mv)(),[l,{isSuccess:c}]=(0,D.u3)();(0,a.useEffect)((()=>{c&&(i(),n.oR.success(t("tip.update")))}),[c]);return(0,m.jsx)(Ce.A,{title:s("title"),desc:s("desc"),children:(0,m.jsx)(je.A,{options:[s("left"),s("self_right")],values:["Left","SelfRight"],value:e,onCh
1ange:e=>{l({chat_layout_mode:e})}})})},Je=()=>{const e=(0,p.GV)((e=>!!e.server.contact_verification_enable),_.bN),{t:s}=(0,r.Bd)("setting",{keyPrefix:"overview.contact_verify"}),{t:t}=(0,r.Bd)(),{refetch:i}=(0,D.Mv)(),[l,{isSuccess:c}]=(0,D.u3)();(0,a.useEffect)((()=>{c&&(i(),n.oR.success(t("tip.update")))}),[c]);return(0,m.jsx)(Ce.A,{title:s("title"),desc:s("desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{l({contact_verification_enable:!e})},checked:e})})},Xe=()=>{const[e,s]=(0,a.useState)(localStorage.theme||"auto"),{t:t}=(0,r.Bd)("setting");return(0,m.jsx)(Ce.A,{title:t("overview.theme.title"),desc:t("overview.theme.desc"),children:(0,m.jsx)(je.A,{options:[t("overview.theme.auto"),t("overview.theme.dark"),t("overview.theme.light")],values:["auto","dark","light"],value:e,onChange:e=>{(e=>{if(s(e),localStorage.theme=e,document.documentElement.classList.remove("dark"),document.documentElement.classList.remove("light"),"auto"!==e)document.documentElement.classList.add(e);else{const e=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.add(e?"dark":"light")}})(e)}})})},$e=()=>{const{data:e,isSuccess:s}=(0,D.X)(),[t,i]=(0,a.useState)(location.origin),{t:l}=(0,r.Bd)("setting"),{t:c}=(0,r.Bd)(),[o,{isLoading:u,isSuccess:x}]=(0,D.PX)();return(0,a.useEffect)((()=>{x&&n.oR.success(c("tip.update"))}),[x]),(0,a.useEffect)((()=>{s&&e&&i(e)}),[s,e]),(0,m.jsx)(Ce.A,{title:l("overview.url.title"),desc:l("overview.url.desc"),children:(0,m.jsxs)("div",{className:"flex items-center gap-4 mt-2",children:[(0,m.jsx)(k.A,{placeholder:"frontend url",value:t,onChange:e=>{i(e.target.value)}}),(0,m.jsxs)(d.A,{disabled:!t||u,className:"small",onClick:()=>{o(t)},children:[" ",c("action.update")]})]})})};var es=t(98079);const ss=()=>{const e=(0,p.GV)((e=>!!e.server.show_user_online_status),_.bN),{t:s}=(0,r.Bd)("setting",{keyPrefix:"overview.online_status"}),{t:t}=(0,r.Bd)(),{refetch:i}=(0,D.Mv)(),[l,{isSuccess:c}]=(0,D.u3)();(0,a.useEffect)((()=>{c&&(i(),n.oR.success(t("tip.update")))}),[c]);return(0,m.jsx)(Ce.A,{title:s("title"),desc:s("desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{l({show_user_online_status:!e})},checked:e})})};var ts=t(24227);const as=()=>{const e=(0,_.wA)(),s=(0,p.GV)((e=>!!e.ui.msgSound),_.bN),{t:t}=(0,r.Bd)("setting",{keyPrefix:"overview.message_sound"});return(0,m.jsx)(Ce.A,{title:t("title"),desc:t("desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{e((0,ts.iy)(!s))},checked:s})})},rs=()=>{const{t:e}=(0,r.Bd)("setting"),{t:s}=(0,r.Bd)(),t=(0,p.GV)((e=>{var s;return null===(s=e.authData.user)||void 0===s?void 0:s.is_admin}),_.bN),i=(0,p.GV)((e=>e.server),_.bN),[l,{isSuccess:c}]=(0,D.PZ)(),[d]=(0,D.NI)(),[o,u]=(0,a.useState)(!1),[x,g]=(0,a.useState)(i),j=e=>{const s=e.target.value,{type:t=""}=e.target.dataset;g((e=>({...e,[t]:s})))};(0,a.useEffect)((()=>{i&&g(i)}),[i]),(0,a.useEffect)((()=>{c&&n.Ay.success(s("tip.update"))}),[c]),(0,a.useEffect)((()=>{if(i&&x){const{name:e,description:s}=x,{name:t,description:a}=i;u(t!==e||a!==s)}}),[i,x]);const{name:h,description:M,logo:N}=x;return x?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"flex gap-4",children:[(0,m.jsx)("div",{className:"w-24 h-24",children:(0,m.jsx)(B.A,{disabled:!t,url:c?`${N}?t=${+new Date}`:N,name:h,uploadImage:l})}),t&&(0,m.jsx)("div",{className:"flex flex-col justify-between items-start",children:(0,m.jsx)("div",{className:"text-sm text-gray-600 dark:text-gray-100",children:e("overview.upload_desc")})})]}),(0,m.jsxs)("div",{className:"flex flex-col items-start gap-6 mb-3",children:[(0,m.jsxs)("div",{className:"w-full flex flex-col items-start gap-2",children:[(0,m.jsx)(me.A,{htmlFor:"name",children:e("overview.name")}),(0,m.jsx)(k.A,{disabled:!t,"data-type":"name",onChange:j,value:h,name:"name",id:"name",placeholder:"Server Name"})]}),(0,m.jsxs)("div",{className:"w-full flex flex-col items-start gap-2",children:[(0,m.jsx)(me.A,{htmlFor:"desc",children:e("overview.desc")}),(0,m.jsx)(ye.A,{disabled:!t,"data-type":"description",onChange:j,value:null!==M&&void 0!==M?M:"",rows:4,name:"desc",id:"desc",placeholder:"Tell the world a bit about this server"})]})]}),o&&(0,m.jsx)(xe.A,{saveHandler:()=>{const{name:e,description:s}=x;d({name:e,description:s})},resetHandler:()=>{g(i)}})]}):null},is=({})=>{const{t:e}=(0,r.Bd)("setting"),{t:s}=(0,r.Bd)(),{refetch:t}=(0,D.Mv)(),i=(0,p.GV)((e=>{var s;return null!==(s=e.server.only_admin_can_create_group)&&void 0!==s&&s}),_.bN),[l,{isSuccess:c}]=(0,D.u3)();(0,a.useEffect)((()=>{c&&(t(),n.Ay.success(s("tip.update")))}),[c]);return(0,m.jsx)(de.A,{empty:!0,version:"0.3.50",children:(0,m.jsx)(Ce.A,{title:e("overview.admin_create_group.title"),desc:e("overview.admin_create_group.desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{l({only_admin_can_create_group:!i})},checked:i})})})};var ls=t(71995);const ns=({})=>{const{updateExtSetting:e,getExtSetting:s}=(0,ls.A)(),{t:t}=(0,r.Bd)("setting"),a=s(U.Ez);return(0,m.jsx)(de.A,{empty:!0,version:"0.3.50",children:(0,m.jsx)(Ce.A,{title:t("overview.admin_see_group_members.title"),desc:t("overview.admin_see_group_members.desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{e(U.Ez,!a)},checked:a})})})},cs=({})=>{const{updateExtSetting:e,getExtSetting:s}=(0,ls.A)(),{t:t}=(0,r.Bd)("setting"),a=s(U.hp);return(0,m.jsx)(de.A,{empty:!0,version:"0.3.50",children:(0,m.jsx)(Ce.A,{title:t("overview.enable_msg_url_preview.title"),desc:t("overview.enable_msg_url_preview.desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{e(U.hp,!a)},checked:a})})})},ds=(0,U.ln)(),os=({})=>{const{values:e}=L("smtp"),{t:s}=(0,r.Bd)("setting"),{t:t}=(0,r.Bd)(),{refetch:i}=(0,D.Mv)(),l=(0,p.GV)((e=>{var s;return null!==(s=e.server.msg_smtp_notify_enable)&&void 0!==s&&s}),_.bN),c=(0,p.GV)((e=>{var s;return null!==(s=e.server.msg_smtp_notify_delay_seconds)&&void 0!==s?s:0}),_.bN),[d,{isSuccess:o}]=(0,D.u3)();(0,a.useEffect)((()=>{o&&(i(),n.Ay.success(t("tip.update")))}),[o]);return(0,m.jsx)(de.A,{empty:!0,version:"0.4.0",children:(0,m.jsx)(Ce.A,{title:s("overview.server_msg_notify.title"),desc:s("overview.server_msg_notify.desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{l||e.enabled?d({msg_smtp_notify_enable:!l}):n.Ay.error("Enable SMTP first!")},checked:l}),children:(0,m.jsx)(je.A,{disabled:!l,options:ds.map((e=>e.label)),values:ds.map((e=>e.value)),value:c,onChange:e=>{d({msg_smtp_notify_delay_seconds:+e})}})})})},us=({})=>{const{values:e,updateConfig:s}=L("login"),{t:t}=(0,r.Bd)("setting");if(!e)return null;const{guest:a=!1}=e;return(0,m.jsx)(Ce.A,{title:t("overview.guest_mode.title"),desc:t("overview.guest_mode.desc"),toggler:(0,m.jsx)(A.A,{onClick:(t=>{s({...e,guest:t})}).bind(null,!a),checked:a})})},xs=({})=>{const{t:e}=(0,r.Bd)("setting"),{values:s,updateConfig:t}=L("login");if(!s)return null;const{who_can_sign_up:a}=s;return(0,m.jsx)(Ce.A,{title:e("overview.sign_up.title"),desc:e("overview.sign_up.desc"),children:(0,m.jsx)(je.A,{options:[e("overview.sign_up.everyone"),e("overview.sign_up.invite")],values:["EveryOne","InvitationOnly"],value:a,onChange:e=>{var a;a=e,t({...s,who_can_sign_up:a})}})})},ms=({})=>{const[e,{isSuccess:s}]=(0,P.sU)(),{t:t}=(0,r.Bd)("setting"),{t:i}=(0,r.Bd)(),{refetch:l}=(0,D.Mv)(),c=(0,p.GV)((e=>{var s;return null!==(s=e.server.msg_smtp_notify_enable)&&void 0!==s&&s}),_.bN),d=(0,p.GV)((e=>{var s,t;return null!==(s=null===(t=e.authData.user)||void 0===t?void 0:t.msg_smtp_notify_enable)&&void 0!==s&&s}),_.bN);(0,a.useEffect)((()=>{s&&(l(),n.Ay.success(i("tip.update")))}),[s]);return c?(0,m.jsx)(de.A,{empty:!0,version:"0.4.0",children:(0,m.jsx)(Ce.A,{title:t("overview.user_msg_notify.title"),desc:t("overview.user_msg_notify.desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{e({msg_smtp_notify_enable:!d})},checked:d})})}):null},gs=({})=>{const{updateExtSetting:e,getExtSetting:s}=(0,ls.A)(),{t:t}=(0,r.Bd)("setting"),a=s(U.f9);return(0,m.jsx)(de.A,{empty:!0,version:"0.3.50",children:(0,m.jsx)(Ce.A,{title:t("overview.admin_only_can_invite.title"),desc:t("overview.admin_only_can_invite.desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{e(U.f9,!a)},checked:a})})})},ps=()=>{const e=(0,p.GV)((e=>!!e.server.webclient_auto_update),_.bN),{t:s}=(0,r.Bd)("setting",{keyPrefix:"overview.webclient_auto_update"}),{t:t}=(0,r.Bd)(),{refetch:i}=(0,D.Mv)(),[l,{isSuccess:c}]=(0,D.u3)();(0,a.useEffect)((()=>{c&&(i(),n.oR.success(t("tip.update")))}),[c]);return(0,m.jsx)(Ce.A,{title:s("title"),desc:s("desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{l({webclient_auto_update:!e})},checked:e})})},js=()=>{const{t:e}=(0,r.Bd)("setting",{keyPrefix:"overview.dm_enable"}),{t:s}=(0,r.Bd)(),{refetch:t}=(0,D.Mv)(),i=(0,p.GV)((e=>{var s;return null===(s=e.server.dm_enable)||void 0===s||s}),_.bN),[l,{isSuccess:c}]=(0,D.u3)();(0,a.useEffect)((()=>{c&&(t(),n.oR.success(s("tip.update")))}),[c]);return(0,m.jsx)(Ce.A,{title:e("title"),desc:e("desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{l({dm_enable:!i})},checked:i})})},hs=()=>{const{t:e}=(0,r.Bd)("setting",{keyPrefix:"overview.add_friend_enable"}),{t:s}=(0,r.Bd)(),{refetch:t}=(0,D.Mv)(),i=(0,p.GV)((e=>{var s;return null===(s=e.server.add_friend_enable)||void 0===s||s}),_.bN),[l,{isSuccess:c}]=(0,D.u3)();(0,a.useEffect)((()=>{c&&(t(),n.oR.success(s("tip.update")))}),[c]);return(0,m.jsx)(Ce.A,{title:e("title"),desc:e("desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{l({add_friend_enable:!i})},checked:i})})},Ms=()=>{const{t:e}=(0,r.Bd)("setting",{keyPrefix:"overview.search_user_enable"}),{t:s}=(0,r.Bd)(),{refetch:t}=(0,D.Mv)(),i=(0,p.GV)((e=>{var s;return null===(s=e.server.search_user_enable)||void 0===s||s}),_.bN),[l,{isSuccess:c}]=(0,D.u3)();(0,a.useEffect)((()=>{c&&(t(),n.oR.success(s("tip.update")))}),[c]);return(0,m.jsx)(Ce.A,{title:e("title"),desc:e("desc"),toggler:(0,m.jsx)(A.A,{onClick:()=>{l({search_user_enable:!i})},checked:i})})};function Ns(){const{t:e}=(0,r.Bd)("setting"),s=(0,p.GV)((e=>{var s;return null===(s=e.authData.user)||void 0===s?void 0:s.is_admin}),_.bN);return(0,m.jsxs)("div",{className:"relative w-full md:w-[512px] flex flex-col gap-6",children:[(0,m.jsx)(rs,{}),s&&(0,m.jsx)(os,{}),(0,m.jsx)(ms,{}),s&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)($e,{}),(0,m.jsx)("div",{className:"flex flex-col",children:(0,m.jsx)("h4",{className:"font-bold text-gray-700 dark:text-white",children:e("overview.title_feat")})}),(0,m.jsx)(xs,{}),(0,m.jsx)(cs,{}),(0,m.jsx)(gs,{}),(0,m.jsx)(js,{}),(0,m.jsx)(hs,{}),(0,m.jsx)(Ms,{}),(0,m.jsx)(ns,{}),(0,m.jsx)(us,{}),(0,m.jsx)(ss,{}),(0,m.jsx)(qe,{}),(0,m.jsx)(Je,{}),(0,m.jsx)(ps,{})]}),(0,m.jsx)(es.A,{}),(0,m.jsx)(Xe,{}),(0,m.jsx)(as,{}),s&&(0,m.jsx)(is,{})]})}var ys=t(18640),_s=t(73560),fs=t(19033);const vs=({paramKey:e,paramDefault:s,remarks:t})=>(0,m.jsxs)("tr",{className:"bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-50 border-b transition duration-300 ease-in-out md:hover:bg-gray-100 dark:md:hover:bg-gray-900",children:[(0,m.jsx)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium",children:e}),(0,m.jsx)("td",{className:"text-sm font-light px-6 py-4 whitespace-nowrap",children:"theme-color"==e?(0,m.jsxs)("span",{style:{color:s},children:[" ",s]}):s}),(0,m.jsx)("td",{className:"text-sm font-light px-6 py-4",children:(0,m.jsx)(fs.A,{linkPreview:!1,text:t,mention:!1})})]}),bs=({})=>{const{t:e}=(0,r.Bd)("setting",{keyPrefix:"widget"}),{t:s}=(0,r.Bd)("widget");return(0,m.jsxs)("table",{className:"min-w-full table-auto",children:[(0,m.jsx)("thead",{className:"border-b bg-gray-50 dark:bg-gray-500",children:(0,m.jsx)("tr",{children:[e("param_key"),e("default_value"),e("remark")].map((e=>(0,m.jsx)("th",{scope:"col",className:"text-sm font-bold text-gray-900 dark:text-white px-6 py-4 text-left whitespace-nowrap",children:e},e)))})}),(0,m.jsx)("tbody",{children:[{paramKey:"id",paramDefault:"-",remarks:e("param_id")},{paramKey:"host-id",paramDefault:1,remarks:e("param_host")},{paramKey:"auto-reg",paramDefault:"true",remarks:e("param_auto_reg")},{paramKey:"login-token",paramDefault:"-",remarks:e("param_login_token")},{paramKey:"title",paramDefault:"[VoceChat Name]",remarks:e("param_title")},{paramKey:"logo",paramDefault:"[VoceChat Logo]",remarks:e("param_logo")},{paramKey:"theme-color",paramDefault:"#1fe1f9",remarks:e("param_theme_color")},{paramKey:"close-width",paramDefault:"48(px)",remarks:e("param_close_width")},{paramKey:"close-height",paramDefault:"48(px)",remarks:e("param_close_height")},{paramKey:"open-width",paramDefault:"380(px)",remarks:e("param_open_width")},{paramKey:"open-height",paramDefault:"680(px)",remarks:e("param_open_height")},{paramKey:"position",paramDefault:"right",remarks:e("param_position")},{paramKey:"welcome",paramDefault:s("welcome"),remarks:e("param_welcome")},{paramKey:"popup-title",paramDefault:"Need help?",remarks:e("param_popup_title")},{paramKey:"popup-subtitle",paramDefault:"Our staff are always ready to help!",remarks:e("param_popup_subtitle")},{paramKey:"popup-image",paramDefault:"-",remarks:e("param_popup_image")},{paramKey:"popup-closable",paramDefault:"true",remarks:e("param_popup_closable")}].map((e=>(0,m.jsx)(vs,{...e},e.paramKey)))}),(0,m.jsx)("tfoot",{className:"border-t border-solid border-gray-200 dark:border-gray-50 dark:bg-gray-500",children:(0,m.jsx)("tr",{children:(0,m.jsxs)("td",{colSpan:3,className:"text-gray-400 dark:text-white px-5 py-3 text-sm",children:["* All the parameters are optional, and prefixed by"," ",(0,m.jsx)("i",{className:"bg-gray-700 text-white px-1",children:"data-"})]})})})]})},ws=({})=>{const[e,{isLoading:s,isSuccess:t}]=(0,D.So)(),{data:r="",isLoading:i}=(0,D._9)(),[l,c]=(0,a.useState)(r);return(0,a.useEffect)((()=>{t&&n.Ay.success("Updated!")}),[t]),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)(ye.A,{disabled:i,onChange:e=>{c(e.target.value)},rows:12,value:l}),(0,m.jsx)(d.A,{disabled:s,onClick:()=>{e(l)},className:"small",children:"Update CSS Code"})]})};function Ds(){const e=(0,p.GV)((e=>{var s;return null===(s=e.authData.user)||void 0===s?void 0:s.uid}),_.bN),s=`${location.origin}/widget.html?host=${e}`,{t:t}=(0,r.Bd)("setting",{keyPrefix:"widget"}),{t:a}=(0,r.Bd)(),{copied:i,copy:l}=(0,O.A)({enableToast:!1});return(0,m.jsxs)("div",{className:"flex flex-col justify-start items-start",children:[(0,m.jsx)("div",{className:"font-semibold dark:text-white",children:t("tip")}),(0,m.jsxs)("label",{htmlFor:"code",className:"font-semibold dark:text-white",children:[t("code"),":"]}),(0,m.jsx)(ys.A,{id:"code",language:"html",style:_s.A,className:"rounded",children:`\x3c!-- ${t("code_comment")} --\x3e\n<script \n  data-host-id="${e}" \n  data-auto-reg="true" \n  data-login-token="" \n  data-title="" \n  data-logo="" \n  data-theme-color="#1fe1f9" \n  data-close-width="48" \n  data-close-height="48" \n  data-open-width="380" \n  data-open-height="680" \n  data-welcome="Your custom welcome text" \n  data-popup-title="Need help?" \n  data-popup-subtitle="Our staff are always ready to help!" \n  data-popup-image="" \n  data-popup-closable="true" \n  src="${location.origin}/widget.js" \n  async \n><\/script>`}),(0,m.jsxs)("div",{className:"text-sm dark:text-white",children:[t("custom_style_tip"),":"]}),(0,m.jsx)(ys.A,{id:"code",language:"html",style:_s.A,className:"rounded",children:"<style>\n  #VOCECHAT_WIDGET {\n    left:10px  /* left position */\n    bottom: 5px /* bottom position */\n  }\n</style>"}),(0,m.jsxs)("div",{className:"text-sm dark:text-white mt-5",children:[t("open_widget_tip"),":"]}),(0,m.jsx)(ys.A,{id:"code",language:"html",style:_s.A,className:"rounded",children:`\x3c!-- ${t("open_widget_example")} --\x3e\n<button onclick="VoceChatWidget.open()">Contact Support</button>\n\n\x3c!-- ${t("open_widget_example_custom")} --\x3e\n<button\n  onclick="VoceChatWidget.open()"\n  style="background: #1fe1f9; color: white; padding: 12px 24px; border: none; border-radius: 8px; cursor: pointer; font-size: 16px;"\n>\n  \ud83d\udcac Chat with us\n</button>\n\n\x3c!-- ${t("open_widget_example_toggle")}
1 --\x3e\n<button onclick="VoceChatWidget.toggle()">Toggle Chat</button>`}),(0,m.jsx)(de.A,{version:"0.4.0",children:(0,m.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,m.jsxs)("div",{className:"text-sm dark:text-white",children:[t("css_code_tip"),":"]}),(0,m.jsx)(ws,{})]})}),(0,m.jsxs)("div",{className:"font-semibold dark:text-white mt-5 mb-2",children:[t("config"),":"]}),(0,m.jsx)("div",{className:"w-full md:w-[700px] border border-solid border-gray-300 dark:border-gray-400 rounded overflow-auto md:overflow-hidden",children:(0,m.jsx)(bs,{})}),(0,m.jsxs)("div",{className:"mt-8",children:[(0,m.jsxs)("p",{className:"text-sm mb-2 text-gray-500 dark:text-gray-50 flex flex-col md:flex-row gap-4",children:[t("share_link")," ",(0,m.jsxs)("a",{className:"text-primary-500 flex gap-1 items-center",href:"https://doc.voce.chat/widget",target:"_blank",rel:"noopener noreferrer",children:[(0,m.jsx)(ge.A,{})," ",t("widget_faq")]})]}),(0,m.jsxs)("div",{className:"w-full md:w-96 mb-3 relative",children:[(0,m.jsx)(k.A,{readOnly:!0,className:"large !pr-16",value:s}),(0,m.jsx)(d.A,{onClick:()=>{l(s)},className:"ghost small border_less absolute right-1 top-1/2 -translate-y-1/2 dark:!text-primary-400",children:i?"Copied":a("action.copy")})]})]})]})}function ks(){const{t:e}=(0,r.Bd)("setting",{keyPrefix:"admin_notification_channels"}),s=(0,p.GV)((e=>e.server.version),_.bN),t=(0,a.useMemo)((()=>s&&(0,f.Gm)(s,"0.5.11")>=0),[s]),{data:i=[],isLoading:l}=(0,Ke.xb)(void 0,{skip:!t}),[c]=(0,Ke.mg)(),[o]=(0,Ke.Vu)(),[u,x]=(0,a.useState)(null),g=Fe.map((e=>e.type)),j=new Set(i.map((e=>e.channel_type))),h=g.filter((e=>!j.has(e)));return Array.from(j),l?(0,m.jsx)("div",{className:"setting-container max-md:w-full",children:(0,m.jsx)("div",{className:"text-gray-500",children:"Loading..."})}):(0,m.jsx)(de.A,{version:"0.5.11",children:(0,m.jsxs)("div",{className:"setting-container max-md:w-full",children:[(0,m.jsx)(le,{title:e("desc")}),i.length>0&&(0,m.jsxs)("div",{className:"mt-6",children:[(0,m.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-4",children:e("enabled_types")}),(0,m.jsx)("div",{className:"overflow-x-auto",children:(0,m.jsxs)("table",{className:"w-full border-collapse",children:[(0,m.jsx)("thead",{children:(0,m.jsxs)("tr",{className:"border-b border-gray-200 dark:border-gray-700",children:[(0,m.jsx)("th",{className:"text-left py-3 px-4 font-semibold text-gray-700 dark:text-gray-300",children:e("channel_type")}),(0,m.jsx)("th",{className:"text-left py-3 px-4 font-semibold text-gray-700 dark:text-gray-300",children:e("channel_status")}),(0,m.jsx)("th",{className:"text-right py-3 px-4 font-semibold text-gray-700 dark:text-gray-300",children:e("actions")})]})}),(0,m.jsx)("tbody",{children:i.map((s=>{const t=Fe.find((e=>e.type===s.channel_type));return(0,m.jsxs)("tr",{className:"border-b border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800",children:[(0,m.jsx)("td",{className:"py-3 px-4",children:(0,m.jsxs)("div",{children:[(0,m.jsx)("div",{className:"font-medium text-gray-900 dark:text-gray-100",children:(null===t||void 0===t?void 0:t.name)||s.channel_type}),(0,m.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400",children:null===t||void 0===t?void 0:t.description})]})}),(0,m.jsx)("td",{className:"py-3 px-4",children:(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(A.A,{checked:s.enabled,onClick:()=>(async(s,t)=>{try{await c({channel_type:s,enabled:!t}).unwrap(),n.Ay.success(e("update_success"))}catch(a){n.Ay.error(e("update_error")),console.error("Failed to toggle channel type:",a)}})(s.channel_type,s.enabled)}),(0,m.jsx)("span",{className:s.enabled?"text-green-600 dark:text-green-400":"text-gray-500",children:s.enabled?e("enabled"):e("disabled")})]})}),(0,m.jsx)("td",{className:"py-3 px-4",children:(0,m.jsx)("div",{className:"flex justify-end gap-2",children:(0,m.jsx)(d.A,{className:"mini danger",onClick:()=>x(s.channel_type),children:e("delete_channel")})})})]},s.id)}))})]})})]}),(0,m.jsxs)("div",{className:"mt-8",children:[(0,m.jsx)("h3",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-4",children:e("available_types")}),h.length>0?(0,m.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:h.map((s=>{const t=Fe.find((e=>e.type===s));return t?(0,m.jsxs)("div",{className:"border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-white dark:bg-gray-800 flex flex-col",children:[(0,m.jsx)("h4",{className:"font-semibold text-gray-900 dark:text-gray-100 mb-2",children:t.name}),(0,m.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-4 flex-1",children:t.description}),(0,m.jsx)(d.A,{onClick:()=>(async s=>{try{await c({channel_type:s,enabled:!0}).unwrap(),n.Ay.success(e("create_success"))}catch(t){n.Ay.error(e("create_error")),console.error("Failed to enable channel type:",t)}})(s),className:"w-full",children:e("enable_type")})]},s):null}))}):(0,m.jsxs)("p",{className:"text-gray-500 dark:text-gray-400",children:["All channel types are already enabled. Total schemas: ",Fe.length]})]}),u&&(0,m.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:(0,m.jsxs)("div",{className:"bg-white dark:bg-gray-900 rounded-lg p-6 max-w-md w-full mx-4",children:[(0,m.jsx)("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100 mb-4",children:e("delete_title")}),(0,m.jsx)("p",{className:"text-gray-700 dark:text-gray-300 mb-6",children:e("delete_desc")}),(0,m.jsxs)("div",{className:"flex gap-3 justify-end",children:[(0,m.jsx)(d.A,{onClick:()=>x(null),className:"cancel",children:e("cancel")}),(0,m.jsx)(d.A,{onClick:()=>(async s=>{try{await o(s).unwrap(),n.Ay.success(e("delete_success")),x(null)}catch(t){n.Ay.error(e("delete_error")),console.error("Failed to delete channel type:",t)}})(u),className:"danger",children:e("delete")})]})]})})]})})}const As={name:"data_management",component:(0,m.jsx)(Se,{}),admin:!0}
1,Is=[{name:"general",items:[{name:"overview",component:(0,m.jsx)(Ns,{})},{name:"my_account",component:(0,m.jsx)(We.A,{})},{name:"notification",component:(0,m.jsx)(Ze,{})},{name:"members",component:(0,m.jsx)(j.A,{}),admin:!0}]},{name:"config",items:[{name:"bot",component:(0,m.jsx)(ce,{}),admin:!0},{name:"cloudflared",component:(0,m.jsx)(ue,{}),admin:!0},{name:"notification_channels",component:(0,m.jsx)(ks,{}),admin:!0},{name:"firebase",component:(0,m.jsx)(_e,{})},{name:"video",component:(0,m.jsx)(Ne,{})},{name:"smtp",component:(0,m.jsx)(Ee,{})},{name:"login_method",component:(0,m.jsx)(Le,{})},{name:"third_app",component:(0,m.jsx)(E,{})},{name:"widget",component:(0,m.jsx)(Ds,{})},{name:"license",component:(0,m.jsx)(Ve,{})}],admin:!0},{name:"about",items:[{name:"api_doc",component:(0,m.jsx)(S,{}),admin:!0},{name:"version",component:(0,m.jsx)(v,{})}]}],Ts=()=>{const{t:e}=(0,r.Bd)("setting"),s=(0,p.GV)((e=>e.authData.user),_.bN),t=((0,p.GV)((e=>e.server.upgraded),_.bN),null!==s&&void 0!==s&&s.is_admin?Is:Is.filter((e=>!e.admin)).map((e=>{const{name:s,items:t,...a}=e;return{name:s,items:t.filter((e=>!e.admin)),...a}})));1!=(null===s||void 0===s?void 0:s.uid)||t[0].items.some((e=>"data_management"==e.name))||t[0].items.push(As);const a=t.map((s=>{const{name:t,items:a,...r}=s;return{name:t,title:e(`nav.${t}`),items:a.map((s=>{const{name:t,...a}=s;return{name:t,title:e(`nav.${t}`),...a}})),...r}}));return a.filter((e=>!(null===s||void 0===s||!s.is_admin)||!e.admin))};let Ls="";function Es(){const{t:e}=(0,r.Bd)(),[s]=(0,i.ok)(),t=Ts(),n=t.map((({items:e})=>e)).flat(),{nav:c}=(0,i.g)(),[d,o]=(0,a.useState)(!1),u=(0,i.Zp)();Ls=Ls||(s.get("f")||"/");const x=()=>{o((e=>!e))},p=n.find((e=>e.name==c));return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(l.A,{nav:p,closeModal:()=>{u(Ls),Ls=""},title:e("setting"),navs:t,dangers:[{title:e("action.logout"),handler:x}],children:c?null===p||void 0===p?void 0:p.component:null}),d&&(0,m.jsx)(g,{closeModal:x})]})}},85369:(e,s,t)=>{t.d(s,{A:()=>n});var a,r=t(64131);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},i.apply(null,arguments)}const l=({title:e,titleId:s,...t},l)=>r.createElement("svg",i({width:20,height:20,viewBox:"0 0 20 20",fill:"#667085",xmlns:"http://www.w3.org/2000/svg",ref:l,"aria-labelledby":s},t),e?r.createElement("title",{id:s},e):null,a||(a=r.createElement("path",{d:"M6 4C6 2.89543 6.89543 2 8 2H14C15.1046 2 16 2.89543 16 4V14C16 15.1046 15.1046 16 14 16H8C6.89543 16 6 15.1046 6 14V4ZM4 6.00001C4 5.25973 4.4022 4.61339 5 4.26758V14.5C5 15.8807 6.11929 17 7.5 17H13.7324C13.3866 17.5978 12.7403 18 12 18H7.5C5.567 18 4 16.433 4 14.5V6.00001Z"}))),n=(0,r.forwardRef)(l)},98079:(e,s,t)=>{t.d(s,{A:()=>c,X:()=>n});var a=t(79574),r=t(38219),i=t(74385),l=t(82979);const n={en:"English",zh:"\u4e2d\u6587",tr:"T\xfcrk\xe7e",jp:"\u65e5\u672c\u8a9e",pt:"Portuguese",de:"Deutsch",fr:"Fran\xe7ais",es:"Espa\xf1ol",ru:"\u0420\u0443\u0441\u0441\u043a\u0438\u0439"},c=({context:e="overview",callback:s})=>{const{t:t,i18n:c}=(0,a.Bd)("setting");return(0,l.jsx)(r.A,{title:"overview"==e?t("overview.lang.title"):"",desc:t("overview.lang.desc"),children:(0,l.jsx)(i.A,{options:Object.values(n),values:Object.keys(n),value:c.language.split("-")[0],onChange:e=>{const t=e;(e=>{c.changeLanguage(e)})(t),null===s||void 0===s||s(n[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.