diff --git a/cmd/telesrv-admin/readstore.go b/cmd/telesrv-admin/readstore.go index 484d5f49..e5b13ab4 100644 --- a/cmd/telesrv-admin/readstore.go +++ b/cmd/telesrv-admin/readstore.go @@ -63,6 +63,9 @@ type AccountDetail struct { type RestrictionRow struct { Frozen bool + Since *time.Time + Until *time.Time + AppealURL string Reason string Actor string CommandID string @@ -152,7 +155,7 @@ SELECT u.id, u.phone, u.username, u.first_name, u.last_name, u.created_at, u.upd COALESCE(a.last_active_at, '0001-01-01 00:00:00+00'::timestamptz), COALESCE(a.device_count, 0)::int, COALESCE(NULLIF(u.username, ''), p.username_lower, '') AS display_username FROM users u -LEFT JOIN account_send_restrictions r ON r.user_id = u.id +LEFT JOIN account_restrictions r ON r.user_id = u.id LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id LEFT JOIN auth a ON a.user_id = u.id WHERE u.id = $1 OR u.phone = $2 OR u.phone = $3 OR lower(u.username) = $4 OR p.username_lower = $4 @@ -326,7 +329,7 @@ SELECT u.id, u.phone, u.username, u.first_name, u.last_name, u.created_at, u.upd COALESCE(NULLIF(u.username, ''), p.username_lower, '') AS display_username FROM users u JOIN auth ON auth.user_id = u.id -LEFT JOIN account_send_restrictions r ON r.user_id = u.id +LEFT JOIN account_restrictions r ON r.user_id = u.id LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id WHERE NOT u.is_bot AND ($1::bigint = 0 OR (auth.last_active_at, u.id) < (to_timestamp(($1::double precision) / 1000000.0), $2::bigint)) @@ -364,7 +367,7 @@ SELECT u.id, u.phone, u.username, u.first_name, u.last_name, u.created_at, u.upd COALESCE(sb.balance, 0)::bigint, COALESCE(sb.granted, false), COALESCE(NULLIF(u.username, ''), p.username_lower, '') AS display_username FROM users u -LEFT JOIN account_send_restrictions r ON r.user_id = u.id +LEFT JOIN account_restrictions r ON r.user_id = u.id LEFT JOIN stars_balances sb ON sb.user_id = u.id LEFT JOIN peer_usernames p ON p.peer_type = 'user' AND p.peer_id = u.id WHERE u.id = $1`, userID).Scan( @@ -393,9 +396,12 @@ WHERE u.id = $1`, userID).Scan( func (s *readStore) restriction(ctx context.Context, userID int64) (RestrictionRow, bool, error) { var r RestrictionRow err := s.pool.QueryRow(ctx, ` -SELECT frozen, reason, actor, command_id, updated_at -FROM account_send_restrictions -WHERE user_id = $1`, userID).Scan(&r.Frozen, &r.Reason, &r.Actor, &r.CommandID, &r.UpdatedAt) +SELECT frozen, frozen_since, frozen_until, appeal_url, reason, actor, command_id, updated_at +FROM account_restrictions +WHERE user_id = $1`, userID).Scan( + &r.Frozen, &r.Since, &r.Until, &r.AppealURL, + &r.Reason, &r.Actor, &r.CommandID, &r.UpdatedAt, + ) if err != nil { if err == pgx.ErrNoRows { return RestrictionRow{}, false, nil diff --git a/cmd/telesrv-admin/server.go b/cmd/telesrv-admin/server.go index 07a8916f..f61e3a6f 100644 --- a/cmd/telesrv-admin/server.go +++ b/cmd/telesrv-admin/server.go @@ -56,7 +56,7 @@ func (s *server) routes() http.Handler { mux.Handle("GET /api/messages/detail", s.requireAuthAPI(http.HandlerFunc(s.handleMessageDetailAPI))) mux.Handle("GET /api/messages/groups", s.requireAuthAPI(http.HandlerFunc(s.handleGroupMessagesAPI))) mux.Handle("GET /api/messages/groups/detail", s.requireAuthAPI(http.HandlerFunc(s.handleGroupMessageDetailAPI))) - mux.Handle("POST /api/actions/freeze-send", s.requireAuthAPI(http.HandlerFunc(s.handleFreezeSendAPI))) + mux.Handle("POST /api/actions/set-frozen", s.requireAuthAPI(http.HandlerFunc(s.handleSetAccountFrozenAPI))) mux.Handle("POST /api/actions/grant-premium", s.requireAuthAPI(http.HandlerFunc(s.handleGrantPremiumAPI))) mux.Handle("POST /api/actions/grant-stars", s.requireAuthAPI(http.HandlerFunc(s.handleGrantStarsAPI))) mux.Handle("POST /api/actions/set-verified", s.requireAuthAPI(http.HandlerFunc(s.handleSetVerifiedAPI))) @@ -388,25 +388,29 @@ func (s *server) handleGroupMessageDetailAPI(w http.ResponseWriter, r *http.Requ writeJSON(w, http.StatusOK, detail) } -type freezeSendAPIRequest struct { - CommandID string `json:"command_id"` - Reason string `json:"reason"` - Confirm bool `json:"confirm"` - UserID int64 `json:"user_id"` - Frozen bool `json:"frozen"` +type setAccountFrozenAPIRequest struct { + CommandID string `json:"command_id"` + Reason string `json:"reason"` + Confirm bool `json:"confirm"` + UserID int64 `json:"user_id"` + Frozen bool `json:"frozen"` + Until time.Time `json:"freeze_until"` + AppealURL string `json:"freeze_appeal_url"` } -func (s *server) handleFreezeSendAPI(w http.ResponseWriter, r *http.Request) { - var body freezeSendAPIRequest +func (s *server) handleSetAccountFrozenAPI(w http.ResponseWriter, r *http.Request) { + var body setAccountFrozenAPIRequest if !decodeAction(w, r, &body) { return } - req := admin.SetSendFrozenRequest{ - CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "freeze-send"), + req := admin.SetAccountFrozenRequest{ + CommandMeta: s.commandMetaFromAPI(r, body.CommandID, body.Reason, body.Confirm, "set-frozen"), UserID: body.UserID, Frozen: body.Frozen, + Until: body.Until, + AppealURL: body.AppealURL, } - result, err := s.callAdminAPI(r.Context(), "/v1/accounts/freeze-send", req) + result, err := s.callAdminAPI(r.Context(), "/v1/accounts/set-frozen", req) writeCommandResultAPI(w, result, err) } diff --git a/cmd/telesrv-admin/session_test.go b/cmd/telesrv-admin/session_test.go index 9314e7d4..51f88416 100644 --- a/cmd/telesrv-admin/session_test.go +++ b/cmd/telesrv-admin/session_test.go @@ -1,11 +1,15 @@ package main import ( + "context" + "encoding/json" "net/http" "net/http/httptest" "strings" "testing" "time" + + "telesrv/internal/admin" ) func TestSignedSessionRoundTripAndTamper(t *testing.T) { @@ -48,3 +52,33 @@ func TestAdminAPIURLDefaultUsesAdminAPIPort(t *testing.T) { t.Fatalf("adminAPIURL(empty) = %q, want %q", got, want) } } + +func TestSetAccountFrozenBFFForwardsClientVisibleState(t *testing.T) { + var got admin.SetAccountFrozenRequest + upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/v1/accounts/set-frozen" || r.Header.Get("Authorization") != "Bearer secret" { + t.Fatalf("upstream request path=%q authorization=%q", r.URL.Path, r.Header.Get("Authorization")) + } + if err := json.NewDecoder(r.Body).Decode(&got); err != nil { + t.Fatal(err) + } + _ = json.NewEncoder(w).Encode(admin.CommandResult{CommandID: got.CommandID, Status: "completed", DryRun: got.DryRun}) + })) + defer upstream.Close() + + srv := &server{cfg: uiConfig{AdminAPIURL: upstream.URL, AdminAPIToken: "secret"}} + req := httptest.NewRequest(http.MethodPost, "/api/actions/set-frozen", strings.NewReader(`{ + "reason":"review","confirm":false,"user_id":1001,"frozen":true, + "freeze_until":"2030-01-02T00:00:00Z","freeze_appeal_url":"https://appeals.example.test/1001" + }`)) + req = req.WithContext(context.WithValue(req.Context(), actorKey{}, "operator")) + rec := httptest.NewRecorder() + srv.handleSetAccountFrozenAPI(rec, req) + if rec.Code != http.StatusOK { + t.Fatalf("status=%d body=%s", rec.Code, rec.Body.String()) + } + if got.Actor != "operator" || got.UserID != 1001 || !got.Frozen || !got.DryRun || + got.Until.IsZero() || got.AppealURL != "https://appeals.example.test/1001" { + t.Fatalf("forwarded freeze request = %+v", got) + } +} diff --git a/cmd/telesrv-admin/web/dist/assets/index-BHnkZ_za.js b/cmd/telesrv-admin/web/dist/assets/index-BHnkZ_za.js deleted file mode 100644 index 6a3697b5..00000000 --- a/cmd/telesrv-admin/web/dist/assets/index-BHnkZ_za.js +++ /dev/null @@ -1,8 +0,0 @@ -var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,ee=Object.prototype.hasOwnProperty,S={current:null},te={key:!0,ref:!0,__self:!0,__source:!0};function C(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)ee.call(n,i)&&!te.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,se(x);else{var t=n(l);t!==null&&ce(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(te),te=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ce(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var ee=!1,S=null,te=-1,C=5,w=-1;function ne(){return!(e.unstable_now()-we||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(te),te=-1):h=!0,ce(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,se(x))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function ee(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` -`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{he=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?me(e):``}function _e(e){switch(e.tag){case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 2:case 15:return e=ge(e.type,!1),e;case 11:return e=ge(e.type.render,!1),e;case 1:return e=ge(e.type,!0),e;default:return``}}function ve(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case w:return`Fragment`;case C:return`Portal`;case re:return`Profiler`;case ne:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case ae:return(e.displayName||`Context`)+`.Consumer`;case ie:return(e._context.displayName||`Context`)+`.Provider`;case oe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?ve(e.type)||`Memo`:t;case le:t=e._payload,e=e._init;try{return ve(e(t))}catch{}}return null}function ye(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ve(t);case 8:return t===ne?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function D(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function be(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function xe(e){var t=be(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Se(e){e._valueTracker||=xe(e)}function Ce(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=be(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function we(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Te(e,t){var n=t.checked;return E({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ee(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=D(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function De(e,t){t=t.checked,t!=null&&ee(e,`checked`,t,!1)}function O(e,t){De(e,t);var n=D(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ke(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ke(e,t.type,D(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Oe(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ke(e,t,n){(t!==`number`||we(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ae=Array.isArray;function je(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Le.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ze(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Be={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ve=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Be).forEach(function(e){Ve.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Be[t]=Be[e]})});function He(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Be.hasOwnProperty(e)&&Be[e]?(``+t).trim():t+`px`}function Ue(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=He(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var We=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ge(e,t){if(t){if(We[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Ke(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qe=null;function Je(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ye=null,Xe=null,Ze=null;function Qe(e){if(e=qi(e)){if(typeof Ye!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Yi(t),Ye(e.stateNode,e.type,t))}}function $e(e){Xe?Ze?Ze.push(e):Ze=[e]:Xe=e}function et(){if(Xe){var e=Xe,t=Ze;if(Ze=Xe=null,Qe(e),t)for(e=0;e>>=0,e===0?32:31-(Nt(e)/Pt|0)|0}var It=64,Lt=4194304;function Rt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Rt(a))):r=Rt(s)}else o=n&~i,o===0?a!==0&&(r=Rt(a)):r=Rt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Gt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mt(t),e[t]=n}function Kt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=sr),ur=` `,dr=!1;function fr(e,t){switch(e){case`keyup`:return ar.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function pr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var mr=!1;function hr(e,t){switch(e){case`compositionend`:return pr(t);case`keypress`:return t.which===32?(dr=!0,ur):null;case`textInput`:return e=t.data,e===ur&&dr?null:e;default:return null}}function gr(e,t){if(mr)return e===`compositionend`||!or&&fr(e,t)?(e=An(),kn=On=Dn=null,mr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Rr(n)}}function Br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vr(){for(var e=window,t=we();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=we(e.document)}return t}function Hr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Ur(e){var t=Vr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Br(n.ownerDocument.documentElement,n)){if(r!==null&&Hr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=zr(n,a);var o=zr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Gr=null,Kr=null,qr=null,Jr=!1;function Yr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jr||Gr==null||Gr!==we(r)||(r=Gr,`selectionStart`in r&&Hr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qr&&Lr(qr,r)||(qr=r,r=bi(Kr,`onSelect`),0Zi||(e.current=Xi[Zi],Xi[Zi]=null,Zi--)}function L(e,t){Zi++,Xi[Zi]=e.current,e.current=t}var $i={},ea=Qi($i),ta=Qi(!1),na=$i;function ra(e,t){var n=e.type.contextTypes;if(!n)return $i;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ia(e){return e=e.childContextTypes,e!=null}function aa(){I(ta),I(ea)}function oa(e,t,n){if(ea.current!==$i)throw Error(r(168));L(ea,t),L(ta,n)}function sa(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ye(e)||`Unknown`,a));return E({},n,i)}function ca(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$i,na=ea.current,L(ea,e),L(ta,ta.current),!0}function la(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=sa(e,t,na),i.__reactInternalMemoizedMergedChildContext=e,I(ta),I(ea),L(ea,e)):I(ta),L(ta,n)}var ua=null,da=!1,fa=!1;function pa(e){ua===null?ua=[e]:ua.push(e)}function ma(e){da=!0,pa(e)}function ha(){if(!fa&&ua!==null){fa=!0;var e=0,t=P;try{var n=ua;for(P=1;e>=o,i-=o,Ca=1<<32-Mt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),R&&Ta(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),R&&Ta(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return R&&Ta(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),R&&Ta(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===w&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case te:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===w){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===le&&Wa(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ha(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===w?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=Ha(e,r,i),o.return=e,e=o)}return s(e);case C:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case le:return l=i._init,_(e,r,l(i._payload),o)}if(Ae(i))return h(e,r,i,o);if(fe(i))return g(e,r,i,o);Ua(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ka=Ga(!0),qa=Ga(!1),Ja=Qi(null),Ya=null,Xa=null,Za=null;function Qa(){Za=Xa=Ya=null}function $a(e){var t=Ja.current;I(Ja),e._currentValue=t}function eo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function to(e,t){Ya=e,Za=Xa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Bs=!0),e.firstContext=null)}function no(e){var t=e._currentValue;if(Za!==e)if(e={context:e,memoizedValue:t,next:null},Xa===null){if(Ya===null)throw Error(r(308));Xa=e,Ya.dependencies={lanes:0,firstContext:e}}else Xa=Xa.next=e;return t}var ro=null;function io(e){ro===null?ro=[e]:ro.push(e)}function ao(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,io(t)):(n.next=i.next,i.next=n),t.interleaved=n,oo(e,r)}function oo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var so=!1;function co(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function uo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,oo(e,n)}return i=r.interleaved,i===null?(t.next=t,io(r)):(t.next=i.next,i.next=t),r.interleaved=t,oo(e,n)}function po(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qt(e,n)}}function mo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function ho(e,t,n,r){var i=e.updateQueue;so=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=E({},d,f);break a;case 2:so=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Yc|=o,e.lanes=o,e.memoizedState=d}}function go(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ao.transition;Ao.transition={};try{e(!1),t()}finally{P=n,Ao.transition=r}}function ps(){return Bo().memoizedState}function ms(e,t,n){var r=ml(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},gs(e))_s(t,n);else if(n=ao(e,t,n,r),n!==null){var i=pl();hl(n,e,r,i),vs(n,t,r)}}function hs(e,t,n){var r=ml(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(gs(e))_s(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Ir(s,o)){var c=t.interleaved;c===null?(i.next=i,io(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=ao(e,t,i,r),n!==null&&(i=pl(),hl(n,e,r,i),vs(n,t,r))}}function gs(e){var t=e.alternate;return e===B||t!==null&&t===B}function _s(e,t){No=Mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function vs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,qt(e,n)}}var ys={readContext:no,useCallback:U,useContext:U,useEffect:U,useImperativeHandle:U,useInsertionEffect:U,useLayoutEffect:U,useMemo:U,useReducer:U,useRef:U,useState:U,useDebugValue:U,useDeferredValue:U,useTransition:U,useMutableSource:U,useSyncExternalStore:U,useId:U,unstable_isNewReconciler:!1},bs={readContext:no,useCallback:function(e,t){return zo().memoizedState=[e,t===void 0?null:t],e},useContext:no,useEffect:ns,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),es(4194308,4,os.bind(null,t,e),n)},useLayoutEffect:function(e,t){return es(4194308,4,e,t)},useInsertionEffect:function(e,t){return es(4,2,e,t)},useMemo:function(e,t){var n=zo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=zo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=ms.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=zo();return e={current:e},t.memoizedState=e},useState:Zo,useDebugValue:cs,useDeferredValue:function(e){return zo().memoizedState=e},useTransition:function(){var e=Zo(!1),t=e[0];return e=fs.bind(null,e[1]),zo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=B,a=zo();if(R){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Y===null)throw Error(r(349));jo&30||Ko(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ns(Jo.bind(null,i,o,e),[e]),i.flags|=2048,Qo(9,qo.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=zo(),t=Y.identifierPrefix;if(R){var n=wa,r=Ca;n=(r&~(1<<32-Mt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Po++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[Bi]=t,e[Vi]=i,uc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ke(n,i),n){case`dialog`:F(`cancel`,e),F(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:F(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;otl&&(t.flags|=128,i=!0,pc(s,!1),t.lanes=4194304)}else{if(!i)if(e=Eo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!R)return W(t),null}else 2*N()-s.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,i=!0,pc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(W(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=N(),t.sibling=null,n=z.current,L(z,i?n&1|2:n&1),t);case 22:case 23:return Tl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Kc&1073741824&&(W(t),t.subtreeFlags&6&&(t.flags|=8192)):W(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function hc(e,t){switch(Oa(t),t.tag){case 1:return ia(t.type)&&aa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Co(),I(ta),I(ea),Oo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return To(t),null;case 13:if(I(z),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return I(z),null;case 4:return Co(),null;case 10:return $a(t.type._context),null;case 22:case 23:return Tl(),null;case 24:return null;default:return null}}var gc=!1,G=!1,_c=typeof WeakSet==`function`?WeakSet:Set,K=null;function vc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){$(e,t,n)}else n.current=null}function yc(e,t,n){try{n()}catch(n){$(e,t,n)}}var bc=!1;function xc(e,t){if(Oi=bn,e=Vr(),Hr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(ki={focusedElem:e,selectionRange:n},bn=!1,K=t;K!==null;)if(t=K,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Cs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){$(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return h=bc,bc=!1,h}function Sc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&yc(t,n,a)}i=i.next}while(i!==r)}}function Cc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function wc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Tc(e){var t=e.alternate;t!==null&&(e.alternate=null,Tc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Bi],delete t[Vi],delete t[Ui],delete t[Wi],delete t[Gi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ec(e){return e.tag===5||e.tag===3||e.tag===4}function Dc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ec(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Oc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Di));else if(r!==4&&(e=e.child,e!==null))for(Oc(e,t,n),e=e.sibling;e!==null;)Oc(e,t,n),e=e.sibling}function kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}var q=null,Ac=!1;function jc(e,t,n){for(n=n.child;n!==null;)Mc(e,t,n),n=n.sibling}function Mc(e,t,n){if(At&&typeof At.onCommitFiberUnmount==`function`)try{At.onCommitFiberUnmount(kt,n)}catch{}switch(n.tag){case 5:G||vc(n,t);case 6:var r=q,i=Ac;q=null,jc(e,t,n),q=r,Ac=i,q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):q.removeChild(n.stateNode));break;case 18:q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?Ii(e.parentNode,n):e.nodeType===1&&Ii(e,n),vn(e)):Ii(q,n.stateNode));break;case 4:r=q,i=Ac,q=n.stateNode.containerInfo,Ac=!0,jc(e,t,n),q=r,Ac=i;break;case 0:case 11:case 14:case 15:if(!G&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&yc(n,t,o),i=i.next}while(i!==r)}jc(e,t,n);break;case 1:if(!G&&(vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){$(n,t,e)}jc(e,t,n);break;case 21:jc(e,t,n);break;case 22:n.mode&1?(G=(r=G)||n.memoizedState!==null,jc(e,t,n),G=r):jc(e,t,n);break;default:jc(e,t,n)}}function Nc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _c),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Pc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=N()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Hc(i/1960))-i,10e?16:e,sl===null)var i=!1;else{if(e=sl,sl=null,cl=0,J&6)throw Error(r(331));var a=J;for(J|=4,K=e.current;K!==null;){var o=K,s=o.child;if(K.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lN()-el?El(e,0):Zc|=n),gl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=Lt,Lt<<=1,!(Lt&130023424)&&(Lt=4194304)):t=1);var n=pl();e=oo(e,t),e!==null&&(Gt(e,t,n),gl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ta.current)Bs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Bs=!1,lc(e,t,n);Bs=!!(e.flags&131072)}else Bs=!1,R&&t.flags&1048576&&Ea(t,ya,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;sc(e,t),e=t.pendingProps;var a=ra(t,ea.current);to(t,n),a=Lo(null,t,i,e,a,n);var o=Ro();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ia(i)?(o=!0,ca(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,co(t),a.updater=Ts,t.stateNode=a,a._reactInternals=t,ks(t,i,e,n),t=Ys(null,t,i,!0,o,n)):(t.tag=0,R&&o&&Da(t),Vs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(sc(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=Cs(i,e),a){case 0:t=qs(null,t,i,e,n);break a;case 1:t=Js(null,t,i,e,n);break a;case 11:t=Hs(null,t,i,e,n);break a;case 14:t=Us(null,t,i,Cs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),qs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),Js(e,t,i,a,n);case 3:a:{if(Xs(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,lo(e,t),ho(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=As(Error(r(423)),t),t=Zs(e,t,i,n,a);break a}else if(i!==a){a=As(Error(r(424)),t),t=Zs(e,t,i,n,a);break a}else for(Aa=Li(t.stateNode.containerInfo.firstChild),ka=t,R=!0,ja=null,n=qa(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(za(),i===a){t=cc(e,t,n);break a}Vs(e,t,i,n)}t=t.child}return t;case 5:return wo(t),e===null&&Fa(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,Ai(i,a)?s=null:o!==null&&Ai(i,o)&&(t.flags|=32),Ks(e,t),Vs(e,t,s,n),t.child;case 6:return e===null&&Fa(t),null;case 13:return ec(e,t,n);case 4:return So(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ka(t,null,i,n):Vs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),Hs(e,t,i,a,n);case 7:return Vs(e,t,t.pendingProps,n),t.child;case 8:return Vs(e,t,t.pendingProps.children,n),t.child;case 12:return Vs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,L(Ja,i._currentValue),i._currentValue=s,o!==null)if(Ir(o.value,s)){if(o.children===a.children&&!ta.current){t=cc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=uo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),eo(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),eo(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Vs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,to(t,n),a=no(a),i=i(a),t.flags|=1,Vs(e,t,i,n),t.child;case 14:return i=t.type,a=Cs(i,t.pendingProps),a=Cs(i.type,a),Us(e,t,i,a,n);case 15:return Ws(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:Cs(i,a),sc(e,t),t.tag=1,ia(i)?(e=!0,ca(t)):e=!1,to(t,n),Ds(t,i,a),ks(t,i,a,n),Ys(null,t,i,!0,e,n);case 19:return oc(e,t,n);case 22:return Gs(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return yt(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===oe)return 11;if(e===T)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case w:return Zl(n.children,a,o,t);case ne:s=8,a|=8;break;case re:return e=Kl(12,n,t,a|2),e.elementType=re,e.lanes=o,e;case se:return e=Kl(13,n,t,a),e.elementType=se,e.lanes=o,e;case ce:return e=Kl(19,n,t,a),e.elementType=ce,e.lanes=o,e;case ue:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case ie:s=10;break a;case ae:s=9;break a;case oe:s=11;break a;case T:s=14;break a;case le:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=ue,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wt(0),this.expirationTimes=Wt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},co(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h(),1),v=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function y(e,t={}){let n=await fetch(e,{credentials:`same-origin`,headers:{"Content-Type":`application/json`,...t.headers??{}},...t}),r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok){let e=i?.error||i?.Error||i?.message||n.statusText;throw new v(n.status,e)}return i}function b(e){return e instanceof Error?e.message:String(e)}var x={session:()=>y(`/api/session`),login:e=>y(`/api/login`,{method:`POST`,body:JSON.stringify({secret:e})}),logout:()=>y(`/api/logout`,{method:`POST`,body:`{}`}),accounts:e=>y(`/api/accounts?${e.toString()}`),account:e=>y(`/api/accounts/${e}`),channels:e=>y(`/api/channels?${e.toString()}`),channel:e=>y(`/api/channels/${e}`),messages:e=>y(`/api/messages?${e.toString()}`),message:(e,t)=>y(`/api/messages/detail?${new URLSearchParams({owner_user_id:String(e),msg_id:String(t)}).toString()}`),groupMessages:e=>y(`/api/messages/groups?${e.toString()}`),groupMessage:(e,t)=>y(`/api/messages/groups/detail?${new URLSearchParams({channel_id:String(e),msg_id:String(t)}).toString()}`),action:(e,t)=>y(e,{method:`POST`,body:JSON.stringify(t)})},ee=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),S=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),te={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},C=(0,g.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,g.createElement)(`svg`,{ref:c,...te,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:S(`lucide`,i),...s},[...o.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(a)?a:[a]])),w=(e,t)=>{let n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(C,{ref:i,iconNode:t,className:S(`lucide-${ee(e)}`,n),...r}));return n.displayName=`${e}`,n},ne=w(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),re=w(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ie=w(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ae=w(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),oe=w(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),se=w(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),ce=w(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),T=w(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),le=w(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ue=w(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),de=w(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),fe=w(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),E=w(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),pe=w(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),me=w(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),he=w(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),ge=w(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),_e=w(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),ve=w(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),ye=w(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),D=w(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),be=w(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),xe=w(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Se=w(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ce=w(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),we=w(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Te=w(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),Ee=w(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),De=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),O=o(((e,t)=>{t.exports=De()}))(),Oe=`telesrv.admin.lang`,ke={en:{"app.adminConsole":`Admin Console`,"app.localAccess":`Local access`,"app.title":`telesrv admin`,"common.actions":`Actions`,"common.admins":`Admins`,"common.backToList":`Back to list`,"common.channel":`Channel`,"common.channelOrGroup":`Channel / Group`,"common.clear":`Clear`,"common.close":`Close`,"common.count":`Count`,"common.deleted":`Deleted`,"common.detail":`Details`,"common.device":`Device`,"common.disabled":`Disabled`,"common.enabled":`Enabled`,"common.fromPeer":`From Peer`,"common.group":`Group`,"common.id":`ID`,"common.limit":`Limit`,"common.loading":`Loading`,"common.member":`Member`,"common.members":`Members`,"common.messageId":`Message ID`,"common.name":`Name`,"common.no":`No`,"common.noResults":`No results`,"common.none":`None`,"common.normal":`Normal`,"common.operations":`Operations`,"common.owner":`Owner`,"common.platform":`Platform`,"common.refresh":`Refresh`,"common.search":`Search`,"common.sender":`Sender`,"common.status":`Status`,"common.survived":`Live`,"common.time":`Time`,"common.type":`Type`,"common.updatedAt":`Updated`,"common.username":`Username`,"common.valid":`Valid`,"common.verified":`Verified`,"common.views":`Views`,"common.yes":`Yes`,"route.accounts":`Accounts`,"route.accountsSubtitle":`Console / Accounts`,"route.channels":`Supergroups and Channels`,"route.channelsSubtitle":`Console / Channels`,"route.dashboard":`Operations Console`,"route.dashboardSubtitle":`Console / Overview`,"route.messages":`Message Audit`,"route.messagesSubtitle":`Console / Messages`,"layout.navigation":`Navigation`,"layout.primaryNav":`Primary navigation`,"layout.dashboard":`Overview`,"layout.accounts":`Accounts`,"layout.channels":`Supergroups / Channels`,"layout.messages":`Messages`,"layout.privateMessages":`Private`,"layout.groupMessages":`Groups`,"layout.runtime":`Runtime`,"layout.adminBackend":`Admin backend`,"layout.ready":`Ready`,"layout.pgRead":`PG read`,"layout.readOnly":`Read-only`,"layout.writeOps":`Write operations`,"layout.dryRun":`Dry-run`,"layout.actor":`Actor: {actor}`,"layout.logout":`Log out`,"language.en":`EN`,"language.zh":`中文`,"login.heading":`Operations Admin`,"login.body":`Enter credentials to open the console.`,"login.secret":`Admin password or token`,"login.submit":`Log in`,"login.submitting":`Logging in`,"dashboard.eyebrow":`Runtime Overview`,"dashboard.title":`Console Overview`,"dashboard.readPath":`Read path`,"dashboard.readPathValue":`PG read-only`,"dashboard.writePath":`Write path`,"dashboard.executionPolicy":`Execution policy`,"dashboard.dryRunFirst":`Dry-run first`,"dashboard.accountsText":`Account status, premium, verification, sessions.`,"dashboard.channelsText":`Public entities, member counts, verification state.`,"dashboard.messagesText":`Message boxes, updates, outbox state.`,"dashboard.strip.dryRun":`All dangerous actions start with dry-run`,"dashboard.strip.token":`Browser never stores internal tokens`,"dashboard.strip.pagination":`Lists use cursor pagination`,"dashboard.strip.snapshot":`Detail pages retain raw state snapshots`,"account.pageTitle":`Accounts`,"account.queryResults":`Search results`,"account.recentActive":`Recently active accounts`,"account.currentPage":`Accounts on page`,"account.onlineDevices":`Online device records`,"account.premium":`Premium`,"account.frozen":`Frozen`,"account.searchPlaceholder":`User ID / phone / username`,"account.userID":`User ID`,"account.phone":`Phone`,"account.lastActive":`Last active`,"account.notVerified":`Not verified`,"account.notPremium":`Not premium`,"account.premiumUntil":`Premium expires`,"account.starsBalance":`Stars balance`,"account.startingGrantApplied":`initial grant applied`,"account.startingGrantPending":`initial grant pending`,"account.activeSessions":`Authorized devices`,"account.accountFlags":`Account flags`,"account.restriction":`Restriction`,"account.restricted":`Restricted`,"account.createdAt":`Created`,"account.detailTitle":`Account #{id}`,"account.profile":`Account Profile`,"account.loadingDetail":`Loading account detail`,"account.waitingData":`Waiting for data`,"account.noUsername":`No username`,"account.noPhone":`No phone`,"account.sendFrozen":`Sending frozen`,"account.sendNormal":`Sending allowed`,"account.authorizationsTitle":`Authorized Devices`,"account.authorizationsCount":`{count} authorizations`,"account.recentAdminOps":`Recent Admin Actions`,"account.recent30Audit":`Last 30 audit rows`,"account.actionDock":`Account Actions`,"account.freezeSend":`Freeze sending`,"account.unfreezeSend":`Unfreeze sending`,"account.premiumMonths":`Premium duration (months)`,"account.premiumMonthsAria":`Set premium duration in months`,"account.setPremium":`Set premium`,"account.clearPremium":`Clear premium`,"account.starsAmount":`Stars to grant`,"account.starsAmountAria":`Set Stars amount to grant`,"account.grantStars":`Grant Stars`,"account.setVerified":`Set verified`,"account.clearVerified":`Clear verified`,"channel.pageTitle":`Supergroups and Channels`,"channel.recentUpdated":`Recently updated`,"channel.currentPage":`Entities on page`,"channel.megagroups":`Supergroups`,"channel.broadcasts":`Channels`,"channel.verifiedCount":`Verified`,"channel.searchPlaceholder":`Channel ID / username / title`,"channel.channelID":`Channel ID`,"channel.kind":`Kind`,"channel.title":`Title`,"channel.pts":`PTS`,"channel.detailProfile":`Channel Profile`,"channel.loadingDetail":`Loading channel detail`,"channel.creator":`Creator {id}`,"channel.governance":`Moderation`,"channel.governanceValue":`Banned {banned} / Kicked {kicked}`,"channel.flags":`Channel flags`,"channel.rawRow":`Channel Raw Row`,"channel.rawRowText":`Database read-only snapshot`,"channel.actionDock":`Channel Actions`,"channel.setVerified":`Set verified`,"channel.clearVerified":`Clear verified`,"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`,"messages.privateTitle":`Private Messages`,"messages.privateEyebrow":`Private message boxes`,"messages.groupTitle":`Group Messages`,"messages.groupEyebrow":`Supergroup / channel messages`,"messages.selectPrivatePeers":`Search and select the owner user and peer user first`,"messages.selectChannel":`Search and select a supergroup or channel first`,"messages.ownerUser":`Owner user`,"messages.peerUser":`Peer user`,"messages.beforeDatePlaceholder":`before_date cursor`,"messages.beforeIDPlaceholder":`before_msg_id cursor`,"messages.limitPlaceholder":`limit <= 100`,"messages.searchMessages":`Search messages`,"messages.nextPage":`Next page`,"messages.currentPage":`Messages on page`,"messages.deleted":`Deleted`,"messages.outgoing":`Outgoing`,"messages.incoming":`Incoming`,"messages.ownerPeer":`Owner / Peer`,"messages.deleteSelected":`Delete selected messages`,"messages.idsPlaceholder":`Message IDs, comma separated`,"messages.revoke":`Revoke for both sides`,"messages.previewDelete":`Dry-run delete`,"messages.clearHistory":`Clear private history`,"messages.maxIDPlaceholder":`max_id cutoff`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Clear only this side`,"messages.previewClearHistory":`Dry-run clear history`,"messages.direction":`Direction`,"messages.body":`Body`,"messages.privateDetailTitle":`Message #{id}`,"messages.detailEyebrow":`Message Detail`,"messages.backPrivate":`Back to private messages`,"messages.backGroup":`Back to group messages`,"messages.ownerPeerTitle":`Owner {owner} · Peer {peer}`,"messages.senderSubtitle":`Sender {sender} · {date}`,"messages.boxID":`Message box ID`,"messages.privateMessageID":`Private message ID`,"messages.messageSender":`Message sender`,"messages.messageBox":`Message Box`,"messages.dialogRow":`Dialog Row`,"messages.privateRow":`Private Message Row`,"messages.channelMessageRow":`Channel Message Row`,"messages.channelRow":`Channel Row`,"messages.userUpdateEvents":`Update Events`,"messages.channelUpdateEvents":`Channel Update Events`,"messages.eventJson":`Event JSON`,"messages.dispatchOutbox":`Dispatch Queue`,"messages.messageBoxesSnapshot":`message_boxes read-only snapshot`,"messages.dialogSnapshot":`dialogs read-only snapshot`,"messages.privateSnapshot":`private_messages read-only snapshot`,"messages.channelMessagesSnapshot":`channel_messages read-only snapshot`,"messages.channelSnapshot":`channels read-only snapshot`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`online/offline dispatch_outbox`,"messages.attempts":`Attempts`,"messages.deleteThis":`Delete this message`,"messages.groupDetailTitle":`Group Message #{id}`,"messages.channelGroupTitle":`Channel / Group {id}`,"messages.mediaCount":`With media`,"messages.channelPosts":`Channel posts`,"messages.channelGroup":`Channel / Group`,"messages.pinned":`Pinned`,"messages.channelPost":`Channel post`,"messages.msgIDsInvalid":`Message IDs are invalid`,"auth.device":`Device`,"auth.platform":`Platform`,"auth.ip":`IP`,"auth.lastActive":`Last active`,"auth.revokeCurrent":`Revoke current`,"auth.keepCurrent":`Keep current`,"auth.revokeAll":`Revoke all devices`,"picker.userPlaceholder":`Search user_id / phone / username`,"picker.channelPlaceholder":`Search channel_id / username / title`,"picker.verified":`Verified`,"picker.regular":`Regular`,"action.reasonRequired":`Please enter an operation reason`,"action.flow":`Action Flow`,"action.close":`Close`,"action.stepReason":`Enter reason`,"action.stepDryRun":`Dry-run check`,"action.stepConfirm":`Confirm execution`,"action.reason":`Operation reason`,"action.reasonPlaceholder":`Describe why this operation is being performed`,"action.requestPreview":`Request preview`,"action.result":`Action result`,"action.commandID":`Command ID`,"action.status":`Status`,"action.dryRun":`Dry-run`,"action.runAgain":`Run dry-run again`,"action.runDry":`Run dry-run first`,"action.confirm":`Confirm execution`,"audit.id":`ID`,"audit.commandID":`Command ID`,"audit.action":`Action`,"audit.actor":`Actor`,"audit.status":`Status`,"audit.dryRun":`Dry-run`,"audit.reason":`Reason`,"audit.time":`Time`},zh:{"app.adminConsole":`管理控制台`,"app.localAccess":`本地访问`,"app.title":`telesrv 管理后台`,"common.actions":`操作`,"common.admins":`管理员`,"common.backToList":`返回列表`,"common.channel":`频道`,"common.channelOrGroup":`频道/群`,"common.clear":`清除`,"common.close":`关闭`,"common.count":`数量`,"common.deleted":`已删除`,"common.detail":`详情`,"common.device":`设备`,"common.disabled":`已禁用`,"common.enabled":`已启用`,"common.fromPeer":`From Peer`,"common.group":`群组`,"common.id":`ID`,"common.limit":`条数`,"common.loading":`加载中`,"common.member":`成员`,"common.members":`成员`,"common.messageId":`消息 ID`,"common.name":`姓名`,"common.no":`否`,"common.noResults":`无结果`,"common.none":`无`,"common.normal":`正常`,"common.operations":`操作`,"common.owner":`所属`,"common.platform":`平台`,"common.refresh":`刷新`,"common.search":`查询`,"common.sender":`发送方`,"common.status":`状态`,"common.survived":`存活`,"common.time":`时间`,"common.type":`类型`,"common.updatedAt":`更新时间`,"common.username":`用户名`,"common.valid":`有效`,"common.verified":`已认证`,"common.views":`浏览`,"common.yes":`是`,"route.accounts":`账号管理`,"route.accountsSubtitle":`控制台 / 账号`,"route.channels":`超级群与频道`,"route.channelsSubtitle":`控制台 / 频道`,"route.dashboard":`运维控制台`,"route.dashboardSubtitle":`控制台 / 总览`,"route.messages":`消息审计`,"route.messagesSubtitle":`控制台 / 消息`,"layout.navigation":`导航`,"layout.primaryNav":`主导航`,"layout.dashboard":`总览`,"layout.accounts":`账号`,"layout.channels":`超级群/频道`,"layout.messages":`消息`,"layout.privateMessages":`私聊`,"layout.groupMessages":`群聊`,"layout.runtime":`运行状态`,"layout.adminBackend":`管理后台`,"layout.ready":`就绪`,"layout.pgRead":`PG 读取`,"layout.readOnly":`只读`,"layout.writeOps":`写操作`,"layout.dryRun":`预演`,"layout.actor":`操作者:{actor}`,"layout.logout":`退出`,"language.en":`EN`,"language.zh":`中文`,"login.heading":`运维后台`,"login.body":`输入凭据后进入控制台。`,"login.secret":`管理员密码或 token`,"login.submit":`登录`,"login.submitting":`登录中`,"dashboard.eyebrow":`运行总览`,"dashboard.title":`控制台总览`,"dashboard.readPath":`读路径`,"dashboard.readPathValue":`PG 只读`,"dashboard.writePath":`写路径`,"dashboard.executionPolicy":`执行策略`,"dashboard.dryRunFirst":`先预演`,"dashboard.accountsText":`账号状态、会员、认证、会话。`,"dashboard.channelsText":`公开实体、成员计数、认证状态。`,"dashboard.messagesText":`消息盒、update、outbox 状态。`,"dashboard.strip.dryRun":`所有危险操作先预演`,"dashboard.strip.token":`浏览器不持有内部 token`,"dashboard.strip.pagination":`列表使用游标分页`,"dashboard.strip.snapshot":`详情页保留原始状态快照`,"account.pageTitle":`账号`,"account.queryResults":`查询结果`,"account.recentActive":`最近活跃账号`,"account.currentPage":`当前页账号`,"account.onlineDevices":`在线设备记录`,"account.premium":`会员`,"account.frozen":`冻结`,"account.searchPlaceholder":`用户 ID / 手机号 / 用户名`,"account.userID":`用户 ID`,"account.phone":`手机号`,"account.lastActive":`最近活跃`,"account.notVerified":`未认证`,"account.notPremium":`非会员`,"account.premiumUntil":`会员到期`,"account.starsBalance":`Stars 余额`,"account.startingGrantApplied":`初始赠送已发放`,"account.startingGrantPending":`初始赠送未触发`,"account.activeSessions":`授权设备`,"account.accountFlags":`账号标记`,"account.restriction":`限制状态`,"account.restricted":`已限制`,"account.createdAt":`创建时间`,"account.detailTitle":`账号 #{id}`,"account.profile":`账号档案`,"account.loadingDetail":`加载账号详情`,"account.waitingData":`等待数据`,"account.noUsername":`无用户名`,"account.noPhone":`无手机号`,"account.sendFrozen":`发消息冻结`,"account.sendNormal":`发送正常`,"account.authorizationsTitle":`授权设备`,"account.authorizationsCount":`共 {count} 个授权`,"account.recentAdminOps":`最近后台操作`,"account.recent30Audit":`最近 30 条审计`,"account.actionDock":`账号操作`,"account.freezeSend":`冻结发消息`,"account.unfreezeSend":`解冻发消息`,"account.premiumMonths":`会员时长(月)`,"account.premiumMonthsAria":`设置会员时长,单位月`,"account.setPremium":`设置会员`,"account.clearPremium":`取消会员`,"account.starsAmount":`赠送 Stars 数量`,"account.starsAmountAria":`设置要赠送的 Stars 数量`,"account.grantStars":`赠送 Stars`,"account.setVerified":`设置认证`,"account.clearVerified":`取消认证`,"channel.pageTitle":`超级群与频道`,"channel.recentUpdated":`最近更新`,"channel.currentPage":`当前页实体`,"channel.megagroups":`超级群`,"channel.broadcasts":`频道`,"channel.verifiedCount":`已认证`,"channel.searchPlaceholder":`频道 ID / 用户名 / 标题`,"channel.channelID":`频道 ID`,"channel.kind":`类型`,"channel.title":`标题`,"channel.pts":`PTS`,"channel.detailProfile":`频道档案`,"channel.loadingDetail":`加载频道详情`,"channel.creator":`创建者 {id}`,"channel.governance":`治理状态`,"channel.governanceValue":`封禁 {banned} / 踢出 {kicked}`,"channel.flags":`频道标记`,"channel.rawRow":`频道原始行`,"channel.rawRowText":`数据库只读快照`,"channel.actionDock":`频道操作`,"channel.setVerified":`设置认证`,"channel.clearVerified":`取消认证`,"channel.kind.broadcast":`频道`,"channel.kind.forum":`超级群/论坛`,"channel.kind.megagroup":`超级群`,"channel.kind.generic":`频道/群`,"messages.privateTitle":`私聊消息`,"messages.privateEyebrow":`私聊消息盒`,"messages.groupTitle":`群聊消息`,"messages.groupEyebrow":`超级群 / 频道消息`,"messages.selectPrivatePeers":`请先搜索并选择所属用户和对端用户`,"messages.selectChannel":`请先搜索并选择超级群或频道`,"messages.ownerUser":`所属用户`,"messages.peerUser":`对端用户`,"messages.beforeDatePlaceholder":`before_date 游标`,"messages.beforeIDPlaceholder":`before_msg_id 游标`,"messages.limitPlaceholder":`条数 <= 100`,"messages.searchMessages":`查询消息`,"messages.nextPage":`下一页`,"messages.currentPage":`当前页消息`,"messages.deleted":`已删除`,"messages.outgoing":`发出消息`,"messages.incoming":`收到`,"messages.ownerPeer":`所属 / 对端`,"messages.deleteSelected":`删除指定消息`,"messages.idsPlaceholder":`消息 ID,逗号分隔`,"messages.revoke":`同步撤回`,"messages.previewDelete":`预演删除`,"messages.clearHistory":`清空私聊历史`,"messages.maxIDPlaceholder":`max_id 截止消息`,"messages.maxBatchesPlaceholder":`max_batches 批次数`,"messages.justClear":`仅清本侧`,"messages.previewClearHistory":`预演清历史`,"messages.direction":`方向`,"messages.body":`正文`,"messages.privateDetailTitle":`消息 #{id}`,"messages.detailEyebrow":`消息详情`,"messages.backPrivate":`返回私聊消息`,"messages.backGroup":`返回群聊消息`,"messages.ownerPeerTitle":`所属 {owner} · 对端 {peer}`,"messages.senderSubtitle":`发送方 {sender} · {date}`,"messages.boxID":`消息盒 ID`,"messages.privateMessageID":`私聊消息 ID`,"messages.messageSender":`发送方`,"messages.messageBox":`消息盒`,"messages.dialogRow":`会话行`,"messages.privateRow":`私聊消息行`,"messages.channelMessageRow":`消息行`,"messages.channelRow":`频道行`,"messages.userUpdateEvents":`更新事件`,"messages.channelUpdateEvents":`频道更新事件`,"messages.eventJson":`事件 JSON`,"messages.dispatchOutbox":`分发队列`,"messages.messageBoxesSnapshot":`message_boxes 只读快照`,"messages.dialogSnapshot":`dialogs 只读快照`,"messages.privateSnapshot":`private_messages 只读快照`,"messages.channelMessagesSnapshot":`channel_messages 只读快照`,"messages.channelSnapshot":`channels 只读快照`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`在线/离线 dispatch_outbox`,"messages.attempts":`尝试`,"messages.deleteThis":`删除此消息`,"messages.groupDetailTitle":`群聊消息 #{id}`,"messages.channelGroupTitle":`频道/群 {id}`,"messages.mediaCount":`有媒体`,"messages.channelPosts":`频道帖子`,"messages.channelGroup":`频道 / 群`,"messages.pinned":`置顶`,"messages.channelPost":`频道帖子`,"messages.msgIDsInvalid":`消息 ID 无效`,"auth.device":`设备`,"auth.platform":`平台`,"auth.ip":`IP`,"auth.lastActive":`最近活跃`,"auth.revokeCurrent":`撤销当前`,"auth.keepCurrent":`保留当前`,"auth.revokeAll":`撤销全部设备`,"picker.userPlaceholder":`搜索 user_id / phone / username`,"picker.channelPlaceholder":`搜索 channel_id / username / title`,"picker.verified":`认证`,"picker.regular":`普通`,"action.reasonRequired":`请填写操作原因`,"action.flow":`操作流程`,"action.close":`关闭`,"action.stepReason":`填写原因`,"action.stepDryRun":`预演检查`,"action.stepConfirm":`确认执行`,"action.reason":`操作原因`,"action.reasonPlaceholder":`说明本次操作原因`,"action.requestPreview":`请求预览`,"action.result":`操作结果`,"action.commandID":`命令 ID`,"action.status":`状态`,"action.dryRun":`预演`,"action.runAgain":`重新预演`,"action.runDry":`先预演`,"action.confirm":`确认执行`,"audit.id":`ID`,"audit.commandID":`命令 ID`,"audit.action":`动作`,"audit.actor":`操作者`,"audit.status":`状态`,"audit.dryRun":`预演`,"audit.reason":`原因`,"audit.time":`时间`}},Ae=(0,g.createContext)(null);function je({children:e}){let[t,n]=(0,g.useState)(()=>Pe());(0,g.useEffect)(()=>{try{localStorage.setItem(Oe,t)}catch{}document.documentElement.lang=t===`zh`?`zh-CN`:`en`,document.documentElement.dir=`ltr`,document.documentElement.setAttribute(`translate`,`no`),document.body.classList.add(`notranslate`),document.title=Ne(t,`app.title`)},[t]);let r=(0,g.useMemo)(()=>({lang:t,setLang:n,t:(e,n)=>Ne(t,e,n)}),[t]);return(0,O.jsx)(Ae.Provider,{value:r,children:e})}function k(){let e=(0,g.useContext)(Ae);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function Me(){let{lang:e,setLang:t,t:n}=k();return(0,O.jsx)(`div`,{className:`language-switch`,role:`group`,"aria-label":`Language`,children:[`en`,`zh`].map(r=>(0,O.jsx)(`button`,{className:e===r?`active`:``,type:`button`,"aria-pressed":e===r,onClick:()=>t(r),children:n(`language.${r}`)},r))})}function Ne(e,t,n){let r=ke[e][t]??ke.en[t]??t;return n?r.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??``)):r}function Pe(){try{let e=Fe(new URLSearchParams(window.location.search).get(`lang`));if(e)return e}catch{}try{let e=Fe(localStorage.getItem(Oe));if(e)return e}catch{}let e=navigator.languages?.length?navigator.languages:[navigator.language];for(let t of e){let e=Fe(t);if(e)return e}return`en`}function Fe(e){if(!e)return null;let t=e.trim().toLowerCase().replace(`_`,`-`);return t===`zh`||t.startsWith(`zh-`)?`zh`:t===`en`||t.startsWith(`en-`)?`en`:null}function Ie(){return{href:`${window.location.pathname}${window.location.search}`,path:window.location.pathname,search:new URLSearchParams(window.location.search)}}function Le(e,t){return e.startsWith(`/accounts`)?t(`route.accounts`):e.startsWith(`/channels`)?t(`route.channels`):e.startsWith(`/messages`)?t(`route.messages`):t(`route.dashboard`)}function Re(e,t){return e.startsWith(`/accounts`)?t(`route.accountsSubtitle`):e.startsWith(`/channels`)?t(`route.channelsSubtitle`):e.startsWith(`/messages`)?t(`route.messagesSubtitle`):t(`route.dashboardSubtitle`)}function ze({href:e,navigate:t,className:n,children:r}){return(0,O.jsx)(`a`,{className:n,href:e,onClick:n=>{n.preventDefault(),t(e)},children:r})}function Be(){let{t:e}=k();return(0,O.jsxs)(`div`,{className:`boot-screen`,children:[(0,O.jsxs)(`div`,{className:`brand compact brand-elevated`,children:[(0,O.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`telesrv`}),(0,O.jsx)(`small`,{children:e(`app.adminConsole`)})]})]}),(0,O.jsx)(`div`,{className:`loader-bar`})]})}function Ve({actor:e,route:t,navigate:n,onLogout:r,children:i}){let{t:a}=k(),o=t.path.startsWith(`/messages`),[s,c]=(0,g.useState)(o);(0,g.useEffect)(()=>{o&&c(!0)},[o]);async function l(){await x.logout().catch(()=>void 0),r()}return(0,O.jsxs)(`div`,{className:`shell`,children:[(0,O.jsxs)(`aside`,{className:`sidebar`,children:[(0,O.jsxs)(ze,{className:`brand`,href:`/`,navigate:n,children:[(0,O.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`telesrv`}),(0,O.jsx)(`small`,{children:a(`app.adminConsole`)})]})]}),(0,O.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.navigation`)}),(0,O.jsxs)(`nav`,{className:`nav-list`,"aria-label":a(`layout.primaryNav`),children:[(0,O.jsx)(He,{icon:(0,O.jsx)(he,{size:16}),href:`/`,route:t,navigate:n,children:a(`layout.dashboard`)}),(0,O.jsx)(He,{icon:(0,O.jsx)(Te,{size:16}),href:`/accounts`,route:t,navigate:n,children:a(`layout.accounts`)}),(0,O.jsx)(He,{icon:(0,O.jsx)(xe,{size:16}),href:`/channels`,route:t,navigate:n,children:a(`layout.channels`)}),(0,O.jsxs)(`div`,{className:`nav-section ${o?`active`:``} ${s?`open`:``}`,children:[(0,O.jsxs)(`button`,{className:`nav-section-toggle`,type:`button`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,O.jsx)(_e,{size:16}),(0,O.jsx)(`span`,{children:a(`layout.messages`)}),(0,O.jsx)(le,{className:`nav-section-chevron`,size:15})]}),s&&(0,O.jsxs)(`div`,{className:`nav-children`,children:[(0,O.jsx)(He,{href:`/messages/private`,route:t,navigate:n,activeWhen:e=>e===`/messages`||e===`/messages/detail`||e.startsWith(`/messages/private`),children:a(`layout.privateMessages`)}),(0,O.jsx)(He,{href:`/messages/groups`,route:t,navigate:n,activeWhen:e=>e.startsWith(`/messages/groups`),children:a(`layout.groupMessages`)})]})]})]}),(0,O.jsxs)(`div`,{className:`sidebar-status`,children:[(0,O.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.runtime`)}),(0,O.jsxs)(`div`,{className:`runtime-row`,children:[(0,O.jsx)(be,{size:14}),(0,O.jsx)(`span`,{children:a(`layout.adminBackend`)}),(0,O.jsx)(`strong`,{children:a(`layout.ready`)})]}),(0,O.jsxs)(`div`,{className:`runtime-row`,children:[(0,O.jsx)(fe,{size:14}),(0,O.jsx)(`span`,{children:a(`layout.pgRead`)}),(0,O.jsx)(`strong`,{children:a(`layout.readOnly`)})]}),(0,O.jsxs)(`div`,{className:`runtime-row`,children:[(0,O.jsx)(Se,{size:14}),(0,O.jsx)(`span`,{children:a(`layout.writeOps`)}),(0,O.jsx)(`strong`,{children:a(`layout.dryRun`)})]})]})]}),(0,O.jsxs)(`div`,{className:`workspace`,children:[(0,O.jsxs)(`header`,{className:`topbar`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`eyebrow`,children:Re(t.path,a)}),(0,O.jsx)(`h1`,{children:Le(t.path,a)})]}),(0,O.jsxs)(`div`,{className:`topbar-actions`,children:[(0,O.jsx)(Me,{}),(0,O.jsx)(`span`,{className:`actor-pill`,children:a(`layout.actor`,{actor:e})}),(0,O.jsxs)(`button`,{className:`btn ghost icon-text`,type:`button`,onClick:l,title:a(`layout.logout`),children:[(0,O.jsx)(ge,{size:16}),` `,a(`layout.logout`)]})]})]}),(0,O.jsx)(`main`,{className:`content`,children:i})]})]})}function He({href:e,route:t,navigate:n,icon:r,children:i,activeWhen:a}){return(0,O.jsxs)(ze,{className:`nav-item ${(a?a(t.path):e===`/`?t.path===`/`:t.path.startsWith(e))?`active`:``}`,href:e,navigate:n,children:[r??(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`nav-dot`}),(0,O.jsx)(`span`,{children:i})]})}function Ue(e){let t=e.trim();return!t||t.startsWith(`+`)?t:/^\d+$/.test(t)?`+${t}`:t}function We(e){let t=e.trim();return t?t.startsWith(`@`)?t:`@${t}`:``}function Ge(e){return`${e.FirstName||``} ${e.LastName||``}`.trim()||`-`}function Ke(e,t){let n=t??(e=>({"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`})[e]??e);return e.Broadcast&&!e.Megagroup?n(`channel.kind.broadcast`):e.Megagroup&&e.Forum?n(`channel.kind.forum`):e.Megagroup?n(`channel.kind.megagroup`):n(`channel.kind.generic`)}function qe(e){if(!e||e.startsWith(`0001-`))return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function Je(e){if(!e||e<=0)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function Ye(e){if(!e.trim())return 0;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}function Xe(e,t=`msg ids invalid`){let n=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean).map(e=>Number.parseInt(e,10));if(n.length===0||n.some(e=>!Number.isFinite(e)||e<=0))throw Error(t);return n}function Ze({title:e,eyebrow:t,children:n,actions:r}){return(0,O.jsxs)(`div`,{className:`page-frame`,children:[(0,O.jsxs)(`div`,{className:`page-title-row`,children:[(0,O.jsxs)(`div`,{children:[t&&(0,O.jsx)(`div`,{className:`eyebrow`,children:t}),(0,O.jsx)(`h2`,{children:e})]}),r&&(0,O.jsx)(`div`,{className:`page-actions`,children:r})]}),n]})}function Qe({children:e}){return(0,O.jsx)(`div`,{className:`query-panel`,children:e})}function $e({main:e,side:t}){return(0,O.jsxs)(`div`,{className:`split-layout`,children:[(0,O.jsx)(`div`,{className:`split-main`,children:e}),(0,O.jsx)(`aside`,{className:`split-side`,children:t})]})}function et({title:e,text:t,action:n}){return(0,O.jsxs)(`div`,{className:`section-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:e}),t&&(0,O.jsx)(`p`,{children:t})]}),n&&(0,O.jsx)(`div`,{className:`section-action`,children:n})]})}function tt({children:e}){return(0,O.jsxs)(`div`,{className:`alert`,children:[(0,O.jsx)(re,{size:16}),` `,(0,O.jsx)(`span`,{children:e})]})}function A({children:e,tone:t=`neutral`}){return(0,O.jsx)(`span`,{className:`badge ${t}`,children:e})}function nt({label:e,value:t,tone:n}){return(0,O.jsxs)(`div`,{className:`status-item ${n}`,children:[(0,O.jsx)(`span`,{children:e}),(0,O.jsx)(`strong`,{children:t})]})}function j({label:e,value:t,tone:n=`neutral`,mono:r=!1}){return(0,O.jsxs)(`div`,{className:`metric ${n}`,children:[(0,O.jsx)(`span`,{children:e}),(0,O.jsx)(`strong`,{className:r?`mono`:``,children:t})]})}function M({label:e,value:t,mono:n=!1}){return(0,O.jsxs)(`div`,{className:`summary-item`,children:[(0,O.jsx)(`span`,{children:e}),(0,O.jsx)(`strong`,{className:n?`mono`:``,children:t})]})}function rt({rows:e}){let{t}=k();return(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`audit.id`)}),(0,O.jsx)(`th`,{children:t(`audit.commandID`)}),(0,O.jsx)(`th`,{children:t(`audit.action`)}),(0,O.jsx)(`th`,{children:t(`audit.actor`)}),(0,O.jsx)(`th`,{children:t(`audit.status`)}),(0,O.jsx)(`th`,{children:t(`audit.dryRun`)}),(0,O.jsx)(`th`,{children:t(`audit.reason`)}),(0,O.jsx)(`th`,{children:t(`audit.time`)})]})}),(0,O.jsxs)(`tbody`,{children:[e.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:e.ID}),(0,O.jsx)(`td`,{className:`mono`,children:e.CommandID}),(0,O.jsx)(`td`,{children:e.Action}),(0,O.jsx)(`td`,{children:e.Actor}),(0,O.jsx)(`td`,{children:e.Status}),(0,O.jsx)(`td`,{children:e.DryRun?t(`common.yes`):t(`common.no`)}),(0,O.jsx)(`td`,{className:`truncate`,children:e.Reason}),(0,O.jsx)(`td`,{children:qe(e.CreatedAt)})]},e.ID)),e.length===0&&(0,O.jsx)(it,{colSpan:8})]})]})})}function it({colSpan:e}){let{t}=k();return(0,O.jsx)(`tr`,{children:(0,O.jsx)(`td`,{colSpan:e,className:`empty-cell`,children:t(`common.noResults`)})})}function at({label:e}){return(0,O.jsx)(`section`,{className:`surface`,children:(0,O.jsx)(`div`,{className:`loading-line`,children:e})})}function ot({value:e}){return(0,O.jsx)(`pre`,{className:`json-block`,children:e||`{}`})}function st({onLogin:e}){let{t}=k(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1);async function c(t){t.preventDefault(),s(!0),a(``);try{e((await x.login(n)).actor)}catch(e){a(b(e))}finally{s(!1)}}return(0,O.jsx)(`main`,{className:`login-page`,children:(0,O.jsxs)(`section`,{className:`login-panel`,children:[(0,O.jsxs)(`div`,{className:`login-head`,children:[(0,O.jsxs)(`div`,{className:`brand brand-elevated`,children:[(0,O.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`telesrv`}),(0,O.jsx)(`small`,{children:t(`app.adminConsole`)})]})]}),(0,O.jsxs)(`div`,{className:`login-head-actions`,children:[(0,O.jsx)(Me,{}),(0,O.jsx)(`span`,{className:`login-chip`,children:t(`app.localAccess`)})]})]}),(0,O.jsxs)(`div`,{className:`login-copy`,children:[(0,O.jsx)(`h1`,{children:t(`login.heading`)}),(0,O.jsx)(`p`,{children:t(`login.body`)})]}),i&&(0,O.jsx)(tt,{children:i}),(0,O.jsxs)(`form`,{className:`form-stack`,onSubmit:c,children:[(0,O.jsxs)(`label`,{children:[(0,O.jsx)(`span`,{children:t(`login.secret`)}),(0,O.jsx)(`input`,{autoFocus:!0,type:`password`,value:n,autoComplete:`current-password`,onChange:e=>r(e.target.value)})]}),(0,O.jsx)(`button`,{className:`btn primary full`,type:`submit`,disabled:o,children:t(o?`login.submitting`:`login.submit`)})]})]})})}var ct=m();function lt({label:e,path:t,payload:n,icon:r,compact:i=!1,tone:a=`danger`,onDone:o}){let{t:s}=k(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(!1);function y(){d(``),p(null),h(``)}async function ee(e){if(!u.trim()){h(s(`action.reasonRequired`));return}v(!0),h(``);try{let r={...n(),reason:u,confirm:e};p(await x.action(t,r)),e&&o?.()}catch(e){h(b(e))}finally{v(!1)}}let S=f?.dry_run&&!f.error,te=`btn ${a===`danger`?`danger`:a===`warn`?`warn`:``} ${i?`compact-btn`:``}`,C=(0,g.useMemo)(()=>{try{return n()}catch(e){return{payload_error:b(e)}}},[c,n]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{className:te,type:`button`,onClick:()=>{y(),l(!0)},children:[r,e]}),c&&(0,ct.createPortal)((0,O.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,O.jsxs)(`section`,{className:`modal command-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,children:[(0,O.jsxs)(`div`,{className:`modal-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`eyebrow`,children:s(`action.flow`)}),(0,O.jsx)(`h2`,{children:e})]}),(0,O.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>l(!1),"aria-label":s(`action.close`),children:(0,O.jsx)(Ee,{size:15})})]}),(0,O.jsxs)(`div`,{className:`command-body`,children:[(0,O.jsxs)(`div`,{className:`command-steps`,children:[(0,O.jsxs)(`div`,{className:`command-step ${u.trim()?`done`:`active`}`,children:[(0,O.jsx)(`span`,{children:`1`}),(0,O.jsx)(`strong`,{children:s(`action.stepReason`)})]}),(0,O.jsxs)(`div`,{className:`command-step ${f?.dry_run?`done`:u.trim()?`active`:``}`,children:[(0,O.jsx)(`span`,{children:`2`}),(0,O.jsx)(`strong`,{children:s(`action.stepDryRun`)})]}),(0,O.jsxs)(`div`,{className:`command-step ${f&&!f.dry_run&&!f.error?`done`:S?`active`:``}`,children:[(0,O.jsx)(`span`,{children:`3`}),(0,O.jsx)(`strong`,{children:s(`action.stepConfirm`)})]})]}),(0,O.jsxs)(`label`,{className:`form-field`,children:[(0,O.jsx)(`span`,{children:s(`action.reason`)}),(0,O.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:s(`action.reasonPlaceholder`)})]}),(0,O.jsxs)(`div`,{className:`command-preview`,children:[(0,O.jsxs)(`div`,{className:`preview-head`,children:[(0,O.jsx)(E,{size:14}),` `,s(`action.requestPreview`)]}),(0,O.jsx)(ot,{value:JSON.stringify(C,null,2)})]}),m&&(0,O.jsx)(tt,{children:m}),f&&(0,O.jsxs)(`div`,{className:`result-box`,children:[(0,O.jsxs)(`div`,{className:`result-title`,children:[f.error?(0,O.jsx)(re,{size:16}):(0,O.jsx)(ie,{size:16}),(0,O.jsx)(`strong`,{children:f.message||f.error||s(`action.result`)})]}),(0,O.jsxs)(`div`,{className:`result-line`,children:[(0,O.jsx)(`span`,{children:s(`action.commandID`)}),(0,O.jsx)(`strong`,{children:f.command_id})]}),(0,O.jsxs)(`div`,{className:`result-line`,children:[(0,O.jsx)(`span`,{children:s(`action.status`)}),(0,O.jsx)(`strong`,{children:f.status})]}),(0,O.jsxs)(`div`,{className:`result-line`,children:[(0,O.jsx)(`span`,{children:s(`action.dryRun`)}),(0,O.jsx)(`strong`,{children:f.dry_run?s(`common.yes`):s(`common.no`)})]}),(0,O.jsx)(`div`,{className:`result-message`,children:f.message||f.error}),f.details&&(0,O.jsx)(ot,{value:JSON.stringify(f.details,null,2)})]})]}),(0,O.jsxs)(`div`,{className:`modal-actions`,children:[(0,O.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l(!1),children:s(`common.close`)}),(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>ee(!1),disabled:_,children:[_?(0,O.jsx)(ae,{size:15,className:`spin`}):(0,O.jsx)(ve,{size:15}),s(f?`action.runAgain`:`action.runDry`)]}),(0,O.jsxs)(`button`,{className:`btn danger icon-text`,type:`button`,onClick:()=>ee(!0),disabled:_||!S,children:[(0,O.jsx)(ie,{size:15}),s(`action.confirm`)]})]})]})}),document.body)]})}function ut({rows:e,userID:t,onDone:n}){let{t:r}=k(),[i,a]=(0,g.useState)(()=>new Set);(0,g.useEffect)(()=>{a(new Set)},[t]);let o=(0,g.useMemo)(()=>e.filter(e=>!i.has(e.Hash)),[e,i]);function s(e){a(t=>e(t)),n()}return(0,O.jsxs)(`div`,{className:`authorization-block`,children:[(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table authorization-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:r(`auth.device`)}),(0,O.jsx)(`th`,{children:r(`auth.platform`)}),(0,O.jsx)(`th`,{children:r(`auth.ip`)}),(0,O.jsx)(`th`,{children:r(`auth.lastActive`)}),(0,O.jsx)(`th`,{className:`device-actions-head`,children:r(`common.actions`)})]})}),(0,O.jsxs)(`tbody`,{children:[o.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsxs)(`td`,{className:`device-text`,children:[n.DeviceModel,` `,n.SystemVersion]}),(0,O.jsxs)(`td`,{className:`device-text`,children:[n.Platform,` `,n.AppVersion]}),(0,O.jsx)(`td`,{children:n.IP}),(0,O.jsx)(`td`,{children:qe(n.ActiveAt)}),(0,O.jsx)(`td`,{className:`device-actions-cell`,children:(0,O.jsxs)(`div`,{className:`device-actions`,children:[(0,O.jsx)(lt,{label:r(`auth.revokeCurrent`),icon:(0,O.jsx)(ge,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,hash:n.Hash}),onDone:()=>s(e=>new Set([...e,n.Hash]))}),(0,O.jsx)(lt,{label:r(`auth.keepCurrent`),icon:(0,O.jsx)(xe,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,keep_hash:n.Hash}),onDone:()=>s(()=>new Set(e.filter(e=>e.Hash!==n.Hash).map(e=>e.Hash)))})]})})]},n.Hash)),o.length===0&&(0,O.jsx)(it,{colSpan:5})]})]})}),(0,O.jsx)(`div`,{className:`danger-zone`,children:(0,O.jsx)(lt,{label:r(`auth.revokeAll`),icon:(0,O.jsx)(ce,{size:15}),path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,revoke_all:!0}),onDone:()=>s(()=>new Set(e.map(e=>e.Hash)))})})]})}function dt({id:e,navigate:t}){let{t:n}=k(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`1`),[d,f]=(0,g.useState)(`1000`);async function p(){c(!0),o(``);try{i(await x.account(e))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{p()},[e]),a)return(0,O.jsx)(tt,{children:a});if(!r)return(0,O.jsx)(at,{label:n(s?`account.loadingDetail`:`account.waitingData`)});let m=r.Account;return(0,O.jsx)(Ze,{title:n(`account.detailTitle`,{id:m.ID}),eyebrow:n(`account.profile`),actions:(0,O.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/accounts`),children:[(0,O.jsx)(se,{size:15}),` `,n(`common.backToList`)]}),children:(0,O.jsx)($e,{main:(0,O.jsxs)(`div`,{className:`stacked-sections`,children:[(0,O.jsxs)(`section`,{className:`entity-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`entity-title`,children:Ge(m)}),(0,O.jsxs)(`div`,{className:`entity-subtitle`,children:[We(m.Username)||n(`account.noUsername`),` · `,Ue(m.Phone)||n(`account.noPhone`)]})]}),(0,O.jsxs)(`div`,{className:`entity-badges`,children:[m.PremiumUntil>0?(0,O.jsx)(A,{tone:`good`,children:n(`account.premium`)}):(0,O.jsx)(A,{children:n(`account.notPremium`)}),r.Verified?(0,O.jsx)(A,{tone:`good`,children:n(`common.verified`)}):(0,O.jsx)(A,{children:n(`account.notVerified`)}),m.Frozen?(0,O.jsx)(A,{tone:`danger`,children:n(`account.sendFrozen`)}):(0,O.jsx)(A,{children:n(`account.sendNormal`)})]})]}),(0,O.jsxs)(`div`,{className:`summary-grid`,children:[(0,O.jsx)(M,{label:n(`account.userID`),value:String(m.ID),mono:!0}),(0,O.jsx)(M,{label:n(`account.lastActive`),value:Je(r.LastSeenAt)||`-`}),(0,O.jsx)(M,{label:n(`account.premiumUntil`),value:m.PremiumUntil>0?Je(m.PremiumUntil):n(`common.none`)}),(0,O.jsx)(M,{label:n(`account.starsBalance`),value:`${r.StarsBalance} / ${r.StarsGranted?n(`account.startingGrantApplied`):n(`account.startingGrantPending`)}`}),(0,O.jsx)(M,{label:n(`common.updatedAt`),value:qe(m.UpdatedAt)||`-`}),(0,O.jsx)(M,{label:n(`account.activeSessions`),value:String(r.Authorizations.length)}),(0,O.jsx)(M,{label:n(`account.accountFlags`),value:`support=${r.Support} bot=${r.Bot}`}),(0,O.jsx)(M,{label:n(`account.restriction`),value:r.HasRestriction?r.Restriction.Reason||n(`account.restricted`):n(`common.none`)}),(0,O.jsx)(M,{label:n(`account.createdAt`),value:qe(m.CreatedAt)||`-`})]}),r.About&&(0,O.jsx)(`p`,{className:`about-text`,children:r.About}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:n(`account.authorizationsTitle`),text:n(`account.authorizationsCount`,{count:r.Authorizations.length})}),(0,O.jsx)(ut,{rows:r.Authorizations,userID:m.ID,onDone:p})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,O.jsx)(rt,{rows:r.AuditLogs})]})]}),side:(0,O.jsxs)(`section`,{className:`action-dock`,children:[(0,O.jsx)(`div`,{className:`dock-title`,children:n(`account.actionDock`)}),(0,O.jsx)(lt,{label:m.Frozen?n(`account.unfreezeSend`):n(`account.freezeSend`),icon:(0,O.jsx)(re,{size:15}),path:`/api/actions/freeze-send`,payload:()=>({user_id:m.ID,frozen:!m.Frozen}),onDone:p}),(0,O.jsxs)(`label`,{className:`duration-field`,children:[(0,O.jsx)(`span`,{children:n(`account.premiumMonths`)}),(0,O.jsx)(`input`,{"aria-label":n(`account.premiumMonthsAria`),value:l,onChange:e=>u(e.target.value),type:`number`,min:`1`,max:`120`})]}),(0,O.jsxs)(`div`,{className:`action-stack`,children:[(0,O.jsx)(lt,{label:n(`account.setPremium`),icon:(0,O.jsx)(oe,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:m.ID,months:Ye(l)}),onDone:p}),(0,O.jsx)(lt,{label:n(`account.clearPremium`),icon:(0,O.jsx)(oe,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:m.ID,months:0}),onDone:p}),(0,O.jsxs)(`label`,{className:`duration-field`,children:[(0,O.jsx)(`span`,{children:n(`account.starsAmount`)}),(0,O.jsx)(`input`,{"aria-label":n(`account.starsAmountAria`),value:d,onChange:e=>f(e.target.value),type:`number`,min:`1`,max:`1000000000`})]}),(0,O.jsx)(lt,{label:n(`account.grantStars`),icon:(0,O.jsx)(Ce,{size:15}),tone:`warn`,path:`/api/actions/grant-stars`,payload:()=>({user_id:m.ID,amount:Ye(d)}),onDone:p}),(0,O.jsx)(lt,{label:r.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,O.jsx)(ne,{size:15}),tone:`warn`,path:`/api/actions/set-verified`,payload:()=>({user_id:m.ID,verified:!r.Verified}),onDone:p})]})]})})})}function ft(e){return e.reduce((e,t)=>(e.devices+=t.DeviceCount,t.PremiumUntil>0&&(e.premium+=1),t.Frozen&&(e.frozen+=1),e),{devices:0,premium:0,frozen:0})}function pt(e){return e.reduce((e,t)=>(t.Megagroup&&(e.megagroups+=1),t.Broadcast&&(e.broadcasts+=1),t.Verified&&(e.verified+=1),e),{megagroups:0,broadcasts:0,verified:0})}function mt({navigate:e}){let{t}=k(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeActiveUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_active_us`,String(c.beforeActiveUS)));try{let e=await x.accounts(t);s(e),l({beforeID:e.next_before_id,beforeActiveUS:e.next_before_active_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=ft(o?.rows??[]);return(0,O.jsxs)(Ze,{title:t(`account.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`account.recentActive`),actions:(0,O.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,O.jsx)(ye,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,O.jsx)(tt,{children:f}),(0,O.jsxs)(`div`,{className:`metric-row`,children:[(0,O.jsx)(j,{label:t(`account.currentPage`),value:String(o?.rows.length??0)}),(0,O.jsx)(j,{label:t(`account.onlineDevices`),value:String(h.devices)}),(0,O.jsx)(j,{label:t(`account.premium`),value:String(h.premium),tone:`good`}),(0,O.jsx)(j,{label:t(`account.frozen`),value:String(h.frozen),tone:h.frozen>0?`danger`:`neutral`})]}),(0,O.jsx)(Qe,{children:(0,O.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,O.jsxs)(`label`,{className:`searchbox`,children:[(0,O.jsx)(D,{size:15}),(0,O.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`account.searchPlaceholder`)})]}),(0,O.jsxs)(`label`,{className:`field-inline`,children:[(0,O.jsx)(`span`,{children:t(`common.limit`)}),(0,O.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,O.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,O.jsx)(ae,{size:15,className:`spin`}):(0,O.jsx)(D,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,O.jsx)(ue,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`account.userID`)}),(0,O.jsx)(`th`,{children:t(`account.phone`)}),(0,O.jsx)(`th`,{children:t(`common.username`)}),(0,O.jsx)(`th`,{children:t(`common.name`)}),(0,O.jsx)(`th`,{children:t(`common.device`)}),(0,O.jsx)(`th`,{children:t(`account.lastActive`)}),(0,O.jsx)(`th`,{children:t(`account.premium`)}),(0,O.jsx)(`th`,{children:t(`common.verified`)}),(0,O.jsx)(`th`,{children:t(`account.frozen`)}),(0,O.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,O.jsx)(`th`,{})]})}),(0,O.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{className:`mono`,children:n.ID}),(0,O.jsx)(`td`,{children:Ue(n.Phone)}),(0,O.jsx)(`td`,{children:We(n.Username)}),(0,O.jsx)(`td`,{children:Ge(n)}),(0,O.jsx)(`td`,{children:n.DeviceCount}),(0,O.jsx)(`td`,{children:qe(n.LastActiveAt)}),(0,O.jsx)(`td`,{children:n.PremiumUntil>0?(0,O.jsxs)(A,{tone:`good`,children:[t(`account.premium`),` `,Je(n.PremiumUntil)]}):(0,O.jsx)(A,{children:t(`common.none`)})}),(0,O.jsx)(`td`,{children:n.Verified?(0,O.jsx)(A,{tone:`good`,children:t(`common.verified`)}):(0,O.jsx)(A,{children:t(`account.notVerified`)})}),(0,O.jsx)(`td`,{children:n.Frozen?(0,O.jsx)(A,{tone:`danger`,children:t(`account.frozen`)}):(0,O.jsx)(A,{children:t(`common.normal`)})}),(0,O.jsx)(`td`,{children:qe(n.UpdatedAt)}),(0,O.jsx)(`td`,{children:(0,O.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/accounts/${n.ID}`),children:[t(`common.detail`),` `,(0,O.jsx)(ue,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,O.jsx)(it,{colSpan:11})]})]})})]})}function ht({id:e,navigate:t}){let{t:n}=k(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``);async function s(){o(``);try{i(await x.channel(e))}catch(e){o(b(e))}}if((0,g.useEffect)(()=>{s()},[e]),a)return(0,O.jsx)(tt,{children:a});if(!r)return(0,O.jsx)(at,{label:n(`channel.loadingDetail`)});let c=r.Channel;return(0,O.jsx)(Ze,{title:`${Ke(c,n)} #${c.ID}`,eyebrow:n(`channel.detailProfile`),actions:(0,O.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/channels`),children:[(0,O.jsx)(se,{size:15}),` `,n(`common.backToList`)]}),children:(0,O.jsx)($e,{main:(0,O.jsxs)(`div`,{className:`stacked-sections`,children:[(0,O.jsxs)(`section`,{className:`entity-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`entity-title`,children:c.Title||`-`}),(0,O.jsxs)(`div`,{className:`entity-subtitle`,children:[We(c.Username)||n(`account.noUsername`),` · `,n(`channel.creator`,{id:c.CreatorUserID})]})]}),(0,O.jsxs)(`div`,{className:`entity-badges`,children:[(0,O.jsx)(A,{children:Ke(c,n)}),c.Verified?(0,O.jsx)(A,{tone:`good`,children:n(`common.verified`)}):(0,O.jsx)(A,{children:n(`account.notVerified`)}),c.Deleted?(0,O.jsx)(A,{tone:`danger`,children:n(`common.deleted`)}):(0,O.jsx)(A,{children:n(`common.valid`)})]})]}),(0,O.jsxs)(`div`,{className:`summary-grid`,children:[(0,O.jsx)(M,{label:n(`channel.channelID`),value:String(c.ID),mono:!0}),(0,O.jsx)(M,{label:`access_hash`,value:String(c.AccessHash),mono:!0}),(0,O.jsx)(M,{label:n(`common.members`),value:`${c.ParticipantsCount} / ${n(`common.admins`)} ${c.AdminsCount}`}),(0,O.jsx)(M,{label:n(`channel.governance`),value:n(`channel.governanceValue`,{banned:c.BannedCount,kicked:c.KickedCount})}),(0,O.jsx)(M,{label:n(`channel.flags`),value:`broadcast=${c.Broadcast} megagroup=${c.Megagroup} forum=${c.Forum}`}),(0,O.jsx)(M,{label:`top / pinned / PTS`,value:`${c.TopMessageID} / ${c.PinnedMessageID} / ${c.PTS}`}),(0,O.jsx)(M,{label:n(`account.createdAt`),value:Je(c.Date)||`-`}),(0,O.jsx)(M,{label:n(`common.updatedAt`),value:qe(c.UpdatedAt)||`-`})]}),c.About&&(0,O.jsx)(`p`,{className:`about-text`,children:c.About}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,O.jsx)(rt,{rows:r.AuditLogs})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:n(`channel.rawRow`),text:n(`channel.rawRowText`)}),(0,O.jsx)(ot,{value:r.ChannelJSON})]})]}),side:(0,O.jsxs)(`section`,{className:`action-dock`,children:[(0,O.jsx)(`div`,{className:`dock-title`,children:n(`channel.actionDock`)}),(0,O.jsx)(lt,{label:c.Verified?n(`channel.clearVerified`):n(`channel.setVerified`),icon:(0,O.jsx)(ne,{size:15}),tone:`warn`,path:`/api/actions/set-channel-verified`,payload:()=>({channel_id:c.ID,verified:!c.Verified}),onDone:s})]})})})}function gt({navigate:e}){let{t}=k(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeUpdatedUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_updated_us`,String(c.beforeUpdatedUS)));try{let e=await x.channels(t);s(e),l({beforeID:e.next_before_id,beforeUpdatedUS:e.next_before_updated_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=pt(o?.rows??[]);return(0,O.jsxs)(Ze,{title:t(`channel.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`channel.recentUpdated`),actions:(0,O.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,O.jsx)(ye,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,O.jsx)(tt,{children:f}),(0,O.jsxs)(`div`,{className:`metric-row`,children:[(0,O.jsx)(j,{label:t(`channel.currentPage`),value:String(o?.rows.length??0)}),(0,O.jsx)(j,{label:t(`channel.megagroups`),value:String(h.megagroups)}),(0,O.jsx)(j,{label:t(`channel.broadcasts`),value:String(h.broadcasts)}),(0,O.jsx)(j,{label:t(`channel.verifiedCount`),value:String(h.verified),tone:`good`})]}),(0,O.jsx)(Qe,{children:(0,O.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,O.jsxs)(`label`,{className:`searchbox`,children:[(0,O.jsx)(D,{size:15}),(0,O.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`channel.searchPlaceholder`)})]}),(0,O.jsxs)(`label`,{className:`field-inline`,children:[(0,O.jsx)(`span`,{children:t(`common.limit`)}),(0,O.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,O.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,O.jsx)(ae,{size:15,className:`spin`}):(0,O.jsx)(D,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,O.jsx)(ue,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`channel.channelID`)}),(0,O.jsx)(`th`,{children:t(`channel.kind`)}),(0,O.jsx)(`th`,{children:t(`common.username`)}),(0,O.jsx)(`th`,{children:t(`channel.title`)}),(0,O.jsx)(`th`,{children:t(`common.members`)}),(0,O.jsx)(`th`,{children:t(`common.admins`)}),(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:t(`common.verified`)}),(0,O.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,O.jsx)(`th`,{})]})}),(0,O.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{className:`mono`,children:n.ID}),(0,O.jsx)(`td`,{children:Ke(n,t)}),(0,O.jsx)(`td`,{children:We(n.Username)}),(0,O.jsx)(`td`,{children:n.Title}),(0,O.jsx)(`td`,{children:n.ParticipantsCount}),(0,O.jsx)(`td`,{children:n.AdminsCount}),(0,O.jsx)(`td`,{children:n.PTS}),(0,O.jsx)(`td`,{children:n.Verified?(0,O.jsx)(A,{tone:`good`,children:t(`common.verified`)}):(0,O.jsx)(A,{children:t(`account.notVerified`)})}),(0,O.jsx)(`td`,{children:qe(n.UpdatedAt)}),(0,O.jsx)(`td`,{children:(0,O.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/channels/${n.ID}`),children:[t(`common.detail`),` `,(0,O.jsx)(ue,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,O.jsx)(it,{colSpan:10})]})]})})]})}function _t({navigate:e}){let{t}=k();return(0,O.jsxs)(`div`,{className:`dashboard-layout`,children:[(0,O.jsxs)(`section`,{className:`overview-band`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`eyebrow`,children:t(`dashboard.eyebrow`)}),(0,O.jsx)(`h2`,{children:t(`dashboard.title`)})]}),(0,O.jsxs)(`div`,{className:`overview-metrics`,children:[(0,O.jsx)(nt,{label:t(`dashboard.readPath`),value:t(`dashboard.readPathValue`),tone:`neutral`}),(0,O.jsx)(nt,{label:t(`dashboard.writePath`),value:`Admin API`,tone:`good`}),(0,O.jsx)(nt,{label:t(`dashboard.executionPolicy`),value:t(`dashboard.dryRunFirst`),tone:`warn`})]})]}),(0,O.jsxs)(`div`,{className:`command-grid`,children:[(0,O.jsx)(vt,{icon:(0,O.jsx)(Te,{}),title:t(`route.accounts`),text:t(`dashboard.accountsText`),href:`/accounts`,navigate:e}),(0,O.jsx)(vt,{icon:(0,O.jsx)(xe,{}),title:t(`route.channels`),text:t(`dashboard.channelsText`),href:`/channels`,navigate:e}),(0,O.jsx)(vt,{icon:(0,O.jsx)(_e,{}),title:t(`route.messages`),text:t(`dashboard.messagesText`),href:`/messages`,navigate:e})]}),(0,O.jsxs)(`section`,{className:`work-strip`,children:[(0,O.jsxs)(`div`,{className:`strip-item`,children:[(0,O.jsx)(ie,{size:16}),(0,O.jsx)(`span`,{children:t(`dashboard.strip.dryRun`)})]}),(0,O.jsxs)(`div`,{className:`strip-item`,children:[(0,O.jsx)(me,{size:16}),(0,O.jsx)(`span`,{children:t(`dashboard.strip.token`)})]}),(0,O.jsxs)(`div`,{className:`strip-item`,children:[(0,O.jsx)(de,{size:16}),(0,O.jsx)(`span`,{children:t(`dashboard.strip.pagination`)})]}),(0,O.jsxs)(`div`,{className:`strip-item`,children:[(0,O.jsx)(E,{size:16}),(0,O.jsx)(`span`,{children:t(`dashboard.strip.snapshot`)})]})]})]})}function vt({icon:e,title:t,text:n,href:r,navigate:i}){return(0,O.jsxs)(ze,{className:`launcher`,href:r,navigate:i,children:[(0,O.jsx)(`span`,{className:`launcher-icon`,children:e}),(0,O.jsxs)(`span`,{className:`launcher-copy`,children:[(0,O.jsx)(`strong`,{children:t}),(0,O.jsx)(`span`,{children:n})]}),(0,O.jsx)(ue,{size:16})]})}function yt({channelID:e,msgID:t,navigate:n}){let{t:r}=k(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.groupMessage(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,O.jsx)(tt,{children:o});if(!i)return(0,O.jsx)(at,{label:r(`common.loading`)});let l=i.Message;return(0,O.jsx)(Ze,{title:r(`messages.groupDetailTitle`,{id:l.ID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,O.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/groups`),children:[(0,O.jsx)(se,{size:15}),` `,r(`messages.backGroup`)]}),children:(0,O.jsxs)(`div`,{className:`stacked-sections`,children:[(0,O.jsxs)(`section`,{className:`entity-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`entity-title`,children:r(`messages.channelGroupTitle`,{id:l.ChannelID})}),(0,O.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.SenderUserID,date:Je(l.Date)})})]}),(0,O.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,O.jsx)(A,{tone:`danger`,children:r(`common.deleted`)}):(0,O.jsx)(A,{children:r(`common.survived`)}),l.Pinned&&(0,O.jsx)(A,{tone:`warn`,children:r(`messages.pinned`)}),l.Post&&(0,O.jsx)(A,{children:r(`messages.channelPost`)}),(0,O.jsxs)(A,{children:[`pts `,l.PTS]})]})]}),(0,O.jsxs)(`div`,{className:`summary-grid`,children:[(0,O.jsx)(M,{label:r(`common.messageId`),value:String(l.ID),mono:!0}),(0,O.jsx)(M,{label:r(`messages.channelGroup`),value:String(l.ChannelID),mono:!0}),(0,O.jsx)(M,{label:`From Peer`,value:`${l.FromPeerType}:${l.FromPeerID}`,mono:!0}),(0,O.jsx)(M,{label:r(`common.views`),value:String(l.ViewsCount)})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.channelMessageRow`),text:r(`messages.channelMessagesSnapshot`)}),(0,O.jsx)(ot,{value:i.MessageJSON})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.channelRow`),text:r(`messages.channelSnapshot`)}),(0,O.jsx)(ot,{value:i.ChannelJSON})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.channelUpdateEvents`),text:r(`messages.channelEventsSource`)}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:r(`common.count`)}),(0,O.jsx)(`th`,{children:r(`common.type`)}),(0,O.jsx)(`th`,{children:r(`common.messageId`)}),(0,O.jsx)(`th`,{children:r(`common.sender`)}),(0,O.jsx)(`th`,{children:r(`common.time`)})]})}),(0,O.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:e.PTS}),(0,O.jsx)(`td`,{children:e.PTSCount}),(0,O.jsx)(`td`,{children:e.Type}),(0,O.jsx)(`td`,{children:e.MessageID}),(0,O.jsx)(`td`,{children:e.SenderUserID}),(0,O.jsx)(`td`,{children:Je(e.Date)})]},`${e.PTS}-${e.Type}-${e.MessageID}`)),i.UpdateEvents.length===0&&(0,O.jsx)(it,{colSpan:6})]})]})})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.eventJson`)}),(0,O.jsxs)(`div`,{className:`raw-grid`,children:[i.UpdateEvents.map(e=>(0,O.jsx)(ot,{value:e.JSON},`${e.PTS}-${e.Type}-json`)),i.UpdateEvents.length===0&&(0,O.jsx)(`div`,{className:`empty-panel`,children:r(`common.noResults`)})]})]})]})})}function bt({label:e,value:t,onChange:n}){let{t:r}=k(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.accounts(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,O.jsxs)(`div`,{className:`entity-picker`,children:[(0,O.jsxs)(`div`,{className:`picker-head`,children:[(0,O.jsx)(`span`,{children:e}),t?(0,O.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,O.jsx)(Ee,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,O.jsxs)(`div`,{className:`selected-entity`,children:[(0,O.jsx)(T,{size:15}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:Ge(t)}),(0,O.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,O.jsx)(`span`,{children:We(t.Username)||Ue(t.Phone)||`-`})]}):null,(0,O.jsxs)(`div`,{className:`picker-search`,children:[(0,O.jsx)(D,{size:15}),(0,O.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.userPlaceholder`)}),(0,O.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,O.jsx)(ae,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,O.jsx)(`div`,{className:`picker-error`,children:u}),(0,O.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,O.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,O.jsx)(`span`,{className:`mono`,children:e.ID}),(0,O.jsx)(`strong`,{children:Ge(e)}),(0,O.jsx)(`span`,{children:We(e.Username)||Ue(e.Phone)||`-`}),e.Verified?(0,O.jsx)(A,{tone:`good`,children:r(`picker.verified`)}):(0,O.jsx)(A,{children:r(`picker.regular`)})]},e.ID)),o.length===0&&!c?(0,O.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function xt({label:e,value:t,onChange:n}){let{t:r}=k(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.channels(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,O.jsxs)(`div`,{className:`entity-picker`,children:[(0,O.jsxs)(`div`,{className:`picker-head`,children:[(0,O.jsx)(`span`,{children:e}),t?(0,O.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,O.jsx)(Ee,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,O.jsxs)(`div`,{className:`selected-entity`,children:[(0,O.jsx)(T,{size:15}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:t.Title||`-`}),(0,O.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,O.jsx)(`span`,{children:We(t.Username)||Ke(t,r)})]}):null,(0,O.jsxs)(`div`,{className:`picker-search`,children:[(0,O.jsx)(D,{size:15}),(0,O.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.channelPlaceholder`)}),(0,O.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,O.jsx)(ae,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,O.jsx)(`div`,{className:`picker-error`,children:u}),(0,O.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,O.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,O.jsx)(`span`,{className:`mono`,children:e.ID}),(0,O.jsx)(`strong`,{children:e.Title||`-`}),(0,O.jsx)(`span`,{children:We(e.Username)||Ke(e,r)}),e.Verified?(0,O.jsx)(A,{tone:`good`,children:r(`picker.verified`)}):(0,O.jsx)(A,{children:Ke(e,r)})]},e.ID)),o.length===0&&!c?(0,O.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function St({navigate:e}){let{t}=k(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(`100`),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(``);async function m(e=!1){if(p(``),!n){p(t(`messages.selectChannel`));return}let r=new URLSearchParams({channel_id:String(n.ID),limit:c});if(e&&u?.rows.length){let e=u.rows[u.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.ID)),a(String(e.Date)),s(String(e.ID))}else i&&r.set(`before_date`,i),o&&r.set(`before_id`,o);try{d(await x.groupMessages(r))}catch(e){p(b(e))}}function h(e){r(e),a(``),s(``),d(null)}let _=u?.rows??[];return(0,O.jsxs)(Ze,{title:t(`messages.groupTitle`),eyebrow:t(`messages.groupEyebrow`),children:[f&&(0,O.jsx)(tt,{children:f}),(0,O.jsxs)(Qe,{children:[(0,O.jsx)(`div`,{className:`message-selector-grid single`,children:(0,O.jsx)(xt,{label:t(`messages.channelGroup`),value:n,onChange:h})}),(0,O.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,O.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,O.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,O.jsx)(`input`,{className:`small-input`,value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,O.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,O.jsx)(D,{size:15}),` `,t(`messages.searchMessages`)]}),_.length?(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),children:[(0,O.jsx)(ue,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,O.jsxs)(`div`,{className:`metric-row`,children:[(0,O.jsx)(j,{label:t(`messages.currentPage`),value:String(_.length)}),(0,O.jsx)(j,{label:t(`messages.mediaCount`),value:String(_.filter(e=>e.Media&&e.Media!==`{}`).length)}),(0,O.jsx)(j,{label:t(`messages.channelPosts`),value:String(_.filter(e=>e.Post).length)}),(0,O.jsx)(j,{label:t(`messages.channelGroup`),value:n?`${n.Title||Ke(n,t)} (${n.ID})`:`-`})]}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`common.messageId`)}),(0,O.jsx)(`th`,{children:t(`common.time`)}),(0,O.jsx)(`th`,{children:t(`common.sender`)}),(0,O.jsx)(`th`,{children:`From Peer`}),(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:t(`common.views`)}),(0,O.jsx)(`th`,{children:t(`common.status`)}),(0,O.jsx)(`th`,{children:t(`messages.body`)}),(0,O.jsx)(`th`,{})]})}),(0,O.jsxs)(`tbody`,{children:[_.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{className:`mono`,children:n.ID}),(0,O.jsx)(`td`,{children:Je(n.Date)}),(0,O.jsx)(`td`,{className:`mono`,children:n.SenderUserID}),(0,O.jsxs)(`td`,{className:`mono`,children:[n.FromPeerType,`:`,n.FromPeerID]}),(0,O.jsx)(`td`,{children:n.PTS}),(0,O.jsx)(`td`,{children:n.ViewsCount}),(0,O.jsx)(`td`,{children:n.Deleted?(0,O.jsx)(A,{tone:`danger`,children:t(`common.deleted`)}):n.Pinned?(0,O.jsx)(A,{tone:`warn`,children:t(`messages.pinned`)}):(0,O.jsx)(A,{children:t(`common.survived`)})}),(0,O.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,O.jsx)(`td`,{children:(0,O.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/groups/detail?channel_id=${n.ChannelID}&msg_id=${n.ID}`),children:[t(`common.detail`),` `,(0,O.jsx)(ue,{size:14})]})})]},`${n.ChannelID}-${n.ID}`)),_.length===0&&(0,O.jsx)(it,{colSpan:9})]})]})})]})}function N({ownerUserID:e,msgID:t,navigate:n}){let{t:r}=k(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.message(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,O.jsx)(tt,{children:o});if(!i)return(0,O.jsx)(at,{label:r(`common.loading`)});let l=i.Message;return(0,O.jsx)(Ze,{title:r(`messages.privateDetailTitle`,{id:l.BoxID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,O.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/private`),children:[(0,O.jsx)(se,{size:15}),` `,r(`messages.backPrivate`)]}),children:(0,O.jsx)($e,{main:(0,O.jsxs)(`div`,{className:`stacked-sections`,children:[(0,O.jsxs)(`section`,{className:`entity-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`entity-title`,children:r(`messages.ownerPeerTitle`,{owner:l.OwnerUserID,peer:l.PeerID})}),(0,O.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.FromUserID,date:Je(l.Date)})})]}),(0,O.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,O.jsx)(A,{tone:`danger`,children:r(`common.deleted`)}):(0,O.jsx)(A,{children:r(`common.survived`)}),(0,O.jsxs)(A,{children:[`pts `,l.PTS]}),(0,O.jsx)(A,{children:l.Outgoing?r(`messages.outgoing`):r(`messages.incoming`)})]})]}),(0,O.jsxs)(`div`,{className:`summary-grid`,children:[(0,O.jsx)(M,{label:r(`messages.boxID`),value:String(l.BoxID),mono:!0}),(0,O.jsx)(M,{label:r(`messages.privateMessageID`),value:String(l.PrivateMessageID),mono:!0}),(0,O.jsx)(M,{label:r(`messages.messageSender`),value:String(l.MessageSenderID),mono:!0}),(0,O.jsx)(M,{label:r(`common.time`),value:Je(l.Date)})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.messageBox`),text:r(`messages.messageBoxesSnapshot`)}),(0,O.jsx)(ot,{value:i.MessageJSON})]}),(0,O.jsxs)(`div`,{className:`raw-grid`,children:[(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.dialogRow`),text:r(`messages.dialogSnapshot`)}),(0,O.jsx)(ot,{value:i.DialogJSON})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.privateRow`),text:r(`messages.privateSnapshot`)}),(0,O.jsx)(ot,{value:i.PrivateJSON})]})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.userUpdateEvents`),text:r(`messages.userEventsSource`)}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:r(`common.count`)}),(0,O.jsx)(`th`,{children:r(`common.type`)}),(0,O.jsx)(`th`,{children:r(`common.time`)})]})}),(0,O.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:e.PTS}),(0,O.jsx)(`td`,{children:e.PTSCount}),(0,O.jsx)(`td`,{children:e.Type}),(0,O.jsx)(`td`,{children:Je(e.Date)})]},`${e.PTS}-${e.Type}`)),i.UpdateEvents.length===0&&(0,O.jsx)(it,{colSpan:4})]})]})})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.dispatchOutbox`),text:r(`messages.outboxSource`)}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`ID`}),(0,O.jsx)(`th`,{children:r(`account.userID`)}),(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:r(`common.type`)}),(0,O.jsx)(`th`,{children:r(`common.status`)}),(0,O.jsx)(`th`,{children:r(`messages.attempts`)}),(0,O.jsx)(`th`,{children:r(`common.updatedAt`)})]})}),(0,O.jsxs)(`tbody`,{children:[i.Outbox.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:e.ID}),(0,O.jsx)(`td`,{children:e.TargetUserID}),(0,O.jsx)(`td`,{children:e.PTS}),(0,O.jsx)(`td`,{children:e.EventType}),(0,O.jsx)(`td`,{children:e.Status}),(0,O.jsx)(`td`,{children:e.Attempts}),(0,O.jsx)(`td`,{children:qe(e.UpdatedAt)})]},e.ID)),i.Outbox.length===0&&(0,O.jsx)(it,{colSpan:7})]})]})})]})]}),side:(0,O.jsxs)(`section`,{className:`action-dock`,children:[(0,O.jsx)(`div`,{className:`dock-title`,children:r(`common.operations`)}),(0,O.jsx)(lt,{label:r(`messages.deleteThis`),icon:(0,O.jsx)(we,{size:15}),path:`/api/actions/delete-messages`,payload:()=>({owner_user_id:l.OwnerUserID,peer_id:l.PeerID,ids:[l.BoxID],revoke:!0}),onDone:c})]})})})}function Ct({navigate:e}){let{t}=k(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`100`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(!0),[_,v]=(0,g.useState)(!1),[y,ee]=(0,g.useState)(``),[S,te]=(0,g.useState)(`1`),[C,w]=(0,g.useState)(null),[ne,re]=(0,g.useState)(``);async function ie(e=!1){if(re(``),!n||!i){re(t(`messages.selectPrivatePeers`));return}let r=new URLSearchParams({owner_user_id:String(n.ID),peer_id:String(i.ID),limit:u});if(e&&C?.rows.length){let e=C.rows[C.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.BoxID)),s(String(e.Date)),l(String(e.BoxID))}else o&&r.set(`before_date`,o),c&&r.set(`before_id`,c);try{w(await x.messages(r))}catch(e){re(b(e))}}function ae(e){r(e),s(``),l(``),w(null)}function oe(e){a(e),s(``),l(``),w(null)}return(0,O.jsxs)(Ze,{title:t(`messages.privateTitle`),eyebrow:t(`messages.privateEyebrow`),children:[ne&&(0,O.jsx)(tt,{children:ne}),(0,O.jsxs)(Qe,{children:[(0,O.jsxs)(`div`,{className:`message-selector-grid`,children:[(0,O.jsx)(bt,{label:t(`messages.ownerUser`),value:n,onChange:ae}),(0,O.jsx)(bt,{label:t(`messages.peerUser`),value:i,onChange:oe})]}),(0,O.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),ie(!1)},children:[(0,O.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,O.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,O.jsx)(`input`,{className:`small-input`,value:u,onChange:e=>d(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,O.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,O.jsx)(D,{size:15}),` `,t(`messages.searchMessages`)]}),C?.rows.length?(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>ie(!0),children:[(0,O.jsx)(ue,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,O.jsxs)(`div`,{className:`metric-row`,children:[(0,O.jsx)(j,{label:t(`messages.currentPage`),value:String(C?.rows.length??0)}),(0,O.jsx)(j,{label:t(`messages.deleted`),value:String((C?.rows??[]).filter(e=>e.Deleted).length),tone:`danger`}),(0,O.jsx)(j,{label:t(`messages.outgoing`),value:String((C?.rows??[]).filter(e=>e.Outgoing).length)}),(0,O.jsx)(j,{label:t(`messages.ownerPeer`),value:n&&i?`${Ge(n)} / ${Ge(i)}`:`-`})]}),(0,O.jsxs)(`div`,{className:`operation-row`,children:[(0,O.jsxs)(`div`,{className:`operation-box`,children:[(0,O.jsxs)(`div`,{className:`operation-title`,children:[(0,O.jsx)(we,{size:15}),` `,t(`messages.deleteSelected`)]}),(0,O.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:t(`messages.idsPlaceholder`)}),(0,O.jsxs)(`label`,{className:`checkline`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,O.jsx)(lt,{path:`/api/actions/delete-messages`,label:t(`messages.previewDelete`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,ids:Xe(f,t(`messages.msgIDsInvalid`)),revoke:m})})]}),(0,O.jsxs)(`div`,{className:`operation-box`,children:[(0,O.jsxs)(`div`,{className:`operation-title`,children:[(0,O.jsx)(pe,{size:15}),` `,t(`messages.clearHistory`)]}),(0,O.jsx)(`input`,{value:y,onChange:e=>ee(e.target.value),placeholder:t(`messages.maxIDPlaceholder`)}),(0,O.jsx)(`input`,{value:S,onChange:e=>te(e.target.value),placeholder:t(`messages.maxBatchesPlaceholder`)}),(0,O.jsxs)(`label`,{className:`checkline`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,O.jsxs)(`label`,{className:`checkline`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),` `,t(`messages.justClear`)]}),(0,O.jsx)(lt,{path:`/api/actions/delete-history`,label:t(`messages.previewClearHistory`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,max_id:Ye(y),max_batches:Ye(S),just_clear:_,revoke:m})})]})]}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`common.messageId`)}),(0,O.jsx)(`th`,{children:t(`common.time`)}),(0,O.jsx)(`th`,{children:t(`common.sender`)}),(0,O.jsx)(`th`,{children:t(`messages.direction`)}),(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:t(`common.status`)}),(0,O.jsx)(`th`,{children:t(`messages.body`)}),(0,O.jsx)(`th`,{})]})}),(0,O.jsxs)(`tbody`,{children:[C?.rows.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{className:`mono`,children:n.BoxID}),(0,O.jsx)(`td`,{children:Je(n.Date)}),(0,O.jsx)(`td`,{className:`mono`,children:n.FromUserID}),(0,O.jsx)(`td`,{children:n.Outgoing?t(`messages.outgoing`):t(`messages.incoming`)}),(0,O.jsx)(`td`,{children:n.PTS}),(0,O.jsx)(`td`,{children:n.Deleted?(0,O.jsx)(A,{tone:`danger`,children:t(`common.deleted`)}):(0,O.jsx)(A,{children:t(`common.survived`)})}),(0,O.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,O.jsx)(`td`,{children:(0,O.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/private/detail?owner_user_id=${n.OwnerUserID}&msg_id=${n.BoxID}`),children:[t(`common.detail`),` `,(0,O.jsx)(ue,{size:14})]})})]},`${n.OwnerUserID}-${n.BoxID}`)),(!C||C.rows.length===0)&&(0,O.jsx)(it,{colSpan:8})]})]})})]})}function wt({route:e,navigate:t}){let n=e.path.match(/^\/accounts\/(\d+)$/)?.[1],r=e.path.match(/^\/channels\/(\d+)$/)?.[1];return n?(0,O.jsx)(dt,{id:Number(n),navigate:t}):r?(0,O.jsx)(ht,{id:Number(r),navigate:t}):e.path===`/accounts`?(0,O.jsx)(mt,{navigate:t}):e.path===`/channels`?(0,O.jsx)(gt,{navigate:t}):e.path===`/messages/detail`||e.path===`/messages/private/detail`?(0,O.jsx)(N,{ownerUserID:Number(e.search.get(`owner_user_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups/detail`?(0,O.jsx)(yt,{channelID:Number(e.search.get(`channel_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups`?(0,O.jsx)(St,{navigate:t}):e.path===`/messages`||e.path===`/messages/private`?(0,O.jsx)(Ct,{navigate:t}):(0,O.jsx)(_t,{navigate:t})}function Tt(){let[e,t]=(0,g.useState)(void 0),[n,r]=(0,g.useState)(()=>Ie());(0,g.useEffect)(()=>{let e=()=>r(Ie());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,g.useEffect)(()=>{x.session().then(e=>t(e.actor)).catch(e=>{if(e instanceof v&&e.status===401){t(null);return}t(null)})},[]);let i=e=>{window.history.pushState(null,``,e),r(Ie())};return e===void 0?(0,O.jsx)(Be,{}):e===null?(0,O.jsx)(st,{onLogin:t}):(0,O.jsx)(Ve,{actor:e,route:n,navigate:i,onLogout:()=>t(null),children:(0,O.jsx)(wt,{route:n,navigate:i})})}_.createRoot(document.getElementById(`root`)).render((0,O.jsx)(g.StrictMode,{children:(0,O.jsx)(je,{children:(0,O.jsx)(Tt,{})})})); \ No newline at end of file diff --git a/cmd/telesrv-admin/web/dist/assets/index-DRWO_DgE.js b/cmd/telesrv-admin/web/dist/assets/index-DRWO_DgE.js new file mode 100644 index 00000000..6b1905fd --- /dev/null +++ b/cmd/telesrv-admin/web/dist/assets/index-DRWO_DgE.js @@ -0,0 +1,8 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,ee=Object.prototype.hasOwnProperty,S={current:null},te={key:!0,ref:!0,__self:!0,__source:!0};function C(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)ee.call(n,i)&&!te.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,se(x);else{var t=n(l);t!==null&&ce(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(te),te=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&ce(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var ee=!1,S=null,te=-1,C=5,w=-1;function ne(){return!(e.unstable_now()-we||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(te),te=-1):h=!0,ce(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,se(x))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u(),n=f();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,d=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},m={};function h(e){return l.call(m,e)?!0:l.call(p,e)?!1:d.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function ee(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2s||i[o]!==a[s]){var c=` +`+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(``)&&(c=c.replace(``,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{he=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?me(e):``}function _e(e){switch(e.tag){case 5:return me(e.type);case 16:return me(`Lazy`);case 13:return me(`Suspense`);case 19:return me(`SuspenseList`);case 0:case 2:case 15:return e=ge(e.type,!1),e;case 11:return e=ge(e.type.render,!1),e;case 1:return e=ge(e.type,!0),e;default:return``}}function ve(e){if(e==null)return null;if(typeof e==`function`)return e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case w:return`Fragment`;case C:return`Portal`;case re:return`Profiler`;case ne:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case ae:return(e.displayName||`Context`)+`.Consumer`;case ie:return(e._context.displayName||`Context`)+`.Provider`;case oe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?ve(e.type)||`Memo`:t;case le:t=e._payload,e=e._init;try{return ve(e(t))}catch{}}return null}function ye(e){var t=e.type;switch(e.tag){case 24:return`Cache`;case 9:return(t.displayName||`Context`)+`.Consumer`;case 10:return(t._context.displayName||`Context`)+`.Provider`;case 18:return`DehydratedFragment`;case 11:return e=t.render,e=e.displayName||e.name||``,t.displayName||(e===``?`ForwardRef`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ve(t);case 8:return t===ne?`StrictMode`:`Mode`;case 22:return`Offscreen`;case 12:return`Profiler`;case 21:return`Scope`;case 13:return`Suspense`;case 19:return`SuspenseList`;case 25:return`TracingMarker`;case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t==`function`)return t.displayName||t.name||null;if(typeof t==`string`)return t}return null}function D(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function be(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function xe(e){var t=be(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Se(e){e._valueTracker||=xe(e)}function Ce(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=be(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function we(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Te(e,t){var n=t.checked;return E({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ee(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=D(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function De(e,t){t=t.checked,t!=null&&ee(e,`checked`,t,!1)}function O(e,t){De(e,t);var n=D(t.value),r=t.type;if(n!=null)r===`number`?(n===0&&e.value===``||e.value!=n)&&(e.value=``+n):e.value!==``+n&&(e.value=``+n);else if(r===`submit`||r===`reset`){e.removeAttribute(`value`);return}t.hasOwnProperty(`value`)?ke(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&ke(e,t.type,D(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Oe(e,t,n){if(t.hasOwnProperty(`value`)||t.hasOwnProperty(`defaultValue`)){var r=t.type;if(!(r!==`submit`&&r!==`reset`||t.value!==void 0&&t.value!==null))return;t=``+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==``&&(e.name=``),e.defaultChecked=!!e._wrapperState.initialChecked,n!==``&&(e.name=n)}function ke(e,t,n){(t!==`number`||we(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var Ae=Array.isArray;function je(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i`+t.valueOf().toString()+``,t=Le.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ze(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Be={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ve=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(Be).forEach(function(e){Ve.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Be[t]=Be[e]})});function He(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||Be.hasOwnProperty(e)&&Be[e]?(``+t).trim():t+`px`}function Ue(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=He(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var We=E({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ge(e,t){if(t){if(We[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(r(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(r(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(r(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(r(62))}}function Ke(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qe=null;function Je(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ye=null,Xe=null,Ze=null;function Qe(e){if(e=Ki(e)){if(typeof Ye!=`function`)throw Error(r(280));var t=e.stateNode;t&&(t=Ji(t),Ye(e.stateNode,e.type,t))}}function $e(e){Xe?Ze?Ze.push(e):Ze=[e]:Xe=e}function et(){if(Xe){var e=Xe,t=Ze;if(Ze=Xe=null,Qe(e),t)for(e=0;e>>=0,e===0?32:31-(Mt(e)/Nt|0)|0}var Ft=64,It=4194304;function Lt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Rt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=Lt(a))):r=Lt(s)}else o=n&~i,o===0?a!==0&&(r=Lt(a)):r=Lt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Wt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function Gt(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=or),lr=` `,ur=!1;function dr(e,t){switch(e){case`keyup`:return ir.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function fr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var pr=!1;function mr(e,t){switch(e){case`compositionend`:return fr(t);case`keypress`:return t.which===32?(ur=!0,lr):null;case`textInput`:return e=t.data,e===lr&&ur?null:e;default:return null}}function hr(e,t){if(pr)return e===`compositionend`||!ar&&dr(e,t)?(e=kn(),On=Dn=En=null,pr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Lr(n)}}function zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Br(){for(var e=window,t=we();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=we(e.document)}return t}function Vr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}function Hr(e){var t=Br(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zr(n.ownerDocument.documentElement,n)){if(r!==null&&Vr(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),`selectionStart`in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Rr(n,a);var o=Rr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus==`function`&&n.focus(),n=0;n=document.documentMode,Wr=null,Gr=null,Kr=null,qr=!1;function Jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qr||Wr==null||Wr!==we(r)||(r=Wr,`selectionStart`in r&&Vr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Kr&&Ir(Kr,r)||(Kr=r,r=yi(Gr,`onSelect`),0Xi||(e.current=Yi[Xi],Yi[Xi]=null,Xi--)}function R(e,t){Xi++,Yi[Xi]=e.current,e.current=t}var Qi={},z=Zi(Qi),$i=Zi(!1),ea=Qi;function ta(e,t){var n=e.type.contextTypes;if(!n)return Qi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function na(e){return e=e.childContextTypes,e!=null}function ra(){L($i),L(z)}function ia(e,t,n){if(z.current!==Qi)throw Error(r(168));R(z,t),R($i,n)}function aa(e,t,n){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!=`function`)return n;for(var a in i=i.getChildContext(),i)if(!(a in t))throw Error(r(108,ye(e)||`Unknown`,a));return E({},n,i)}function oa(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qi,ea=z.current,R(z,e),R($i,$i.current),!0}function sa(e,t,n){var i=e.stateNode;if(!i)throw Error(r(169));n?(e=aa(e,t,ea),i.__reactInternalMemoizedMergedChildContext=e,L($i),L(z),R(z,e)):L($i),R($i,n)}var ca=null,la=!1,ua=!1;function da(e){ca===null?ca=[e]:ca.push(e)}function fa(e){la=!0,da(e)}function pa(){if(!ua&&ca!==null){ua=!0;var e=0,t=F;try{var n=ca;for(F=1;e>=o,i-=o,xa=1<<32-jt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(r,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(r,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(r,d),B&&Ca(r,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),B&&Ca(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return B&&Ca(a,g),u}for(h=i(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),B&&Ca(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===w&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case te:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===w){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===le&&Ha(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ba(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===w?(r=Zl(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=Xl(i.type,i.key,i.props,null,e.mode,o),o.ref=Ba(e,r,i),o.return=e,e=o)}return s(e);case C:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=eu(i,e.mode,o),r.return=e,e=r}return s(e);case le:return l=i._init,_(e,r,l(i._payload),o)}if(Ae(i))return h(e,r,i,o);if(fe(i))return g(e,r,i,o);Va(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=$l(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Wa=Ua(!0),Ga=Ua(!1),Ka=Zi(null),qa=null,Ja=null,Ya=null;function Xa(){Ya=Ja=qa=null}function Za(e){var t=Ka.current;L(Ka),e._currentValue=t}function Qa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $a(e,t){qa=e,Ya=Ja=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Rs=!0),e.firstContext=null)}function eo(e){var t=e._currentValue;if(Ya!==e)if(e={context:e,memoizedValue:t,next:null},Ja===null){if(qa===null)throw Error(r(308));Ja=e,qa.dependencies={lanes:0,firstContext:e}}else Ja=Ja.next=e;return t}var to=null;function no(e){to===null?to=[e]:to.push(e)}function ro(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,no(t)):(n.next=i.next,i.next=n),t.interleaved=n,io(e,r)}function io(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var ao=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function so(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,io(e,n)}return i=r.interleaved,i===null?(t.next=t,no(r)):(t.next=i.next,i.next=t),r.interleaved=t,io(e,n)}function uo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kt(e,n)}}function fo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function po(e,t,n,r){var i=e.updateQueue;ao=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=E({},d,f);break a;case 2:ao=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Yc|=o,e.lanes=o,e.memoizedState=d}}function mo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Oo.transition;Oo.transition={};try{e(!1),t()}finally{F=n,Oo.transition=r}}function ds(){return Ro().memoizedState}function fs(e,t,n){var r=ml(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ms(e))hs(t,n);else if(n=ro(e,t,n,r),n!==null){var i=pl();hl(n,e,r,i),gs(n,t,r)}}function ps(e,t,n){var r=ml(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ms(e))hs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Fr(s,o)){var c=t.interleaved;c===null?(i.next=i,no(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=ro(e,t,i,r),n!==null&&(i=pl(),hl(n,e,r,i),gs(n,t,r))}}function ms(e){var t=e.alternate;return e===H||t!==null&&t===H}function hs(e,t){jo=Ao=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function gs(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Kt(e,n)}}var _s={readContext:eo,useCallback:G,useContext:G,useEffect:G,useImperativeHandle:G,useInsertionEffect:G,useLayoutEffect:G,useMemo:G,useReducer:G,useRef:G,useState:G,useDebugValue:G,useDeferredValue:G,useTransition:G,useMutableSource:G,useSyncExternalStore:G,useId:G,unstable_isNewReconciler:!1},vs={readContext:eo,useCallback:function(e,t){return Lo().memoizedState=[e,t===void 0?null:t],e},useContext:eo,useEffect:es,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),Qo(4194308,4,is.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Qo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Qo(4,2,e,t)},useMemo:function(e,t){var n=Lo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lo();return t=n===void 0?t:n(t),r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=fs.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=Lo();return e={current:e},t.memoizedState=e},useState:Yo,useDebugValue:os,useDeferredValue:function(e){return Lo().memoizedState=e},useTransition:function(){var e=Yo(!1),t=e[0];return e=us.bind(null,e[1]),Lo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var i=H,a=Lo();if(B){if(n===void 0)throw Error(r(407));n=n()}else{if(n=t(),Y===null)throw Error(r(349));ko&30||Wo(i,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,es(Ko.bind(null,i,o,e),[e]),i.flags|=2048,Xo(9,Go.bind(null,i,o,n,t),void 0,null),n},useId:function(){var e=Lo(),t=Y.identifierPrefix;if(B){var n=Sa,r=xa;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Mo++,0<\/script>`,e=e.removeChild(e.firstChild)):typeof i.is==`string`?e=c.createElement(n,{is:i.is}):(e=c.createElement(n),n===`select`&&(c=e,i.multiple?c.multiple=!0:i.size&&(c.size=i.size))):e=c.createElementNS(e,n),e[zi]=t,e[Bi]=i,cc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Ke(n,i),n){case`dialog`:I(`cancel`,e),I(`close`,e),o=i;break;case`iframe`:case`object`:case`embed`:I(`load`,e),o=i;break;case`video`:case`audio`:for(o=0;otl&&(t.flags|=128,i=!0,dc(s,!1),t.lanes=4194304)}else{if(!i)if(e=wo(c),e!==null){if(t.flags|=128,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),dc(s,!0),s.tail===null&&s.tailMode===`hidden`&&!c.alternate&&!B)return fc(t),null}else 2*P()-s.renderingStartTime>tl&&n!==1073741824&&(t.flags|=128,i=!0,dc(s,!1),t.lanes=4194304);s.isBackwards?(c.sibling=t.child,t.child=c):(n=s.last,n===null?t.child=c:n.sibling=c,s.last=c)}return s.tail===null?(fc(t),null):(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=P(),t.sibling=null,n=V.current,R(V,i?n&1|2:n&1),t);case 22:case 23:return Tl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Kc&1073741824&&(fc(t),t.subtreeFlags&6&&(t.flags|=8192)):fc(t),null;case 24:return null;case 25:return null}throw Error(r(156,t.tag))}function mc(e,t){switch(Ea(t),t.tag){case 1:return na(t.type)&&ra(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xo(),L($i),L(z),Eo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Co(t),null;case 13:if(L(V),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));La()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return L(V),null;case 4:return xo(),null;case 10:return Za(t.type._context),null;case 22:case 23:return Tl(),null;case 24:return null;default:return null}}var hc=!1,gc=!1,_c=typeof WeakSet==`function`?WeakSet:Set,K=null;function vc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){$(e,t,n)}else n.current=null}function yc(e,t,n){try{n()}catch(n){$(e,t,n)}}var bc=!1;function xc(e,t){if(Di=yn,e=Br(),Vr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var i=n.getSelection&&n.getSelection();if(i&&i.rangeCount!==0){n=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Oi={focusedElem:e,selectionRange:n},yn=!1,K=t;K!==null;)if(t=K,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:xs(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(e){$(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return h=bc,bc=!1,h}function Sc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&yc(t,n,a)}i=i.next}while(i!==r)}}function Cc(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function wc(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t==`function`?t(e):t.current=e}}function Tc(e){var t=e.alternate;t!==null&&(e.alternate=null,Tc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[zi],delete t[Bi],delete t[Hi],delete t[Ui],delete t[Wi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ec(e){return e.tag===5||e.tag===3||e.tag===4}function Dc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ec(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Oc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ei));else if(r!==4&&(e=e.child,e!==null))for(Oc(e,t,n),e=e.sibling;e!==null;)Oc(e,t,n),e=e.sibling}function kc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}var q=null,Ac=!1;function jc(e,t,n){for(n=n.child;n!==null;)Mc(e,t,n),n=n.sibling}function Mc(e,t,n){if(kt&&typeof kt.onCommitFiberUnmount==`function`)try{kt.onCommitFiberUnmount(Ot,n)}catch{}switch(n.tag){case 5:gc||vc(n,t);case 6:var r=q,i=Ac;q=null,jc(e,t,n),q=r,Ac=i,q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):q.removeChild(n.stateNode));break;case 18:q!==null&&(Ac?(e=q,n=n.stateNode,e.nodeType===8?Fi(e.parentNode,n):e.nodeType===1&&Fi(e,n),_n(e)):Fi(q,n.stateNode));break;case 4:r=q,i=Ac,q=n.stateNode.containerInfo,Ac=!0,jc(e,t,n),q=r,Ac=i;break;case 0:case 11:case 14:case 15:if(!gc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&yc(n,t,o),i=i.next}while(i!==r)}jc(e,t,n);break;case 1:if(!gc&&(vc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){$(n,t,e)}jc(e,t,n);break;case 21:jc(e,t,n);break;case 22:n.mode&1?(gc=(r=gc)||n.memoizedState!==null,jc(e,t,n),gc=r):jc(e,t,n);break;default:jc(e,t,n)}}function Nc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _c),t.forEach(function(t){var r=Hl.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Pc(e,t){var n=t.deletions;if(n!==null)for(var i=0;ia&&(a=s),i&=~o}if(i=a,i=P()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Hc(i/1960))-i,10e?16:e,sl===null)var i=!1;else{if(e=sl,sl=null,cl=0,J&6)throw Error(r(331));var a=J;for(J|=4,K=e.current;K!==null;){var o=K,s=o.child;if(K.flags&16){var c=o.deletions;if(c!==null){for(var l=0;lP()-el?El(e,0):Zc|=n),gl(e,t)}function Bl(e,t){t===0&&(e.mode&1?(t=It,It<<=1,!(It&130023424)&&(It=4194304)):t=1);var n=pl();e=io(e,t),e!==null&&(Wt(e,t,n),gl(e,n))}function Vl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Bl(e,n)}function Hl(e,t){var n=0;switch(e.tag){case 13:var i=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(r(314))}i!==null&&i.delete(t),Bl(e,n)}var Ul=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$i.current)Rs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Rs=!1,sc(e,t,n);Rs=!!(e.flags&131072)}else Rs=!1,B&&t.flags&1048576&&wa(t,_a,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;ac(e,t),e=t.pendingProps;var a=ta(t,z.current);$a(t,n),a=Fo(null,t,i,e,a,n);var o=Io();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,na(i)?(o=!0,oa(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,oo(t),a.updater=Cs,t.stateNode=a,a._reactInternals=t,Ds(t,i,e,n),t=qs(null,t,i,!0,o,n)):(t.tag=0,B&&o&&Ta(t),zs(null,t,a,n),t=t.child),t;case 16:i=t.elementType;a:{switch(ac(e,t),e=t.pendingProps,a=i._init,i=a(i._payload),t.type=i,a=t.tag=Jl(i),e=xs(i,e),a){case 0:t=Gs(null,t,i,e,n);break a;case 1:t=Ks(null,t,i,e,n);break a;case 11:t=Bs(null,t,i,e,n);break a;case 14:t=Vs(null,t,i,xs(i.type,e),n);break a}throw Error(r(306,i,``))}return t;case 0:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Gs(e,t,i,a,n);case 1:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Ks(e,t,i,a,n);case 3:a:{if(Js(t),e===null)throw Error(r(387));i=t.pendingProps,o=t.memoizedState,a=o.element,so(e,t),po(t,i,null,n);var s=t.memoizedState;if(i=s.element,o.isDehydrated)if(o={element:i,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=Os(Error(r(423)),t),t=Ys(e,t,i,n,a);break a}else if(i!==a){a=Os(Error(r(424)),t),t=Ys(e,t,i,n,a);break a}else for(Oa=Ii(t.stateNode.containerInfo.firstChild),Da=t,B=!0,ka=null,n=Ga(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(La(),i===a){t=oc(e,t,n);break a}zs(e,t,i,n)}t=t.child}return t;case 5:return So(t),e===null&&Na(t),i=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,ki(i,a)?s=null:o!==null&&ki(i,o)&&(t.flags|=32),Ws(e,t),zs(e,t,s,n),t.child;case 6:return e===null&&Na(t),null;case 13:return Qs(e,t,n);case 4:return bo(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Wa(t,null,i,n):zs(e,t,i,n),t.child;case 11:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),Bs(e,t,i,a,n);case 7:return zs(e,t,t.pendingProps,n),t.child;case 8:return zs(e,t,t.pendingProps.children,n),t.child;case 12:return zs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(i=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,R(Ka,i._currentValue),i._currentValue=s,o!==null)if(Fr(o.value,s)){if(o.children===a.children&&!$i.current){t=oc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===i){if(o.tag===1){l=co(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Qa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(r(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Qa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}zs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,i=t.pendingProps.children,$a(t,n),a=eo(a),i=i(a),t.flags|=1,zs(e,t,i,n),t.child;case 14:return i=t.type,a=xs(i,t.pendingProps),a=xs(i.type,a),Vs(e,t,i,a,n);case 15:return Hs(e,t,t.type,t.pendingProps,n);case 17:return i=t.type,a=t.pendingProps,a=t.elementType===i?a:xs(i,a),ac(e,t),t.tag=1,na(i)?(e=!0,oa(t)):e=!1,$a(t,n),Ts(t,i,a),Ds(t,i,a,n),qs(null,t,i,!0,e,n);case 19:return ic(e,t,n);case 22:return Us(e,t,n)}throw Error(r(156,t.tag))};function Wl(e,t){return vt(e,t)}function Gl(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kl(e,t,n,r){return new Gl(e,t,n,r)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jl(e){if(typeof e==`function`)return+!!ql(e);if(e!=null){if(e=e.$$typeof,e===oe)return 11;if(e===T)return 14}return 2}function Yl(e,t){var n=e.alternate;return n===null?(n=Kl(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Xl(e,t,n,i,a,o){var s=2;if(i=e,typeof e==`function`)ql(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case w:return Zl(n.children,a,o,t);case ne:s=8,a|=8;break;case re:return e=Kl(12,n,t,a|2),e.elementType=re,e.lanes=o,e;case se:return e=Kl(13,n,t,a),e.elementType=se,e.lanes=o,e;case ce:return e=Kl(19,n,t,a),e.elementType=ce,e.lanes=o,e;case ue:return Ql(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case ie:s=10;break a;case ae:s=9;break a;case oe:s=11;break a;case T:s=14;break a;case le:s=16,i=null;break a}throw Error(r(130,e==null?e:typeof e,``))}return t=Kl(s,n,t,a),t.elementType=e,t.type=i,t.lanes=o,t}function Zl(e,t,n,r){return e=Kl(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Kl(22,e,r,t),e.elementType=ue,e.lanes=n,e.stateNode={isHidden:!1},e}function $l(e,t,n){return e=Kl(6,e,null,t),e.lanes=n,e}function eu(e,t,n){return t=Kl(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tu(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ut(0),this.expirationTimes=Ut(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ut(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function nu(e,t,n,r,i,a,o,s,c){return e=new tu(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=Kl(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},oo(a),e}function ru(e,t,n){var r=3{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=m();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot})),g=c(u()),_=c(h(),1),v=class extends Error{status;constructor(e,t){super(t),this.status=e}};async function y(e,t={}){let n=await fetch(e,{credentials:`same-origin`,headers:{"Content-Type":`application/json`,...t.headers??{}},...t}),r=await n.text(),i=r?JSON.parse(r):null;if(!n.ok){let e=i?.error||i?.Error||i?.message||n.statusText;throw new v(n.status,e)}return i}function b(e){return e instanceof Error?e.message:String(e)}var x={session:()=>y(`/api/session`),login:e=>y(`/api/login`,{method:`POST`,body:JSON.stringify({secret:e})}),logout:()=>y(`/api/logout`,{method:`POST`,body:`{}`}),accounts:e=>y(`/api/accounts?${e.toString()}`),account:e=>y(`/api/accounts/${e}`),channels:e=>y(`/api/channels?${e.toString()}`),channel:e=>y(`/api/channels/${e}`),messages:e=>y(`/api/messages?${e.toString()}`),message:(e,t)=>y(`/api/messages/detail?${new URLSearchParams({owner_user_id:String(e),msg_id:String(t)}).toString()}`),groupMessages:e=>y(`/api/messages/groups?${e.toString()}`),groupMessage:(e,t)=>y(`/api/messages/groups/detail?${new URLSearchParams({channel_id:String(e),msg_id:String(t)}).toString()}`),action:(e,t)=>y(e,{method:`POST`,body:JSON.stringify(t)})},ee=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),S=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),te={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},C=(0,g.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,g.createElement)(`svg`,{ref:c,...te,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:S(`lucide`,i),...s},[...o.map(([e,t])=>(0,g.createElement)(e,t)),...Array.isArray(a)?a:[a]])),w=(e,t)=>{let n=(0,g.forwardRef)(({className:n,...r},i)=>(0,g.createElement)(C,{ref:i,iconNode:t,className:S(`lucide-${ee(e)}`,n),...r}));return n.displayName=`${e}`,n},ne=w(`BadgeCheck`,[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),re=w(`CircleAlert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ie=w(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),ae=w(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),oe=w(`Sparkles`,[[`path`,{d:`M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z`,key:`4pj2yx`}],[`path`,{d:`M20 3v4`,key:`1olli1`}],[`path`,{d:`M22 5h-4`,key:`1gvqau`}],[`path`,{d:`M4 17v2`,key:`vumght`}],[`path`,{d:`M5 18H3`,key:`zchphs`}]]),se=w(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),ce=w(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),T=w(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),le=w(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ue=w(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),de=w(`Clock3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),fe=w(`Database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),E=w(`FileJson`,[[`path`,{d:`M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z`,key:`1rqfz7`}],[`path`,{d:`M14 2v4a2 2 0 0 0 2 2h4`,key:`tnqrlb`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),pe=w(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),me=w(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),he=w(`LayoutDashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),ge=w(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),_e=w(`MessageSquareText`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}],[`path`,{d:`M13 8H7`,key:`14i4kc`}],[`path`,{d:`M17 12H7`,key:`16if0g`}]]),ve=w(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),ye=w(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),D=w(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),be=w(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),xe=w(`ShieldCheck`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Se=w(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Ce=w(`Star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),we=w(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Te=w(`Users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`,key:`1da9ce`}]]),Ee=w(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),De=o((e=>{var t=u(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),i=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(e,t,r){var s,c={},l=null,u=null;for(s in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)i.call(t,s)&&!o.hasOwnProperty(s)&&(c[s]=t[s]);if(e&&e.defaultProps)for(s in t=e.defaultProps,t)c[s]===void 0&&(c[s]=t[s]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:a.current}}e.Fragment=r,e.jsx=s,e.jsxs=s})),O=o(((e,t)=>{t.exports=De()}))(),Oe=`telesrv.admin.lang`,ke={en:{"app.adminConsole":`Admin Console`,"app.localAccess":`Local access`,"app.title":`telesrv admin`,"common.actions":`Actions`,"common.admins":`Admins`,"common.backToList":`Back to list`,"common.channel":`Channel`,"common.channelOrGroup":`Channel / Group`,"common.clear":`Clear`,"common.close":`Close`,"common.count":`Count`,"common.deleted":`Deleted`,"common.detail":`Details`,"common.device":`Device`,"common.disabled":`Disabled`,"common.enabled":`Enabled`,"common.fromPeer":`From Peer`,"common.group":`Group`,"common.id":`ID`,"common.limit":`Limit`,"common.loading":`Loading`,"common.member":`Member`,"common.members":`Members`,"common.messageId":`Message ID`,"common.name":`Name`,"common.no":`No`,"common.noResults":`No results`,"common.none":`None`,"common.normal":`Normal`,"common.operations":`Operations`,"common.owner":`Owner`,"common.platform":`Platform`,"common.refresh":`Refresh`,"common.search":`Search`,"common.sender":`Sender`,"common.status":`Status`,"common.survived":`Live`,"common.time":`Time`,"common.type":`Type`,"common.updatedAt":`Updated`,"common.username":`Username`,"common.valid":`Valid`,"common.verified":`Verified`,"common.views":`Views`,"common.yes":`Yes`,"route.accounts":`Accounts`,"route.accountsSubtitle":`Console / Accounts`,"route.channels":`Supergroups and Channels`,"route.channelsSubtitle":`Console / Channels`,"route.dashboard":`Operations Console`,"route.dashboardSubtitle":`Console / Overview`,"route.messages":`Message Audit`,"route.messagesSubtitle":`Console / Messages`,"layout.navigation":`Navigation`,"layout.primaryNav":`Primary navigation`,"layout.dashboard":`Overview`,"layout.accounts":`Accounts`,"layout.channels":`Supergroups / Channels`,"layout.messages":`Messages`,"layout.privateMessages":`Private`,"layout.groupMessages":`Groups`,"layout.runtime":`Runtime`,"layout.adminBackend":`Admin backend`,"layout.ready":`Ready`,"layout.pgRead":`PG read`,"layout.readOnly":`Read-only`,"layout.writeOps":`Write operations`,"layout.dryRun":`Dry-run`,"layout.actor":`Actor: {actor}`,"layout.logout":`Log out`,"language.en":`EN`,"language.zh":`中文`,"login.heading":`Operations Admin`,"login.body":`Enter credentials to open the console.`,"login.secret":`Admin password or token`,"login.submit":`Log in`,"login.submitting":`Logging in`,"dashboard.eyebrow":`Runtime Overview`,"dashboard.title":`Console Overview`,"dashboard.readPath":`Read path`,"dashboard.readPathValue":`PG read-only`,"dashboard.writePath":`Write path`,"dashboard.executionPolicy":`Execution policy`,"dashboard.dryRunFirst":`Dry-run first`,"dashboard.accountsText":`Account status, premium, verification, sessions.`,"dashboard.channelsText":`Public entities, member counts, verification state.`,"dashboard.messagesText":`Message boxes, updates, outbox state.`,"dashboard.strip.dryRun":`All dangerous actions start with dry-run`,"dashboard.strip.token":`Browser never stores internal tokens`,"dashboard.strip.pagination":`Lists use cursor pagination`,"dashboard.strip.snapshot":`Detail pages retain raw state snapshots`,"account.pageTitle":`Accounts`,"account.queryResults":`Search results`,"account.recentActive":`Recently active accounts`,"account.currentPage":`Accounts on page`,"account.onlineDevices":`Online device records`,"account.premium":`Premium`,"account.frozen":`Frozen`,"account.searchPlaceholder":`User ID / phone / username`,"account.userID":`User ID`,"account.phone":`Phone`,"account.lastActive":`Last active`,"account.notVerified":`Not verified`,"account.notPremium":`Not premium`,"account.premiumUntil":`Premium expires`,"account.starsBalance":`Stars balance`,"account.startingGrantApplied":`initial grant applied`,"account.startingGrantPending":`initial grant pending`,"account.activeSessions":`Authorized devices`,"account.accountFlags":`Account flags`,"account.restriction":`Restriction`,"account.restricted":`Restricted`,"account.createdAt":`Created`,"account.detailTitle":`Account #{id}`,"account.profile":`Account Profile`,"account.loadingDetail":`Loading account detail`,"account.waitingData":`Waiting for data`,"account.noUsername":`No username`,"account.noPhone":`No phone`,"account.accountFrozen":`Account frozen`,"account.accountActive":`Account active`,"account.authorizationsTitle":`Authorized Devices`,"account.authorizationsCount":`{count} authorizations`,"account.recentAdminOps":`Recent Admin Actions`,"account.recent30Audit":`Last 30 audit rows`,"account.actionDock":`Account Actions`,"account.freezeAccount":`Freeze account`,"account.updateFreeze":`Update freeze`,"account.unfreezeAccount":`Unfreeze account`,"account.freezeSince":`Frozen since`,"account.freezeUntil":`Appeal deadline`,"account.freezeUntilAria":`Freeze appeal deadline`,"account.freezeAppealURL":`Appeal URL`,"account.freezeAppealURLAria":`Freeze appeal URL`,"account.premiumMonths":`Premium duration (months)`,"account.premiumMonthsAria":`Set premium duration in months`,"account.setPremium":`Set premium`,"account.clearPremium":`Clear premium`,"account.starsAmount":`Stars to grant`,"account.starsAmountAria":`Set Stars amount to grant`,"account.grantStars":`Grant Stars`,"account.setVerified":`Set verified`,"account.clearVerified":`Clear verified`,"channel.pageTitle":`Supergroups and Channels`,"channel.recentUpdated":`Recently updated`,"channel.currentPage":`Entities on page`,"channel.megagroups":`Supergroups`,"channel.broadcasts":`Channels`,"channel.verifiedCount":`Verified`,"channel.searchPlaceholder":`Channel ID / username / title`,"channel.channelID":`Channel ID`,"channel.kind":`Kind`,"channel.title":`Title`,"channel.pts":`PTS`,"channel.detailProfile":`Channel Profile`,"channel.loadingDetail":`Loading channel detail`,"channel.creator":`Creator {id}`,"channel.governance":`Moderation`,"channel.governanceValue":`Banned {banned} / Kicked {kicked}`,"channel.flags":`Channel flags`,"channel.rawRow":`Channel Raw Row`,"channel.rawRowText":`Database read-only snapshot`,"channel.actionDock":`Channel Actions`,"channel.setVerified":`Set verified`,"channel.clearVerified":`Clear verified`,"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`,"messages.privateTitle":`Private Messages`,"messages.privateEyebrow":`Private message boxes`,"messages.groupTitle":`Group Messages`,"messages.groupEyebrow":`Supergroup / channel messages`,"messages.selectPrivatePeers":`Search and select the owner user and peer user first`,"messages.selectChannel":`Search and select a supergroup or channel first`,"messages.ownerUser":`Owner user`,"messages.peerUser":`Peer user`,"messages.beforeDatePlaceholder":`before_date cursor`,"messages.beforeIDPlaceholder":`before_msg_id cursor`,"messages.limitPlaceholder":`limit <= 100`,"messages.searchMessages":`Search messages`,"messages.nextPage":`Next page`,"messages.currentPage":`Messages on page`,"messages.deleted":`Deleted`,"messages.outgoing":`Outgoing`,"messages.incoming":`Incoming`,"messages.ownerPeer":`Owner / Peer`,"messages.deleteSelected":`Delete selected messages`,"messages.idsPlaceholder":`Message IDs, comma separated`,"messages.revoke":`Revoke for both sides`,"messages.previewDelete":`Dry-run delete`,"messages.clearHistory":`Clear private history`,"messages.maxIDPlaceholder":`max_id cutoff`,"messages.maxBatchesPlaceholder":`max_batches`,"messages.justClear":`Clear only this side`,"messages.previewClearHistory":`Dry-run clear history`,"messages.direction":`Direction`,"messages.body":`Body`,"messages.privateDetailTitle":`Message #{id}`,"messages.detailEyebrow":`Message Detail`,"messages.backPrivate":`Back to private messages`,"messages.backGroup":`Back to group messages`,"messages.ownerPeerTitle":`Owner {owner} · Peer {peer}`,"messages.senderSubtitle":`Sender {sender} · {date}`,"messages.boxID":`Message box ID`,"messages.privateMessageID":`Private message ID`,"messages.messageSender":`Message sender`,"messages.messageBox":`Message Box`,"messages.dialogRow":`Dialog Row`,"messages.privateRow":`Private Message Row`,"messages.channelMessageRow":`Channel Message Row`,"messages.channelRow":`Channel Row`,"messages.userUpdateEvents":`Update Events`,"messages.channelUpdateEvents":`Channel Update Events`,"messages.eventJson":`Event JSON`,"messages.dispatchOutbox":`Dispatch Queue`,"messages.messageBoxesSnapshot":`message_boxes read-only snapshot`,"messages.dialogSnapshot":`dialogs read-only snapshot`,"messages.privateSnapshot":`private_messages read-only snapshot`,"messages.channelMessagesSnapshot":`channel_messages read-only snapshot`,"messages.channelSnapshot":`channels read-only snapshot`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`online/offline dispatch_outbox`,"messages.attempts":`Attempts`,"messages.deleteThis":`Delete this message`,"messages.groupDetailTitle":`Group Message #{id}`,"messages.channelGroupTitle":`Channel / Group {id}`,"messages.mediaCount":`With media`,"messages.channelPosts":`Channel posts`,"messages.channelGroup":`Channel / Group`,"messages.pinned":`Pinned`,"messages.channelPost":`Channel post`,"messages.msgIDsInvalid":`Message IDs are invalid`,"auth.device":`Device`,"auth.platform":`Platform`,"auth.ip":`IP`,"auth.lastActive":`Last active`,"auth.revokeCurrent":`Revoke current`,"auth.keepCurrent":`Keep current`,"auth.revokeAll":`Revoke all devices`,"picker.userPlaceholder":`Search user_id / phone / username`,"picker.channelPlaceholder":`Search channel_id / username / title`,"picker.verified":`Verified`,"picker.regular":`Regular`,"action.reasonRequired":`Please enter an operation reason`,"action.flow":`Action Flow`,"action.close":`Close`,"action.stepReason":`Enter reason`,"action.stepDryRun":`Dry-run check`,"action.stepConfirm":`Confirm execution`,"action.reason":`Operation reason`,"action.reasonPlaceholder":`Describe why this operation is being performed`,"action.requestPreview":`Request preview`,"action.result":`Action result`,"action.commandID":`Command ID`,"action.status":`Status`,"action.dryRun":`Dry-run`,"action.runAgain":`Run dry-run again`,"action.runDry":`Run dry-run first`,"action.confirm":`Confirm execution`,"audit.id":`ID`,"audit.commandID":`Command ID`,"audit.action":`Action`,"audit.actor":`Actor`,"audit.status":`Status`,"audit.dryRun":`Dry-run`,"audit.reason":`Reason`,"audit.time":`Time`},zh:{"app.adminConsole":`管理控制台`,"app.localAccess":`本地访问`,"app.title":`telesrv 管理后台`,"common.actions":`操作`,"common.admins":`管理员`,"common.backToList":`返回列表`,"common.channel":`频道`,"common.channelOrGroup":`频道/群`,"common.clear":`清除`,"common.close":`关闭`,"common.count":`数量`,"common.deleted":`已删除`,"common.detail":`详情`,"common.device":`设备`,"common.disabled":`已禁用`,"common.enabled":`已启用`,"common.fromPeer":`From Peer`,"common.group":`群组`,"common.id":`ID`,"common.limit":`条数`,"common.loading":`加载中`,"common.member":`成员`,"common.members":`成员`,"common.messageId":`消息 ID`,"common.name":`姓名`,"common.no":`否`,"common.noResults":`无结果`,"common.none":`无`,"common.normal":`正常`,"common.operations":`操作`,"common.owner":`所属`,"common.platform":`平台`,"common.refresh":`刷新`,"common.search":`查询`,"common.sender":`发送方`,"common.status":`状态`,"common.survived":`存活`,"common.time":`时间`,"common.type":`类型`,"common.updatedAt":`更新时间`,"common.username":`用户名`,"common.valid":`有效`,"common.verified":`已认证`,"common.views":`浏览`,"common.yes":`是`,"route.accounts":`账号管理`,"route.accountsSubtitle":`控制台 / 账号`,"route.channels":`超级群与频道`,"route.channelsSubtitle":`控制台 / 频道`,"route.dashboard":`运维控制台`,"route.dashboardSubtitle":`控制台 / 总览`,"route.messages":`消息审计`,"route.messagesSubtitle":`控制台 / 消息`,"layout.navigation":`导航`,"layout.primaryNav":`主导航`,"layout.dashboard":`总览`,"layout.accounts":`账号`,"layout.channels":`超级群/频道`,"layout.messages":`消息`,"layout.privateMessages":`私聊`,"layout.groupMessages":`群聊`,"layout.runtime":`运行状态`,"layout.adminBackend":`管理后台`,"layout.ready":`就绪`,"layout.pgRead":`PG 读取`,"layout.readOnly":`只读`,"layout.writeOps":`写操作`,"layout.dryRun":`预演`,"layout.actor":`操作者:{actor}`,"layout.logout":`退出`,"language.en":`EN`,"language.zh":`中文`,"login.heading":`运维后台`,"login.body":`输入凭据后进入控制台。`,"login.secret":`管理员密码或 token`,"login.submit":`登录`,"login.submitting":`登录中`,"dashboard.eyebrow":`运行总览`,"dashboard.title":`控制台总览`,"dashboard.readPath":`读路径`,"dashboard.readPathValue":`PG 只读`,"dashboard.writePath":`写路径`,"dashboard.executionPolicy":`执行策略`,"dashboard.dryRunFirst":`先预演`,"dashboard.accountsText":`账号状态、会员、认证、会话。`,"dashboard.channelsText":`公开实体、成员计数、认证状态。`,"dashboard.messagesText":`消息盒、update、outbox 状态。`,"dashboard.strip.dryRun":`所有危险操作先预演`,"dashboard.strip.token":`浏览器不持有内部 token`,"dashboard.strip.pagination":`列表使用游标分页`,"dashboard.strip.snapshot":`详情页保留原始状态快照`,"account.pageTitle":`账号`,"account.queryResults":`查询结果`,"account.recentActive":`最近活跃账号`,"account.currentPage":`当前页账号`,"account.onlineDevices":`在线设备记录`,"account.premium":`会员`,"account.frozen":`冻结`,"account.searchPlaceholder":`用户 ID / 手机号 / 用户名`,"account.userID":`用户 ID`,"account.phone":`手机号`,"account.lastActive":`最近活跃`,"account.notVerified":`未认证`,"account.notPremium":`非会员`,"account.premiumUntil":`会员到期`,"account.starsBalance":`Stars 余额`,"account.startingGrantApplied":`初始赠送已发放`,"account.startingGrantPending":`初始赠送未触发`,"account.activeSessions":`授权设备`,"account.accountFlags":`账号标记`,"account.restriction":`限制状态`,"account.restricted":`已限制`,"account.createdAt":`创建时间`,"account.detailTitle":`账号 #{id}`,"account.profile":`账号档案`,"account.loadingDetail":`加载账号详情`,"account.waitingData":`等待数据`,"account.noUsername":`无用户名`,"account.noPhone":`无手机号`,"account.accountFrozen":`账号已冻结`,"account.accountActive":`账号正常`,"account.authorizationsTitle":`授权设备`,"account.authorizationsCount":`共 {count} 个授权`,"account.recentAdminOps":`最近后台操作`,"account.recent30Audit":`最近 30 条审计`,"account.actionDock":`账号操作`,"account.freezeAccount":`冻结账号`,"account.updateFreeze":`更新冻结信息`,"account.unfreezeAccount":`解冻账号`,"account.freezeSince":`冻结开始时间`,"account.freezeUntil":`申诉截止时间`,"account.freezeUntilAria":`账号冻结申诉截止时间`,"account.freezeAppealURL":`申诉链接`,"account.freezeAppealURLAria":`账号冻结申诉链接`,"account.premiumMonths":`会员时长(月)`,"account.premiumMonthsAria":`设置会员时长,单位月`,"account.setPremium":`设置会员`,"account.clearPremium":`取消会员`,"account.starsAmount":`赠送 Stars 数量`,"account.starsAmountAria":`设置要赠送的 Stars 数量`,"account.grantStars":`赠送 Stars`,"account.setVerified":`设置认证`,"account.clearVerified":`取消认证`,"channel.pageTitle":`超级群与频道`,"channel.recentUpdated":`最近更新`,"channel.currentPage":`当前页实体`,"channel.megagroups":`超级群`,"channel.broadcasts":`频道`,"channel.verifiedCount":`已认证`,"channel.searchPlaceholder":`频道 ID / 用户名 / 标题`,"channel.channelID":`频道 ID`,"channel.kind":`类型`,"channel.title":`标题`,"channel.pts":`PTS`,"channel.detailProfile":`频道档案`,"channel.loadingDetail":`加载频道详情`,"channel.creator":`创建者 {id}`,"channel.governance":`治理状态`,"channel.governanceValue":`封禁 {banned} / 踢出 {kicked}`,"channel.flags":`频道标记`,"channel.rawRow":`频道原始行`,"channel.rawRowText":`数据库只读快照`,"channel.actionDock":`频道操作`,"channel.setVerified":`设置认证`,"channel.clearVerified":`取消认证`,"channel.kind.broadcast":`频道`,"channel.kind.forum":`超级群/论坛`,"channel.kind.megagroup":`超级群`,"channel.kind.generic":`频道/群`,"messages.privateTitle":`私聊消息`,"messages.privateEyebrow":`私聊消息盒`,"messages.groupTitle":`群聊消息`,"messages.groupEyebrow":`超级群 / 频道消息`,"messages.selectPrivatePeers":`请先搜索并选择所属用户和对端用户`,"messages.selectChannel":`请先搜索并选择超级群或频道`,"messages.ownerUser":`所属用户`,"messages.peerUser":`对端用户`,"messages.beforeDatePlaceholder":`before_date 游标`,"messages.beforeIDPlaceholder":`before_msg_id 游标`,"messages.limitPlaceholder":`条数 <= 100`,"messages.searchMessages":`查询消息`,"messages.nextPage":`下一页`,"messages.currentPage":`当前页消息`,"messages.deleted":`已删除`,"messages.outgoing":`发出消息`,"messages.incoming":`收到`,"messages.ownerPeer":`所属 / 对端`,"messages.deleteSelected":`删除指定消息`,"messages.idsPlaceholder":`消息 ID,逗号分隔`,"messages.revoke":`同步撤回`,"messages.previewDelete":`预演删除`,"messages.clearHistory":`清空私聊历史`,"messages.maxIDPlaceholder":`max_id 截止消息`,"messages.maxBatchesPlaceholder":`max_batches 批次数`,"messages.justClear":`仅清本侧`,"messages.previewClearHistory":`预演清历史`,"messages.direction":`方向`,"messages.body":`正文`,"messages.privateDetailTitle":`消息 #{id}`,"messages.detailEyebrow":`消息详情`,"messages.backPrivate":`返回私聊消息`,"messages.backGroup":`返回群聊消息`,"messages.ownerPeerTitle":`所属 {owner} · 对端 {peer}`,"messages.senderSubtitle":`发送方 {sender} · {date}`,"messages.boxID":`消息盒 ID`,"messages.privateMessageID":`私聊消息 ID`,"messages.messageSender":`发送方`,"messages.messageBox":`消息盒`,"messages.dialogRow":`会话行`,"messages.privateRow":`私聊消息行`,"messages.channelMessageRow":`消息行`,"messages.channelRow":`频道行`,"messages.userUpdateEvents":`更新事件`,"messages.channelUpdateEvents":`频道更新事件`,"messages.eventJson":`事件 JSON`,"messages.dispatchOutbox":`分发队列`,"messages.messageBoxesSnapshot":`message_boxes 只读快照`,"messages.dialogSnapshot":`dialogs 只读快照`,"messages.privateSnapshot":`private_messages 只读快照`,"messages.channelMessagesSnapshot":`channel_messages 只读快照`,"messages.channelSnapshot":`channels 只读快照`,"messages.userEventsSource":`durable user_update_events`,"messages.channelEventsSource":`durable channel_update_events`,"messages.outboxSource":`在线/离线 dispatch_outbox`,"messages.attempts":`尝试`,"messages.deleteThis":`删除此消息`,"messages.groupDetailTitle":`群聊消息 #{id}`,"messages.channelGroupTitle":`频道/群 {id}`,"messages.mediaCount":`有媒体`,"messages.channelPosts":`频道帖子`,"messages.channelGroup":`频道 / 群`,"messages.pinned":`置顶`,"messages.channelPost":`频道帖子`,"messages.msgIDsInvalid":`消息 ID 无效`,"auth.device":`设备`,"auth.platform":`平台`,"auth.ip":`IP`,"auth.lastActive":`最近活跃`,"auth.revokeCurrent":`撤销当前`,"auth.keepCurrent":`保留当前`,"auth.revokeAll":`撤销全部设备`,"picker.userPlaceholder":`搜索 user_id / phone / username`,"picker.channelPlaceholder":`搜索 channel_id / username / title`,"picker.verified":`认证`,"picker.regular":`普通`,"action.reasonRequired":`请填写操作原因`,"action.flow":`操作流程`,"action.close":`关闭`,"action.stepReason":`填写原因`,"action.stepDryRun":`预演检查`,"action.stepConfirm":`确认执行`,"action.reason":`操作原因`,"action.reasonPlaceholder":`说明本次操作原因`,"action.requestPreview":`请求预览`,"action.result":`操作结果`,"action.commandID":`命令 ID`,"action.status":`状态`,"action.dryRun":`预演`,"action.runAgain":`重新预演`,"action.runDry":`先预演`,"action.confirm":`确认执行`,"audit.id":`ID`,"audit.commandID":`命令 ID`,"audit.action":`动作`,"audit.actor":`操作者`,"audit.status":`状态`,"audit.dryRun":`预演`,"audit.reason":`原因`,"audit.time":`时间`}},Ae=(0,g.createContext)(null);function je({children:e}){let[t,n]=(0,g.useState)(()=>Pe());(0,g.useEffect)(()=>{try{localStorage.setItem(Oe,t)}catch{}document.documentElement.lang=t===`zh`?`zh-CN`:`en`,document.documentElement.dir=`ltr`,document.documentElement.setAttribute(`translate`,`no`),document.body.classList.add(`notranslate`),document.title=Ne(t,`app.title`)},[t]);let r=(0,g.useMemo)(()=>({lang:t,setLang:n,t:(e,n)=>Ne(t,e,n)}),[t]);return(0,O.jsx)(Ae.Provider,{value:r,children:e})}function k(){let e=(0,g.useContext)(Ae);if(!e)throw Error(`useI18n must be used inside I18nProvider`);return e}function Me(){let{lang:e,setLang:t,t:n}=k();return(0,O.jsx)(`div`,{className:`language-switch`,role:`group`,"aria-label":`Language`,children:[`en`,`zh`].map(r=>(0,O.jsx)(`button`,{className:e===r?`active`:``,type:`button`,"aria-pressed":e===r,onClick:()=>t(r),children:n(`language.${r}`)},r))})}function Ne(e,t,n){let r=ke[e][t]??ke.en[t]??t;return n?r.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??``)):r}function Pe(){try{let e=Fe(new URLSearchParams(window.location.search).get(`lang`));if(e)return e}catch{}try{let e=Fe(localStorage.getItem(Oe));if(e)return e}catch{}let e=navigator.languages?.length?navigator.languages:[navigator.language];for(let t of e){let e=Fe(t);if(e)return e}return`en`}function Fe(e){if(!e)return null;let t=e.trim().toLowerCase().replace(`_`,`-`);return t===`zh`||t.startsWith(`zh-`)?`zh`:t===`en`||t.startsWith(`en-`)?`en`:null}function Ie(){return{href:`${window.location.pathname}${window.location.search}`,path:window.location.pathname,search:new URLSearchParams(window.location.search)}}function Le(e,t){return e.startsWith(`/accounts`)?t(`route.accounts`):e.startsWith(`/channels`)?t(`route.channels`):e.startsWith(`/messages`)?t(`route.messages`):t(`route.dashboard`)}function Re(e,t){return e.startsWith(`/accounts`)?t(`route.accountsSubtitle`):e.startsWith(`/channels`)?t(`route.channelsSubtitle`):e.startsWith(`/messages`)?t(`route.messagesSubtitle`):t(`route.dashboardSubtitle`)}function ze({href:e,navigate:t,className:n,children:r}){return(0,O.jsx)(`a`,{className:n,href:e,onClick:n=>{n.preventDefault(),t(e)},children:r})}function Be(){let{t:e}=k();return(0,O.jsxs)(`div`,{className:`boot-screen`,children:[(0,O.jsxs)(`div`,{className:`brand compact brand-elevated`,children:[(0,O.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`telesrv`}),(0,O.jsx)(`small`,{children:e(`app.adminConsole`)})]})]}),(0,O.jsx)(`div`,{className:`loader-bar`})]})}function Ve({actor:e,route:t,navigate:n,onLogout:r,children:i}){let{t:a}=k(),o=t.path.startsWith(`/messages`),[s,c]=(0,g.useState)(o);(0,g.useEffect)(()=>{o&&c(!0)},[o]);async function l(){await x.logout().catch(()=>void 0),r()}return(0,O.jsxs)(`div`,{className:`shell`,children:[(0,O.jsxs)(`aside`,{className:`sidebar`,children:[(0,O.jsxs)(ze,{className:`brand`,href:`/`,navigate:n,children:[(0,O.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`telesrv`}),(0,O.jsx)(`small`,{children:a(`app.adminConsole`)})]})]}),(0,O.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.navigation`)}),(0,O.jsxs)(`nav`,{className:`nav-list`,"aria-label":a(`layout.primaryNav`),children:[(0,O.jsx)(He,{icon:(0,O.jsx)(he,{size:16}),href:`/`,route:t,navigate:n,children:a(`layout.dashboard`)}),(0,O.jsx)(He,{icon:(0,O.jsx)(Te,{size:16}),href:`/accounts`,route:t,navigate:n,children:a(`layout.accounts`)}),(0,O.jsx)(He,{icon:(0,O.jsx)(xe,{size:16}),href:`/channels`,route:t,navigate:n,children:a(`layout.channels`)}),(0,O.jsxs)(`div`,{className:`nav-section ${o?`active`:``} ${s?`open`:``}`,children:[(0,O.jsxs)(`button`,{className:`nav-section-toggle`,type:`button`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[(0,O.jsx)(_e,{size:16}),(0,O.jsx)(`span`,{children:a(`layout.messages`)}),(0,O.jsx)(le,{className:`nav-section-chevron`,size:15})]}),s&&(0,O.jsxs)(`div`,{className:`nav-children`,children:[(0,O.jsx)(He,{href:`/messages/private`,route:t,navigate:n,activeWhen:e=>e===`/messages`||e===`/messages/detail`||e.startsWith(`/messages/private`),children:a(`layout.privateMessages`)}),(0,O.jsx)(He,{href:`/messages/groups`,route:t,navigate:n,activeWhen:e=>e.startsWith(`/messages/groups`),children:a(`layout.groupMessages`)})]})]})]}),(0,O.jsxs)(`div`,{className:`sidebar-status`,children:[(0,O.jsx)(`div`,{className:`sidebar-label`,children:a(`layout.runtime`)}),(0,O.jsxs)(`div`,{className:`runtime-row`,children:[(0,O.jsx)(be,{size:14}),(0,O.jsx)(`span`,{children:a(`layout.adminBackend`)}),(0,O.jsx)(`strong`,{children:a(`layout.ready`)})]}),(0,O.jsxs)(`div`,{className:`runtime-row`,children:[(0,O.jsx)(fe,{size:14}),(0,O.jsx)(`span`,{children:a(`layout.pgRead`)}),(0,O.jsx)(`strong`,{children:a(`layout.readOnly`)})]}),(0,O.jsxs)(`div`,{className:`runtime-row`,children:[(0,O.jsx)(Se,{size:14}),(0,O.jsx)(`span`,{children:a(`layout.writeOps`)}),(0,O.jsx)(`strong`,{children:a(`layout.dryRun`)})]})]})]}),(0,O.jsxs)(`div`,{className:`workspace`,children:[(0,O.jsxs)(`header`,{className:`topbar`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`eyebrow`,children:Re(t.path,a)}),(0,O.jsx)(`h1`,{children:Le(t.path,a)})]}),(0,O.jsxs)(`div`,{className:`topbar-actions`,children:[(0,O.jsx)(Me,{}),(0,O.jsx)(`span`,{className:`actor-pill`,children:a(`layout.actor`,{actor:e})}),(0,O.jsxs)(`button`,{className:`btn ghost icon-text`,type:`button`,onClick:l,title:a(`layout.logout`),children:[(0,O.jsx)(ge,{size:16}),` `,a(`layout.logout`)]})]})]}),(0,O.jsx)(`main`,{className:`content`,children:i})]})]})}function He({href:e,route:t,navigate:n,icon:r,children:i,activeWhen:a}){return(0,O.jsxs)(ze,{className:`nav-item ${(a?a(t.path):e===`/`?t.path===`/`:t.path.startsWith(e))?`active`:``}`,href:e,navigate:n,children:[r??(0,O.jsx)(`span`,{"aria-hidden":`true`,className:`nav-dot`}),(0,O.jsx)(`span`,{children:i})]})}function Ue(e){let t=e.trim();return!t||t.startsWith(`+`)?t:/^\d+$/.test(t)?`+${t}`:t}function We(e){let t=e.trim();return t?t.startsWith(`@`)?t:`@${t}`:``}function Ge(e){return`${e.FirstName||``} ${e.LastName||``}`.trim()||`-`}function Ke(e,t){let n=t??(e=>({"channel.kind.broadcast":`Channel`,"channel.kind.forum":`Supergroup / Forum`,"channel.kind.megagroup":`Supergroup`,"channel.kind.generic":`Channel / Group`})[e]??e);return e.Broadcast&&!e.Megagroup?n(`channel.kind.broadcast`):e.Megagroup&&e.Forum?n(`channel.kind.forum`):e.Megagroup?n(`channel.kind.megagroup`):n(`channel.kind.generic`)}function qe(e){if(!e||e.startsWith(`0001-`))return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function Je(e){if(!e||e<=0)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toLocaleString()}function Ye(e){if(!e.trim())return 0;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:0}function Xe(e,t=`msg ids invalid`){let n=e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean).map(e=>Number.parseInt(e,10));if(n.length===0||n.some(e=>!Number.isFinite(e)||e<=0))throw Error(t);return n}function Ze({title:e,eyebrow:t,children:n,actions:r}){return(0,O.jsxs)(`div`,{className:`page-frame`,children:[(0,O.jsxs)(`div`,{className:`page-title-row`,children:[(0,O.jsxs)(`div`,{children:[t&&(0,O.jsx)(`div`,{className:`eyebrow`,children:t}),(0,O.jsx)(`h2`,{children:e})]}),r&&(0,O.jsx)(`div`,{className:`page-actions`,children:r})]}),n]})}function Qe({children:e}){return(0,O.jsx)(`div`,{className:`query-panel`,children:e})}function $e({main:e,side:t}){return(0,O.jsxs)(`div`,{className:`split-layout`,children:[(0,O.jsx)(`div`,{className:`split-main`,children:e}),(0,O.jsx)(`aside`,{className:`split-side`,children:t})]})}function et({title:e,text:t,action:n}){return(0,O.jsxs)(`div`,{className:`section-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:e}),t&&(0,O.jsx)(`p`,{children:t})]}),n&&(0,O.jsx)(`div`,{className:`section-action`,children:n})]})}function tt({children:e}){return(0,O.jsxs)(`div`,{className:`alert`,children:[(0,O.jsx)(re,{size:16}),` `,(0,O.jsx)(`span`,{children:e})]})}function A({children:e,tone:t=`neutral`}){return(0,O.jsx)(`span`,{className:`badge ${t}`,children:e})}function nt({label:e,value:t,tone:n}){return(0,O.jsxs)(`div`,{className:`status-item ${n}`,children:[(0,O.jsx)(`span`,{children:e}),(0,O.jsx)(`strong`,{children:t})]})}function j({label:e,value:t,tone:n=`neutral`,mono:r=!1}){return(0,O.jsxs)(`div`,{className:`metric ${n}`,children:[(0,O.jsx)(`span`,{children:e}),(0,O.jsx)(`strong`,{className:r?`mono`:``,children:t})]})}function M({label:e,value:t,mono:n=!1}){return(0,O.jsxs)(`div`,{className:`summary-item`,children:[(0,O.jsx)(`span`,{children:e}),(0,O.jsx)(`strong`,{className:n?`mono`:``,children:t})]})}function rt({rows:e}){let{t}=k();return(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`audit.id`)}),(0,O.jsx)(`th`,{children:t(`audit.commandID`)}),(0,O.jsx)(`th`,{children:t(`audit.action`)}),(0,O.jsx)(`th`,{children:t(`audit.actor`)}),(0,O.jsx)(`th`,{children:t(`audit.status`)}),(0,O.jsx)(`th`,{children:t(`audit.dryRun`)}),(0,O.jsx)(`th`,{children:t(`audit.reason`)}),(0,O.jsx)(`th`,{children:t(`audit.time`)})]})}),(0,O.jsxs)(`tbody`,{children:[e.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:e.ID}),(0,O.jsx)(`td`,{className:`mono`,children:e.CommandID}),(0,O.jsx)(`td`,{children:e.Action}),(0,O.jsx)(`td`,{children:e.Actor}),(0,O.jsx)(`td`,{children:e.Status}),(0,O.jsx)(`td`,{children:e.DryRun?t(`common.yes`):t(`common.no`)}),(0,O.jsx)(`td`,{className:`truncate`,children:e.Reason}),(0,O.jsx)(`td`,{children:qe(e.CreatedAt)})]},e.ID)),e.length===0&&(0,O.jsx)(it,{colSpan:8})]})]})})}function it({colSpan:e}){let{t}=k();return(0,O.jsx)(`tr`,{children:(0,O.jsx)(`td`,{colSpan:e,className:`empty-cell`,children:t(`common.noResults`)})})}function at({label:e}){return(0,O.jsx)(`section`,{className:`surface`,children:(0,O.jsx)(`div`,{className:`loading-line`,children:e})})}function ot({value:e}){return(0,O.jsx)(`pre`,{className:`json-block`,children:e||`{}`})}function st({onLogin:e}){let{t}=k(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(!1);async function c(t){t.preventDefault(),s(!0),a(``);try{e((await x.login(n)).actor)}catch(e){a(b(e))}finally{s(!1)}}return(0,O.jsx)(`main`,{className:`login-page`,children:(0,O.jsxs)(`section`,{className:`login-panel`,children:[(0,O.jsxs)(`div`,{className:`login-head`,children:[(0,O.jsxs)(`div`,{className:`brand brand-elevated`,children:[(0,O.jsx)(`span`,{className:`brand-mark`,children:`T`}),(0,O.jsxs)(`span`,{children:[(0,O.jsx)(`strong`,{children:`telesrv`}),(0,O.jsx)(`small`,{children:t(`app.adminConsole`)})]})]}),(0,O.jsxs)(`div`,{className:`login-head-actions`,children:[(0,O.jsx)(Me,{}),(0,O.jsx)(`span`,{className:`login-chip`,children:t(`app.localAccess`)})]})]}),(0,O.jsxs)(`div`,{className:`login-copy`,children:[(0,O.jsx)(`h1`,{children:t(`login.heading`)}),(0,O.jsx)(`p`,{children:t(`login.body`)})]}),i&&(0,O.jsx)(tt,{children:i}),(0,O.jsxs)(`form`,{className:`form-stack`,onSubmit:c,children:[(0,O.jsxs)(`label`,{children:[(0,O.jsx)(`span`,{children:t(`login.secret`)}),(0,O.jsx)(`input`,{autoFocus:!0,type:`password`,value:n,autoComplete:`current-password`,onChange:e=>r(e.target.value)})]}),(0,O.jsx)(`button`,{className:`btn primary full`,type:`submit`,disabled:o,children:t(o?`login.submitting`:`login.submit`)})]})]})})}var ct=m();function N({label:e,path:t,payload:n,icon:r,compact:i=!1,tone:a=`danger`,onDone:o}){let{t:s}=k(),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``),[f,p]=(0,g.useState)(null),[m,h]=(0,g.useState)(``),[_,v]=(0,g.useState)(!1);function y(){d(``),p(null),h(``)}async function ee(e){if(!u.trim()){h(s(`action.reasonRequired`));return}v(!0),h(``);try{let r={...n(),reason:u,confirm:e};p(await x.action(t,r)),e&&o?.()}catch(e){h(b(e))}finally{v(!1)}}let S=f?.dry_run&&!f.error,te=`btn ${a===`danger`?`danger`:a===`warn`?`warn`:``} ${i?`compact-btn`:``}`,C=(0,g.useMemo)(()=>{try{return n()}catch(e){return{payload_error:b(e)}}},[c,n]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{className:te,type:`button`,onClick:()=>{y(),l(!0)},children:[r,e]}),c&&(0,ct.createPortal)((0,O.jsx)(`div`,{className:`modal-backdrop`,role:`presentation`,children:(0,O.jsxs)(`section`,{className:`modal command-modal`,role:`dialog`,"aria-modal":`true`,"aria-label":e,children:[(0,O.jsxs)(`div`,{className:`modal-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`eyebrow`,children:s(`action.flow`)}),(0,O.jsx)(`h2`,{children:e})]}),(0,O.jsx)(`button`,{className:`icon-btn`,type:`button`,onClick:()=>l(!1),"aria-label":s(`action.close`),children:(0,O.jsx)(Ee,{size:15})})]}),(0,O.jsxs)(`div`,{className:`command-body`,children:[(0,O.jsxs)(`div`,{className:`command-steps`,children:[(0,O.jsxs)(`div`,{className:`command-step ${u.trim()?`done`:`active`}`,children:[(0,O.jsx)(`span`,{children:`1`}),(0,O.jsx)(`strong`,{children:s(`action.stepReason`)})]}),(0,O.jsxs)(`div`,{className:`command-step ${f?.dry_run?`done`:u.trim()?`active`:``}`,children:[(0,O.jsx)(`span`,{children:`2`}),(0,O.jsx)(`strong`,{children:s(`action.stepDryRun`)})]}),(0,O.jsxs)(`div`,{className:`command-step ${f&&!f.dry_run&&!f.error?`done`:S?`active`:``}`,children:[(0,O.jsx)(`span`,{children:`3`}),(0,O.jsx)(`strong`,{children:s(`action.stepConfirm`)})]})]}),(0,O.jsxs)(`label`,{className:`form-field`,children:[(0,O.jsx)(`span`,{children:s(`action.reason`)}),(0,O.jsx)(`textarea`,{value:u,onChange:e=>d(e.target.value),rows:3,placeholder:s(`action.reasonPlaceholder`)})]}),(0,O.jsxs)(`div`,{className:`command-preview`,children:[(0,O.jsxs)(`div`,{className:`preview-head`,children:[(0,O.jsx)(E,{size:14}),` `,s(`action.requestPreview`)]}),(0,O.jsx)(ot,{value:JSON.stringify(C,null,2)})]}),m&&(0,O.jsx)(tt,{children:m}),f&&(0,O.jsxs)(`div`,{className:`result-box`,children:[(0,O.jsxs)(`div`,{className:`result-title`,children:[f.error?(0,O.jsx)(re,{size:16}):(0,O.jsx)(ie,{size:16}),(0,O.jsx)(`strong`,{children:f.message||f.error||s(`action.result`)})]}),(0,O.jsxs)(`div`,{className:`result-line`,children:[(0,O.jsx)(`span`,{children:s(`action.commandID`)}),(0,O.jsx)(`strong`,{children:f.command_id})]}),(0,O.jsxs)(`div`,{className:`result-line`,children:[(0,O.jsx)(`span`,{children:s(`action.status`)}),(0,O.jsx)(`strong`,{children:f.status})]}),(0,O.jsxs)(`div`,{className:`result-line`,children:[(0,O.jsx)(`span`,{children:s(`action.dryRun`)}),(0,O.jsx)(`strong`,{children:f.dry_run?s(`common.yes`):s(`common.no`)})]}),(0,O.jsx)(`div`,{className:`result-message`,children:f.message||f.error}),f.details&&(0,O.jsx)(ot,{value:JSON.stringify(f.details,null,2)})]})]}),(0,O.jsxs)(`div`,{className:`modal-actions`,children:[(0,O.jsx)(`button`,{className:`btn`,type:`button`,onClick:()=>l(!1),children:s(`common.close`)}),(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>ee(!1),disabled:_,children:[_?(0,O.jsx)(ae,{size:15,className:`spin`}):(0,O.jsx)(ve,{size:15}),s(f?`action.runAgain`:`action.runDry`)]}),(0,O.jsxs)(`button`,{className:`btn danger icon-text`,type:`button`,onClick:()=>ee(!0),disabled:_||!S,children:[(0,O.jsx)(ie,{size:15}),s(`action.confirm`)]})]})]})}),document.body)]})}function lt({rows:e,userID:t,onDone:n}){let{t:r}=k(),[i,a]=(0,g.useState)(()=>new Set);(0,g.useEffect)(()=>{a(new Set)},[t]);let o=(0,g.useMemo)(()=>e.filter(e=>!i.has(e.Hash)),[e,i]);function s(e){a(t=>e(t)),n()}return(0,O.jsxs)(`div`,{className:`authorization-block`,children:[(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table authorization-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:r(`auth.device`)}),(0,O.jsx)(`th`,{children:r(`auth.platform`)}),(0,O.jsx)(`th`,{children:r(`auth.ip`)}),(0,O.jsx)(`th`,{children:r(`auth.lastActive`)}),(0,O.jsx)(`th`,{className:`device-actions-head`,children:r(`common.actions`)})]})}),(0,O.jsxs)(`tbody`,{children:[o.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsxs)(`td`,{className:`device-text`,children:[n.DeviceModel,` `,n.SystemVersion]}),(0,O.jsxs)(`td`,{className:`device-text`,children:[n.Platform,` `,n.AppVersion]}),(0,O.jsx)(`td`,{children:n.IP}),(0,O.jsx)(`td`,{children:qe(n.ActiveAt)}),(0,O.jsx)(`td`,{className:`device-actions-cell`,children:(0,O.jsxs)(`div`,{className:`device-actions`,children:[(0,O.jsx)(N,{label:r(`auth.revokeCurrent`),icon:(0,O.jsx)(ge,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,hash:n.Hash}),onDone:()=>s(e=>new Set([...e,n.Hash]))}),(0,O.jsx)(N,{label:r(`auth.keepCurrent`),icon:(0,O.jsx)(xe,{size:13}),compact:!0,path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,keep_hash:n.Hash}),onDone:()=>s(()=>new Set(e.filter(e=>e.Hash!==n.Hash).map(e=>e.Hash)))})]})})]},n.Hash)),o.length===0&&(0,O.jsx)(it,{colSpan:5})]})]})}),(0,O.jsx)(`div`,{className:`danger-zone`,children:(0,O.jsx)(N,{label:r(`auth.revokeAll`),icon:(0,O.jsx)(ce,{size:15}),path:`/api/actions/revoke-sessions`,payload:()=>({user_id:t,revoke_all:!0}),onDone:()=>s(()=>new Set(e.map(e=>e.Hash)))})})]})}function ut({id:e,navigate:t}){let{t:n}=k(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``),[s,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(`1`),[d,f]=(0,g.useState)(`1000`),[p,m]=(0,g.useState)(()=>dt(new Date(Date.now()+7*864e5))),[h,_]=(0,g.useState)(``);async function v(){c(!0),o(``);try{let t=await x.account(e);i(t),t.Restriction.Frozen&&(t.Restriction.Until&&m(dt(new Date(t.Restriction.Until))),_(t.Restriction.AppealURL||``))}catch(e){o(b(e))}finally{c(!1)}}if((0,g.useEffect)(()=>{v()},[e]),a)return(0,O.jsx)(tt,{children:a});if(!r)return(0,O.jsx)(at,{label:n(s?`account.loadingDetail`:`account.waitingData`)});let y=r.Account;return(0,O.jsx)(Ze,{title:n(`account.detailTitle`,{id:y.ID}),eyebrow:n(`account.profile`),actions:(0,O.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/accounts`),children:[(0,O.jsx)(se,{size:15}),` `,n(`common.backToList`)]}),children:(0,O.jsx)($e,{main:(0,O.jsxs)(`div`,{className:`stacked-sections`,children:[(0,O.jsxs)(`section`,{className:`entity-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`entity-title`,children:Ge(y)}),(0,O.jsxs)(`div`,{className:`entity-subtitle`,children:[We(y.Username)||n(`account.noUsername`),` · `,Ue(y.Phone)||n(`account.noPhone`)]})]}),(0,O.jsxs)(`div`,{className:`entity-badges`,children:[y.PremiumUntil>0?(0,O.jsx)(A,{tone:`good`,children:n(`account.premium`)}):(0,O.jsx)(A,{children:n(`account.notPremium`)}),r.Verified?(0,O.jsx)(A,{tone:`good`,children:n(`common.verified`)}):(0,O.jsx)(A,{children:n(`account.notVerified`)}),y.Frozen?(0,O.jsx)(A,{tone:`danger`,children:n(`account.accountFrozen`)}):(0,O.jsx)(A,{children:n(`account.accountActive`)})]})]}),(0,O.jsxs)(`div`,{className:`summary-grid`,children:[(0,O.jsx)(M,{label:n(`account.userID`),value:String(y.ID),mono:!0}),(0,O.jsx)(M,{label:n(`account.lastActive`),value:Je(r.LastSeenAt)||`-`}),(0,O.jsx)(M,{label:n(`account.premiumUntil`),value:y.PremiumUntil>0?Je(y.PremiumUntil):n(`common.none`)}),(0,O.jsx)(M,{label:n(`account.starsBalance`),value:`${r.StarsBalance} / ${r.StarsGranted?n(`account.startingGrantApplied`):n(`account.startingGrantPending`)}`}),(0,O.jsx)(M,{label:n(`common.updatedAt`),value:qe(y.UpdatedAt)||`-`}),(0,O.jsx)(M,{label:n(`account.activeSessions`),value:String(r.Authorizations.length)}),(0,O.jsx)(M,{label:n(`account.accountFlags`),value:`support=${r.Support} bot=${r.Bot}`}),(0,O.jsx)(M,{label:n(`account.restriction`),value:r.HasRestriction?r.Restriction.Reason||n(`account.restricted`):n(`common.none`)}),(0,O.jsx)(M,{label:n(`account.freezeSince`),value:r.Restriction.Since?qe(r.Restriction.Since):n(`common.none`)}),(0,O.jsx)(M,{label:n(`account.freezeUntil`),value:r.Restriction.Until?qe(r.Restriction.Until):n(`common.none`)}),(0,O.jsx)(M,{label:n(`account.freezeAppealURL`),value:r.Restriction.AppealURL||n(`common.none`)}),(0,O.jsx)(M,{label:n(`account.createdAt`),value:qe(y.CreatedAt)||`-`})]}),r.About&&(0,O.jsx)(`p`,{className:`about-text`,children:r.About}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:n(`account.authorizationsTitle`),text:n(`account.authorizationsCount`,{count:r.Authorizations.length})}),(0,O.jsx)(lt,{rows:r.Authorizations,userID:y.ID,onDone:v})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,O.jsx)(rt,{rows:r.AuditLogs})]})]}),side:(0,O.jsxs)(`section`,{className:`action-dock`,children:[(0,O.jsx)(`div`,{className:`dock-title`,children:n(`account.actionDock`)}),(0,O.jsxs)(`label`,{className:`duration-field`,children:[(0,O.jsx)(`span`,{children:n(`account.freezeUntil`)}),(0,O.jsx)(`input`,{"aria-label":n(`account.freezeUntilAria`),value:p,onChange:e=>m(e.target.value),type:`datetime-local`})]}),(0,O.jsxs)(`label`,{className:`duration-field`,children:[(0,O.jsx)(`span`,{children:n(`account.freezeAppealURL`)}),(0,O.jsx)(`input`,{"aria-label":n(`account.freezeAppealURLAria`),value:h,onChange:e=>_(e.target.value),type:`url`,placeholder:`https://...`})]}),(0,O.jsx)(N,{label:y.Frozen?n(`account.updateFreeze`):n(`account.freezeAccount`),icon:(0,O.jsx)(re,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!0,freeze_until:new Date(p).toISOString(),freeze_appeal_url:h.trim()}),onDone:v}),y.Frozen&&(0,O.jsx)(N,{label:n(`account.unfreezeAccount`),icon:(0,O.jsx)(re,{size:15}),path:`/api/actions/set-frozen`,payload:()=>({user_id:y.ID,frozen:!1}),onDone:v}),(0,O.jsxs)(`label`,{className:`duration-field`,children:[(0,O.jsx)(`span`,{children:n(`account.premiumMonths`)}),(0,O.jsx)(`input`,{"aria-label":n(`account.premiumMonthsAria`),value:l,onChange:e=>u(e.target.value),type:`number`,min:`1`,max:`120`})]}),(0,O.jsxs)(`div`,{className:`action-stack`,children:[(0,O.jsx)(N,{label:n(`account.setPremium`),icon:(0,O.jsx)(oe,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:Ye(l)}),onDone:v}),(0,O.jsx)(N,{label:n(`account.clearPremium`),icon:(0,O.jsx)(oe,{size:15}),tone:`warn`,path:`/api/actions/grant-premium`,payload:()=>({user_id:y.ID,months:0}),onDone:v}),(0,O.jsxs)(`label`,{className:`duration-field`,children:[(0,O.jsx)(`span`,{children:n(`account.starsAmount`)}),(0,O.jsx)(`input`,{"aria-label":n(`account.starsAmountAria`),value:d,onChange:e=>f(e.target.value),type:`number`,min:`1`,max:`1000000000`})]}),(0,O.jsx)(N,{label:n(`account.grantStars`),icon:(0,O.jsx)(Ce,{size:15}),tone:`warn`,path:`/api/actions/grant-stars`,payload:()=>({user_id:y.ID,amount:Ye(d)}),onDone:v}),(0,O.jsx)(N,{label:r.Verified?n(`account.clearVerified`):n(`account.setVerified`),icon:(0,O.jsx)(ne,{size:15}),tone:`warn`,path:`/api/actions/set-verified`,payload:()=>({user_id:y.ID,verified:!r.Verified}),onDone:v})]})]})})})}function dt(e){return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function ft(e){return e.reduce((e,t)=>(e.devices+=t.DeviceCount,t.PremiumUntil>0&&(e.premium+=1),t.Frozen&&(e.frozen+=1),e),{devices:0,premium:0,frozen:0})}function pt(e){return e.reduce((e,t)=>(t.Megagroup&&(e.megagroups+=1),t.Broadcast&&(e.broadcasts+=1),t.Verified&&(e.verified+=1),e),{megagroups:0,broadcasts:0,verified:0})}function mt({navigate:e}){let{t}=k(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeActiveUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_active_us`,String(c.beforeActiveUS)));try{let e=await x.accounts(t);s(e),l({beforeID:e.next_before_id,beforeActiveUS:e.next_before_active_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=ft(o?.rows??[]);return(0,O.jsxs)(Ze,{title:t(`account.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`account.recentActive`),actions:(0,O.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,O.jsx)(ye,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,O.jsx)(tt,{children:f}),(0,O.jsxs)(`div`,{className:`metric-row`,children:[(0,O.jsx)(j,{label:t(`account.currentPage`),value:String(o?.rows.length??0)}),(0,O.jsx)(j,{label:t(`account.onlineDevices`),value:String(h.devices)}),(0,O.jsx)(j,{label:t(`account.premium`),value:String(h.premium),tone:`good`}),(0,O.jsx)(j,{label:t(`account.frozen`),value:String(h.frozen),tone:h.frozen>0?`danger`:`neutral`})]}),(0,O.jsx)(Qe,{children:(0,O.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,O.jsxs)(`label`,{className:`searchbox`,children:[(0,O.jsx)(D,{size:15}),(0,O.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`account.searchPlaceholder`)})]}),(0,O.jsxs)(`label`,{className:`field-inline`,children:[(0,O.jsx)(`span`,{children:t(`common.limit`)}),(0,O.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,O.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,O.jsx)(ae,{size:15,className:`spin`}):(0,O.jsx)(D,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,O.jsx)(ue,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`account.userID`)}),(0,O.jsx)(`th`,{children:t(`account.phone`)}),(0,O.jsx)(`th`,{children:t(`common.username`)}),(0,O.jsx)(`th`,{children:t(`common.name`)}),(0,O.jsx)(`th`,{children:t(`common.device`)}),(0,O.jsx)(`th`,{children:t(`account.lastActive`)}),(0,O.jsx)(`th`,{children:t(`account.premium`)}),(0,O.jsx)(`th`,{children:t(`common.verified`)}),(0,O.jsx)(`th`,{children:t(`account.frozen`)}),(0,O.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,O.jsx)(`th`,{})]})}),(0,O.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{className:`mono`,children:n.ID}),(0,O.jsx)(`td`,{children:Ue(n.Phone)}),(0,O.jsx)(`td`,{children:We(n.Username)}),(0,O.jsx)(`td`,{children:Ge(n)}),(0,O.jsx)(`td`,{children:n.DeviceCount}),(0,O.jsx)(`td`,{children:qe(n.LastActiveAt)}),(0,O.jsx)(`td`,{children:n.PremiumUntil>0?(0,O.jsxs)(A,{tone:`good`,children:[t(`account.premium`),` `,Je(n.PremiumUntil)]}):(0,O.jsx)(A,{children:t(`common.none`)})}),(0,O.jsx)(`td`,{children:n.Verified?(0,O.jsx)(A,{tone:`good`,children:t(`common.verified`)}):(0,O.jsx)(A,{children:t(`account.notVerified`)})}),(0,O.jsx)(`td`,{children:n.Frozen?(0,O.jsx)(A,{tone:`danger`,children:t(`account.frozen`)}):(0,O.jsx)(A,{children:t(`common.normal`)})}),(0,O.jsx)(`td`,{children:qe(n.UpdatedAt)}),(0,O.jsx)(`td`,{children:(0,O.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/accounts/${n.ID}`),children:[t(`common.detail`),` `,(0,O.jsx)(ue,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,O.jsx)(it,{colSpan:11})]})]})})]})}function ht({id:e,navigate:t}){let{t:n}=k(),[r,i]=(0,g.useState)(null),[a,o]=(0,g.useState)(``);async function s(){o(``);try{i(await x.channel(e))}catch(e){o(b(e))}}if((0,g.useEffect)(()=>{s()},[e]),a)return(0,O.jsx)(tt,{children:a});if(!r)return(0,O.jsx)(at,{label:n(`channel.loadingDetail`)});let c=r.Channel;return(0,O.jsx)(Ze,{title:`${Ke(c,n)} #${c.ID}`,eyebrow:n(`channel.detailProfile`),actions:(0,O.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>t(`/channels`),children:[(0,O.jsx)(se,{size:15}),` `,n(`common.backToList`)]}),children:(0,O.jsx)($e,{main:(0,O.jsxs)(`div`,{className:`stacked-sections`,children:[(0,O.jsxs)(`section`,{className:`entity-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`entity-title`,children:c.Title||`-`}),(0,O.jsxs)(`div`,{className:`entity-subtitle`,children:[We(c.Username)||n(`account.noUsername`),` · `,n(`channel.creator`,{id:c.CreatorUserID})]})]}),(0,O.jsxs)(`div`,{className:`entity-badges`,children:[(0,O.jsx)(A,{children:Ke(c,n)}),c.Verified?(0,O.jsx)(A,{tone:`good`,children:n(`common.verified`)}):(0,O.jsx)(A,{children:n(`account.notVerified`)}),c.Deleted?(0,O.jsx)(A,{tone:`danger`,children:n(`common.deleted`)}):(0,O.jsx)(A,{children:n(`common.valid`)})]})]}),(0,O.jsxs)(`div`,{className:`summary-grid`,children:[(0,O.jsx)(M,{label:n(`channel.channelID`),value:String(c.ID),mono:!0}),(0,O.jsx)(M,{label:`access_hash`,value:String(c.AccessHash),mono:!0}),(0,O.jsx)(M,{label:n(`common.members`),value:`${c.ParticipantsCount} / ${n(`common.admins`)} ${c.AdminsCount}`}),(0,O.jsx)(M,{label:n(`channel.governance`),value:n(`channel.governanceValue`,{banned:c.BannedCount,kicked:c.KickedCount})}),(0,O.jsx)(M,{label:n(`channel.flags`),value:`broadcast=${c.Broadcast} megagroup=${c.Megagroup} forum=${c.Forum}`}),(0,O.jsx)(M,{label:`top / pinned / PTS`,value:`${c.TopMessageID} / ${c.PinnedMessageID} / ${c.PTS}`}),(0,O.jsx)(M,{label:n(`account.createdAt`),value:Je(c.Date)||`-`}),(0,O.jsx)(M,{label:n(`common.updatedAt`),value:qe(c.UpdatedAt)||`-`})]}),c.About&&(0,O.jsx)(`p`,{className:`about-text`,children:c.About}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:n(`account.recentAdminOps`),text:n(`account.recent30Audit`)}),(0,O.jsx)(rt,{rows:r.AuditLogs})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:n(`channel.rawRow`),text:n(`channel.rawRowText`)}),(0,O.jsx)(ot,{value:r.ChannelJSON})]})]}),side:(0,O.jsxs)(`section`,{className:`action-dock`,children:[(0,O.jsx)(`div`,{className:`dock-title`,children:n(`channel.actionDock`)}),(0,O.jsx)(N,{label:c.Verified?n(`channel.clearVerified`):n(`channel.setVerified`),icon:(0,O.jsx)(ne,{size:15}),tone:`warn`,path:`/api/actions/set-channel-verified`,payload:()=>({channel_id:c.ID,verified:!c.Verified}),onDone:s})]})})})}function gt({navigate:e}){let{t}=k(),[n,r]=(0,g.useState)(``),[i,a]=(0,g.useState)(`50`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)({beforeID:0,beforeUpdatedUS:0}),[u,d]=(0,g.useState)(!1),[f,p]=(0,g.useState)(``);async function m(e=!1){d(!0),p(``);let t=new URLSearchParams({limit:i});n.trim()?t.set(`q`,n.trim()):e&&(t.set(`before_id`,String(c.beforeID)),t.set(`before_updated_us`,String(c.beforeUpdatedUS)));try{let e=await x.channels(t);s(e),l({beforeID:e.next_before_id,beforeUpdatedUS:e.next_before_updated_us})}catch(e){p(b(e))}finally{d(!1)}}(0,g.useEffect)(()=>{m(!1)},[]);let h=pt(o?.rows??[]);return(0,O.jsxs)(Ze,{title:t(`channel.pageTitle`),eyebrow:o?.listing===!1?t(`account.queryResults`):t(`channel.recentUpdated`),actions:(0,O.jsxs)(`button`,{className:`btn`,type:`button`,onClick:()=>m(!1),disabled:u,children:[(0,O.jsx)(ye,{size:15}),` `,t(`common.refresh`)]}),children:[f&&(0,O.jsx)(tt,{children:f}),(0,O.jsxs)(`div`,{className:`metric-row`,children:[(0,O.jsx)(j,{label:t(`channel.currentPage`),value:String(o?.rows.length??0)}),(0,O.jsx)(j,{label:t(`channel.megagroups`),value:String(h.megagroups)}),(0,O.jsx)(j,{label:t(`channel.broadcasts`),value:String(h.broadcasts)}),(0,O.jsx)(j,{label:t(`channel.verifiedCount`),value:String(h.verified),tone:`good`})]}),(0,O.jsx)(Qe,{children:(0,O.jsxs)(`form`,{className:`toolbar`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,O.jsxs)(`label`,{className:`searchbox`,children:[(0,O.jsx)(D,{size:15}),(0,O.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:t(`channel.searchPlaceholder`)})]}),(0,O.jsxs)(`label`,{className:`field-inline`,children:[(0,O.jsx)(`span`,{children:t(`common.limit`)}),(0,O.jsx)(`input`,{className:`small-input`,value:i,onChange:e=>a(e.target.value),type:`number`,min:`1`,max:`100`})]}),(0,O.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,disabled:u,children:[u?(0,O.jsx)(ae,{size:15,className:`spin`}):(0,O.jsx)(D,{size:15}),` `,t(`common.search`)]}),o?.listing&&o.has_more&&(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),disabled:u,children:[(0,O.jsx)(ue,{size:15}),` `,t(`messages.nextPage`)]})]})}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`channel.channelID`)}),(0,O.jsx)(`th`,{children:t(`channel.kind`)}),(0,O.jsx)(`th`,{children:t(`common.username`)}),(0,O.jsx)(`th`,{children:t(`channel.title`)}),(0,O.jsx)(`th`,{children:t(`common.members`)}),(0,O.jsx)(`th`,{children:t(`common.admins`)}),(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:t(`common.verified`)}),(0,O.jsx)(`th`,{children:t(`common.updatedAt`)}),(0,O.jsx)(`th`,{})]})}),(0,O.jsxs)(`tbody`,{children:[o?.rows.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{className:`mono`,children:n.ID}),(0,O.jsx)(`td`,{children:Ke(n,t)}),(0,O.jsx)(`td`,{children:We(n.Username)}),(0,O.jsx)(`td`,{children:n.Title}),(0,O.jsx)(`td`,{children:n.ParticipantsCount}),(0,O.jsx)(`td`,{children:n.AdminsCount}),(0,O.jsx)(`td`,{children:n.PTS}),(0,O.jsx)(`td`,{children:n.Verified?(0,O.jsx)(A,{tone:`good`,children:t(`common.verified`)}):(0,O.jsx)(A,{children:t(`account.notVerified`)})}),(0,O.jsx)(`td`,{children:qe(n.UpdatedAt)}),(0,O.jsx)(`td`,{children:(0,O.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/channels/${n.ID}`),children:[t(`common.detail`),` `,(0,O.jsx)(ue,{size:14})]})})]},n.ID)),(!o||o.rows.length===0)&&(0,O.jsx)(it,{colSpan:10})]})]})})]})}function _t({navigate:e}){let{t}=k();return(0,O.jsxs)(`div`,{className:`dashboard-layout`,children:[(0,O.jsxs)(`section`,{className:`overview-band`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`eyebrow`,children:t(`dashboard.eyebrow`)}),(0,O.jsx)(`h2`,{children:t(`dashboard.title`)})]}),(0,O.jsxs)(`div`,{className:`overview-metrics`,children:[(0,O.jsx)(nt,{label:t(`dashboard.readPath`),value:t(`dashboard.readPathValue`),tone:`neutral`}),(0,O.jsx)(nt,{label:t(`dashboard.writePath`),value:`Admin API`,tone:`good`}),(0,O.jsx)(nt,{label:t(`dashboard.executionPolicy`),value:t(`dashboard.dryRunFirst`),tone:`warn`})]})]}),(0,O.jsxs)(`div`,{className:`command-grid`,children:[(0,O.jsx)(vt,{icon:(0,O.jsx)(Te,{}),title:t(`route.accounts`),text:t(`dashboard.accountsText`),href:`/accounts`,navigate:e}),(0,O.jsx)(vt,{icon:(0,O.jsx)(xe,{}),title:t(`route.channels`),text:t(`dashboard.channelsText`),href:`/channels`,navigate:e}),(0,O.jsx)(vt,{icon:(0,O.jsx)(_e,{}),title:t(`route.messages`),text:t(`dashboard.messagesText`),href:`/messages`,navigate:e})]}),(0,O.jsxs)(`section`,{className:`work-strip`,children:[(0,O.jsxs)(`div`,{className:`strip-item`,children:[(0,O.jsx)(ie,{size:16}),(0,O.jsx)(`span`,{children:t(`dashboard.strip.dryRun`)})]}),(0,O.jsxs)(`div`,{className:`strip-item`,children:[(0,O.jsx)(me,{size:16}),(0,O.jsx)(`span`,{children:t(`dashboard.strip.token`)})]}),(0,O.jsxs)(`div`,{className:`strip-item`,children:[(0,O.jsx)(de,{size:16}),(0,O.jsx)(`span`,{children:t(`dashboard.strip.pagination`)})]}),(0,O.jsxs)(`div`,{className:`strip-item`,children:[(0,O.jsx)(E,{size:16}),(0,O.jsx)(`span`,{children:t(`dashboard.strip.snapshot`)})]})]})]})}function vt({icon:e,title:t,text:n,href:r,navigate:i}){return(0,O.jsxs)(ze,{className:`launcher`,href:r,navigate:i,children:[(0,O.jsx)(`span`,{className:`launcher-icon`,children:e}),(0,O.jsxs)(`span`,{className:`launcher-copy`,children:[(0,O.jsx)(`strong`,{children:t}),(0,O.jsx)(`span`,{children:n})]}),(0,O.jsx)(ue,{size:16})]})}function yt({channelID:e,msgID:t,navigate:n}){let{t:r}=k(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.groupMessage(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,O.jsx)(tt,{children:o});if(!i)return(0,O.jsx)(at,{label:r(`common.loading`)});let l=i.Message;return(0,O.jsx)(Ze,{title:r(`messages.groupDetailTitle`,{id:l.ID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,O.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/groups`),children:[(0,O.jsx)(se,{size:15}),` `,r(`messages.backGroup`)]}),children:(0,O.jsxs)(`div`,{className:`stacked-sections`,children:[(0,O.jsxs)(`section`,{className:`entity-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`entity-title`,children:r(`messages.channelGroupTitle`,{id:l.ChannelID})}),(0,O.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.SenderUserID,date:Je(l.Date)})})]}),(0,O.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,O.jsx)(A,{tone:`danger`,children:r(`common.deleted`)}):(0,O.jsx)(A,{children:r(`common.survived`)}),l.Pinned&&(0,O.jsx)(A,{tone:`warn`,children:r(`messages.pinned`)}),l.Post&&(0,O.jsx)(A,{children:r(`messages.channelPost`)}),(0,O.jsxs)(A,{children:[`pts `,l.PTS]})]})]}),(0,O.jsxs)(`div`,{className:`summary-grid`,children:[(0,O.jsx)(M,{label:r(`common.messageId`),value:String(l.ID),mono:!0}),(0,O.jsx)(M,{label:r(`messages.channelGroup`),value:String(l.ChannelID),mono:!0}),(0,O.jsx)(M,{label:`From Peer`,value:`${l.FromPeerType}:${l.FromPeerID}`,mono:!0}),(0,O.jsx)(M,{label:r(`common.views`),value:String(l.ViewsCount)})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.channelMessageRow`),text:r(`messages.channelMessagesSnapshot`)}),(0,O.jsx)(ot,{value:i.MessageJSON})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.channelRow`),text:r(`messages.channelSnapshot`)}),(0,O.jsx)(ot,{value:i.ChannelJSON})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.channelUpdateEvents`),text:r(`messages.channelEventsSource`)}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:r(`common.count`)}),(0,O.jsx)(`th`,{children:r(`common.type`)}),(0,O.jsx)(`th`,{children:r(`common.messageId`)}),(0,O.jsx)(`th`,{children:r(`common.sender`)}),(0,O.jsx)(`th`,{children:r(`common.time`)})]})}),(0,O.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:e.PTS}),(0,O.jsx)(`td`,{children:e.PTSCount}),(0,O.jsx)(`td`,{children:e.Type}),(0,O.jsx)(`td`,{children:e.MessageID}),(0,O.jsx)(`td`,{children:e.SenderUserID}),(0,O.jsx)(`td`,{children:Je(e.Date)})]},`${e.PTS}-${e.Type}-${e.MessageID}`)),i.UpdateEvents.length===0&&(0,O.jsx)(it,{colSpan:6})]})]})})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.eventJson`)}),(0,O.jsxs)(`div`,{className:`raw-grid`,children:[i.UpdateEvents.map(e=>(0,O.jsx)(ot,{value:e.JSON},`${e.PTS}-${e.Type}-json`)),i.UpdateEvents.length===0&&(0,O.jsx)(`div`,{className:`empty-panel`,children:r(`common.noResults`)})]})]})]})})}function bt({label:e,value:t,onChange:n}){let{t:r}=k(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.accounts(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,O.jsxs)(`div`,{className:`entity-picker`,children:[(0,O.jsxs)(`div`,{className:`picker-head`,children:[(0,O.jsx)(`span`,{children:e}),t?(0,O.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,O.jsx)(Ee,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,O.jsxs)(`div`,{className:`selected-entity`,children:[(0,O.jsx)(T,{size:15}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:Ge(t)}),(0,O.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,O.jsx)(`span`,{children:We(t.Username)||Ue(t.Phone)||`-`})]}):null,(0,O.jsxs)(`div`,{className:`picker-search`,children:[(0,O.jsx)(D,{size:15}),(0,O.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.userPlaceholder`)}),(0,O.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,O.jsx)(ae,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,O.jsx)(`div`,{className:`picker-error`,children:u}),(0,O.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,O.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,O.jsx)(`span`,{className:`mono`,children:e.ID}),(0,O.jsx)(`strong`,{children:Ge(e)}),(0,O.jsx)(`span`,{children:We(e.Username)||Ue(e.Phone)||`-`}),e.Verified?(0,O.jsx)(A,{tone:`good`,children:r(`picker.verified`)}):(0,O.jsx)(A,{children:r(`picker.regular`)})]},e.ID)),o.length===0&&!c?(0,O.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function xt({label:e,value:t,onChange:n}){let{t:r}=k(),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)([]),[c,l]=(0,g.useState)(!1),[u,d]=(0,g.useState)(``);async function f(){l(!0),d(``);let e=new URLSearchParams({limit:`20`});i.trim()&&e.set(`q`,i.trim());try{s((await x.channels(e)).rows)}catch(e){d(b(e))}finally{l(!1)}}return(0,g.useEffect)(()=>{f()},[]),(0,O.jsxs)(`div`,{className:`entity-picker`,children:[(0,O.jsxs)(`div`,{className:`picker-head`,children:[(0,O.jsx)(`span`,{children:e}),t?(0,O.jsxs)(`button`,{className:`link-button`,type:`button`,onClick:()=>n(null),children:[(0,O.jsx)(Ee,{size:13}),` `,r(`common.clear`)]}):null]}),t?(0,O.jsxs)(`div`,{className:`selected-entity`,children:[(0,O.jsx)(T,{size:15}),(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`strong`,{children:t.Title||`-`}),(0,O.jsx)(`span`,{className:`mono`,children:t.ID})]}),(0,O.jsx)(`span`,{children:We(t.Username)||Ke(t,r)})]}):null,(0,O.jsxs)(`div`,{className:`picker-search`,children:[(0,O.jsx)(D,{size:15}),(0,O.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),f())},placeholder:r(`picker.channelPlaceholder`)}),(0,O.jsx)(`button`,{className:`btn compact-btn`,type:`button`,onClick:f,disabled:c,children:c?(0,O.jsx)(ae,{size:14,className:`spin`}):r(`common.search`)})]}),u&&(0,O.jsx)(`div`,{className:`picker-error`,children:u}),(0,O.jsxs)(`div`,{className:`picker-results`,children:[o.map(e=>(0,O.jsxs)(`button`,{className:`picker-row ${t?.ID===e.ID?`selected`:``}`,type:`button`,onClick:()=>n(e),children:[(0,O.jsx)(`span`,{className:`mono`,children:e.ID}),(0,O.jsx)(`strong`,{children:e.Title||`-`}),(0,O.jsx)(`span`,{children:We(e.Username)||Ke(e,r)}),e.Verified?(0,O.jsx)(A,{tone:`good`,children:r(`picker.verified`)}):(0,O.jsx)(A,{children:Ke(e,r)})]},e.ID)),o.length===0&&!c?(0,O.jsx)(`div`,{className:`picker-empty`,children:r(`common.noResults`)}):null]})]})}function P({navigate:e}){let{t}=k(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(``),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(`100`),[u,d]=(0,g.useState)(null),[f,p]=(0,g.useState)(``);async function m(e=!1){if(p(``),!n){p(t(`messages.selectChannel`));return}let r=new URLSearchParams({channel_id:String(n.ID),limit:c});if(e&&u?.rows.length){let e=u.rows[u.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.ID)),a(String(e.Date)),s(String(e.ID))}else i&&r.set(`before_date`,i),o&&r.set(`before_id`,o);try{d(await x.groupMessages(r))}catch(e){p(b(e))}}function h(e){r(e),a(``),s(``),d(null)}let _=u?.rows??[];return(0,O.jsxs)(Ze,{title:t(`messages.groupTitle`),eyebrow:t(`messages.groupEyebrow`),children:[f&&(0,O.jsx)(tt,{children:f}),(0,O.jsxs)(Qe,{children:[(0,O.jsx)(`div`,{className:`message-selector-grid single`,children:(0,O.jsx)(xt,{label:t(`messages.channelGroup`),value:n,onChange:h})}),(0,O.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),m(!1)},children:[(0,O.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,O.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,O.jsx)(`input`,{className:`small-input`,value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,O.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,O.jsx)(D,{size:15}),` `,t(`messages.searchMessages`)]}),_.length?(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>m(!0),children:[(0,O.jsx)(ue,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,O.jsxs)(`div`,{className:`metric-row`,children:[(0,O.jsx)(j,{label:t(`messages.currentPage`),value:String(_.length)}),(0,O.jsx)(j,{label:t(`messages.mediaCount`),value:String(_.filter(e=>e.Media&&e.Media!==`{}`).length)}),(0,O.jsx)(j,{label:t(`messages.channelPosts`),value:String(_.filter(e=>e.Post).length)}),(0,O.jsx)(j,{label:t(`messages.channelGroup`),value:n?`${n.Title||Ke(n,t)} (${n.ID})`:`-`})]}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`common.messageId`)}),(0,O.jsx)(`th`,{children:t(`common.time`)}),(0,O.jsx)(`th`,{children:t(`common.sender`)}),(0,O.jsx)(`th`,{children:`From Peer`}),(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:t(`common.views`)}),(0,O.jsx)(`th`,{children:t(`common.status`)}),(0,O.jsx)(`th`,{children:t(`messages.body`)}),(0,O.jsx)(`th`,{})]})}),(0,O.jsxs)(`tbody`,{children:[_.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{className:`mono`,children:n.ID}),(0,O.jsx)(`td`,{children:Je(n.Date)}),(0,O.jsx)(`td`,{className:`mono`,children:n.SenderUserID}),(0,O.jsxs)(`td`,{className:`mono`,children:[n.FromPeerType,`:`,n.FromPeerID]}),(0,O.jsx)(`td`,{children:n.PTS}),(0,O.jsx)(`td`,{children:n.ViewsCount}),(0,O.jsx)(`td`,{children:n.Deleted?(0,O.jsx)(A,{tone:`danger`,children:t(`common.deleted`)}):n.Pinned?(0,O.jsx)(A,{tone:`warn`,children:t(`messages.pinned`)}):(0,O.jsx)(A,{children:t(`common.survived`)})}),(0,O.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,O.jsx)(`td`,{children:(0,O.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/groups/detail?channel_id=${n.ChannelID}&msg_id=${n.ID}`),children:[t(`common.detail`),` `,(0,O.jsx)(ue,{size:14})]})})]},`${n.ChannelID}-${n.ID}`)),_.length===0&&(0,O.jsx)(it,{colSpan:9})]})]})})]})}function St({ownerUserID:e,msgID:t,navigate:n}){let{t:r}=k(),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``);async function c(){s(``);try{a(await x.message(e,t))}catch(e){s(b(e))}}if((0,g.useEffect)(()=>{c()},[e,t]),o)return(0,O.jsx)(tt,{children:o});if(!i)return(0,O.jsx)(at,{label:r(`common.loading`)});let l=i.Message;return(0,O.jsx)(Ze,{title:r(`messages.privateDetailTitle`,{id:l.BoxID}),eyebrow:r(`messages.detailEyebrow`),actions:(0,O.jsxs)(`button`,{className:`btn icon-text`,onClick:()=>n(`/messages/private`),children:[(0,O.jsx)(se,{size:15}),` `,r(`messages.backPrivate`)]}),children:(0,O.jsx)($e,{main:(0,O.jsxs)(`div`,{className:`stacked-sections`,children:[(0,O.jsxs)(`section`,{className:`entity-head`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`div`,{className:`entity-title`,children:r(`messages.ownerPeerTitle`,{owner:l.OwnerUserID,peer:l.PeerID})}),(0,O.jsx)(`div`,{className:`entity-subtitle`,children:r(`messages.senderSubtitle`,{sender:l.FromUserID,date:Je(l.Date)})})]}),(0,O.jsxs)(`div`,{className:`entity-badges`,children:[l.Deleted?(0,O.jsx)(A,{tone:`danger`,children:r(`common.deleted`)}):(0,O.jsx)(A,{children:r(`common.survived`)}),(0,O.jsxs)(A,{children:[`pts `,l.PTS]}),(0,O.jsx)(A,{children:l.Outgoing?r(`messages.outgoing`):r(`messages.incoming`)})]})]}),(0,O.jsxs)(`div`,{className:`summary-grid`,children:[(0,O.jsx)(M,{label:r(`messages.boxID`),value:String(l.BoxID),mono:!0}),(0,O.jsx)(M,{label:r(`messages.privateMessageID`),value:String(l.PrivateMessageID),mono:!0}),(0,O.jsx)(M,{label:r(`messages.messageSender`),value:String(l.MessageSenderID),mono:!0}),(0,O.jsx)(M,{label:r(`common.time`),value:Je(l.Date)})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.messageBox`),text:r(`messages.messageBoxesSnapshot`)}),(0,O.jsx)(ot,{value:i.MessageJSON})]}),(0,O.jsxs)(`div`,{className:`raw-grid`,children:[(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.dialogRow`),text:r(`messages.dialogSnapshot`)}),(0,O.jsx)(ot,{value:i.DialogJSON})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.privateRow`),text:r(`messages.privateSnapshot`)}),(0,O.jsx)(ot,{value:i.PrivateJSON})]})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.userUpdateEvents`),text:r(`messages.userEventsSource`)}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:r(`common.count`)}),(0,O.jsx)(`th`,{children:r(`common.type`)}),(0,O.jsx)(`th`,{children:r(`common.time`)})]})}),(0,O.jsxs)(`tbody`,{children:[i.UpdateEvents.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:e.PTS}),(0,O.jsx)(`td`,{children:e.PTSCount}),(0,O.jsx)(`td`,{children:e.Type}),(0,O.jsx)(`td`,{children:Je(e.Date)})]},`${e.PTS}-${e.Type}`)),i.UpdateEvents.length===0&&(0,O.jsx)(it,{colSpan:4})]})]})})]}),(0,O.jsxs)(`section`,{className:`section-block`,children:[(0,O.jsx)(et,{title:r(`messages.dispatchOutbox`),text:r(`messages.outboxSource`)}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:`ID`}),(0,O.jsx)(`th`,{children:r(`account.userID`)}),(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:r(`common.type`)}),(0,O.jsx)(`th`,{children:r(`common.status`)}),(0,O.jsx)(`th`,{children:r(`messages.attempts`)}),(0,O.jsx)(`th`,{children:r(`common.updatedAt`)})]})}),(0,O.jsxs)(`tbody`,{children:[i.Outbox.map(e=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{children:e.ID}),(0,O.jsx)(`td`,{children:e.TargetUserID}),(0,O.jsx)(`td`,{children:e.PTS}),(0,O.jsx)(`td`,{children:e.EventType}),(0,O.jsx)(`td`,{children:e.Status}),(0,O.jsx)(`td`,{children:e.Attempts}),(0,O.jsx)(`td`,{children:qe(e.UpdatedAt)})]},e.ID)),i.Outbox.length===0&&(0,O.jsx)(it,{colSpan:7})]})]})})]})]}),side:(0,O.jsxs)(`section`,{className:`action-dock`,children:[(0,O.jsx)(`div`,{className:`dock-title`,children:r(`common.operations`)}),(0,O.jsx)(N,{label:r(`messages.deleteThis`),icon:(0,O.jsx)(we,{size:15}),path:`/api/actions/delete-messages`,payload:()=>({owner_user_id:l.OwnerUserID,peer_id:l.PeerID,ids:[l.BoxID],revoke:!0}),onDone:c})]})})})}function Ct({navigate:e}){let{t}=k(),[n,r]=(0,g.useState)(null),[i,a]=(0,g.useState)(null),[o,s]=(0,g.useState)(``),[c,l]=(0,g.useState)(``),[u,d]=(0,g.useState)(`100`),[f,p]=(0,g.useState)(``),[m,h]=(0,g.useState)(!0),[_,v]=(0,g.useState)(!1),[y,ee]=(0,g.useState)(``),[S,te]=(0,g.useState)(`1`),[C,w]=(0,g.useState)(null),[ne,re]=(0,g.useState)(``);async function ie(e=!1){if(re(``),!n||!i){re(t(`messages.selectPrivatePeers`));return}let r=new URLSearchParams({owner_user_id:String(n.ID),peer_id:String(i.ID),limit:u});if(e&&C?.rows.length){let e=C.rows[C.rows.length-1];r.set(`before_date`,String(e.Date)),r.set(`before_id`,String(e.BoxID)),s(String(e.Date)),l(String(e.BoxID))}else o&&r.set(`before_date`,o),c&&r.set(`before_id`,c);try{w(await x.messages(r))}catch(e){re(b(e))}}function ae(e){r(e),s(``),l(``),w(null)}function oe(e){a(e),s(``),l(``),w(null)}return(0,O.jsxs)(Ze,{title:t(`messages.privateTitle`),eyebrow:t(`messages.privateEyebrow`),children:[ne&&(0,O.jsx)(tt,{children:ne}),(0,O.jsxs)(Qe,{children:[(0,O.jsxs)(`div`,{className:`message-selector-grid`,children:[(0,O.jsx)(bt,{label:t(`messages.ownerUser`),value:n,onChange:ae}),(0,O.jsx)(bt,{label:t(`messages.peerUser`),value:i,onChange:oe})]}),(0,O.jsxs)(`form`,{className:`toolbar message-query`,onSubmit:e=>{e.preventDefault(),ie(!1)},children:[(0,O.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:t(`messages.beforeDatePlaceholder`)}),(0,O.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),placeholder:t(`messages.beforeIDPlaceholder`)}),(0,O.jsx)(`input`,{className:`small-input`,value:u,onChange:e=>d(e.target.value),placeholder:t(`messages.limitPlaceholder`)}),(0,O.jsxs)(`button`,{className:`btn primary icon-text`,type:`submit`,children:[(0,O.jsx)(D,{size:15}),` `,t(`messages.searchMessages`)]}),C?.rows.length?(0,O.jsxs)(`button`,{className:`btn icon-text`,type:`button`,onClick:()=>ie(!0),children:[(0,O.jsx)(ue,{size:15}),` `,t(`messages.nextPage`)]}):null]})]}),(0,O.jsxs)(`div`,{className:`metric-row`,children:[(0,O.jsx)(j,{label:t(`messages.currentPage`),value:String(C?.rows.length??0)}),(0,O.jsx)(j,{label:t(`messages.deleted`),value:String((C?.rows??[]).filter(e=>e.Deleted).length),tone:`danger`}),(0,O.jsx)(j,{label:t(`messages.outgoing`),value:String((C?.rows??[]).filter(e=>e.Outgoing).length)}),(0,O.jsx)(j,{label:t(`messages.ownerPeer`),value:n&&i?`${Ge(n)} / ${Ge(i)}`:`-`})]}),(0,O.jsxs)(`div`,{className:`operation-row`,children:[(0,O.jsxs)(`div`,{className:`operation-box`,children:[(0,O.jsxs)(`div`,{className:`operation-title`,children:[(0,O.jsx)(we,{size:15}),` `,t(`messages.deleteSelected`)]}),(0,O.jsx)(`input`,{value:f,onChange:e=>p(e.target.value),placeholder:t(`messages.idsPlaceholder`)}),(0,O.jsxs)(`label`,{className:`checkline`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,O.jsx)(N,{path:`/api/actions/delete-messages`,label:t(`messages.previewDelete`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,ids:Xe(f,t(`messages.msgIDsInvalid`)),revoke:m})})]}),(0,O.jsxs)(`div`,{className:`operation-box`,children:[(0,O.jsxs)(`div`,{className:`operation-title`,children:[(0,O.jsx)(pe,{size:15}),` `,t(`messages.clearHistory`)]}),(0,O.jsx)(`input`,{value:y,onChange:e=>ee(e.target.value),placeholder:t(`messages.maxIDPlaceholder`)}),(0,O.jsx)(`input`,{value:S,onChange:e=>te(e.target.value),placeholder:t(`messages.maxBatchesPlaceholder`)}),(0,O.jsxs)(`label`,{className:`checkline`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:m,onChange:e=>h(e.target.checked)}),` `,t(`messages.revoke`)]}),(0,O.jsxs)(`label`,{className:`checkline`,children:[(0,O.jsx)(`input`,{type:`checkbox`,checked:_,onChange:e=>v(e.target.checked)}),` `,t(`messages.justClear`)]}),(0,O.jsx)(N,{path:`/api/actions/delete-history`,label:t(`messages.previewClearHistory`),payload:()=>({owner_user_id:n?.ID??0,peer_id:i?.ID??0,max_id:Ye(y),max_batches:Ye(S),just_clear:_,revoke:m})})]})]}),(0,O.jsx)(`div`,{className:`table-wrap`,children:(0,O.jsxs)(`table`,{className:`data-table`,children:[(0,O.jsx)(`thead`,{children:(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`th`,{children:t(`common.messageId`)}),(0,O.jsx)(`th`,{children:t(`common.time`)}),(0,O.jsx)(`th`,{children:t(`common.sender`)}),(0,O.jsx)(`th`,{children:t(`messages.direction`)}),(0,O.jsx)(`th`,{children:`PTS`}),(0,O.jsx)(`th`,{children:t(`common.status`)}),(0,O.jsx)(`th`,{children:t(`messages.body`)}),(0,O.jsx)(`th`,{})]})}),(0,O.jsxs)(`tbody`,{children:[C?.rows.map(n=>(0,O.jsxs)(`tr`,{children:[(0,O.jsx)(`td`,{className:`mono`,children:n.BoxID}),(0,O.jsx)(`td`,{children:Je(n.Date)}),(0,O.jsx)(`td`,{className:`mono`,children:n.FromUserID}),(0,O.jsx)(`td`,{children:n.Outgoing?t(`messages.outgoing`):t(`messages.incoming`)}),(0,O.jsx)(`td`,{children:n.PTS}),(0,O.jsx)(`td`,{children:n.Deleted?(0,O.jsx)(A,{tone:`danger`,children:t(`common.deleted`)}):(0,O.jsx)(A,{children:t(`common.survived`)})}),(0,O.jsx)(`td`,{className:`truncate`,children:n.Body}),(0,O.jsx)(`td`,{children:(0,O.jsxs)(`button`,{className:`row-link`,onClick:()=>e(`/messages/private/detail?owner_user_id=${n.OwnerUserID}&msg_id=${n.BoxID}`),children:[t(`common.detail`),` `,(0,O.jsx)(ue,{size:14})]})})]},`${n.OwnerUserID}-${n.BoxID}`)),(!C||C.rows.length===0)&&(0,O.jsx)(it,{colSpan:8})]})]})})]})}function wt({route:e,navigate:t}){let n=e.path.match(/^\/accounts\/(\d+)$/)?.[1],r=e.path.match(/^\/channels\/(\d+)$/)?.[1];return n?(0,O.jsx)(ut,{id:Number(n),navigate:t}):r?(0,O.jsx)(ht,{id:Number(r),navigate:t}):e.path===`/accounts`?(0,O.jsx)(mt,{navigate:t}):e.path===`/channels`?(0,O.jsx)(gt,{navigate:t}):e.path===`/messages/detail`||e.path===`/messages/private/detail`?(0,O.jsx)(St,{ownerUserID:Number(e.search.get(`owner_user_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups/detail`?(0,O.jsx)(yt,{channelID:Number(e.search.get(`channel_id`)||`0`),msgID:Number(e.search.get(`msg_id`)||`0`),navigate:t}):e.path===`/messages/groups`?(0,O.jsx)(P,{navigate:t}):e.path===`/messages`||e.path===`/messages/private`?(0,O.jsx)(Ct,{navigate:t}):(0,O.jsx)(_t,{navigate:t})}function Tt(){let[e,t]=(0,g.useState)(void 0),[n,r]=(0,g.useState)(()=>Ie());(0,g.useEffect)(()=>{let e=()=>r(Ie());return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,g.useEffect)(()=>{x.session().then(e=>t(e.actor)).catch(e=>{if(e instanceof v&&e.status===401){t(null);return}t(null)})},[]);let i=e=>{window.history.pushState(null,``,e),r(Ie())};return e===void 0?(0,O.jsx)(Be,{}):e===null?(0,O.jsx)(st,{onLogin:t}):(0,O.jsx)(Ve,{actor:e,route:n,navigate:i,onLogout:()=>t(null),children:(0,O.jsx)(wt,{route:n,navigate:i})})}_.createRoot(document.getElementById(`root`)).render((0,O.jsx)(g.StrictMode,{children:(0,O.jsx)(je,{children:(0,O.jsx)(Tt,{})})})); \ No newline at end of file diff --git a/cmd/telesrv-admin/web/dist/index.html b/cmd/telesrv-admin/web/dist/index.html index 2dbae31b..c0fd45ce 100644 --- a/cmd/telesrv-admin/web/dist/index.html +++ b/cmd/telesrv-admin/web/dist/index.html @@ -4,7 +4,7 @@ telesrv admin - + diff --git a/cmd/telesrv-admin/web/src/i18n.tsx b/cmd/telesrv-admin/web/src/i18n.tsx index 5a876431..78771a53 100644 --- a/cmd/telesrv-admin/web/src/i18n.tsx +++ b/cmd/telesrv-admin/web/src/i18n.tsx @@ -127,15 +127,21 @@ const translations: Record> = { "account.waitingData": "Waiting for data", "account.noUsername": "No username", "account.noPhone": "No phone", - "account.sendFrozen": "Sending frozen", - "account.sendNormal": "Sending allowed", + "account.accountFrozen": "Account frozen", + "account.accountActive": "Account active", "account.authorizationsTitle": "Authorized Devices", "account.authorizationsCount": "{count} authorizations", "account.recentAdminOps": "Recent Admin Actions", "account.recent30Audit": "Last 30 audit rows", "account.actionDock": "Account Actions", - "account.freezeSend": "Freeze sending", - "account.unfreezeSend": "Unfreeze sending", + "account.freezeAccount": "Freeze account", + "account.updateFreeze": "Update freeze", + "account.unfreezeAccount": "Unfreeze account", + "account.freezeSince": "Frozen since", + "account.freezeUntil": "Appeal deadline", + "account.freezeUntilAria": "Freeze appeal deadline", + "account.freezeAppealURL": "Appeal URL", + "account.freezeAppealURLAria": "Freeze appeal URL", "account.premiumMonths": "Premium duration (months)", "account.premiumMonthsAria": "Set premium duration in months", "account.setPremium": "Set premium", @@ -392,15 +398,21 @@ const translations: Record> = { "account.waitingData": "等待数据", "account.noUsername": "无用户名", "account.noPhone": "无手机号", - "account.sendFrozen": "发消息冻结", - "account.sendNormal": "发送正常", + "account.accountFrozen": "账号已冻结", + "account.accountActive": "账号正常", "account.authorizationsTitle": "授权设备", "account.authorizationsCount": "共 {count} 个授权", "account.recentAdminOps": "最近后台操作", "account.recent30Audit": "最近 30 条审计", "account.actionDock": "账号操作", - "account.freezeSend": "冻结发消息", - "account.unfreezeSend": "解冻发消息", + "account.freezeAccount": "冻结账号", + "account.updateFreeze": "更新冻结信息", + "account.unfreezeAccount": "解冻账号", + "account.freezeSince": "冻结开始时间", + "account.freezeUntil": "申诉截止时间", + "account.freezeUntilAria": "账号冻结申诉截止时间", + "account.freezeAppealURL": "申诉链接", + "account.freezeAppealURLAria": "账号冻结申诉链接", "account.premiumMonths": "会员时长(月)", "account.premiumMonthsAria": "设置会员时长,单位月", "account.setPremium": "设置会员", diff --git a/cmd/telesrv-admin/web/src/pages/AccountDetailPage.tsx b/cmd/telesrv-admin/web/src/pages/AccountDetailPage.tsx index 65948fc7..b71d8028 100644 --- a/cmd/telesrv-admin/web/src/pages/AccountDetailPage.tsx +++ b/cmd/telesrv-admin/web/src/pages/AccountDetailPage.tsx @@ -16,12 +16,21 @@ export function AccountDetailPage({ id, navigate }: { id: number; navigate: Navi const [busy, setBusy] = useState(false); const [months, setMonths] = useState("1"); const [starsAmount, setStarsAmount] = useState("1000"); + const [freezeUntil, setFreezeUntil] = useState(() => toDateTimeLocal(new Date(Date.now() + 7 * 86400_000))); + const [freezeAppealURL, setFreezeAppealURL] = useState(""); async function load() { setBusy(true); setError(""); try { - setDetail(await api.account(id)); + const next = await api.account(id); + setDetail(next); + if (next.Restriction.Frozen) { + if (next.Restriction.Until) { + setFreezeUntil(toDateTimeLocal(new Date(next.Restriction.Until))); + } + setFreezeAppealURL(next.Restriction.AppealURL || ""); + } } catch (err) { setError(errorMessage(err)); } finally { @@ -58,7 +67,7 @@ export function AccountDetailPage({ id, navigate }: { id: number; navigate: Navi
{account.PremiumUntil > 0 ? {t("account.premium")} : {t("account.notPremium")}} {detail.Verified ? {t("common.verified")} : {t("account.notVerified")}} - {account.Frozen ? {t("account.sendFrozen")} : {t("account.sendNormal")}} + {account.Frozen ? {t("account.accountFrozen")} : {t("account.accountActive")}}
@@ -70,6 +79,9 @@ export function AccountDetailPage({ id, navigate }: { id: number; navigate: Navi + + +
{detail.About &&

{detail.About}

} @@ -86,13 +98,46 @@ export function AccountDetailPage({ id, navigate }: { id: number; navigate: Navi side={
{t("account.actionDock")}
+ + } - path="/api/actions/freeze-send" - payload={() => ({ user_id: account.ID, frozen: !account.Frozen })} + path="/api/actions/set-frozen" + payload={() => ({ + user_id: account.ID, + frozen: true, + freeze_until: new Date(freezeUntil).toISOString(), + freeze_appeal_url: freezeAppealURL.trim() + })} onDone={load} /> + {account.Frozen && ( + } + path="/api/actions/set-frozen" + payload={() => ({ user_id: account.ID, frozen: false })} + onDone={load} + /> + )}