krona-front/dist/assets/index-CrJKtV0u.js

45 lines
No EOL
769 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DynamicDashboard-BWfBzitG.js","assets/useToast-CS8pZhce.js","assets/dollar-sign-Bf6JneNn.js","assets/truck-D5o8mTsH.js","assets/utensils-BhILG_B7.js","assets/formatters-WvGQLZg0.js","assets/AreaChart-tvNE-d9G.js","assets/OperationsModule-DlDaJDmo.js","assets/building-BdUpGLM5.js","assets/phone-DpnQw4if.js","assets/user-CuEEaB8a.js","assets/mockData-DAqQG5te.js","assets/InventoryModule-VpTxuRuh.js","assets/useOrders-TRZWcao8.js","assets/currency-DdDs82F5.js","assets/useInventory-C7Fo8GE1.js","assets/SalesModule-Cf0nSO8B.js","assets/CrmModule-l7PoMLhA.js","assets/DynamicFormRenderer-0ioSXYKX.js","assets/types-DMl_5q2N.js","assets/file-text-DR21jZDS.js","assets/list-XDoRqfJ2.js","assets/star-B6hvSjuv.js","assets/upload-CY2IsfiN.js","assets/FinanceModule-D-3_6PUg.js","assets/EmployeesModule-70hl9DMi.js","assets/CommunicationsModule-gCjT_vNw.js","assets/HelpDeskModule-BIrYP26C.js","assets/TasksModule-D4E78liD.js","assets/link-DOg0dLYA.js","assets/CmsModule-DuJnf1QM.js","assets/arrow-down-CWbiHuZO.js","assets/arrow-up-B4Ca-HNG.js","assets/image-B_RO1I7c.js","assets/settings-2-CSojebrG.js","assets/MarketingModule-DyvYzuoi.js","assets/AnalyticsModule-xduYpRUy.js","assets/AutomationModule-DO2GmeS1.js","assets/AiCenterModule-BBao0YAQ.js","assets/AppsCatalogModule-rSx-Kisy.js","assets/types-CTcNpN0z.js","assets/SettingsModule-BbqUjWn1.js","assets/indexedDb-D30TbhA6.js","assets/EntityCatalog-CAg8Pzny.js","assets/panels-top-left-BomsDlf9.js","assets/table-_fqSCPRE.js","assets/FieldBuilder-CLdLCeVX.js","assets/fieldTypesMeta-BCSfJ-2N.js","assets/mail-DOD5KO1v.js","assets/eye-CkF1gwUX.js","assets/pen-D8SS70u3.js","assets/FormBuilder-d4z6JEl5.js","assets/move-up-qiRY8MuU.js","assets/save-D8euL60I.js","assets/CardLayoutBuilder-CiBozXyO.js","assets/ViewBuilder-zR702NRL.js","assets/arrow-up-down--M136cK3.js","assets/CustomEntityPage-B_J0Fvzq.js"])))=>i.map(i=>d[i]);
import{a as e,c as t,f as n,h as r,i,l as a,n as o,o as s,p as c,r as l,s as u,u as d}from"./useToast-CS8pZhce.js";import{n as f,t as p}from"./demo-D1nHL60J.js";import{S as m,b as h,c as g,f as _,g as v,h as y,i as b,l as x,m as S,n as C,o as w,p as T,r as E,s as D,t as O,u as k,v as ee,x as A,y as te}from"./indexedDb-D30TbhA6.js";(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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ne=c((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(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(e.unstable_now=void 0,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=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(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 x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),re=c(((e,t)=>{t.exports=ne()})),ie=c((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),ae=c(((e,t)=>{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=ie()})),oe=c((e=>{var t=re(),r=n(),i=ae();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),A=Symbol.for(`react.profiler`),te=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),ie=Symbol.for(`react.forward_ref`),oe=Symbol.for(`react.suspense`),se=Symbol.for(`react.suspense_list`),j=Symbol.for(`react.memo`),ce=Symbol.for(`react.lazy`),le=Symbol.for(`react.activity`),ue=Symbol.for(`react.legacy_hidden`),de=Symbol.for(`react.memo_cache_sentinel`),M=Symbol.for(`react.view_transition`),fe=Symbol.for(`react.recoverable`),pe=Symbol.iterator;function me(e){return typeof e!=`object`||!e?null:(e=pe&&e[pe]||e[`@@iterator`],typeof e==`function`?e:null)}var he=Symbol.for(`react.client.reference`);function N(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===he?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case A:return`Profiler`;case ee:return`StrictMode`;case oe:return`Suspense`;case se:return`SuspenseList`;case le:return`Activity`;case M:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case ne:return e.displayName||`Context`;case te:return(e._context.displayName||`Context`)+`.Consumer`;case ie:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case j:return t=e.displayName||null,t===null?N(e.type)||`Memo`:t;case ce:t=e._payload,e=e._init;try{return N(e(t))}catch{}}return null}var ge=Array.isArray,P=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ve=[],ye=-1;function I(e){return{current:e}}function L(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function be(e,t){ye++,ve[ye]=e.current,e.current=t}var xe=I(null),Se=I(null),Ce=I(null),we=I(null);function Te(e,t){switch(be(Ce,t),be(Se,e),be(xe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}L(xe),be(xe,e)}function Ee(){L(xe),L(Se),L(Ce)}function De(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,be(we,e)),t=xe.current;var n=dp(t,e.type);t!==n&&(be(Se,e),be(xe,n))}function Oe(e){Se.current===e&&(L(xe),L(Se)),we.current===e&&(L(we),sh._currentValue=_e)}var ke,Ae;function je(e){if(ke===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ke=t&&t[1]||``,Ae=-1<e.stack.indexOf(`
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+ke+e+Ae}var Me=!1;function Ne(e,t){if(!e||Me)return``;Me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?je(n):``}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je(`Lazy`);case 13:return e.child!==t&&t!==null?je(`Suspense Fallback`):je(`Suspense`);case 19:return je(`SuspenseList`);case 0:case 15:return Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return je(`Activity`);case 30:return je(`ViewTransition`);default:return``}}function Fe(e){try{var t=``,n=null;do t+=Pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function st(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-$e(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function xt(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[Ct])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=RegExp(`^[: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]*$`),Wt={},Gt={};function Kt(e){return Ie.call(Gt,e)?!0:Ie.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var R=!1;function qt(){var e=R;return R=!1,e}function Jt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Xt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Zt(s):e.removeAttribute(`name`)}function on(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Zt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ln(e,t,n){if(t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ge(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function pn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,R=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(pn(e,i,r),R=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(e){if(e.indexOf(`-`)===-1)return!1;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 gn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),_n=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[wt]||null;if(!i)throw Error(a(90));an(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Rd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var On=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Nn=i.slice(e,1<r?1-r:void 0)}function Fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function In(){return!0}function Ln(){return!1}function Rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?In:Ln,this.isPropagationStopped=Ln,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=T({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=T({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(T({},Kn,{dataTransfer:0})),Yn=Rn(T({},Vn,{relatedTarget:0})),Xn=Rn(T({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(T({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(T({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(T({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(T({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(T({},zn,{submitter:0})),sr=Rn(T({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(T({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(T({},Kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ur=Rn(T({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=qf(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Bf(e,0)}function kr(e){if(tn(Ft(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ie.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(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 Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=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=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(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`)}var Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(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}),$r&&Ur($r,r)||($r=r,r=qf(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Vt(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=yd.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Dd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Od)throw Od=0,kd=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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.refCleanup=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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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&1206910976,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.refCleanup=e.refCleanup,n}function Ii(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Li(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,xe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case le:return e=Ni(31,n,t,i),e.elementType=le,e.lanes=o,e;case k:return Ri(n.children,i,o,t);case ee:s=8,i|=24;break;case A:return e=Ni(12,n,t,i|2),e.elementType=A,e.lanes=o,e;case oe:return e=Ni(13,n,t,i),e.elementType=oe,e.lanes=o,e;case se:return e=Ni(19,n,t,i),e.elementType=se,e.lanes=o,e;case ue:case M:return e=i|32,e=Ni(30,n,t,e),e.elementType=M,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ne:s=10;break a;case te:s=9;break a;case ie:s=11;break a;case j:s=14;break a;case ce:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-$e(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,z=!1,oa=null,sa=!1,ca=Error(a(519));function la(e){throw ha(Ui(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),un(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||la(e,!0)}function da(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:ia=ia.return}}function fa(e){if(e!==ia)return!1;if(!z)return da(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&aa&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));aa=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));aa=dm(e)}else t===27?(t=aa,Sp(e.type)?(e=um,um=null,aa=e):aa=t):aa=ia?lm(e.stateNode.nextSibling):null;return!0}function pa(){aa=ia=null,z=!1}function ma(){var e=oa;return e!==null&&(X===null?X=e:X.push.apply(X,e),oa=null),e}function ha(e){oa===null?oa=[e]:oa.push(e)}var ga=I(null),_a=null,va=null;function ya(e,t,n){be(ga,t._currentValue),t._currentValue=n}function ba(e){e._currentValue=ga.current,L(ga)}function xa(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 Sa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),xa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),xa(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),xa(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Ca(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Hr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===we.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}i=i.return}return e!==null&&Sa(t,e,n,r),t.flags|=262144,e!==null}function wa(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ta(e){_a=e,va=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ea(e){return Oa(_a,e)}function Da(e,t){return _a===null&&Ta(e),Oa(e,t)}function Oa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},va===null){if(e===null)throw Error(a(308));va=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else va=va.next=t;return n}var ka=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Aa=t.unstable_scheduleCallback,ja=t.unstable_NormalPriority,Ma={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Na(){return{controller:new ka,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&Aa(ja,function(){e.controller.abort()})}function Fa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ia=null;function La(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ra=null,za=0,Ba=0,B=null;function Va(e,t){if(Ra===null){var n=Ra=[];za=0,Ba=Nf(),B={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return za++,t.then(Ha,Ha),t}function Ha(){if(--za===0&&(Ia=null,Ra!==null)){B!==null&&(B.status=`fulfilled`);var e=Ra;Ra=null,Ba=0,B=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Wa=P.S;P.S=function(e,t){if(md=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Ia!==null)for(var n=yf;n!==null;)Fa(n,Ia),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Fa(r,n),r=r.next;if(Ba!==0){r=Ia,r===null&&(r=Ia=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=I(null);function Ka(){var e=Ga.current;return e===null?td.pooledCache:e}function qa(e,t){t===null?be(Ga,Ga.current):be(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:Ma._currentValue,pool:e}}var Ya=Error(a(460)),Xa=Error(a(474)),Za=Error(a(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function eo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=td,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e}throw no=t,Ya}}function to(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(no=e,Ya):e}}var no=null;function ro(){if(no===null)throw Error(a(459));var e=no;return no=null,e}function io(e){if(e===Ya||e===Za)throw Error(a(483))}var ao=null,oo=0;function so(e){var t=oo;return oo+=1,ao===null&&(ao=[]),eo(ao,e,t)}function co(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function lo(e,t){throw t.$$typeof===E?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function uo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===k?(e=d(e,t,n.props.children,r,n.key),co(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===ce&&to(a)===t.type)?(t=i(t,n.props),co(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),co(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Vi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Ri(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Li(t.type,t.key,t.props,null,e.mode,n),co(n,t),n.return=e,n;case O:return t=Vi(t,e.mode,n),t.return=e,t;case ce:return t=to(t),f(e,t,n)}if(ge(t)||me(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,so(t),n);if(t.$$typeof===ne)return f(e,Da(e,t),n);lo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case ce:return n=to(n),p(e,t,n,r)}if(ge(n)||me(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,so(n),r);if(n.$$typeof===ne)return p(e,t,Da(e,n),r);lo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ce:return r=to(r),m(e,t,n,r,i)}if(ge(r)||me(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,so(r),i);if(r.$$typeof===ne)return m(e,t,n,Da(t,r),i);lo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&$i(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return z&&$i(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),z&&$i(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),z&&$i(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&$i(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),z&&$i(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),co(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ce&&to(l)===r.type){n(e,r.sibling),c=i(r,o.props),co(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ri(o.props.children,e.mode,c,o.key),co(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),co(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case ce:return o=to(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(me(o)){if(l=me(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,so(o),c);if(o.$$typeof===ne)return _(e,r,Da(e,o),c);lo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,G&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function yo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}function bo(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={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,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,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){var e=B;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!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&-536870913,p=f!==s.lane;if(p?(q&f)===f:(r&f)===f){f!==0&&f===Ba&&(xo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,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(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:mo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else 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;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),sd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=I(null),Do=I(0);function Oo(e,t){e=ad,be(Do,e),be(Eo,t),ad=e|t.baseLanes}function ko(){be(Do,ad),be(Eo,Eo.current)}function Ao(){ad=Do.current,L(Eo),L(Do)}var jo=I(null),Mo=null;function No(e){var t=e.alternate;be(Ro,Ro.current&1),be(jo,e),Mo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){be(Ro,Ro.current),be(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(be(Ro,Ro.current),be(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){be(Ro,Ro.current),be(jo,jo.current)}function Lo(e){L(jo),Mo===e&&(Mo=null),L(Ro)}var Ro=I(0);function zo(e,t){be(jo,jo.current),be(Ro,t)}function Bo(e){L(Ro),L(jo),Mo===e&&(Mo=null)}function Vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ho=0,V=null,H=null,Uo=null,Wo=!1,Go=!1,Ko=!1,qo=0,Jo=0,Yo=null,Xo=0;function Zo(){throw Error(a(321))}function Qo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function $o(e,t,n,r,i,a){return Ho=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?gc:_c,Ko=!1,a=n(r,i),Ko=!1,Go&&(a=ts(t,n,r,i)),es(e),a}function es(e){P.H=hc;var t=H!==null&&H.next!==null;if(Ho=0,Uo=H=V=null,Wo=!1,Jo=0,Yo=null,t)throw Error(a(300));e===null||Pc||(e=e.dependencies,e!==null&&wa(e)&&(Pc=!0))}function ts(e,t,n,r){V=e;var i=0;do{if(Go&&(Yo=null),Jo=0,Go=!1,25<=i)throw Error(a(301));if(i+=1,Uo=H=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=vc,o=t(n,r)}while(Go);return o}function ns(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?ls(t):t,e=e.useState()[0],(H===null?null:H.memoizedState)!==e&&(V.flags|=1024),t}function rs(){var e=qo!==0;return qo=0,e}function is(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function as(e){if(Wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wo=!1}Ho=0,Uo=H=V=null,Go=!1,Jo=qo=0,Yo=null}function os(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e,Uo}function ss(){if(H===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=H.next;var t=Uo===null?V.memoizedState:Uo.next;if(t!==null)Uo=t,H=e;else{if(e===null)throw V.alternate===null?Error(a(467)):Error(a(310));H=e,e={memoizedState:H.memoizedState,baseState:H.baseState,baseQueue:H.baseQueue,queue:H.queue,next:null},Uo===null?V.memoizedState=Uo=e:Uo=Uo.next=e}return Uo}function cs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ls(e){var t=Jo;return Jo+=1,Yo===null&&(Yo=[]),e=eo(Yo,e,t),t=V,(Uo===null?t.memoizedState:Uo.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?gc:_c),e}function us(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ls(e);if(e.$$typeof===fe)return;if(e.$$typeof===ne)return Ea(e)}throw Error(a(438,String(e)))}function ds(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=cs(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=de;return t.index++,n}function fs(e,t){return typeof t==`function`?t(e):t}function ps(e){return ms(ss(),H,e)}function ms(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ho&f)===f:(q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ba&&(d=!0);else if((Ho&p)===p){u=u.next,p===Ba&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,V.lanes|=p,sd|=p;f=u.action,Ko&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,V.lanes|=f,sd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(Pc=!0,d&&(n=B,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function hs(e){var t=ss(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Hr(o,t.memoizedState)||(Pc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function gs(e,t,n){var r=V,i=ss(),o=z;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Hr((H||i).memoizedState,n);if(s&&(i.memoizedState=n,Pc=!0),i=i.queue,Vs(ys.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Uo!==null&&!!(Uo.memoizedState.tag&1),Is(e?9:8,{destroy:void 0},vs.bind(null,r,i,n,t),null),e){if(r.flags|=2048,td===null)throw Error(a(349));o||Ho&127||_s(r,t,n)}return n}function _s(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=cs(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function vs(e,t,n,r){t.value=n,t.getSnapshot=r,bs(t)&&xs(e)}function ys(e,t,n){return n(function(){bs(t)&&xs(e)})}function bs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function xs(e){var t=Oi(e,2);t!==null&&Nd(t,e,2)}function Ss(e){var t=os();if(typeof e==`function`){var n=e;if(e=n(),Ko){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:e},t}function Cs(e,t,n,r){return e.baseState=n,ms(e,H,typeof r==`function`?r:fs)}function ws(e,t,n,r,i){if(fc(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ts(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ts(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};o.types=a===null?null:a.types,P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),Es(e,t,s)}catch(n){Os(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),Es(e,t,a)}catch(n){Os(e,t,n)}}function Es(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ds(e,t,n)},function(n){return Os(e,t,n)}):Ds(e,t,n)}function Ds(e,t,n){t.status=`fulfilled`,t.value=n,ks(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ts(e,n)))}function Os(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ks(t),t=t.next;while(t!==r)}e.action=null}function ks(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function As(e,t){return t}function js(e,t){if(z){var n=td.formState;if(n!==null){a:{var r=V;if(z){if(aa){b:{for(var i=aa,a=sa;i.nodeType!==8;){if(!a){i=null;break b}if(i=lm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=lm(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=os(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:As,lastRenderedState:t},n.queue=r,n=lc.bind(null,V,r),r.dispatch=n,r=Ss(!1),a=dc.bind(null,V,!1,r.queue),r=os(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ws.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ms(e){return Ns(ss(),H,e)}function Ns(e,t,n){if(t=ms(e,t,As)[0],e=ps(fs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ls(t)}catch(e){throw e===Ya?Za:e}else r=t;t=ss();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,Is(9,{destroy:void 0},Ps.bind(null,i,n),null)),[r,a,e]}function Ps(e,t){e.action=t}function Fs(e){var t=ss(),n=H;if(n!==null)return Ns(t,n,e);ss(),t=t.memoizedState,n=ss();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Is(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=cs(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ls(){return ss().memoizedState}function Rs(e,t,n,r){var i=os();V.flags|=e,i.memoizedState=Is(1|t,{destroy:void 0},n,r===void 0?null:r)}function zs(e,t,n,r){var i=ss();r=r===void 0?null:r;var a=i.memoizedState.inst;H!==null&&r!==null&&Qo(r,H.memoizedState.deps)?i.memoizedState=Is(t,a,n,r):(V.flags|=e,i.memoizedState=Is(1|t,a,n,r))}function Bs(e,t){Rs(8390656,8,e,t)}function Vs(e,t){zs(2048,8,e,t)}function Hs(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=cs(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Us(e){var t=ss().memoizedState;return Hs({ref:t,nextImpl:e}),function(){if(G&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Ws(e,t){return zs(4,2,e,t)}function Gs(e,t){return zs(4,4,e,t)}function Ks(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function qs(e,t,n){n=n==null?null:n.concat([e]),zs(4,4,Ks.bind(null,t,e),n)}function Js(){}function Ys(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Qo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Xs(e,t){var n=ss();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Qo(t,r[1]))return r[0];if(r=e(),Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function Zs(e,t,n){return n===void 0||Ho&1073741824&&!(q&261930)?e.memoizedState=t:(e.memoizedState=n,e=jd(),V.lanes|=e,sd|=e,n)}function Qs(e,t,n,r){return Hr(n,t)?n:Eo.current===null?!(Ho&106)||Ho&1073741824&&!(q&261930)?(Pc=!0,e.memoizedState=n):(e=jd(),V.lanes|=e,sd|=e,t):(e=Zs(e,n,r),Hr(e,t)||(Pc=!0),e)}function $s(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};s.types=o===null?null:o.types,P.T=s,dc(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?uc(e,t,Ua(c,r),Ad(e)):uc(e,t,r,Ad(e))}catch(n){uc(e,t,{then:function(){},status:`rejected`,reason:n},Ad())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ec(){}function tc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=nc(e).queue;$s(e,i,t,_e,n===null?ec:function(){return rc(e),n(r)})}function nc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function rc(e){var t=nc(e);t.next===null&&(t=e.alternate.memoizedState),uc(e,t.next.queue,{},Ad())}function ic(){return Ea(sh)}function ac(){return ss().memoizedState}function oc(){return ss().memoizedState}function sc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ad();e=_o(n);var r=vo(t,e,n);r!==null&&(Nd(r,t,n),yo(r,t,n)),t={cache:Na()},e.payload=t;return}t=t.return}}function cc(e,t,n){var r=Ad();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},fc(e)?pc(t,n):(n=Di(e,t,n,r),n!==null&&(Nd(n,e,r),mc(n,t,r)))}function lc(e,t,n){uc(e,t,n,Ad())}function uc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(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,Hr(s,o))return Ei(e,t,i,0),td===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Nd(n,e,r),mc(n,t,r),!0}return!1}function dc(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e)){if(t)throw Error(a(479))}else t=Di(e,n,r,2),t!==null&&Nd(t,e,2)}function fc(e){var t=e.alternate;return e===V||t!==null&&t===V}function pc(e,t){Go=Wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var hc={readContext:Ea,use:us,useCallback:Zo,useContext:Zo,useEffect:Zo,useImperativeHandle:Zo,useLayoutEffect:Zo,useInsertionEffect:Zo,useMemo:Zo,useReducer:Zo,useRef:Zo,useState:Zo,useDebugValue:Zo,useDeferredValue:Zo,useTransition:Zo,useSyncExternalStore:Zo,useId:Zo,useHostTransitionStatus:Zo,useFormState:Zo,useActionState:Zo,useOptimistic:Zo,useMemoCache:Zo,useCacheRefresh:Zo,useEffectEvent:Zo},gc={readContext:Ea,use:us,useCallback:function(e,t){return os().memoizedState=[e,t===void 0?null:t],e},useContext:Ea,useEffect:Bs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Rs(4194308,4,Ks.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){Rs(4,2,e,t)},useMemo:function(e,t){var n=os();t=t===void 0?null:t;var r=e();if(Ko){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=os();if(n!==void 0){var i=n(t);if(Ko){Qe(!0);try{n(t)}finally{Qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=cc.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=os();return e={current:e},t.memoizedState=e},useState:function(e){e=Ss(e);var t=e.queue,n=lc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Js,useDeferredValue:function(e,t){return Zs(os(),e,t)},useTransition:function(){var e=Ss(!1);return e=$s.bind(null,V,e.queue,!0,!1),os().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,i=os();if(z){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),td===null)throw Error(a(349));q&127||_s(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Bs(ys.bind(null,r,o,e),[e]),r.flags|=2048,Is(9,{destroy:void 0},vs.bind(null,r,o,n,t),null),n},useId:function(){var e=os(),t=td.identifierPrefix;if(z){var n=Qi,r=Zi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ic,useFormState:js,useActionState:js,useOptimistic:function(e){var t=os();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=dc.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:ds,useCacheRefresh:function(){return os().memoizedState=sc.bind(null,V)},useEffectEvent:function(e){var t=os(),n={impl:e};return t.memoizedState=n,function(){if(G&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},_c={readContext:Ea,use:us,useCallback:Ys,useContext:Ea,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:ps,useRef:Ls,useState:function(){return ps(fs)},useDebugValue:Js,useDeferredValue:function(e,t){return Qs(ss(),H.memoizedState,e,t)},useTransition:function(){var e=ps(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Ms,useActionState:Ms,useOptimistic:function(e,t){return Cs(ss(),H,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us},vc={readContext:Ea,use:us,useCallback:Ys,useContext:Ea,useEffect:Vs,useImperativeHandle:qs,useInsertionEffect:Ws,useLayoutEffect:Gs,useMemo:Xs,useReducer:hs,useRef:Ls,useState:function(){return hs(fs)},useDebugValue:Js,useDeferredValue:function(e,t){var n=ss();return H===null?Zs(n,e,t):Qs(n,H.memoizedState,e,t)},useTransition:function(){var e=hs(fs)[0],t=ss().memoizedState;return[typeof e==`boolean`?e:ls(e),t]},useSyncExternalStore:gs,useId:ac,useHostTransitionStatus:ic,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){var n=ss();return H===null?(n.baseState=e,[e,n.queue.dispatch]):Cs(n,H,e,t)},useMemoCache:ds,useCacheRefresh:oc,useEffectEvent:Us};function yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var bc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Nd(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ad(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(Nd(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ad(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(Nd(t,e,n),yo(t,e,n))}};function xc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ur(n,r)||!Ur(i,a):!0}function Sc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&bc.enqueueReplaceState(t,t.state,null)}function Cc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function wc(e){xi(e)}function Tc(e){console.error(e)}function Ec(e){xi(e)}function Dc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Oc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){return n=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Dc(e,t)},n}function Ac(e){return e=_o(e),e.tag=3,e}function jc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Oc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Oc(t,n,r),typeof i!=`function`&&(_d===null?_d=new Set([this]):_d.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Mc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ca(t,n,i,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?Gd():n.alternate===null&&od===0&&(od=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,i)),!1;case 22:return n.flags|=65536,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),pf(e,r,i)),!1}throw Error(a(435,n.tag))}return pf(e,r,i),Gd(),!1}if(z)return t=jo.current,t===null?(r!==ca&&(t=Error(a(423),{cause:r}),ha(Ui(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Ui(r,n),i=kc(e.stateNode,r,i),bo(e,i),od!==4&&(od=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ca&&(e=Error(a(422),{cause:r}),ha(Ui(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Ui(o,n),fd===null?fd=[o]:fd.push(o),od!==4&&(od=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=kc(n.stateNode,r,e),bo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(_d===null||!_d.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Ac(i),jc(i,e,n,r),bo(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Nc=Error(a(461)),Pc=!1;function Fc(e,t,n,r){t.child=e===null?po(t,null,n,r):fo(t,e.child,n,r)}function Ic(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ta(t),r=$o(e,t,n,o,a,i),s=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(z&&s&&ta(t),t.flags|=1,Fc(e,t,r,i),t.child)}function Lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Rc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!dl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return ul(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(Pc=!1,t.pendingProps=r=a,dl(e,i))e.flags&131072&&(Pc=!0);else return t.lanes=e.lanes,ul(e,t,i)}}return Kc(e,t,n,r,i)}function zc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Vc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Fo(t);else return r=t.lanes=536870912,Vc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),ko(),Io()):(qa(t,a.cachePool),Oo(t,a),Io(),t.memoizedState=null);return Fc(e,t,i,n),t.child}function Bc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Vc(e,t,n,r,i){var a=Ka();return a=a===null?null:{parent:Ma._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),ko(),Fo(t),e!==null&&Ca(e,t,r,!0),t.childLanes=i,null}function Hc(e,t){return t=tl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Uc(e,t,n){return fo(t,e.child,null,n),e=Hc(t,t.pendingProps),e.flags|=2,Lo(t),t.memoizedState=null,e}function Wc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=Hc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Bc(null,e);if(Po(t),(e=aa)?(e=am(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Po(t),i){if(t.flags&256)t.flags&=-257,t=Uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(Pc||Ca(e,t,n,!1),i=(n&e.childLanes)!==0,Pc||i){if(Eo.current===null){if(r=td,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Nd(r,e,s),Nc;Gd()}t=Uc(e,t,n)}else e=o.treeContext,aa=lm(s.nextSibling),ia=t,z=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=Hc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Kc(e,t,n,r,i){return Ta(t),n=$o(e,t,n,r,void 0,i),r=rs(),e!==null&&!Pc?(is(e,t,i),ul(e,t,i)):(z&&r&&ta(t),t.flags|=1,Fc(e,t,n,i),t.child)}function qc(e,t,n,r,i,a){return Ta(t),t.updateQueue=null,n=ts(t,r,n,i),es(e),r=rs(),e!==null&&!Pc?(is(e,t,a),ul(e,t,a)):(z&&r&&ta(t),t.flags|=1,Fc(e,t,n,a),t.child)}function Jc(e,t,n,r,i){if(Ta(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Ea(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=bc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Ea(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(yc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&bc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Cc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Ea(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Sc(t,a,r,o),mo=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||mo?(typeof d==`function`&&(yc(t,n,d,r),l=t.memoizedState),(c=mo||xc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,go(e,t),o=t.memoizedProps,u=Cc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Ea(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Sc(t,a,r,c),mo=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||mo||e!==null&&e.dependencies!==null&&wa(e.dependencies)?(typeof s==`function`&&(yc(t,n,s,r),p=t.memoizedState),(u=mo||xc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&wa(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=fo(t,e.child,null,i),t.child=fo(t,null,n,i)):Fc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ul(e,t,i),e}function Yc(e,t,n,r){return pa(),t.flags|=256,Fc(e,t,n,r),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:Ja()}}function Qc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=ud),e}function $c(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(z){if(i?No(t):Io(),(e=aa)?(e=am(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw la(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=tl({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Zc(n),r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(null,r)):(No(t),el(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return rl(e,t,a,o,r,c,s,n)}return i?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Bc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Zc(n):(a=i.cachePool,a===null?a=Ja():(s=Ma._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Qc(e,o,n),t.memoizedState=Xc,Bc(e.child,r)):(No(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function el(e,t){return t=tl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function tl(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function nl(e,t,n){return fo(t,e.child,null,n),e=el(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rl(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(No(t),t.flags&=-257,nl(e,t,c)):t.memoizedState===null?(Io(),o=i.fallback,s=t.mode,i=tl({mode:`visible`,children:i.children},s),o=Ri(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,fo(t,e.child,null,c),i=t.child,i.memoizedState=Zc(c),i.childLanes=Qc(e,r,c),t.memoizedState=Xc,Bc(null,i)):(Io(),t.child=e.child,t.flags|=128,null);if(No(t),sm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(a(419)),i.stack=``,i.digest=r,ha({value:i,source:null,stack:null})),nl(e,t,c)}if(Pc||Ca(e,t,c,!1),r=(c&e.childLanes)!==0,Pc||r){if(Eo.current!==null)return nl(e,t,c);if(r=td,r!==null&&(i=_t(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Oi(e,i),Nd(r,e,i),Nc;return om(o)||Gd(),nl(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=lm(o.nextSibling),ia=t,z=!0,oa=null,sa=!1,e!==null&&ra(t,e),t=el(t,i.children),t.flags|=134221824,t)}function il(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),xa(e.return,t,n)}function al(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(n)===null&&(t=e),e=e.sibling}return t}function ol(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function sl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function cl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(sl(e),Fc(e,t,r,n),sl(e)):Fc(e,t,r,n),r=z?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&il(e,n,t);else if(e.tag===19)il(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,sl(t)),ol(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ol(t,!0,n,null,a,r);break;case`together`:ol(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=al(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ol(t,!1,i,n,a,r)}return t.child}function ll(e,t,n){var r=t.pendingProps;return ya(t,t.type,r.value),Fc(e,t,r.children,n),t.child}function ul(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),sd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ca(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function dl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&wa(e)))}function fl(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),ya(t,Ma,e.memoizedState.cache),pa();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:ya(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Ca(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?$c(e,t,n):(No(t),e=ul(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return cl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return cl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,zc(e,t,n,t.pendingProps);case 24:ya(t,Ma,e.memoizedState.cache)}return ul(e,t,n)}function pl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Pc=!0;else{if(!dl(e,n)&&!(t.flags&128))return Pc=!1,fl(e,t,n);Pc=!!(e.flags&131072)}}else Pc=!1,z&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=to(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=Cc(e,r),t.tag=1,t=Jc(null,t,e,r,n)):(t.tag=0,t=Kc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===ie){t.tag=11,t=Ic(null,t,e,r,n);break a}if(i===j){t.tag=14,t=Lc(null,t,e,r,n);break a}if(i===ne){t.tag=10,t.type=e,t=ll(null,t,n);break a}}throw t=N(e)||e,Error(a(306,t,``))}}return t;case 0:return Kc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Cc(r,t.pendingProps),Jc(e,t,r,i,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,go(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ya(t,Ma,r),r!==o.cache&&Sa(t,[Ma],n,!0),So(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Yc(e,t,r,n);break a}if(r!==i){i=Ui(Error(a(424)),t),ha(i),t=Yc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(aa=lm(e.firstChild),ia=t,z=!0,oa=null,sa=!0,n=po(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===i){t=ul(e,t,n);break a}Fc(e,t,r,n)}t=t.child}return t;case 26:return Gc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(t.stateNode=fp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&z&&(r=t.stateNode=hm(t.type,t.pendingProps,Ce.current),ia=t,sa=!0,i=aa,Sp(t.type)?(um=i,aa=lm(r.firstChild)):aa=i),Fc(e,t,t.pendingProps.children,n),Gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((i=r=aa)&&(r=rm(r,t.type,t.pendingProps,sa),r===null?i=!1:(t.stateNode=r,ia=t,aa=lm(r.firstChild),sa=!1,i=!0)),i||la(t)),De(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(i,o)?r=null:s!==null&&pp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=$o(e,t,ns,null,null,n),sh._currentValue=i),Gc(e,t),Fc(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=aa)&&(n=im(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||la(t)),null;case 13:return $c(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):Fc(e,t,r,n),t.child;case 11:return Ic(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Gc(e,t),Fc(e,t,r,n),t.child;case 8:return Fc(e,t,t.pendingProps.children,n),t.child;case 12:return Fc(e,t,t.pendingProps.children,n),t.child;case 10:return ll(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Ta(t),i=Ea(i),r=r(i),t.flags|=1,Fc(e,t,r,n),t.child;case 14:return Lc(e,t,t.type,t.pendingProps,n);case 15:return Rc(e,t,t.type,t.pendingProps,n);case 19:return cl(e,t,n);case 31:return Wc(e,t,n);case 22:return zc(e,t,n,t.pendingProps);case 24:return Ta(t),r=Ea(Ma),e===null?(i=Ka(),i===null&&(i=td,o=Na(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},ho(t),ya(t,Ma,i)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,ya(t,Ma,r),r!==i.cache&&Sa(t,[Ma],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ya(t,Ma,r))),Fc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:z&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Gc(e,t),Fc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function ml(e){e.flags|=4}function hl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Hd())e.flags|=8192;else throw no=Qa,Xa}}else e.flags&=-16777217}function gl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Hd())e.flags|=8192;else throw no=Qa,Xa}}function _l(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,dd|=t)}function vl(e,t){if(!z)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function yl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function bl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yl(t),null;case 1:return yl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ba(Ma),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?ml(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ma())),yl(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(ml(t),o===null?(yl(t),hl(t,i,null,r,n)):(yl(t),gl(t,o))):o?o===e.memoizedState?(yl(t),t.flags&=-16777217):(ml(t),yl(t),gl(t,o)):(e=e.memoizedProps,e!==r&&ml(t),yl(t),hl(t,i,e,r,n)),null;case 27:if(Oe(t),n=Ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return yl(t),t.subtreeFlags&=-33554433,null}e=xe.current,fa(t)?ua(t,e):(e=hm(i,r,n),t.stateNode=e,ml(t))}return yl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return yl(t),t.subtreeFlags&=-33554433,null}if(o=xe.current,fa(t))ua(t,o);else{var s=lp(Ce.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Ct]=t,o[wt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(np(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&ml(t)}}return yl(t),t.subtreeFlags&=-33554433,hl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ml(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Ce.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ia,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||la(t,!0)}else e=lp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return yl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Ct]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),e=!1}else n=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(a(558))}return yl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Ct]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yl(t),i=!1}else i=ma(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),_l(t,t.updateQueue),yl(t),null);case 4:return Ee(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,yl(t),null;case 10:return ba(t.type),yl(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return yl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)vl(r,!1);else{if(od!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vo(e),o!==null){for(t.flags|=128,vl(r,!1),e=o.updateQueue,t.updateQueue=e,_l(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return zo(t,Ro.current&1|2),z&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>hd&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Vo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,_l(t,e),vl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!z)return yl(t),null}else 2*Ve()-r.renderingStartTime>hd&&n!==536870912&&(t.flags|=128,i=!0,vl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Ro.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||z?zo(t,o):(n=o,be(jo,t),be(Ro,n),Mo===null&&(Mo=t)),z&&$i(t,r.treeForkCount),e}return yl(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(yl(t),t.subtreeFlags&6&&(t.flags|=8192)):yl(t),n=t.updateQueue,n!==null&&_l(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&L(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ba(Ma),yl(t),null;case 25:return null;case 30:return t.flags|=33554432,yl(t),null}throw Error(a(156,t.tag))}function xl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ba(Ma),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(a(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return ba(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&L(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ba(Ma),null;case 25:return null;default:return null}}function Sl(e,t){switch(na(t),t.tag){case 3:ba(Ma),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ba(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&L(Ga);break;case 24:ba(Ma)}}function Cl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function wl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function U(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){Q(e,e.return,t)}}}function Tl(e,t,n){n.props=Cc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function El(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);p(e.child,!1,Qp,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Dl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}}function Ol(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)em(e.stateNode,t[n])}function kl(e){for(var t=e.return;t!==null&&(Ml(t)&&em(e.stateNode,t.stateNode),!jl(t));)t=t.return}function Al(e){for(var t=e.return;t!==null&&(Ml(t)&&tm(e.stateNode,t.stateNode),!jl(t));)t=t.return}function jl(e){return e.tag===5||e.tag===3||e.tag===27}function Ml(e){return e&&e.tag===7&&e.stateNode!==null}function Nl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Pl(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[wt]=t}catch(t){Q(e,e.return,t)}}function Fl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Il(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Fl(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.tag===27&&Sp(e.type)||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 Ll(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Ol(e,r),R=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ll(e,t,n,r),e=e.sibling;e!==null;)Ll(e,t,n,r),e=e.sibling}function Rl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ol(e,r),R=!0;else if(i!==4&&(i===27&&(Ol(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Rl(e,t,n,r),e=e.sibling;e!==null;)Rl(e,t,n,r),e=e.sibling}function zl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[Ct]=e,t[wt]=n}catch(t){Q(e,e.return,t)}}var Bl=!1,Vl=null;function Hl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Bl=!0)}var Ul=null;function Wl(){var e=Ul;return Ul=null,e}var Gl=0;function Kl(e,t,n,r,i){return Gl=0,ql(e.child,t,n,r,i)}function ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Bl=!0,Tp(o,Gl===0?t:t+`_`+Gl,n),Gl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Jl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Jl(e.child,t)),e=e.sibling}function Yl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Yl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Kl(e,n,t,null,!1)||Jl(e.child,!1))}e=e.sibling}}function Xl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Yl(e):Kl(e,i,a,null,!1)?(Yl(e),n.paired||t||Md(e,r.onEnter)):Jl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Xl(e,t),e=e.sibling;else Yl(e)}function Zl(e){if(Vl!==null&&Vl.size!==0){var t=Vl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Kl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Md(e,n.onShare)):Jl(e.child,!1)),t.delete(r),t.size===0)break}}}Zl(e)}e=e.sibling}}}function Ql(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Vl===null?void 0:Vl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Kl(e,n,i,null,!1)?r===void 0?Md(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Vl.delete(n),Md(e,t.onShare)):Jl(e.child,!1)),Vl!==null&&Zl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e),e=e.sibling;else Vl!==null&&Zl(e)}function $l(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Kl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&$l(e);e=e.sibling}}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Jl(e.child,!1))}eu(e)}e=e.sibling}}function tu(e){if(e.tag===30)e.stateNode.paired=null,Jl(e.child,!1),eu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e),e=e.sibling;else eu(e)}function nu(e){for(e=e.child;e!==null;)e.tag===30?Jl(e.child,!1):e.subtreeFlags&33554432&&nu(e),e=e.sibling}function ru(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Gl<a.length){var l=a[Gl],u=Op(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Tp(c,Gl===0?n:n+`_`+Gl,i),s&&e.flags&4||(Ul===null&&(Ul=[]),Ul.push(c,Gl===0?r:r+`_`+Gl,t.memoizedProps)),Gl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:ru(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function iu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Gl=0,i=ru(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Md(e,n.onUpdate))}else e.subtreeFlags&33554432&&iu(e,t);e=e.sibling}}var au=!1,W=!1,ou=!1,su=!1,cu=typeof WeakSet==`function`?WeakSet:Set,lu=null,uu=!1,du=!1,fu=!1,pu=!1;function mu(e,t,n){if(e=e.containerInfo,sp=gh,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||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===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,lu=t,t=n?9270:1024;lu!==null;){if(e=lu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Ql(r[a]);if(e.alternate===null&&e.flags&2)n&&Hl(e),hu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Ql(r),hu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Hl(e),hu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,lu=r):(n&&$l(e),hu(n))}}Vl=null}function hu(e){for(;lu!==null;){var t=lu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Cc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Q(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=bi(i.default,i.update),i!==`none`&&Kl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,lu=r;break}lu=t.return}}function gu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Iu(e,n),r&4&&Cl(5,n);break;case 1:if(Iu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Q(n,n.return,e)}else{var i=Cc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Q(n,n.return,e)}}}r&64&&U(n),r&512&&El(n,n.return);break;case 3:if(Iu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{To(e,t)}catch(e){Q(n,n.return,e)}}break;case 27:t===null&&r&4&&zl(n);case 26:case 5:Iu(e,n),t===null&&r&4&&Nl(n),r&512&&El(n,n.return);break;case 12:Iu(e,n);break;case 31:Iu(e,n),r&4&&Tu(e,n);break;case 13:Iu(e,n),r&4&&Eu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||au,!r){var a=t!==null&&t.memoizedState!==null||W;t=au,i=W,au=r,(W=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ru(e,n,r)):Iu(e,n),au=t,W=i}break;case 30:Iu(e,n),r&512&&El(n,n.return);break;case 7:r&512&&El(n,n.return);default:Iu(e,n)}}function _u(e,t){for(e=e.child;e!==null;)vu(e,t),e=e.sibling}function vu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Q(e,e.return,t)}yu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,R=!0}catch(t){Q(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){Q(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&_u(e,t);break;default:_u(e,t)}}function yu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:vu(n,r);break a;case 22:n.memoizedState===null&&yu(n,r);break a;default:yu(n,r)}}e=e.sibling}}function bu(e){var t=e.alternate;t!==null&&(e.alternate=null,bu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var xu=null,Su=!1;function Cu(e,t,n){for(n=n.child;n!==null;)wu(e,t,n),n=n.sibling}function wu(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:W||Dl(n,t),Cu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!W&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:W||Dl(n,t),Al(n);var r=xu,i=Su;Sp(n.type)&&(xu=n.stateNode,Su=!1),Cu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),xu=r,Su=i;break;case 5:W||Dl(n,t),Al(n);case 6:if(n.tag===6&&Al(n),r=xu,i=Su,xu=null,Cu(e,t,n),xu=r,Su=i,xu!==null){if(Su)try{(xu.nodeType===9?xu.body:xu.nodeName===`HTML`?xu.ownerDocument.body:xu).removeChild(n.stateNode),R=!0}catch(e){Q(n,t,e)}else try{xu.removeChild(n.stateNode),R=!0}catch(e){Q(n,t,e)}}break;case 18:xu!==null&&(Su?(e=xu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(xu,n.stateNode));break;case 4:r=xu,i=Su,xu=n.stateNode.containerInfo,Su=!0,Cu(e,t,n),xu=r,Su=i;break;case 0:case 11:case 14:case 15:wl(2,n,t),W||wl(4,n,t),Cu(e,t,n);break;case 1:W||(Dl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Tl(n,t,r)),Cu(e,t,n);break;case 21:Cu(e,t,n);break;case 22:W=(r=W)||n.memoizedState!==null,Cu(e,t,n),W=r;break;case 30:Dl(n,t),Cu(e,t,n);break;case 7:W||Dl(n,t),Cu(e,t,n);break;default:Cu(e,t,n)}}function Tu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){Q(t,t.return,e)}}}function Eu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){Q(t,t.return,e)}}function Du(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cu),t;default:throw Error(a(435,e.tag))}}function Ou(e,t){var n=Du(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function ku(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Sp(l.type)){xu=l.stateNode,Su=!1;break a}break;case 5:xu=l.stateNode,Su=!1;break a;case 3:case 4:xu=l.stateNode.containerInfo,Su=!0;break a}l=l.return}if(xu===null)throw Error(a(160));wu(s,c,o),xu=null,Su=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ju(t,e,n),t=t.sibling}var Au=null;function ju(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}ku(t,e,n),Mu(e),i&4&&(wl(3,e,e.return),Cl(3,e),wl(5,e,e.return));break;case 1:ku(t,e,n),Mu(e),i&512&&(W||r===null||Dl(r,r.return)),i&64&&au&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Au,ku(t,e,n),Mu(e),i&512&&(W||r===null||Dl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(au)e.stateNode=fp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),np(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Gm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=Gm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=i.createElement(t),np(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else au||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Pl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||W||t.parentNode.removeChild(t)):i.count--,n===null?au||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:ku(t,e,n),Mu(e),i&512&&(W||r===null||Dl(r,r.return)),r!==null&&i&4&&Pl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=ou,ou=!1,ku(t,e,n),ou=o,Mu(e),i&512&&(W||r===null||Dl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),R=!0}catch(t){Q(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Pl(e,t,r===null?t:r.memoizedProps)),i&1024&&(su=!0);break;case 6:if(ku(t,e,n),Mu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,R=!0}catch(t){Q(e,e.return,t)}}break;case 3:if(R=!1,Wm=null,o=Au,Au=bm(t.containerInfo),ku(t,e,n),Au=o,Mu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){Q(e,e.return,t)}su&&(su=!1,Nu(e)),R=!1;break;case 4:i=ou,ou=au,r=qt(),o=Au,Au=bm(e.stateNode.containerInfo),ku(t,e,n),Mu(e),Au=o,R&&du&&(fu=!0),R=r,ou=i;break;case 12:ku(t,e,n),Mu(e);break;case 31:ku(t,e,n),Mu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 13:ku(t,e,n),Mu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Z=Ve()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=au,l=W,u=ou;au=c||o,ou=u||o,W=l||s,ku(t,e,n),W=l,ou=u,au=c,Mu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||au||W||(t=s||W,n=au,r=W,au=o||au,W=t,Lu(e,2),au=n,W=r),!o&&ou||_u(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ou(e,n))));break;case 19:ku(t,e,n),Mu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ou(e,t)));break;case 30:i&512&&(W||r===null||Dl(r,r.return)),i=qt(),o=du,s=(n&335544064)===n,c=e.memoizedProps,du=s&&bi(c.default,c.update)!==`none`,ku(t,e,n),Mu(e),s&&r!==null&&R&&(e.flags|=4),du=o,R=i;break;case 21:break;case 7:i&512&&(W||r===null||Dl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:ku(t,e,n),Mu(e)}}function Mu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Fl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Ml(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(jl(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;Rl(e,Il(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Rl(e,Il(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ll(e,Il(e),u,s);break;default:throw Error(a(161))}}catch(t){Q(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Nu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Nu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function Pu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Fu(t,e),t=t.sibling;else iu(t,!1)}function Fu(e,t){var n=e.alternate;if(n===null)Xl(e,!1);else switch(e.tag){case 3:if(pu=uu=!1,Wl(),Pu(t,e),!uu&&!fu){if(e=Ul,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),pu=!0}Ul=null;break;case 5:Pu(t,e);break;case 4:r=uu,uu=!1,Pu(t,e),uu&&(fu=!0),uu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Pu(t,e):Xl(e,!1));break;case 30:r=uu,i=Wl(),uu=!1,Pu(t,e),uu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Gl=0,t=ru(e,n,t,o,s,a,!0),Gl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Md(e,e.memoizedProps.onUpdate),Ul=i):i!==null&&(i.push.apply(i,Ul),Ul=i),uu=e.flags&32?!0:r;break;default:Pu(t,e)}}function Iu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(e,t.alternate,t),t=t.sibling}function Lu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:wl(4,n,n.return),Lu(n,r);break;case 1:Dl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Tl(n,n.return,i),Lu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:Dl(n,n.return),n.tag!==5&&n.tag!==27||Al(n),Lu(n,r);break;case 6:Al(n);break;case 26:Dl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||W||i.parentNode.removeChild(i),Lu(n,r);break;case 22:n.memoizedState===null&&Lu(n,r);break;case 30:Dl(n,n.return),Lu(n,r);break;case 7:Dl(n,n.return);default:Lu(n,r)}e=e.sibling}}function Ru(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Ru(i,a,n),Cl(4,a);break;case 1:if(Ru(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Q(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)wo(l[i],c)}catch(e){Q(r,r.return,e)}}s&&o&64&&U(a),El(a,a.return);break;case 27:n&2&&zl(a);case 5:a.tag!==5&&a.tag!==27||kl(a),Ru(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 6:kl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||au||Km(bm(c.ownerDocument),a.type,c),Ru(i,a,n),s&&r===null&&o&4&&Nl(a),El(a,a.return);break;case 12:Ru(i,a,n);break;case 31:Ru(i,a,n),s&&o&4&&Tu(i,a);break;case 13:Ru(i,a,n),s&&o&4&&Eu(i,a);break;case 22:a.memoizedState===null&&Ru(i,a,n),El(a,a.return);break;case 30:Ru(i,a,n),El(a,a.return);break;case 7:El(a,a.return);default:Ru(i,a,n)}t=t.sibling}}function zu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Pa(n))}function Bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function Vu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Hu(e,t,n,r),t=t.sibling;else i&&nu(t)}function Hu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&tu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Vu(e,t,n,r),a&2048&&Cl(9,t);break;case 1:Vu(e,t,n,r);break;case 3:Vu(e,t,n,r),i&&pu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Pa(a)));break;case 12:if(a&2048){Vu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Q(t,t.return,e)}}else Vu(e,t,n,r);break;case 31:Vu(e,t,n,r);break;case 13:Vu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&tu(t),o._visibility&2?Vu(e,t,n,r):(o._visibility|=2,Uu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&tu(s),o._visibility&2?Vu(e,t,n,r):Wu(e,t)),a&2048&&zu(s,t);break;case 24:Vu(e,t,n,r),a&2048&&Bu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Jl(a.child,!0),Jl(t.child,!0))),Vu(e,t,n,r);break;default:Vu(e,t,n,r)}}function Uu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Uu(a,o,s,c,i),Cl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Uu(a,o,s,c,i)):u._visibility&2?Uu(a,o,s,c,i):Wu(a,o),i&&l&2048&&zu(o.alternate,o);break;case 24:Uu(a,o,s,c,i),i&&l&2048&&Bu(o.alternate,o);break;default:Uu(a,o,s,c,i)}t=t.sibling}}function Wu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Wu(n,r),i&2048&&zu(r.alternate,r);break;case 24:Wu(n,r),i&2048&&Bu(r.alternate,r);break;default:Wu(n,r)}t=t.sibling}}var Gu=8192;function Ku(e,t,n){if(e.subtreeFlags&Gu)for(e=e.child;e!==null;)qu(e,t,n),e=e.sibling}function qu(e,t,n){switch(e.tag){case 26:Ku(e,t,n),e.flags&Gu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Au,e.memoizedState,e.memoizedProps));break;case 5:Ku(e,t,n),e.flags&Gu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Au;Au=bm(e.stateNode.containerInfo),Ku(e,t,n),Au=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Gu,Gu=16777216,Ku(e,t,n),Gu=r):Ku(e,t,n));break;case 30:if((e.flags&Gu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Vl===null&&(Vl=new Map),Vl.set(r,i)}Ku(e,t,n);break;default:Ku(e,t,n)}}function Ju(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Yu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xu(e),e=e.sibling}function Xu(e){switch(e.tag){case 0:case 11:case 15:Yu(e),e.flags&2048&&wl(9,e,e.return);break;case 3:Yu(e);break;case 12:Yu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Zu(e)):Yu(e);break;default:Yu(e)}}function Zu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];lu=r,Qu(r,e)}Ju(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:wl(8,t,t.return),Zu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Zu(t));break;default:Zu(t)}e=e.sibling}}function Qu(e,t){for(;lu!==null;){var n=lu;switch(n.tag){case 0:case 11:case 15:wl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Pa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,lu=r;else a:for(n=e;lu!==null;){r=lu;var i=r.sibling,a=r.return;if(bu(r),r===n){lu=null;break a}if(i!==null){i.return=a,lu=i;break a}lu=a}}}var $u={getCacheForType:function(e){var t=Ea(Ma),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ea(Ma).controller.signal}},ed=typeof WeakMap==`function`?WeakMap:Map,G=0,td=null,K=null,q=0,J=0,Y=null,nd=!1,rd=!1,id=!1,ad=0,od=0,sd=0,cd=0,ld=0,ud=0,dd=0,fd=null,X=null,pd=!1,Z=0,md=0,hd=1/0,gd=null,_d=null,vd=0,yd=null,bd=null,xd=0,Sd=0,Cd=null,wd=null,Td=null,Ed=null,Dd=null,Od=0,kd=null;function Ad(){return G&2&&q!==0?q&-q:P.T===null?bt():Nf()}function jd(){if(ud===0){if(!(q&536870912)||z){var e=it;it<<=1,!(it&3932160)&&(it=262144),ud=e}else ud=536870912}return e=jo.current,e!==null&&(e.flags|=32),ud}function Md(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(vi(e.memoizedProps,n))),Ed===null&&(Ed=[]),Ed.push(t.bind(null,r))}}function Nd(e,t,n){(e===td&&(J===2||J===9)||e.cancelPendingCommit!==null)&&(Bd(e,0),Ld(e,q,ud,!1)),pt(e,n),(!(G&2)||e!==td)&&(e===td&&(!(G&2)&&(cd|=n),od===4&&Ld(e,q,ud,!1)),Tf(e))}function Pd(e,t,n){if(G&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),i=r?Jd(e,t):Kd(e,t,!0),o=r;do{if(i===0){rd&&!r&&Ld(e,t,0,!1);break}if(n=e.current.alternate,o&&!Id(n)){i=Kd(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=fd;var l=c.current.memoizedState.isDehydrated;if(l&&(Bd(c,s).flags|=256),s=Kd(c,s,!1),s!==2&&s!==6){if(id&&!l){c.errorRecoveryDisabledLanes|=o,cd|=o,i=4;break a}o=X,X=i,o!==null&&(X===null?X=o:X.push.apply(X,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){Bd(e,0),Ld(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ld(r,t,ud,!nd);break a;case 2:X=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=Z+300-Ve(),10<i)){if(Ld(r,t,ud,!nd),st(r,0,!0)!==0)break a;xd=t,r.timeoutHandle=gp(Fd.bind(null,r,n,X,gd,pd,t,ud,cd,dd,nd,o,`Throttled`,-0,0),i);break a}Fd(r,n,X,gd,pd,t,ud,cd,dd,nd,o,null,-0,0)}break}while(1);Tf(e)}function Fd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Vl=null,qu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Z-Ve():(a&4194048)===a?md-Ve():0,m=eh(d,m),m!==null)){xd=a,e.cancelPendingCommit=m(tf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ld(e,a,o,!l);return}tf(e,t,a,n,r,i,o,s,c,l,u,d)}function Id(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Hr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ld(e,t,n,r){t=lt(e,t),t&=~ld,t&=~cd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Rd(){return G&6?!0:(Ef(0,!1),!1)}function zd(){if(K!==null){if(J===0)var e=K.return;else e=K,va=_a=null,as(e),ao=null,oo=0,e=K;for(;e!==null;)Sl(e.alternate,e),e=e.return;K=null}}function Bd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),xd=0,zd(),td=e,K=n=Fi(e.current,null),q=t,J=0,Y=null,nd=!1,rd=ct(e,t),id=!1,dd=ud=ld=cd=sd=od=0,X=fd=null,pd=!1,ad=lt(e,t),Ti(),n}function Vd(e,t){V=null,P.H=hc,t===Ya||t===Za?(t=ro(),J=3):t===Xa?(t=ro(),J=4):J=t===Nc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Y=t,K===null&&(od=1,Dc(e,Ui(t,e.current)))}function Hd(){var e=jo.current;return e===null?!0:(q&4194048)===q?Mo===null:(q&62914560)===q||q&536870912?e===Mo:!1}function Ud(){var e=P.H;return P.H=hc,e===null?hc:e}function Wd(){var e=P.A;return P.A=$u,e}function Gd(){od=4,nd||(q&4194048)!==q&&jo.current!==null||(rd=!0),!(sd&134217727)&&!(cd&134217727)||td===null||Ld(td,q,ud,!1)}function Kd(e,t,n){var r=G;G|=2;var i=Ud(),a=Wd();(td!==e||q!==t)&&(gd=null,Bd(e,t)),t=!1;var o=od;a:do try{if(J!==0&&K!==null){var s=K,c=Y;switch(J){case 8:zd(),o=6;break a;case 3:case 2:case 9:case 6:jo.current===null&&(t=!0);var l=J;if(J=0,Y=null,Qd(e,s,c,l),n&&rd){o=0;break a}break;default:l=J,J=0,Y=null,Qd(e,s,c,l)}}qd(),o=od;break}catch(t){Vd(e,t)}while(1);return t&&e.shellSuspendCounter++,va=_a=null,G=r,P.H=i,P.A=a,K===null&&(td=null,q=0,Ti()),o}function qd(){for(;K!==null;)Xd(K)}function Jd(e,t){var n=G;G|=2;var r=Ud(),i=Wd();td!==e||q!==t?(gd=null,hd=Ve()+500,Bd(e,t)):rd=ct(e,t);a:do try{if(J!==0&&K!==null){t=K;var o=Y;b:switch(J){case 1:J=0,Y=null,Qd(e,t,o,1);break;case 2:case 9:if($a(o)){J=0,Y=null,Zd(t);break}t=function(){J!==2&&J!==9||td!==e||(J=7),Tf(e)},o.then(t,t);break a;case 3:J=7;break a;case 4:J=5;break a;case 7:$a(o)?(J=0,Y=null,Zd(t)):(J=0,Y=null,Qd(e,t,o,7));break;case 5:var s=null;switch(K.tag){case 26:s=K.memoizedState;case 5:case 27:var c=K;if(s?Ym(s):c.stateNode.complete){J=0,Y=null;var l=c.sibling;if(l!==null)K=l;else{var u=c.return;u===null?K=null:(K=u,$d(u))}break b}}J=0,Y=null,Qd(e,t,o,5);break;case 6:J=0,Y=null,Qd(e,t,o,6);break;case 8:zd(),od=6;break a;default:throw Error(a(462))}}Yd();break}catch(t){Vd(e,t)}while(1);return va=_a=null,P.H=r,P.A=i,G=n,K===null?(td=null,q=0,Ti(),od):0}function Yd(){for(;K!==null&&!ze();)Xd(K)}function Xd(e){var t=pl(e.alternate,e,ad);e.memoizedProps=e.pendingProps,t===null?$d(e):K=t}function Zd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=qc(n,t,t.pendingProps,t.type,void 0,q);break;case 11:t=qc(n,t,t.pendingProps,t.type.render,t.ref,q);break;case 5:as(t);var r=t;r===ia&&(z?(da(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(da(r),z=!0));default:Sl(n,t),t=K=Ii(t,ad),t=pl(n,t,ad)}e.memoizedProps=e.pendingProps,t===null?$d(e):K=t}function Qd(e,t,n,r){va=_a=null,as(t),ao=null,oo=0;var i=t.return;try{if(Mc(e,i,t,n,q)){od=1,Dc(e,Ui(n,e.current)),K=null;return}}catch(t){if(i!==null)throw K=i,t;od=1,Dc(e,Ui(n,e.current)),K=null;return}t.flags&32768?(z||r===1?e=!0:rd||q&536870912?e=!1:(nd=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.current,r!==null&&r.tag===13&&(r.flags|=16384))),ef(t,e)):$d(t)}function $d(e){var t=e;do{if(t.flags&32768){ef(t,nd);return}e=t.return;var n=bl(t.alternate,t,ad);if(n!==null){K=n;return}if(t=t.sibling,t!==null){K=t;return}K=t=e}while(t!==null);od===0&&(od=5)}function ef(e,t){do{var n=xl(e.alternate,e);if(n!==null){n.flags&=32767,K=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){K=e;return}K=e=n}while(e!==null);od=6,K=null}function tf(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do uf();while(vd!==0);if(G&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===td&&(K=td=null,q=0),bd=t,yd=e,xd=n,Cd=i,wd=r,nf(e,t,n,s,c,l,f)}}function nf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Sd=s,s|=wi,mt(e,n,s,r,i,a),Ed=null,(n&335544064)===n?(Dd=La(e),r=10262):(Dd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(Ge,function(){return df(),null})):(e.callbackNode=null,e.callbackPriority=0),Bl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,a=G,G|=4;try{mu(e,t,n)}finally{G=a,F.p=i,P.T=r}}vd=1,Bl?Td=Mp(o,e.containerInfo,Dd,of,sf,af,cf,df,rf,null,null):(of(),sf(),cf())}function rf(e){if(vd!==0){var t=yd.onRecoverableError;t(e,{componentStack:null})}}function af(){vd===3&&(vd=0,Fu(bd,yd),vd=4)}function of(){if(vd===1){vd=0;var e=yd,t=bd,n=xd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=P.T,P.T=null;var i=F.p;F.p=2;var a=G;G|=4;try{du=fu=!1,ju(t,e,n),n=cp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{G=a,F.p=i,P.T=r}}e.current=t,vd=2}}function sf(){if(vd===2){vd=0;var e=yd,t=bd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=G;G|=4;try{gu(e,t.alternate,t)}finally{G=i,F.p=r,P.T=n}}vd=3}}function cf(){if(vd===4||vd===3){vd=0;var e=Td;Td=null,Be();var t=yd,n=bd,r=xd,i=wd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?vd=5:(vd=0,bd=yd=null,lf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(_d=null),yt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=P.T,a=F.p,F.p=2,P.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{P.T=n,F.p=a}}if(i=Ed,o=Dd,Dd=null,i!==null&&(Ed=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);xd&3&&uf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===kd?Od++:(Od=0,kd=t):(Od=0,kd=null),Ef(0,!1)}}function lf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function uf(){return Td!==null&&(Td.skipTransition(),Td=null),of(),sf(),cf(),df()}function df(){if(vd!==5)return!1;var e=yd,t=Sd;Sd=0;var n=yt(xd),r=P.T,i=F.p;try{F.p=32>n?32:n,P.T=null,n=Cd,Cd=null;var o=yd,s=xd;if(vd=0,bd=yd=null,xd=0,G&6)throw Error(a(331));var c=G;if(G|=4,Xu(o.current),Hu(o,o.current,s,n),G=c,Ef(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{F.p=i,P.T=r,lf(e,t)}}function ff(e,t,n){t=Ui(n,t),t=kc(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(pt(e,2),Tf(e))}function Q(e,t,n){if(e.tag===3)ff(e,e,n);else for(;t!==null;){if(t.tag===3){ff(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(_d===null||!_d.has(r))){e=Ui(n,e),n=Ac(2),r=vo(t,n,2),r!==null&&(jc(n,r,t,e),pt(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ed;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(id=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,td===e&&(q&n)===n&&(od===4||od===3&&(q&62914560)===q&&300>Ve()-Z?G&2?ld|=n:Bd(e,0):ld|=n,dd===q&&(dd=0)),Tf(e)}function hf(e,t){t===0&&(t=dt()),e=Oi(e,t),e!==null&&(pt(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),hf(e,n)}function vf(e,t){return Le(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=q,a=st(r,r===td?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Ve(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}vd!==0&&vd!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=td,n=q,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(J===2||J===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),yt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Af.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(vd!==0&&vd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uf()&&e.callbackNode!==n)return null;var r=q;return r=st(e,e===td?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Pd(e,r,t),kf(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(uf())return null;Pd(e,t,!0)}function Mf(){bp(function(){G&6?Le(Ue,Df):Of()})}function Nf(){if(wf===0){var e=Ba;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);tc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),tc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<hi.length;If++){var Lf=hi[If];gi(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,zt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!kn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Gf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=Nt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}En(function(){var r=a,i=xn(n),o=[];a:{var c=mi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case si:case ci:case li:l=Xn;break;case pi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Dn(m,p),g!=null&&d.push(Kf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,Jf):null,c!==null&&Yf(o,u,c,d,!1),l!==null&&f!==null&&Yf(o,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(o,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(o,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=qf(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Ff(o,e,r,n,i)}Bf(o,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Dn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Dn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&ep(e,t,`name`,i.name,i,null),ep(e,t,`formEncType`,i.formEncType,i,null),ep(e,t,`formMethod`,i.formMethod,i,null),ep(e,t,`formTarget`,i.formTarget,i,null)):(ep(e,t,`encType`,i.encType,i,null),ep(e,t,`method`,i.method,i,null),ep(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=vn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:$(`beforetoggle`,e),$(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function tp(e,t,n,r,i,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,o,s,n,null)}}i&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:ep(e,t,r,d,n,null)}}on(e,o,c,l,u,s,i,!1);return;case`select`:for(i in $(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:ep(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in $(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:ep(e,t,s,c,n,null)}un(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:ep(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||ep(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(R=!0),o=m;break;case`name`:m!==f&&(R=!0),i=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),s=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||ep(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(R=!0),p=o;break;case`defaultValue`:o!==l&&(R=!0),c=o;break;case`multiple`:o!==l&&(R=!0),s=o;default:o!==l&&ep(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:ep(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(R=!0),p=i;break;case`defaultValue`:i!==o&&(R=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&ep(e,t,s,i,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:ep(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&ep(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:ep(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&ap(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&ap(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function dp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function fp(e,t,n,r){return n=lp(n).createElement(e),n[Ct]=r,n[wt]=t,np(n,e,t),Lt(n),n}function pp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Tp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ep(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Dp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ap(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Bp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=v(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=lp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function Zp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),Zp(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=v(i),Zp(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=v(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:nm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function pm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var vm=new Map,ym=new Set;function bm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var xm=F.d;F.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Rd();return e||t}function Cm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?rc(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=It(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);Lt(c),np(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=It(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),Lt(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var i=(i=Ce.current)?bm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Pm(n.href),t=It(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Pm(n.href);var o=It(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},vm.set(e,o)),Lm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Rm(n),t=It(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Pm(e){return`href="`+rn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),np(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Rm(e){return`[src="`+rn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),np(r,`style`,i),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Pm(n.href);var o=e.querySelector(Fm(i));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Im(n),(i=vm.get(i))&&Hm(r,i),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(i=e.querySelector(zm(o)))?(t.instance=i,Lt(i),i):(r=n,(i=vm.get(o))&&(r=T({},n),Um(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Lt(i),np(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Vm(r,n.precedence,e));return t.instance}function Vm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[Ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=nh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var sh={$$typeof:ne,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function ch(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function uh(e){return e?(e=ji,e):ji}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(Nd(n,e,t),yo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Nd(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=Ad();t=vt(t);var n=Oi(e,t);n!==null&&Nd(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,yh(e,t,n,r)}finally{F.p=a,P.T=i}}function vh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,yh(e,t,n,r)}finally{F.p=a,P.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(G&6)&&(hd=Ve()+500,Ef(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Nd(s,a,2),Rd(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=xn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Nt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return xh=e,null}function Ch(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Nt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,xt(e.priority,function(){hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Sh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,tc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;dh(n,Ad(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Rd(),t[Tt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=r.version;if(Kh!==`19.3.0`)throw Error(a(527,Kh,`19.3.0`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Xe=Jh.inject(qh),Ze=Jh}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=wc,s=Tc,c=Ec;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=lh(e,1,!1,null,null,n,r,null,i,s,c,Uh),e[Tt]=t.current,Uf(e),new Wh(t)}})),se=c(((e,t)=>{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=oe()})),j=r(n(),1),ce=se(),le=`modulepreload`,ue=function(e){return`/`+e},de={},M=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=ue(t,n),t=s(t),t in de)return;de[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:le,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},fe=e=>{throw TypeError(e)},pe=(e,t,n)=>t.has(e)||fe(`Cannot `+n),me=(e,t,n)=>(pe(e,t,`read from private field`),n?n.call(e):t.get(e)),he=(e,t,n)=>t.has(e)?fe(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),N=(e,t,n,r)=>(pe(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),ge=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,P=/^[\\/]{2}/;function F(e,t){return t+e.replace(/\\/g,`/`)}var _e=`popstate`;function ve(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function ye(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Se(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Ce(t)}return Te(t,n,null,e)}function I(e,t){if(e===!1||e==null)throw Error(t)}function L(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function be(){return Math.random().toString(36).substring(2,10)}function xe(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Se(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?we(t):t,state:n,key:t&&t.key||r||be(),mask:i}}function Ce({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function we(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function Te(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ve(e)?e:Se(h.location,e,t);n&&n(r,e),l=u()+1;let d=xe(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ve(e)?e:Se(h.location,e,t);n&&n(r,e),l=u();let i=xe(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ee(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(_e,d),c=e,()=>{i.removeEventListener(_e,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ee(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),I(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:Ce(t);return i=i.replace(/ $/,`%20`),!n&&P.test(i)&&(i=r+i),new URL(i,r)}var De,Oe=class{constructor(e){if(he(this,De,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(me(this,De).has(e))return me(this,De).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw Error(`No value found for context`)}set(e,t){me(this,De).set(e,t)}};De=new WeakMap;var ke=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`children`]);function Ae(e){return ke.has(e)}var je=new Set([`lazy`,`caseSensitive`,`path`,`id`,`index`,`middleware`,`children`]);function Me(e){return je.has(e)}function Ne(e){return e.index===!0}function Pe(e,t,n=[],r={},i=!1){return e.map((e,a)=>{let o=[...n,String(a)],s=typeof e.id==`string`?e.id:o.join(`-`);if(I(e.index!==!0||!e.children,`Cannot specify children on an index route`),I(i||!r[s],`Found a route id collision on id "${s}". Route id's must be globally unique within Data Router usages`),Ne(e)){let n={...e,id:s};return r[s]=Fe(n,t(n)),n}{let n={...e,id:s,children:void 0};return r[s]=Fe(n,t(n)),e.children&&(n.children=Pe(e.children,t,o,r,i)),n}})}function Fe(e,t){return Object.assign(e,{...t,...typeof t.lazy==`object`&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ie(e,t,n=`/`){return Le(e,t,n,!1)}function Le(e,t,n,r,i){let a=rt((typeof t==`string`?we(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ze(e),s=null,c=nt(a);for(let e=0;s==null&&e<o.length;++e)s=Qe(o[e],c,r);return s}function Re(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ze(e){let t=Be(e);return He(t),t}function Be(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;I(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=pt([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(I(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Be(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Xe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=tt(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Ve(e.path))a(e,t,!0,n)}),t}function Ve(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Ve(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function He(e){e.sort((e,t)=>e.score===t.score?Ze(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Ue=/^:[\w-]+$/,We=3,Ge=2,Ke=1,qe=10,Je=-2,Ye=e=>e===`*`;function Xe(e,t){let n=e.split(`/`),r=n.length;return n.some(Ye)&&(r+=Je),t&&(r+=Ge),n.filter(e=>!Ye(e)).reduce((e,t)=>e+(Ue.test(t)?We:t===``?Ke:qe),r)}function Ze(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Qe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?et(u,l,s.matcher,s.compiledParams):$e(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=$e({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:pt([a,d.pathname]),pathnameBase:ht(pt([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=pt([a,d.pathnameBase]))}return o}function $e(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=tt(e.path,e.caseSensitive,e.end);return et(e,t,n,r)}function et(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=mt(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=mt(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function tt(e,t=!1,n=!0){L(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function nt(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return L(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function rt(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function it({basename:e,pathname:t}){return t===`/`?e:pt([e,t])}var at=e=>ge.test(e);function ot(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?we(e):e,a;return n?(n=ft(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?st(n.substring(1),`/`):st(n,t)):a=t,{pathname:a,search:gt(r),hash:_t(i)}}function st(e,t){let n=mt(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ct(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function lt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function ut(e){let t=lt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function dt(e,t,n,r=!1){let i;typeof e==`string`?i=we(e):(i={...e},I(!i.pathname||!i.pathname.includes(`?`),ct(`?`,`pathname`,`search`,i)),I(!i.pathname||!i.pathname.includes(`#`),ct(`#`,`pathname`,`hash`,i)),I(!i.search||!i.search.includes(`#`),ct(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=ot(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var ft=e=>e.replace(/[\\/]{2,}/g,`/`),pt=e=>ft(e.join(`/`));function mt(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var ht=e=>mt(e).replace(/^\/*/,`/`),gt=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,_t=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,vt=[`EvalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],yt=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function bt(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function xt(e){return pt(e.map(e=>e.route.path).filter(Boolean))||`/`}var St=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ct(e,t){let n=e;if(typeof n!=`string`||!ge.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(St)try{let e=new URL(window.location.href),r=P.test(n)?new URL(F(n,e.protocol)):new URL(n),a=rt(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{L(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}var wt=Symbol(`Uninstrumented`);function Tt(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(e=>e({id:t.id,index:t.index,path:t.path,instrument(e){let t=Object.keys(n);for(let r of t)e[r]&&n[r].push(e[r])}}));let r={};if(typeof t.lazy==`function`&&n.lazy.length>0){let e=Dt(n.lazy,t.lazy,()=>void 0);e&&(r.lazy=e)}if(typeof t.lazy==`object`){let e=t.lazy;[`middleware`,`loader`,`action`].forEach(t=>{let i=e[t],a=n[`lazy.${t}`];if(typeof i==`function`&&a.length>0){let e=Dt(a,i,()=>void 0);e&&(r.lazy=Object.assign(r.lazy||{},{[t]:e}))}})}return[`loader`,`action`].forEach(e=>{let i=t[e];if(typeof i==`function`&&n[e].length>0){let t=i[wt]??i,a=Dt(n[e],t,(...e)=>kt(e[0]));a&&(e===`loader`&&t.hydrate===!0&&(a.hydrate=!0),a[wt]=t,r[e]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(e=>{let t=e[wt]??e,r=Dt(n.middleware,t,(...e)=>kt(e[0]));return r?(r[wt]=t,r):e})),r}function Et(e,t){let n={navigate:[],fetch:[]};if(t.forEach(e=>e({instrument(e){let t=Object.keys(e);for(let r of t)e[r]&&n[r].push(e[r])}})),n.navigate.length>0){let t=e.navigate[wt]??e.navigate,r=Dt(n.navigate,t,(...t)=>{let[n,r]=t;return{to:typeof n==`number`||typeof n==`string`?n:n?Ce(n):`.`,...At(e,r??{})}});r&&(r[wt]=t,e.navigate=r)}if(n.fetch.length>0){let t=e.fetch[wt]??e.fetch,r=Dt(n.fetch,t,(...t)=>{let[n,,r,i]=t;return{href:r??`.`,fetcherKey:n,...At(e,i??{})}});r&&(r[wt]=t,e.fetch=r)}return e}function Dt(e,t,n){return e.length===0?null:async(...r)=>{let i=await Ot(e,n(...r),()=>t(...r),e.length-1);if(i.type===`error`)throw i.value;return i.value}}async function Ot(e,t,n,r){let i=e[r],a;if(i){let o,s=async()=>(o?console.error(`You cannot call instrumented handlers more than once`):o=Ot(e,t,n,r-1),a=await o,I(a,`Expected a result`),a.type===`error`&&a.value instanceof Error?{status:`error`,error:a.value}:{status:`success`,error:void 0});try{await i(s,t)}catch(e){console.error(`An instrumentation function threw an error:`,e)}o||await s(),await o}else try{a={type:`success`,value:await n()}}catch(e){a={type:`error`,value:e}}return a||{type:`error`,value:Error(`No result assigned in instrumentation chain.`)}}function kt(e){let{request:t,context:n,params:r,pattern:i}=e;return{request:jt(t),params:{...r},pattern:i,context:Mt(n)}}function At(e,t){return{currentUrl:Ce(e.state.location),...`formMethod`in t?{formMethod:t.formMethod}:{},...`formEncType`in t?{formEncType:t.formEncType}:{},...`formData`in t?{formData:t.formData}:{},...`body`in t?{body:t.body}:{}}}function jt(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Mt(e){if(Pt(e)){let t={...e};return Object.freeze(t),t}return{get:t=>e.get(t)}}var Nt=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Pt(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Nt}var Ft=new URL(`http://localhost`);function It(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),Ft)}catch{return Ft}}function Lt(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Rt(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function zt(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Lt(i,n),s=!Lt(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Rt(e,i)||!Lt(i,a)))throw Error(`External navigation is not allowed`)}var Bt=[`POST`,`PUT`,`PATCH`,`DELETE`],Vt=new Set(Bt),Ht=[`GET`,...Bt],Ut=new Set(Ht),Wt=new Set([301,302,303,307,308]),Gt=new Set([307,308]),Kt={state:`idle`,location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},R={state:`idle`,data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},qt={state:`unblocked`,proceed:void 0,reset:void 0,location:void 0},Jt=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Yt=`remix-router-transitions`,Xt=Symbol(`ResetLoaderData`),Zt,Qt,$t,en,tn=class{constructor(e){he(this,Zt),he(this,Qt),he(this,$t),he(this,en),N(this,Zt,e),N(this,Qt,ze(e))}get stableRoutes(){return me(this,Zt)}get activeRoutes(){return me(this,$t)??me(this,Zt)}get branches(){return me(this,en)??me(this,Qt)}get hasHMRRoutes(){return me(this,$t)!=null}setRoutes(e){N(this,Zt,e),N(this,Qt,ze(e))}setHmrRoutes(e){N(this,$t,e),N(this,en,ze(e))}commitHmrRoutes(){me(this,$t)&&(N(this,Zt,me(this,$t)),N(this,Qt,me(this,en)),N(this,$t,void 0),N(this,en,void 0))}};Zt=new WeakMap,Qt=new WeakMap,$t=new WeakMap,en=new WeakMap;function nn(e){let t=e.window?e.window:typeof window<`u`?window:void 0,n=t!==void 0&&t.document!==void 0&&t.document.createElement!==void 0;I(e.routes.length>0,`You must provide a non-empty routes array to createRouter`);let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||Jt,a=i;if(e.instrumentations){let t=e.instrumentations;a=e=>({...i(e),...Tt(t.map(e=>e.route).filter(Boolean),e)})}let o={},s=new tn(Pe(e.routes,a,void 0,o)),c=e.basename||`/`;c.startsWith(`/`)||(c=`/${c}`);let l=e.dataStrategy||bn,u={...e.future},d=null,f=new Set,p=null,m=null,h=null,g=null,_=e.hydrationData!=null,v=Le(s.activeRoutes,e.history.location,c,!1,s.branches),y=!1,b=null,x,S;if(v==null&&!e.patchRoutesOnNavigation){let t=Gn(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=Wn(s.activeRoutes);x=!0,S=!x,v=n,b={[r.id]:t}}else if(v&&!e.hydrationData&&it(v,s.activeRoutes,e.history.location.pathname).active&&(v=null),!v){x=!1,S=!x,v=[];let t=it(null,s.activeRoutes,e.history.location.pathname);t.active&&t.matches&&(y=!0,v=t.matches)}else if(v.some(e=>e.route.lazy))x=!1,S=!x;else if(!v.some(e=>cn(e.route)))x=!0,S=!x;else{let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=v;if(n){let e=v.findIndex(e=>n[e.route.id]!==void 0);r=r.slice(0,e+1)}S=!1,x=!0,r.forEach(e=>{let r=ln(e.route,t,n);S||=r.renderFallback,x&&=!r.shouldLoad})}let C,w={historyAction:e.history.action,location:e.history.location,matches:v,initialized:x,renderFallback:S,navigation:Kt,restoreScrollPosition:e.hydrationData==null&&null,preventScrollReset:!1,revalidation:`idle`,loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||b,fetchers:new Map,blockers:new Map},T=`POP`,E=null,D=!1,O,k=!1,ee=new Map,A=null,te=!1,ne=!1,re=new Set,ie=new Map,ae=0,oe=-1,se=new Map,j=new Set,ce=new Map,le=new Map,ue=new Set,de=new Map,M,fe=null;function pe(){if(d=e.history.listen(({action:t,location:n,delta:r})=>{if(M){M(),M=void 0;return}L(de.size===0||r!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let i=Ze({currentLocation:w.location,nextLocation:n,historyAction:t});if(i&&r!=null){let t=new Promise(e=>{M=e});e.history.go(r*-1),Xe(i,{state:`blocked`,location:n,proceed(){Xe(i,{state:`proceeding`,proceed:void 0,reset:void 0,location:n}),t.then(()=>e.history.go(r))},reset(){let e=new Map(w.blockers);e.set(i,qt),N({blockers:e})}}),E?.resolve(),E=null;return}return ve(t,n)}),n){hr(t,ee);let e=()=>gr(t,ee);t.addEventListener(`pagehide`,e),A=()=>t.removeEventListener(`pagehide`,e)}return w.initialized||ve(`POP`,w.location,{initialHydration:!0}),C}function me(){d&&d(),A&&A(),f.clear(),O&&O.abort(),w.fetchers.forEach((e,t)=>He(w.fetchers,t)),w.blockers.forEach((e,t)=>Ye(t))}function he(e){if(f.add(e),p){let{newErrors:t}=p;p=null,e(w,{deletedFetchers:[],newErrors:t,viewTransitionOpts:void 0,flushSync:!1})}return()=>f.delete(e)}function N(e,t={}){e.matches&&=e.matches.map(e=>{let t=o[e.route.id],n=e.route;return n.element!==t.element||n.errorElement!==t.errorElement||n.hydrateFallbackElement!==t.hydrateFallbackElement?{...e,route:t}:e}),w={...w,...e};let n=[],r=[];w.fetchers.forEach((e,t)=>{e.state===`idle`&&(ue.has(t)?n.push(t):r.push(t))}),ue.forEach(e=>{!w.fetchers.has(e)&&!ie.has(e)&&n.push(e)}),f.size===0&&(p={newErrors:e.errors??null}),[...f].forEach(r=>r(w,{deletedFetchers:n,newErrors:e.errors??null,viewTransitionOpts:t.viewTransitionOpts,flushSync:t.flushSync===!0})),n.forEach(e=>He(w.fetchers,e)),r.forEach(e=>w.fetchers.delete(e))}function ge(t,n,{flushSync:r}={}){let i=w.actionData!=null&&w.navigation.formMethod!=null&&or(w.navigation.formMethod)&&w.navigation.state===`loading`&&t.state?._isRedirect!==!0,a;a=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:i?w.actionData:null;let o=n.loaderData?Vn(w.loaderData,n.loaderData,n.matches||[],n.errors):w.loaderData,c=w.blockers;c.size>0&&(c=new Map(c),c.forEach((e,t)=>c.set(t,qt)));let l=!te&&nt(t,n.matches||w.matches),u=D===!0||w.navigation.formMethod!=null&&or(w.navigation.formMethod)&&t.state?._isRedirect!==!0;s.commitHmrRoutes(),te||T===`POP`||(T===`PUSH`?e.history.push(t,t.state):T===`REPLACE`&&e.history.replace(t,t.state));let d;if(T===`POP`){let e=ee.get(w.location.pathname);e&&e.has(t.pathname)?d={currentLocation:w.location,nextLocation:t}:ee.has(t.pathname)&&(d={currentLocation:t,nextLocation:w.location})}else if(k){let e=ee.get(w.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),ee.set(w.location.pathname,e)),d={currentLocation:w.location,nextLocation:t}}N({...n,actionData:a,loaderData:o,historyAction:T,location:t,initialized:!0,renderFallback:!1,navigation:Kt,revalidation:`idle`,restoreScrollPosition:l,preventScrollReset:u,blockers:c},{viewTransitionOpts:d,flushSync:r===!0}),T=`POP`,D=!1,k=!1,te=!1,ne=!1,E?.resolve(),E=null,fe?.resolve(),fe=null}async function F(t,n){if(E?.resolve(),E=null,typeof t==`number`){E||=_r();let n=E.promise;return e.history.go(t),n}let{path:r,submission:i,error:a}=on(!1,an(w.location,w.matches,c,t,n?.fromRouteId,n?.relative),n),o;if(n?.mask){let t=typeof n.mask==`string`?we(n.mask):{...w.location.mask,...n.mask};if(o={pathname:t.pathname??``,search:t.search??``,hash:t.hash??``},P.test(o.pathname))throw Error(`External navigation is not allowed`);o.pathname.startsWith(`\\`)&&(o.pathname=o.pathname.replace(/^\\+/,`/`)),zt(typeof n.mask==`string`?n.mask:Ce(n.mask),Ce(o),e.history.createURL(`/`),`reject`)}let s=w.location,l=Se(s,r,n&&n.state,void 0,o);l={...l,...e.history.encodeLocation(l)},zt(t==null?e.history.createHref(w.location):typeof t==`string`?t:Ce(t),e.history.createHref(l.mask||l),e.history.createURL(`/`),`reject`);let u=n&&n.replace!=null?n.replace:void 0,d=`PUSH`;u===!0?d=`REPLACE`:u===!1||i!=null&&or(i.formMethod)&&i.formAction===w.location.pathname+w.location.search&&(d=`REPLACE`);let f=n&&`preventScrollReset`in n?n.preventScrollReset===!0:void 0,p=(n&&n.flushSync)===!0,m=Ze({currentLocation:s,nextLocation:l,historyAction:d});if(m){Xe(m,{state:`blocked`,location:l,proceed(){Xe(m,{state:`proceeding`,proceed:void 0,reset:void 0,location:l}),F(t,n)},reset(){let e=new Map(w.blockers);e.set(m,qt),N({blockers:e})}});return}await ve(d,l,{submission:i,pendingError:a,preventScrollReset:f,replace:n&&n.replace,enableViewTransition:n&&n.viewTransition,flushSync:p,callSiteDefaultShouldRevalidate:n&&n.defaultShouldRevalidate})}function _e(){fe||=_r(),Fe(),N({revalidation:`loading`});let e=fe.promise;return w.navigation.state===`submitting`?e:w.navigation.state===`idle`?(ve(w.historyAction,w.location,{startUninterruptedRevalidation:!0}),e):(ve(T||w.historyAction,w.navigation.location,{overrideNavigation:w.navigation,enableViewTransition:k===!0}),e)}async function ve(t,n,r){O&&O.abort(),O=null,T=t,te=(r&&r.startUninterruptedRevalidation)===!0,tt(w.location,w.matches),D=(r&&r.preventScrollReset)===!0,k=(r&&r.enableViewTransition)===!0;let i=s.activeRoutes,a=r?.initialHydration&&w.matches&&w.matches.length>0&&!y?w.matches:Le(i,n,c,!1,s.branches),o=(r&&r.flushSync)===!0;if(a&&w.initialized&&!ne&&Jn(w.location,n)&&!(r&&r.submission&&or(r.submission.formMethod))){ge(n,{matches:a},{flushSync:o});return}let l=it(a,i,n.pathname);if(l.active&&l.matches&&(a=l.matches),!a){let{error:e,notFoundMatches:t,route:r}=Qe(n.pathname);ge(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:o});return}let u=r&&r.overrideNavigation?{...r.overrideNavigation,matches:a,historyAction:t}:void 0;O=new AbortController;let d=Fn(e.history,n,O.signal,r&&r.submission),f=e.getContext?await e.getContext():new Oe,p;if(r&&r.pendingError)p=[Un(a).route.id,{type:`error`,error:r.pendingError}];else if(r&&r.submission&&or(r.submission.formMethod)){let i=await ye(d,n,r.submission,a,t,f,l.active,r&&r.initialHydration===!0,{replace:r.replace,flushSync:o});if(i.shortCircuited)return;if(i.pendingActionResult){let[e,t]=i.pendingActionResult;if($n(t)&&bt(t.error)&&t.error.status===404){O=null,ge(n,{matches:i.matches,loaderData:{},errors:{[e]:t.error}});return}}a=i.matches||a,p=i.pendingActionResult,u=ur(n,a,t,r.submission),o=!1,l.active=!1,d=Fn(e.history,d.url,d.signal)}let{shortCircuited:m,matches:h,loaderData:g,errors:_,workingFetchers:v}=await be(d,n,a,t,f,l.active,u,r&&r.submission,r&&r.fetcherSubmission,r&&r.replace,r&&r.initialHydration===!0,o,p,r&&r.callSiteDefaultShouldRevalidate);m||(O=null,ge(n,{matches:h||a,...Hn(p),loaderData:g,errors:_,...v?{fetchers:v}:{}}))}async function ye(t,n,i,l,u,d,f,p,m={}){if(Fe(),N({navigation:dr(n,l,u,i)},{flushSync:m.flushSync===!0}),f){let e=await ot(l,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wn(s.activeRoutes);return{matches:t,pendingActionResult:[n.id,{type:`error`,error:e.error}]}}let t=Un(e.partialMatches).route.id;return{matches:e.partialMatches,pendingActionResult:[t,{type:`error`,error:e.error}]}}if(e.matches)l=e.matches;else{let{notFoundMatches:e,error:t,route:r}=Qe(n.pathname);return{matches:e,pendingActionResult:[r.id,{type:`error`,error:t}]}}}let h,g=cr(l,n);if(!g.route.action&&!g.route.lazy)h={type:`error`,error:Gn(405,{method:t.method,pathname:n.pathname,routeId:g.route.id})};else{let e=await Me(t,n,En(a,o,t,n,l,g,p?[]:r,d),d,null);if(h=e[g.route.id],!h){for(let t of l)if(e[t.route.id]){h=e[t.route.id];break}}if(t.signal.aborted)return{shortCircuited:!0}}if(er(h)){let n;return n=m&&m.replace!=null?m.replace:Pn(h.response.headers.get(`Location`),new URL(t.url),c,e.history)===w.location.pathname+w.location.search,await je(t,h,!0,{submission:i,replace:n}),{shortCircuited:!0}}if($n(h)){let e=Un(l,g.route.id);return(m&&m.replace)!==!0&&(T=`PUSH`),{matches:l,pendingActionResult:[e.route.id,h,g.route.id]}}return{matches:l,pendingActionResult:[g.route.id,h]}}async function be(t,n,i,l,u,d,f,p,m,h,g,_,v,y){let b=f||ur(n,i,l,p),x=p||m||lr(b),S=!te&&!g;if(d){if(S){let e=xe(v);N({navigation:b,...e===void 0?{}:{actionData:e}},{flushSync:_})}let e=await ot(i,n.pathname,t.signal);if(e.type===`aborted`)return{shortCircuited:!0};if(e.type===`error`){if(e.partialMatches.length===0){let{matches:t,route:n}=Wn(s.activeRoutes);return{matches:t,loaderData:{},errors:{[n.id]:e.error}}}let t=Un(e.partialMatches).route.id;return{matches:e.partialMatches,loaderData:{},errors:{[t]:e.error}}}if(e.matches)i=e.matches;else{let{error:e,notFoundMatches:t,route:r}=Qe(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}}let C=s.activeRoutes,{dsMatches:T,revalidatingFetchers:E}=sn(t,u,a,o,e.history,w,i,x,n,g?[]:r,g===!0,ne,re,ue,ce,j,C,c,e.patchRoutesOnNavigation!=null,s.branches,v,y);if(oe=++ae,!e.dataStrategy&&!T.some(e=>e.shouldLoad)&&!T.some(e=>e.route.middleware&&e.route.middleware.length>0)&&E.length===0){let e=new Map(w.fetchers),t=Ke(e);return ge(n,{matches:i,loaderData:{},errors:v&&$n(v[1])?{[v[0]]:v[1].error}:null,...Hn(v),...t?{fetchers:e}:{}},{flushSync:_}),{shortCircuited:!0}}if(S){let e={};if(!d){e.navigation=b;let t=xe(v);t!==void 0&&(e.actionData=t)}E.length>0&&(e.fetchers=Te(E)),N(e,{flushSync:_})}E.forEach(e=>{We(e.key),e.controller&&ie.set(e.key,e.controller)});let D=()=>E.forEach(e=>We(e.key));O&&O.signal.addEventListener(`abort`,D);let{loaderResults:k,fetcherResults:ee}=await Ne(T,E,t,n,u);if(t.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener(`abort`,D),E.forEach(e=>ie.delete(e.key));let A=Kn(k);if(A)return await je(t,A.result,!0,{replace:h}),{shortCircuited:!0};if(A=Kn(ee),A)return j.add(A.key),await je(t,A.result,!0,{replace:h}),{shortCircuited:!0};let se=new Map(w.fetchers),{loaderData:le,errors:de}=Bn(w,i,k,v,E,ee,se);g&&w.errors&&(de={...w.errors,...de});let M=Ke(se),fe=qe(oe,se),pe=M||fe||E.length>0;return{matches:i,loaderData:le,errors:de,...pe?{workingFetchers:se}:{}}}function xe(e){if(e&&!$n(e[1]))return{[e[0]]:e[1].data};if(w.actionData)return Object.keys(w.actionData).length===0?null:w.actionData}function Te(e){let t=new Map(w.fetchers);return e.forEach(e=>{let n=t.get(e.key),r=fr(void 0,n?n.data:void 0);t.set(e.key,r)}),t}async function De(t,n,r,i){We(t);let a=(i&&i.flushSync)===!0,o=s.activeRoutes,l=an(w.location,w.matches,c,r,n,i?.relative),u=Le(o,l,c,!1,s.branches),d=it(u,o,l);if(d.active&&d.matches&&(u=d.matches),!u){ze(t,n,Gn(404,{pathname:l}),{flushSync:a});return}let{path:f,submission:p,error:m}=on(!0,l,i);if(m){ze(t,n,m,{flushSync:a});return}let h=e.getContext?await e.getContext():new Oe,g=(i&&i.preventScrollReset)===!0;if(p&&or(p.formMethod)){await ke(t,n,f,u,h,d.active,a,g,p,i&&i.defaultShouldRevalidate);return}ce.set(t,{routeId:n,path:f}),await Ae(t,n,f,u,h,d.active,a,g,p)}async function ke(t,n,i,l,u,d,f,p,m,h){Fe(),ce.delete(t),Ie(t,pr(m,w.fetchers.get(t)),{flushSync:f});let g=new AbortController,_=Fn(e.history,i,g.signal,m);if(d){let e=await ot(l,new URL(_.url).pathname,_.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ze(t,n,e.error,{flushSync:f});return}if(e.matches)l=e.matches;else{ze(t,n,Gn(404,{pathname:i}),{flushSync:f});return}}let v=cr(l,i);if(!v.route.action&&!v.route.lazy){ze(t,n,Gn(405,{method:m.formMethod,pathname:i,routeId:n}),{flushSync:f});return}ie.set(t,g);let y=ae,b=En(a,o,_,i,l,v,r,u),x=await Me(_,i,b,u,t),S=x[v.route.id];if(!S){for(let e of b)if(x[e.route.id]){S=x[e.route.id];break}}if(_.signal.aborted){ie.get(t)===g&&ie.delete(t);return}if(ue.has(t)){if(er(S)||$n(S)){Ie(t,mr(void 0));return}}else{if(er(S)){if(ie.delete(t),oe>y){Ie(t,mr(void 0));return}return j.add(t),Ie(t,fr(m)),je(_,S,!1,{fetcherSubmission:m,preventScrollReset:p})}if($n(S)){ze(t,n,S.error);return}}let C=w.navigation.location||w.location,E=Fn(e.history,C,g.signal),D=s.activeRoutes,k=w.navigation.state===`idle`?w.matches:Le(D,w.navigation.location,c,!1,s.branches);I(k,`Didn't find any matches after fetcher action`);let ee=++ae;se.set(t,ee);let{dsMatches:A,revalidatingFetchers:te}=sn(E,u,a,o,e.history,w,k,m,C,r,!1,ne,re,ue,ce,j,D,c,e.patchRoutesOnNavigation!=null,s.branches,[v.route.id,S],h),le=fr(m,S.data),de=new Map(w.fetchers);de.set(t,le),te.filter(e=>e.key!==t).forEach(e=>{let t=e.key,n=de.get(t),r=fr(void 0,n?n.data:void 0);de.set(t,r),We(t),e.controller&&ie.set(t,e.controller)}),N({fetchers:de});let M=()=>te.forEach(e=>We(e.key));g.signal.addEventListener(`abort`,M);let{loaderResults:fe,fetcherResults:pe}=await Ne(A,te,E,C,u);if(g.signal.aborted)return;g.signal.removeEventListener(`abort`,M),se.delete(t),ie.delete(t),te.forEach(e=>ie.delete(e.key));let me=w.fetchers.has(t),he=e=>{if(!me)return e;let n=new Map(e.fetchers);return n.set(t,mr(S.data)),{...e,fetchers:n}},P=Kn(fe);if(P)return w=he(w),je(E,P.result,!1,{preventScrollReset:p});if(P=Kn(pe),P)return j.add(P.key),w=he(w),je(E,P.result,!1,{preventScrollReset:p});let F=new Map(w.fetchers);me&&F.set(t,mr(S.data));let{loaderData:_e,errors:ve}=Bn(w,k,fe,void 0,te,pe,F);qe(ee,F),w.navigation.state===`loading`&&ee>oe?(I(T,`Expected pending action`),O&&O.abort(),ge(w.navigation.location,{matches:k,loaderData:_e,errors:ve,fetchers:F})):(N({errors:ve,loaderData:Vn(w.loaderData,_e,k,ve),fetchers:F}),ne=!1)}async function Ae(t,n,i,s,c,l,u,d,f){let p=w.fetchers.get(t);Ie(t,fr(f,p?p.data:void 0),{flushSync:u});let m=new AbortController,h=Fn(e.history,i,m.signal);if(l){let e=await ot(s,new URL(h.url).pathname,h.signal,t);if(e.type===`aborted`)return;if(e.type===`error`){ze(t,n,e.error,{flushSync:u});return}if(e.matches)s=e.matches;else{ze(t,n,Gn(404,{pathname:i}),{flushSync:u});return}}let g=cr(s,i);ie.set(t,m);let _=ae,v=await Me(h,i,En(a,o,h,i,s,g,r,c),c,t),y=v[g.route.id];if(!y){for(let e of s)if(v[e.route.id]){y=v[e.route.id];break}}if(ie.get(t)===m&&ie.delete(t),!h.signal.aborted){if(ue.has(t)){Ie(t,mr(void 0));return}if(er(y)){if(oe>_){Ie(t,mr(void 0));return}j.add(t),await je(h,y,!1,{preventScrollReset:d});return}if($n(y)){ze(t,n,y.error);return}Ie(t,mr(y.data))}}async function je(r,i,a,{submission:o,fetcherSubmission:s,preventScrollReset:l,replace:u}={}){a||(E?.resolve(),E=null),i.response.headers.has(`X-Remix-Revalidate`)&&(ne=!0);let d=i.response.headers.get(`Location`);I(d,`Expected a Location header on the redirect Response`);let f=d,p=new URL(r.url);d=Pn(d,p,c,e.history),zt(f,d,p,`allow-explicit`);let m=Se(w.location,d,{_isRedirect:!0});if(n){let e=!1;if(i.response.headers.has(`X-Remix-Reload-Document`))e=!0;else if(at(d)){let n=Ee(t,d,!0);e=n.origin!==t.location.origin||rt(n.pathname,c)==null}if(e){u?t.location.replace(d):t.location.assign(d);return}}O=null;let h=u===!0||i.response.headers.has(`X-Remix-Replace`)?`REPLACE`:`PUSH`,{formMethod:g,formAction:_,formEncType:v}=w.navigation;!o&&!s&&g&&_&&v&&(o=lr(w.navigation));let y=o||s;Gt.has(i.response.status)&&y&&or(y.formMethod)?await ve(h,m,{submission:{...y,formAction:d},preventScrollReset:l||D,enableViewTransition:a?k:void 0}):await ve(h,m,{overrideNavigation:ur(m,[],h,o),fetcherSubmission:s,preventScrollReset:l||D,enableViewTransition:a?k:void 0})}async function Me(e,t,n,r,i){let a,o={};try{a=await Dn(l,e,t,n,i,r,!1)}catch(e){return n.filter(e=>e.shouldLoad).forEach(t=>{o[t.route.id]={type:`error`,error:e}}),o}if(e.signal.aborted)return o;if(!or(e.method))for(let e of n){if(a[e.route.id]?.type===`error`)break;!a.hasOwnProperty(e.route.id)&&!w.loaderData.hasOwnProperty(e.route.id)&&(!w.errors||!w.errors.hasOwnProperty(e.route.id))&&e.shouldCallHandler()&&(a[e.route.id]={type:`error`,result:Error(`No result returned from dataStrategy for route ${e.route.id}`)})}for(let[t,r]of Object.entries(a))if(Qn(r)){let i=r.result;o[t]={type:`redirect`,response:jn(i,e,t,n,c)}}else o[t]=await An(r);return o}async function Ne(e,t,n,r,i){let a=Me(n,r,e,i,null),o=Promise.all(t.map(async e=>{if(e.matches&&e.match&&e.request&&e.controller){let t=(await Me(e.request,e.path,e.matches,i,e.key))[e.match.route.id];return{[e.key]:t}}return Promise.resolve({[e.key]:{type:`error`,error:Gn(404,{pathname:e.path})}})}));return{loaderResults:await a,fetcherResults:(await o).reduce((e,t)=>Object.assign(e,t),{})}}function Fe(){ne=!0,ce.forEach((e,t)=>{ie.has(t)&&re.add(t),We(t)})}function Ie(e,t,n={}){let r=new Map(w.fetchers);r.set(e,t),N({fetchers:r},{flushSync:(n&&n.flushSync)===!0})}function ze(e,t,n,r={}){let i=Un(w.matches,t),a=new Map(w.fetchers);He(a,e),N({errors:{[i.route.id]:n},fetchers:a},{flushSync:(r&&r.flushSync)===!0})}function Be(e){return le.set(e,(le.get(e)||0)+1),ue.has(e)&&ue.delete(e),w.fetchers.get(e)||R}function Ve(e,t){We(e,t?.reason),Ie(e,mr(null))}function He(e,t){let n=w.fetchers.get(t);ie.has(t)&&!(n&&n.state===`loading`&&se.has(t))&&We(t),ce.delete(t),se.delete(t),j.delete(t),ue.delete(t),re.delete(t),e.delete(t)}function Ue(e){let t=(le.get(e)||0)-1;t<=0?(le.delete(e),ue.add(e)):le.set(e,t),N({fetchers:new Map(w.fetchers)})}function We(e,t){let n=ie.get(e);n&&(n.abort(t),ie.delete(e))}function Ge(e,t){for(let n of e){let e=t.get(n);I(e,`Expected fetcher: ${n}`);let r=mr(e.data);t.set(n,r)}}function Ke(e){let t=[],n=!1;for(let r of j){let i=e.get(r);I(i,`Expected fetcher: ${r}`),i.state===`loading`&&(j.delete(r),t.push(r),n=!0)}return Ge(t,e),n}function qe(e,t){let n=[];for(let[r,i]of se)if(i<e){let e=t.get(r);I(e,`Expected fetcher: ${r}`),e.state===`loading`&&(We(r),se.delete(r),n.push(r))}return Ge(n,t),n.length>0}function Je(e,t){let n=w.blockers.get(e)||qt;return de.get(e)!==t&&de.set(e,t),n}function Ye(e){w.blockers.delete(e),de.delete(e)}function Xe(e,t){let n=w.blockers.get(e)||qt;I(n.state===`unblocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`blocked`||n.state===`blocked`&&t.state===`proceeding`||n.state===`blocked`&&t.state===`unblocked`||n.state===`proceeding`&&t.state===`unblocked`,`Invalid blocker state transition: ${n.state} -> ${t.state}`);let r=new Map(w.blockers);r.set(e,t),N({blockers:r})}function Ze({currentLocation:e,nextLocation:t,historyAction:n}){if(de.size===0)return;de.size>1&&L(!1,`A router only supports one blocker at a time`);let r=Array.from(de.entries()),[i,a]=r[r.length-1],o=w.blockers.get(i);if(!(o&&o.state===`proceeding`)&&a({currentLocation:e,nextLocation:t,historyAction:n}))return i}function Qe(e){let t=Gn(404,{pathname:e}),n=s.activeRoutes,{matches:r,route:i}=Wn(n);return{notFoundMatches:r,route:i,error:t}}function $e(e,t,n){if(m=e,g=t,h=n||null,!_&&w.navigation===Kt){_=!0;let e=nt(w.location,w.matches);e!=null&&N({restoreScrollPosition:e})}return()=>{m=null,g=null,h=null}}function et(e,t){return h&&h(e,t.map(e=>Re(e,w.loaderData)))||e.key}function tt(e,t){if(m&&g){let n=et(e,t);m[n]=g()}}function nt(e,t){if(m){let n=et(e,t),r=m[n];if(typeof r==`number`)return r}return null}function it(t,n,r){if(e.patchRoutesOnNavigation){let e=s.branches;if(!t)return{active:!0,matches:Le(n,r,c,!0,e)||[]};if(Object.keys(t[0].params).length>0)return{active:!0,matches:Le(n,r,c,!0,e)}}return{active:!1,matches:null}}async function ot(t,n,r,i){if(!e.patchRoutesOnNavigation)return{type:`success`,matches:t};let l=t;for(;;){let t=o;try{await e.patchRoutesOnNavigation({signal:r,path:n,matches:l,fetcherKey:i,patch:(e,n)=>{r.aborted||pn(e,n,s,t,a,!1)}})}catch(e){return{type:`error`,error:e,partialMatches:l}}if(r.aborted)return{type:`aborted`};let u=s.branches,d=Le(s.activeRoutes,n,c,!1,u),f=null;if(d&&(Object.keys(d[0].params).length===0||(f=Le(s.activeRoutes,n,c,!0,u),!(f&&l.length<f.length&&st(l,f.slice(0,l.length))))))return{type:`success`,matches:d};if(f||=Le(s.activeRoutes,n,c,!0,u),!f||st(l,f))return{type:`success`,matches:null};l=f}}function st(e,t){return e.length===t.length&&e.every((e,n)=>e.route.id===t[n].route.id)}function ct(e){o={},s.setHmrRoutes(Pe(e,a,void 0,o))}function lt(e,t,n=!1){pn(e,t,s,o,a,n),s.hasHMRRoutes||N({})}return C={get basename(){return c},get future(){return u},get state(){return w},get routes(){return s.stableRoutes},get branches(){return s.branches},get manifest(){return o},get window(){return t},initialize:pe,subscribe:he,enableScrollRestoration:$e,navigate:F,fetch:De,revalidate:_e,createHref:t=>e.history.createHref(t),createURL:t=>e.history.createURL(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Be,resetFetcher:Ve,deleteFetcher:Ue,dispose:me,getBlocker:Je,deleteBlocker:Ye,patchRoutes:lt,_internalFetchControllers:ie,_internalSetRoutes:ct,_internalSetStateDoNotUseOrYouWillBreakYourApp(e){N(e)}},e.instrumentations&&(C=Et(C,e.instrumentations.map(e=>e.router).filter(Boolean))),C}function rn(e){return e!=null&&(`formData`in e&&e.formData!=null||`body`in e&&e.body!==void 0)}function an(e,t,n,r,i,a){let o,s;if(i){o=[];for(let e of t)if(o.push(e),e.route.id===i){s=e;break}}else o=t,s=t[t.length-1];let c=dt(r||`.`,ut(o),rt(e.pathname,n)||e.pathname,a===`path`);if(r??(c.search=e.search,c.hash=e.hash),(r==null||r===``||r===`.`)&&s){let e=sr(c.search);if(s.route.index&&!e)c.search=c.search?c.search.replace(/^\?/,`?index&`):`?index`;else if(!s.route.index&&e){let e=new URLSearchParams(c.search),t=e.getAll(`index`);e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();c.search=n?`?${n}`:``}}return n!==`/`&&(c.pathname=it({basename:n,pathname:c.pathname})),Ce(c)}function on(e,t,n){if(!n||!rn(n))return{path:t};if(n.formMethod&&!ar(n.formMethod))return{path:t,error:Gn(405,{method:n.formMethod})};let r=()=>({path:t,error:Gn(400,{type:`invalid-body`})}),i=(n.formMethod||`get`).toUpperCase(),a=qn(t);if(n.body!==void 0){if(n.formEncType===`text/plain`){if(!or(i))return r();let e=typeof n.body==`string`?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((e,[t,n])=>`${e}${t}=${n}
`,``):String(n.body);return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:void 0,text:e}}}if(n.formEncType===`application/json`){if(!or(i))return r();try{let e=typeof n.body==`string`?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:a,formEncType:n.formEncType,formData:void 0,json:e,text:void 0}}}catch{return r()}}}I(typeof FormData==`function`,`FormData is not available in this environment`);let o,s;if(n.formData)o=Ln(n.formData),s=n.formData;else if(n.body instanceof FormData)o=Ln(n.body),s=n.body;else if(n.body instanceof URLSearchParams)o=n.body,s=Rn(o);else if(n.body==null)o=new URLSearchParams,s=new FormData;else try{o=new URLSearchParams(n.body),s=Rn(o)}catch{return r()}let c={formMethod:i,formAction:a,formEncType:n&&n.formEncType||`application/x-www-form-urlencoded`,formData:s,json:void 0,text:void 0};if(or(c.formMethod))return{path:t,submission:c};let l=we(t);return e&&l.search&&sr(l.search)&&o.append(`index`,``),l.search=`?${o}`,{path:Ce(l),submission:c}}function sn(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x){let S=b?$n(b[1])?b[1].error:b[1].data:void 0,C=i.createURL(a.location),w=i.createURL(c),T;if(u&&a.errors){let e=Object.keys(a.errors)[0];T=o.findIndex(t=>t.route.id===e)}else if(b&&$n(b[1])){let e=b[0];T=o.findIndex(t=>t.route.id===e)-1}let E=b?b[1].statusCode:void 0,D=E&&E>=400,O={currentUrl:C,currentParams:a.matches[0]?.params||{},nextUrl:w,nextParams:o[0].params,...s,actionResult:S,actionStatus:E},k=xt(o),ee=o.map((i,o)=>{let{route:s}=i,f=null;if(T!=null&&o>T)f=!1;else if(s.lazy)f=!0;else if(!cn(s))f=!1;else if(u){let{shouldLoad:e}=ln(s,a.loaderData,a.errors);f=e}else un(a.loaderData,a.matches[o],i)&&(f=!0);if(f!==null)return Tn(n,r,e,c,k,i,l,t,f);let p=!1;typeof x==`boolean`?p=x:D?p=!1:d||C.pathname+C.search===w.pathname+w.search?p=!0:C.search===w.search?dn(a.matches[o],i)&&(p=!0):p=!0;let m={...O,defaultShouldRevalidate:p},h=fn(i,m);return Tn(n,r,e,c,k,i,l,t,h,m,x)}),A=[];return m.forEach((e,s)=>{if(u||!o.some(t=>t.route.id===e.routeId)||p.has(s))return;let c=a.fetchers.get(s),m=c&&c.state!==`idle`&&c.data===void 0,b=Le(g,e.path,_??`/`,!1,y);if(!b){if(v&&m)return;A.push({key:s,routeId:e.routeId,path:e.path,matches:null,match:null,request:null,controller:null});return}if(h.has(s))return;let S=cr(b,e.path),C=new AbortController,w=Fn(i,e.path,C.signal),T=null;if(f.has(s))f.delete(s),T=En(n,r,w,e.path,b,S,l,t);else if(m)d&&(T=En(n,r,w,e.path,b,S,l,t));else{let i;i=typeof x==`boolean`?x:!D&&d;let a={...O,defaultShouldRevalidate:i};fn(S,a)&&(T=En(n,r,w,e.path,b,S,l,t,a))}T&&A.push({key:s,routeId:e.routeId,path:e.path,matches:T,match:S,request:w,controller:C})}),{dsMatches:ee,revalidatingFetchers:A}}function cn(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function ln(e,t,n){if(e.lazy)return{shouldLoad:!0,renderFallback:!0};if(!cn(e))return{shouldLoad:!1,renderFallback:!1};let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;if(!r&&i)return{shouldLoad:!1,renderFallback:!1};if(typeof e.loader==`function`&&e.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let a=!r&&!i;return{shouldLoad:a,renderFallback:a}}function un(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function dn(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith(`*`)&&e.params[`*`]!==t.params[`*`]}function fn(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n==`boolean`)return n}return t.defaultShouldRevalidate}function pn(e,t,n,r,i,a){let o;if(e){let t=r[e];I(t,`No route found to patch children into: routeId = ${e}`),t.children||=[],o=t.children}else o=n.activeRoutes;let s=[],c=[];if(t.forEach(e=>{let t=o.find(t=>mn(e,t));t?c.push({existingRoute:t,newRoute:e}):s.push(e)}),s.length>0){let t=Pe(s,i,[e||`_`,`patch`,String(o?.length||`0`)],r);o.push(...t)}if(a&&c.length>0)for(let e=0;e<c.length;e++){let{existingRoute:t,newRoute:n}=c[e],r=t,[a]=Pe([n],i,[],{},!0);Object.assign(r,{element:a.element?a.element:r.element,errorElement:a.errorElement?a.errorElement:r.errorElement,hydrateFallbackElement:a.hydrateFallbackElement?a.hydrateFallbackElement:r.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function mn(e,t){return`id`in e&&`id`in t&&e.id===t.id?!0:e.index!==t.index||e.path!==t.path||e.caseSensitive!==t.caseSensitive?!1:(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children?.every((e,n)=>t.children?.some(t=>mn(e,t)))??!1}var hn=new WeakMap,gn=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(I(i,`No route found in manifest`),!i.lazy||typeof i.lazy!=`object`)return;let a=i.lazy[e];if(!a)return;let o=hn.get(i);o||(o={},hn.set(i,o));let s=o[e];if(s)return s;let c=(async()=>{let t=Ae(e),n=i[e]!==void 0&&e!==`hasErrorBoundary`;if(t)L(!t,`Route property `+e+` is not a supported lazy route property. This property will be ignored.`),o[e]=Promise.resolve();else if(n)L(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let t=await a();t!=null&&(Object.assign(i,{[e]:t}),Object.assign(i,r(i)))}typeof i.lazy==`object`&&(i.lazy[e]=void 0,Object.values(i.lazy).every(e=>e===void 0)&&(i.lazy=void 0))})();return o[e]=c,c},_n=new WeakMap;function vn(e,t,n,r,i){let a=n[e.id];if(I(a,`No route found in manifest`),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy==`function`){let t=_n.get(a);if(t)return{lazyRoutePromise:t,lazyHandlerPromise:t};let n=(async()=>{I(typeof e.lazy==`function`,`No lazy route function found`);let t=await e.lazy(),n={};for(let e in t){let r=t[e];if(r===void 0)continue;let i=Me(e),o=a[e]!==void 0&&e!==`hasErrorBoundary`;i?L(!i,`Route property `+e+` is not a supported property to be returned from a lazy route function. This property will be ignored.`):o?L(!o,`Route "${a.id}" has a static property "${e}" defined but its lazy function is also returning a value for this property. The lazy route property "${e}" will be ignored.`):n[e]=r}Object.assign(a,n),Object.assign(a,{...r(a),lazy:void 0})})();return _n.set(a,n),n.catch(()=>{}),{lazyRoutePromise:n,lazyHandlerPromise:n}}let o=Object.keys(e.lazy),s=[],c;for(let a of o){if(i&&i.includes(a))continue;let o=gn({key:a,route:e,manifest:n,mapRouteProperties:r});o&&(s.push(o),a===t&&(c=o))}let l=s.length>0?Promise.all(s).then(()=>{}):void 0;return l?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:l,lazyHandlerPromise:c}}async function yn(e){let t=e.matches.filter(e=>e.shouldLoad),n={};return(await Promise.all(t.map(e=>e.resolve()))).forEach((e,r)=>{n[t[r].route.id]=e}),n}async function bn(e){return e.matches.some(e=>e.route.middleware)?xn(e,()=>yn(e)):yn(e)}function xn(e,t){return Sn(e,t,e=>{if(ir(e))throw e;return e},Xn,n);function n(t,n,r){if(r)return Promise.resolve(Object.assign(r.value,{[n]:{type:`error`,result:t}}));{let{matches:r}=e,i=Un(r,r[Math.min(Math.max(r.findIndex(e=>e.route.id===n),0),Math.max(r.findIndex(e=>e.shouldCallHandler()),0))].route.id).route.id;return Promise.resolve({[i]:{type:`error`,result:t}})}}}async function Sn(e,t,n,r,i){let{matches:a,...o}=e;return await Cn(o,a.flatMap(e=>e.route.middleware?e.route.middleware.map(t=>[e.route.id,t]):[]),t,n,r,i)}async function Cn(e,t,n,r,i,a,o=0){let{request:s}=e;if(s.signal.aborted)throw s.signal.reason??Error(`Request aborted: ${s.method} ${s.url}`);let c=t[o];if(!c)return await n();let[l,u]=c,d,f=async()=>{if(d)throw Error("You may only call `next()` once per middleware");try{return d={value:await Cn(e,t,n,r,i,a,o+1)},d.value}catch(e){return d={value:await a(e,l,d)},d.value}};try{let t=await u(e,f),n=t==null?void 0:r(t);return i(n)?n:d?n??d.value:(d={value:await f()},d.value)}catch(e){return await a(e,l,d)}}function wn(e,t,n,r,i){let a=gn({key:`middleware`,route:r.route,manifest:t,mapRouteProperties:e}),o=vn(r.route,or(n.method)?`action`:`loader`,t,e,i);return{middleware:a,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function Tn(e,t,n,r,i,a,o,s,c,l=null,u){let d=!1,f=wn(e,t,n,a,o);return{...a,_lazyPromises:f,shouldLoad:c,shouldRevalidateArgs:l,shouldCallHandler(e){return d=!0,l?typeof u==`boolean`?fn(a,{...l,defaultShouldRevalidate:u}):typeof e==`boolean`?fn(a,{...l,defaultShouldRevalidate:e}):fn(a,l):c},resolve(e){let{lazy:t,loader:o,middleware:l}=a.route,u=d||c||e&&!or(n.method)&&(t||o),p=l&&l.length>0&&!o&&!t;return u&&(or(n.method)||!p)?On({request:n,path:r,pattern:i,match:a,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:e,scopedContext:s}):Promise.resolve({type:`data`,result:void 0})}}}function En(e,t,n,r,i,a,o,s,c=null){return i.map(l=>l.route.id===a.route.id?Tn(e,t,n,r,xt(i),l,o,s,!0,c):{...l,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:wn(e,t,n,l,o),resolve:()=>Promise.resolve({type:`data`,result:void 0})})}async function Dn(e,t,n,r,i,a,o){r.some(e=>e._lazyPromises?.middleware)&&await Promise.all(r.map(e=>e._lazyPromises?.middleware));let s={request:t,url:In(t,n),pattern:xt(r),params:r[0].params,context:a,matches:r},c=o?()=>{throw Error("You cannot call `runClientMiddleware()` from a static handler `dataStrategy`. Middleware is run outside of `dataStrategy` during SSR in order to bubble up the Response. You can enable middleware via the `respond` API in `query`/`queryRoute`")}:e=>{let t=s;return xn(t,()=>e({...t,fetcherKey:i,runClientMiddleware:()=>{throw Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))},l=await e({...s,fetcherKey:i,runClientMiddleware:c});try{await Promise.all(r.flatMap(e=>[e._lazyPromises?.handler,e._lazyPromises?.route]))}catch{}return l}async function On({request:e,path:t,pattern:n,match:r,lazyHandlerPromise:i,lazyRoutePromise:a,handlerOverride:o,scopedContext:s}){let c,l,u=or(e.method),d=u?`action`:`loader`,f=i=>{let a,c=new Promise((e,t)=>a=t);l=()=>a(),e.signal.addEventListener(`abort`,l);let u=a=>typeof i==`function`?i({request:e,url:In(e,t),pattern:n,params:r.params,context:s},...a===void 0?[]:[a]):Promise.reject(Error(`You cannot call the handler for a route which defines a boolean "${d}" [routeId: ${r.route.id}]`)),f=(async()=>{try{return{type:`data`,result:await(o?o(e=>u(e)):u())}}catch(e){return{type:`error`,result:e}}})();return Promise.race([f,c])};try{let t=u?r.route.action:r.route.loader;if(i||a){if(t){let e,[n]=await Promise.all([f(t).catch(t=>{e=t}),i,a]);if(e!==void 0)throw e;c=n}else{await i;let t=u?r.route.action:r.route.loader;if(t)[c]=await Promise.all([f(t),a]);else if(d===`action`){let t=new URL(e.url),n=t.pathname+t.search;throw Gn(405,{method:e.method,pathname:n,routeId:r.route.id})}else return{type:`data`,result:void 0}}}else if(t)c=await f(t);else{let t=new URL(e.url);throw Gn(404,{pathname:t.pathname+t.search})}}catch(e){return{type:`error`,result:e}}finally{l&&e.signal.removeEventListener(`abort`,l)}return c}async function kn(e){let t=e.headers.get(`Content-Type`);return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function An(e){let{result:t,type:n}=e;if(nr(t)){let e;try{e=await kn(t)}catch(e){return{type:`error`,error:e}}return n===`error`?{type:`error`,error:new yt(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:`data`,data:e,statusCode:t.status,headers:t.headers}}return n===`error`?tr(t)?t.data instanceof Error?{type:`error`,error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:Yn(t),statusCode:bt(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`error`,error:t,statusCode:bt(t)?t.status:void 0}:tr(t)?{type:`data`,data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:`data`,data:t}}function jn(e,t,n,r,i){let a=e.headers.get(`Location`);if(I(a,`Redirects returned/thrown from loaders/actions must have a Location header`),!at(a)){let o=r.slice(0,r.findIndex(e=>e.route.id===n)+1);a=an(new URL(t.url),o,i,a),e.headers.set(`Location`,a)}return e}var Mn=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Nn(e){try{return Mn.includes(new URL(e).protocol)}catch{return!1}}function Pn(e,t,n,r){if(at(e)){let r=e,i=P.test(r)?new URL(F(r,t.protocol)):new URL(r);if(Nn(i.toString()))throw Error(`Invalid redirect location`);let a=rt(i.pathname,n)!=null;if(i.origin===t.origin&&a)return ft(i.pathname)+i.search+i.hash}try{if(Nn(r.createURL(e).toString()))throw Error(`Invalid redirect location`)}catch{}return e}function Fn(e,t,n,r){let i=e.createURL(qn(t)).toString(),a={signal:n};if(r&&or(r.formMethod)){let{formMethod:e,formEncType:t}=r;a.method=e.toUpperCase(),t===`application/json`?(a.headers=new Headers({"Content-Type":t}),a.body=JSON.stringify(r.json)):a.body=t===`text/plain`?r.text:t===`application/x-www-form-urlencoded`&&r.formData?Ln(r.formData):r.formData}return new Request(i,a)}function In(e,t){let n=new URL(e.url),r=typeof t==`string`?we(t):t;if(n.pathname=r.pathname||`/`,r.search){let e=new URLSearchParams(r.search),t=e.getAll(`index`);e.delete(`index`);for(let n of t.filter(Boolean))e.append(`index`,n);n.search=e.size?`?${e.toString()}`:``}else n.search=``;return n.hash=r.hash||``,n}function Ln(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r==`string`?r:r.name);return t}function Rn(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function zn(e,t,n,r=!1,i=!1){let a={},o=null,s,c=!1,l={},u=n&&$n(n[1])?n[1].error:void 0;return e.forEach(n=>{if(!(n.route.id in t))return;let d=n.route.id,f=t[d];if(I(!er(f),`Cannot handle redirect results in processLoaderData`),$n(f)){let t=f.error;if(u!==void 0&&(t=u,u=void 0),o||={},i)o[d]=t;else{let n=Un(e,d);o[n.route.id]??(o[n.route.id]=t)}r||(a[d]=Xt),c||(c=!0,s=bt(f.error)?f.error.status:500),f.headers&&(l[d]=f.headers)}else a[d]=f.data,f.statusCode&&f.statusCode!==200&&!c&&(s=f.statusCode),f.headers&&(l[d]=f.headers)}),u!==void 0&&n&&(o={[n[0]]:u},n[2]&&(a[n[2]]=void 0)),{loaderData:a,errors:o,statusCode:s||200,loaderHeaders:l}}function Bn(e,t,n,r,i,a,o){let{loaderData:s,errors:c}=zn(t,n,r);return i.filter(e=>!e.matches||e.matches.some(e=>e.shouldLoad)).forEach(t=>{let{key:n,match:r,controller:i}=t;if(i&&i.signal.aborted)return;let s=a[n];if(I(s,`Did not find corresponding fetcher result`),$n(s)){let t=Un(e.matches,r?.route.id);c&&c[t.route.id]||(c={...c,[t.route.id]:s.error}),o.delete(n)}else if(er(s))I(!1,`Unhandled fetcher revalidation redirect`);else{let e=mr(s.data);o.set(n,e)}}),{loaderData:s,errors:c}}function Vn(e,t,n,r){let i=Object.entries(t).filter(([,e])=>e!==Xt).reduce((e,[t,n])=>(e[t]=n,e),{});for(let a of n){let n=a.route.id;if(!t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&a.route.loader&&(i[n]=e[n]),r&&r.hasOwnProperty(n))break}return i}function Hn(e){return e?$n(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Un(e,t){return(t?e.slice(0,e.findIndex(e=>e.route.id===t)+1):[...e]).reverse().find(e=>e.route.hasErrorBoundary===!0)||e[0]}function Wn(e){let t=e.length===1?e[0]:e.find(e=>e.index||!e.path||e.path===`/`)||{id:`__shim-error-route__`};return{matches:[{params:{},pathname:``,pathnameBase:``,route:t}],route:t}}function Gn(e,{pathname:t,routeId:n,method:r,type:i,message:a}={}){let o=`Unknown Server Error`,s=`Unknown @remix-run/router error`;return e===400?(o=`Bad Request`,r&&t&&n?s=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i===`invalid-body`&&(s=`Unable to encode submission body`)):e===403?(o=`Forbidden`,s=`Route "${n}" does not match URL "${t}"`):e===404?(o=`Not Found`,s=`No route matches URL "${t}"`):e===405&&(o=`Method Not Allowed`,r&&t&&n?s=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(s=`Invalid request method "${r.toUpperCase()}"`)),new yt(e||500,o,Error(s),!0)}function Kn(e){let t=Object.entries(e);for(let e=t.length-1;e>=0;e--){let[n,r]=t[e];if(er(r))return{key:n,result:r}}}function qn(e){return Ce({...typeof e==`string`?we(e):e,hash:``})}function Jn(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===``?t.hash!==``:e.hash===t.hash||t.hash!==``}function Yn(e){return new yt(e.init?.status??500,e.init?.statusText??`Internal Server Error`,e.data)}function Xn(e){return typeof e==`object`&&!!e&&Object.entries(e).every(([e,t])=>typeof e==`string`&&Zn(t))}function Zn(e){return typeof e==`object`&&!!e&&`type`in e&&`result`in e&&(e.type===`data`||e.type===`error`)}function Qn(e){return nr(e.result)&&Wt.has(e.result.status)}function $n(e){return e.type===`error`}function er(e){return(e&&e.type)===`redirect`}function tr(e){return typeof e==`object`&&!!e&&`type`in e&&`data`in e&&`init`in e&&e.type===`DataWithResponseInit`}function nr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.headers==`object`&&e.body!==void 0}function rr(e){return Wt.has(e)}function ir(e){return nr(e)&&rr(e.status)&&e.headers.has(`Location`)}function ar(e){return Ut.has(e.toUpperCase())}function or(e){return Vt.has(e.toUpperCase())}function sr(e){return new URLSearchParams(e).getAll(`index`).some(e=>e===``)}function cr(e,t){let n=typeof t==`string`?we(t).search:t.search;if(e[e.length-1].route.index&&sr(n||``))return e[e.length-1];let r=lt(e);return r[r.length-1]}function lr(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:a,json:o}=e;if(t&&n&&r){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:a,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function ur(e,t,n,r){return r?{state:`loading`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:`loading`,location:e,matches:t,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function dr(e,t,n,r){return{state:`submitting`,location:e,matches:t,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function fr(e,t){return e?{state:`loading`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:`loading`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function pr(e,t){return{state:`submitting`,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function mr(e){return{state:`idle`,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function hr(e,t){try{let n=e.sessionStorage.getItem(Yt);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch{}}function gr(e,t){if(t.size>0){let n={};for(let[e,r]of t)n[e]=[...r];try{e.sessionStorage.setItem(Yt,JSON.stringify(n))}catch(e){L(!1,`Failed to save applied view transitions in sessionStorage (${e}).`)}}}function _r(){let e,t,n=new Promise((r,i)=>{e=async e=>{r(e);try{await n}catch{}},t=async e=>{i(e);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var vr=j.createContext(null);vr.displayName=`DataRouter`;var yr=j.createContext(null);yr.displayName=`DataRouterState`;var br=j.createContext(!1);function xr(){return j.useContext(br)}var Sr=j.createContext({isTransitioning:!1});Sr.displayName=`ViewTransition`;var Cr=j.createContext(new Map);Cr.displayName=`Fetchers`;var wr=j.createContext(null);wr.displayName=`Await`;var Tr=j.createContext(null);Tr.displayName=`Navigation`;var Er=j.createContext(null);Er.displayName=`Location`;var Dr=j.createContext({outlet:null,matches:[],isDataRoute:!1});Dr.displayName=`Route`;var Or=j.createContext(null);Or.displayName=`RouteError`;var kr=`REACT_ROUTER_ERROR`,Ar=`REDIRECT`,jr=`ROUTE_ERROR_RESPONSE`;function Mr(e){if(e.startsWith(`${kr}:${Ar}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Nr(e){if(e.startsWith(`${kr}:${jr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new yt(t.status,t.statusText,t.data)}catch{}}function Pr(e,{relative:t}={}){I(Fr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=j.useContext(Tr),{hash:i,pathname:a,search:o}=Wr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:pt([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Fr(){return j.useContext(Er)!=null}function Ir(){return I(Fr(),`useLocation() may be used only in the context of a <Router> component.`),j.useContext(Er).location}var Lr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Rr(e){j.useContext(Tr).static||j.useLayoutEffect(e)}function zr(){let{isDataRoute:e}=j.useContext(Dr);return e?oi():Br()}function Br(){I(Fr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=j.useContext(vr),{basename:t,navigator:n}=j.useContext(Tr),{matches:r}=j.useContext(Dr),{pathname:i}=Ir(),a=JSON.stringify(ut(r)),o=j.useRef(!1);return Rr(()=>{o.current=!0}),j.useCallback((r,s={})=>{if(L(o.current,Lr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=dt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:pt([t,c.pathname])),zt(typeof r==`string`?r:Ce(r),n.createHref(c),It(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Vr=j.createContext(null);function Hr(e){let t=j.useContext(Dr).outlet;return j.useMemo(()=>t&&j.createElement(Vr.Provider,{value:e},t),[t,e])}function Ur(){let{matches:e}=j.useContext(Dr);return e[e.length-1]?.params??{}}function Wr(e,{relative:t}={}){let{matches:n}=j.useContext(Dr),{pathname:r}=Ir(),i=JSON.stringify(ut(n));return j.useMemo(()=>dt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Gr(e,t,n){I(Fr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=j.useContext(Tr),{matches:i}=j.useContext(Dr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;ci(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Ir(),d;if(t){let e=typeof t==`string`?we(t):t;I(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):Ie(e,{pathname:p});L(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),L(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Qr(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:pt([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:pt([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?j.createElement(Er.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Kr(){let e=ai(),t=bt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=j.createElement(j.Fragment,null,j.createElement(`p`,null,`💿 Hey developer 👋`),j.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,j.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,j.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),j.createElement(j.Fragment,null,j.createElement(`h2`,null,`Unexpected Application Error!`),j.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?j.createElement(`pre`,{style:i},n):null,o)}var qr=j.createElement(Kr,null),Jr=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Nr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:j.createElement(Dr.Provider,{value:this.props.routeContext},j.createElement(Or.Provider,{value:e,children:this.props.component}));return this.context?j.createElement(Xr,{error:e},t):t}};Jr.contextType=br;var Yr=new WeakMap;function Xr({children:e,error:t}){let{basename:n,navigator:r}=j.useContext(Tr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Mr(t.digest);if(e){let i=Yr.get(t);if(i)throw i;let a=Ct(e.location,n),o=a.absoluteURL||a.to;if(zt(e.location,o,It(r),`allow-explicit`),Nn(o))throw Error(`Invalid redirect location`);if(St&&!Yr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw Yr.set(t,n),n}}return j.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Zr({routeContext:e,match:t,children:n}){let r=j.useContext(vr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Dr.Provider,{value:e},n)}function Qr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);I(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:xt(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||qr,o&&(s<0&&c===0?(ci(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?j.createElement(n.route.Component,null):n.route.element?n.route.element:e,j.createElement(Zr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?j.createElement(Jr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function $r(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ei(e){let t=j.useContext(vr);return I(t,$r(e)),t}function ti(e){let t=j.useContext(yr);return I(t,$r(e)),t}function ni(e){let t=j.useContext(Dr);return I(t,$r(e)),t}function ri(e){let t=ni(e),n=t.matches[t.matches.length-1];return I(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ii(){return ri(`useRouteId`)}function ai(){let e=j.useContext(Or),t=ti(`useRouteError`),n=ri(`useRouteError`);return e===void 0?t.errors?.[n]:e}function oi(){let{router:e}=ei(`useNavigate`),t=ri(`useNavigate`),n=j.useRef(!1);return Rr(()=>{n.current=!0}),j.useCallback(async(r,i={})=>{L(n.current,Lr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var si={};function ci(e,t,n){!t&&!si[e]&&(si[e]=!0,L(!1,n))}var li={};function ui(e,t){!e&&!li[t]&&(li[t]=!0,console.warn(t))}var di=j.useOptimistic,fi=()=>void 0;function pi(e){return di?di(e):[e,fi]}function mi(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&L(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:j.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&L(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:j.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&L(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:j.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var hi=[`HydrateFallback`,`hydrateFallbackElement`],gi=class{constructor(){this.status=`pending`,this.promise=new Promise((e,t)=>{this.resolve=t=>{this.status===`pending`&&(this.status=`resolved`,e(t))},this.reject=e=>{this.status===`pending`&&(this.status=`rejected`,t(e))}})}};function _i({router:e,flushSync:t,onError:n,useTransitions:r}){r=xr()||r;let[i,a]=j.useState(e.state),[o,s]=pi(i),[c,l]=j.useState(),[u,d]=j.useState({isTransitioning:!1}),[f,p]=j.useState(),[m,h]=j.useState(),[g,_]=j.useState(),v=j.useRef(new Map),y=j.useCallback((i,{deletedFetchers:o,newErrors:c,flushSync:u,viewTransitionOpts:g})=>{c&&n&&Object.values(c).forEach(e=>n(e,{location:i.location,params:i.matches[0]?.params??{},pattern:xt(i.matches)})),i.fetchers.forEach((e,t)=>{e.data!==void 0&&v.current.set(t,e.data)}),o.forEach(e=>v.current.delete(e)),ui(u===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let y=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition==`function`;if(ui(g==null||y,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!g||!y){t&&u?t(()=>a(i)):r===!1?a(i):j.startTransition(()=>{r===!0&&s(e=>vi(e,i)),a(i)});return}if(t&&u){t(()=>{m&&(f?.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:g.currentLocation,nextLocation:g.nextLocation})});let n=e.window.document.startViewTransition(()=>{t(()=>a(i))});n.finished.finally(()=>{t(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})})}),t(()=>h(n));return}m?(f?.resolve(),m.skipTransition(),_({state:i,currentLocation:g.currentLocation,nextLocation:g.nextLocation})):(l(i),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}))},[e.window,t,m,f,r,s,n]);j.useLayoutEffect(()=>e.subscribe(y),[e,y]),j.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new gi)},[u]),j.useEffect(()=>{if(f&&c&&e.window){let t=c,n=f.promise,i=e.window.document.startViewTransition(async()=>{r===!1?a(t):j.startTransition(()=>{r===!0&&s(e=>vi(e,t)),a(t)}),await n});i.finished.finally(()=>{p(void 0),h(void 0),l(void 0),d({isTransitioning:!1})}),h(i)}},[c,f,e.window,r,s]),j.useEffect(()=>{f&&c&&o.location.key===c.location.key&&f.resolve()},[f,m,o.location,c]),j.useEffect(()=>{!u.isTransitioning&&g&&(l(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),_(void 0))},[u.isTransitioning,g]);let b=j.useMemo(()=>({createHref:e.createHref,createURL:e.createURL,encodeLocation:e.encodeLocation,go:t=>e.navigate(t),push:(t,n,r)=>e.navigate(t,{state:n,preventScrollReset:r?.preventScrollReset}),replace:(t,n,r)=>e.navigate(t,{replace:!0,state:n,preventScrollReset:r?.preventScrollReset})}),[e]),x=e.basename||`/`,S=j.useMemo(()=>({router:e,navigator:b,static:!1,basename:x,onError:n}),[e,b,x,n]);return j.createElement(j.Fragment,null,j.createElement(vr.Provider,{value:S},j.createElement(yr.Provider,{value:o},j.createElement(Cr.Provider,{value:v.current},j.createElement(Sr.Provider,{value:u},j.createElement(Ci,{basename:x,location:o.location,navigationType:o.historyAction,navigator:b,useTransitions:r},j.createElement(yi,{routes:e.routes,manifest:e.manifest,future:e.future,state:o,isStatic:!1,onError:n})))))),null)}function vi(e,t){return{...e,navigation:t.navigation.state===`idle`?e.navigation:t.navigation,revalidation:t.revalidation===`idle`?e.revalidation:t.revalidation,actionData:t.navigation.state===`submitting`?e.actionData:t.actionData,fetchers:t.fetchers}}var yi=j.memo(bi);function bi({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Gr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function xi({to:e,replace:t,state:n,relative:r}){I(Fr(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i,navigator:a}=j.useContext(Tr);L(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:o}=j.useContext(Dr),{pathname:s}=Ir(),c=zr(),l=dt(e,ut(o),s,r===`path`);zt(typeof e==`string`?e:Ce(e),a.createHref(l),It(a),`reject`);let u=JSON.stringify(l);return j.useEffect(()=>{c(JSON.parse(u),{replace:t,state:n,relative:r})},[c,u,r,t,n]),null}function Si(e){return Hr(e.context)}function Ci({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){I(!Fr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=j.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=we(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=j.useMemo(()=>{let e=rt(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return L(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:j.createElement(Tr.Provider,{value:c},j.createElement(Er.Provider,{children:t,value:h}))}j.Component;var wi=`get`,Ti=`application/x-www-form-urlencoded`;function Ei(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Di(e){return Ei(e)&&e.tagName.toLowerCase()===`button`}function Oi(e){return Ei(e)&&e.tagName.toLowerCase()===`form`}function ki(e){return Ei(e)&&e.tagName.toLowerCase()===`input`}function Ai(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ji(e,t){return e.button===0&&(!t||t===`_self`)&&!Ai(e)}var Mi=null;function Ni(){if(Mi===null)try{new FormData(document.createElement(`form`),0),Mi=!1}catch{Mi=!0}return Mi}var Pi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Fi(e){return e!=null&&!Pi.has(e)?(L(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ti}"`),null):e}function Ii(e,t){let n,r,i,a,o;if(Oi(e)){let o=e.getAttribute(`action`);r=o?rt(o,t):null,n=e.getAttribute(`method`)||wi,i=Fi(e.getAttribute(`enctype`))||Ti,a=new FormData(e)}else if(Di(e)||ki(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?rt(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||wi,i=Fi(e.getAttribute(`formenctype`))||Fi(o.getAttribute(`enctype`))||Ti,a=new FormData(o,e),!Ni()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Ei(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=wi,r=null,i=Ti,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Li(e,t){if(e===!1||e==null)throw Error(t)}function Ri(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&rt(i.pathname,t)===`/`?`${mt(t)}/_root.${r}`:`${mt(i.pathname)}.${r}`,i}async function zi(e,t){if(e.id in t)return t[e.id];try{let n=await M(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Bi(e){return e!=null&&typeof e.page==`string`}function Vi(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Hi(e,t,n){return qi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await zi(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Vi).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Ui(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Wi(e,t,{includeHydrateFallback:n}={}){return Gi(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function Gi(e){return[...new Set(e)]}function Ki(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function qi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Bi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Ki(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Ji(){let e=j.useContext(vr);return Li(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Yi(){let e=j.useContext(yr);return Li(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Xi=j.createContext(void 0);Xi.displayName=`FrameworkContext`;function Zi(){let e=j.useContext(Xi);return Li(e,`You must render this element inside a <HydratedRouter> element`),e}function Qi(e,t){let n=j.useContext(Xi),[r,i]=j.useState(!1),[a,o]=j.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=j.useRef(null);j.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),j.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:$i(s,p),onBlur:$i(c,m),onMouseEnter:$i(l,p),onMouseLeave:$i(u,m),onTouchStart:$i(d,p)}]:[a,f,{}]:[!1,f,{}]}function $i(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function ea({page:e,...t}){let n=xr(),{nonce:r}=Zi(),{router:i}=Ji(),a=j.useMemo(()=>Ie(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?j.createElement(na,{page:e,matches:a,...t}):j.createElement(ra,{page:e,matches:a,...t})):null}function ta(e){let{manifest:t,routeModules:n}=Zi(),[r,i]=j.useState([]);return j.useEffect(()=>{let r=!1;return Hi(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function na({page:e,matches:t,...n}){let r=Ir(),{future:i}=Zi(),{basename:a}=Ji(),o=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Ri(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return j.createElement(j.Fragment,null,o.map(e=>j.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ra({page:e,matches:t,...n}){let r=Ir(),{future:i,manifest:a,routeModules:o}=Zi(),{basename:s}=Ji(),{loaderData:c,matches:l}=Yi(),u=j.useMemo(()=>Ui(e,t,l,a,r,`data`),[e,t,l,a,r]),d=j.useMemo(()=>Ui(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Ri(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=j.useMemo(()=>Wi(d,a),[d,a]),m=ta(d);return j.createElement(j.Fragment,null,f.map(e=>j.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>j.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>j.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function ia(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}j.Component;var aa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{aa&&(window.__reactRouterVersion=`7.18.3`)}catch{}function z(e,t){return nn({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:ye({window:t?.window}),hydrationData:t?.hydrationData||oa(),routes:e,mapRouteProperties:mi,hydrationRouteProperties:hi,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,instrumentations:t?.instrumentations}).initialize()}function oa(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:sa(e.errors)}),e}function sa(e){if(!e)return null;let t=Object.entries(e),n={};for(let[e,r]of t)if(r&&r.__type===`RouteErrorResponse`)n[e]=new yt(r.status,r.statusText,r.data,r.internal===!0);else if(r&&r.__type===`Error`){if(typeof r.__subType==`string`&&vt.includes(r.__subType)){let t=window[r.__subType];if(typeof t==`function`)try{let i=new t(r.message);i.stack=``,n[e]=i}catch{}}if(n[e]==null){let t=Error(r.message);t.stack=``,n[e]=t}}else n[e]=r;return n}var ca=j.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=j.useContext(Tr),v=typeof l==`string`&&ge.test(l),y=Ct(l,h);l=y.to;let b=Pr(l,{relative:r}),x=Ir(),S=null;if(o){let e=dt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:pt([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Qi(n,p),E=pa(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=j.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:ia(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?j.createElement(j.Fragment,null,k,j.createElement(ea,{page:b})):k});ca.displayName=`Link`;var la=j.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Wr(a,{relative:c.relative}),d=Ir(),f=j.useContext(yr),{navigator:p,basename:m}=j.useContext(Tr),h=f!=null&&va(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=rt(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return j.createElement(ca,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});la.displayName=`NavLink`;var ua=j.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=wi,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=j.useContext(Tr),g=ga(),_=_a(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&ge.test(s);return j.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?j.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});ua.displayName=`Form`;function da(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fa(e){let t=j.useContext(vr);return I(t,da(e)),t}function pa(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=zr(),d=Ir(),f=Wr(e,{relative:o});return j.useCallback(p=>{if(ji(p,t)){p.preventDefault();let t=n===void 0?Ce(d)===Ce(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?j.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var ma=0,ha=()=>`__${String(++ma)}__`;function ga(){let{router:e}=fa(`useSubmit`),{basename:t}=j.useContext(Tr),n=ii(),r=e.fetch,i=e.navigate;return j.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Ii(e,t);if(a.navigate===!1){let e=a.fetcherKey||ha();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function _a(e,{relative:t}={}){let{basename:n}=j.useContext(Tr),r=j.useContext(Dr);I(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Wr(e||`.`,{relative:t})},o=Ir();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:pt([n,a.pathname])),Ce(a)}function va(e,{relative:t}={}){let n=j.useContext(Sr);I(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=fa(`useViewTransitionState`),i=Wr(e,{relative:t});if(!n.isTransitioning)return!1;let a=rt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=rt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return $e(i.pathname,o)!=null||$e(i.pathname,a)!=null}var ya=r(ae(),1);function ba(e){return j.createElement(_i,{flushSync:ya.flushSync,...e})}var xa={restaurant_hall_delivery:{id:`restaurant_hall_delivery`,name:`Ресторан: Зал + Доставка`,label:`Суши & Гёдза (Зал + Доставка)`,category:`Общепит`,companyName:`Суши & Гёдза`,locations:[`Горский 1/1`,`Красный пр-т 186а`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!0,booking:!0,pos:!0,kds:!0,dining:!0,work_orders:!1,production:!0,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`Заказы`,route:`/operations/orders`,badge:`14`},{id:`pos`,label:`Касса (POS)`,route:`/operations/pos`,requiredCapability:`pos`},{id:`dining`,label:`Зал`,route:`/operations/dining`,requiredCapability:`dining`,badge:`82%`},{id:`kds`,label:`Кухня (KDS)`,route:`/operations/kds`,requiredCapability:`kds`,badge:`6`},{id:`catalog`,label:`Меню`,route:`/operations/catalog`},{id:`recipes`,label:`Техкарты`,route:`/operations/recipes`,requiredCapability:`production`},{id:`inventory`,label:`Склад`,route:`/operations/inventory`,requiredCapability:`inventory`},{id:`purchasing`,label:`Закупки`,route:`/operations/purchasing`,requiredCapability:`purchasing`},{id:`delivery`,label:`Доставка`,route:`/operations/delivery`,requiredCapability:`delivery`,badge:`5`},{id:`booking`,label:`Бронирования`,route:`/operations/booking`,requiredCapability:`booking`}],terminology:{itemLabel:`Блюдо`,itemsLabel:`Меню и напитки`,bookingResourceLabel:`Стол`,orderSourceLabel:`Зал / Доставка / Навынос`,clientIdentifierLabel:`Гость ресторана`},dashboardPreset:{primaryKpis:[`revenue_today`,`orders_count`,`avg_check`,`hall_occupancy`,`food_cost`],quickActionIds:[`new_order`,`book_table`,`create_task`,`new_client`,`new_expense`,`write_off`]}},restaurant_delivery_only:{id:`restaurant_delivery_only`,name:`Ресторан: Только Доставка / Dark Kitchen`,label:`Суши & Гёдза Express (Dark Kitchen)`,category:`Общепит / Dark Kitchen`,companyName:`Суши & Гёдза Express`,locations:[`Красный пр-т 186а (Кухня 1)`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!0,booking:!1,pos:!0,kds:!0,dining:!1,work_orders:!1,production:!0,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`Заказы`,route:`/operations/orders`,badge:`19`},{id:`pos`,label:`Касса (POS)`,route:`/operations/pos`,requiredCapability:`pos`},{id:`kds`,label:`Кухня (KDS)`,route:`/operations/kds`,requiredCapability:`kds`,badge:`9`},{id:`catalog`,label:`Меню`,route:`/operations/catalog`},{id:`recipes`,label:`Техкарты`,route:`/operations/recipes`,requiredCapability:`production`},{id:`inventory`,label:`Склад`,route:`/operations/inventory`,requiredCapability:`inventory`},{id:`purchasing`,label:`Закупки`,route:`/operations/purchasing`,requiredCapability:`purchasing`},{id:`delivery`,label:`Доставка`,route:`/operations/delivery`,requiredCapability:`delivery`,badge:`12`}],terminology:{itemLabel:`Позиция доставки`,itemsLabel:`Ассортимент Dark Kitchen`,bookingResourceLabel:`Линия сборки`,orderSourceLabel:`Доставка / Агрегаторы`,clientIdentifierLabel:`Получатель заказа`},dashboardPreset:{primaryKpis:[`revenue_today`,`orders_count`,`avg_check`,`delivery_avg_time`,`food_cost`],quickActionIds:[`new_order`,`assign_courier`,`create_task`,`new_client`,`inventory_check`]}},retail:{id:`retail`,name:`Розничная торговля / Retail`,label:`Krona Retail & Store`,category:`Торговля`,companyName:`Krona Concept Store`,locations:[`Флагманский магазин — Ленина 12`,`Островок в ТЦ`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!1,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!1,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`Продажи`,route:`/operations/orders`,badge:`31`},{id:`pos`,label:`Касса`,route:`/operations/pos`,requiredCapability:`pos`},{id:`catalog`,label:`Товары & Штрихкоды`,route:`/operations/catalog`},{id:`inventory`,label:`Склад & Остатки`,route:`/operations/inventory`,requiredCapability:`inventory`},{id:`purchasing`,label:`Закупки`,route:`/operations/purchasing`,requiredCapability:`purchasing`},{id:`suppliers`,label:`Поставщики`,route:`/operations/purchasing?tab=suppliers`},{id:`audit`,label:`Инвентаризация`,route:`/operations/inventory?tab=audit`},{id:`pricing`,label:`Цены & Скидки`,route:`/operations/catalog?tab=pricing`}],terminology:{itemLabel:`Товар`,itemsLabel:`Товары и SKU`,bookingResourceLabel:`Торговая точка`,orderSourceLabel:`Касса / Интернет-магазин`,clientIdentifierLabel:`Покупатель`},dashboardPreset:{primaryKpis:[`revenue_today`,`orders_count`,`avg_check`,`stock_turnover`,`margin_rate`],quickActionIds:[`pos_sale`,`stock_intake`,`new_client`,`inventory_scan`,`create_task`]}},car_wash:{id:`car_wash`,name:`Автомойка`,label:`Автомойка Крона`,category:`Автоуслуги`,companyName:`Автомойка Крона`,locations:[`Бокс 1-6 — ул. Станционная 42`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!1,tasks:!0,cms:!1,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!0,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Запись & Очередь`,route:`/operations/booking`,requiredCapability:`booking`,badge:`7`},{id:`work_orders`,label:`Заказ-наряды`,route:`/operations/work-orders`,requiredCapability:`work_orders`,badge:`3`},{id:`vehicles`,label:`Автомобили`,route:`/crm?tab=vehicles`},{id:`pos`,label:`Касса & Оплата`,route:`/operations/pos`,requiredCapability:`pos`},{id:`bays`,label:`Боксы`,route:`/operations/bays`},{id:`catalog`,label:`Услуги & Прайс`,route:`/operations/catalog`},{id:`inventory`,label:`Материалы & Склад`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Услуга`,itemsLabel:`Услуги`,bookingResourceLabel:`Бокс`,orderSourceLabel:`Прямой заезд / Запись`,clientIdentifierLabel:`Владелец (Госномер)`},dashboardPreset:{primaryKpis:[`revenue_today`,`bay_load`,`avg_ticket`,`repeat_rate`],quickActionIds:[`new_booking`,`new_vehicle`,`new_payment`,`create_task`]}},beauty_services:{id:`beauty_services`,name:`Салон красоты / Бьюти`,label:`Студия Красоты Крона Эстетик`,category:`Сфера услуг`,companyName:`Студия Красоты Крона`,locations:[`Центр — Советская 25`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!1,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Запись клиентов`,route:`/operations/booking`,requiredCapability:`booking`,badge:`11`},{id:`schedule`,label:`Расписание мастеров`,route:`/employees?tab=schedule`},{id:`pos`,label:`Касса & Визиты`,route:`/operations/pos`,requiredCapability:`pos`},{id:`masters`,label:`Специалисты`,route:`/employees`},{id:`catalog`,label:`Услуги салона`,route:`/operations/catalog`},{id:`resources`,label:`Рабочие места`,route:`/operations/bays`},{id:`inventory`,label:`Расходники`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Услуга мастера`,itemsLabel:`Услуги и уходовая косметика`,bookingResourceLabel:`Мастер / Кресло`,orderSourceLabel:`Онлайн-запись / Стойка`,clientIdentifierLabel:`Клиент салона`},dashboardPreset:{primaryKpis:[`revenue_today`,`appointments_today`,`master_load`,`avg_check`,`retention_rate`],quickActionIds:[`new_booking`,`new_client`,`pos_sale`,`chat_message`,`create_task`]}},wholesale_b2b:{id:`wholesale_b2b`,name:`Оптовая торговля / B2B`,label:`Торговый Дом Крона Опт`,category:`Опт & Дистрибуция`,companyName:`Торговый Дом Крона Опт`,locations:[`Центральный распределительный склад — Северный проезд 8`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!1,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!0,booking:!1,pos:!1,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`B2B Заказы & Спецификации`,route:`/operations/orders`,badge:`18`},{id:`companies`,label:`Компании & Договоры`,route:`/crm?tab=companies`},{id:`inventory`,label:`Оптовый склад & Партии`,route:`/operations/inventory`,requiredCapability:`inventory`},{id:`purchasing`,label:`Контракты & Закупки`,route:`/operations/purchasing`,requiredCapability:`purchasing`},{id:`suppliers`,label:`Поставщики`,route:`/operations/purchasing?tab=suppliers`},{id:`documents`,label:`УПД & Документы`,route:`/finance?tab=docs`},{id:`delivery`,label:`Логистика & Отгрузки`,route:`/operations/delivery`,requiredCapability:`delivery`}],terminology:{itemLabel:`Товарная позиция`,itemsLabel:`Номенклатурный каталог`,bookingResourceLabel:`Складская зона`,orderSourceLabel:`B2B Договор / EDI`,clientIdentifierLabel:`Контрагент / ИНН`},dashboardPreset:{primaryKpis:[`revenue_month`,`active_contracts`,`receivables`,`warehouse_capacity`,`b2b_avg_deal`],quickActionIds:[`new_deal`,`new_contract`,`stock_receipt`,`create_invoice`,`create_task`]}},auto_service:{id:`auto_service`,name:`Автосервис / СТО`,label:`СТО Крона`,category:`Автоуслуги`,companyName:`СТО Крона`,locations:[`Главный сервис`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!1,tasks:!0,cms:!1,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!0,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Запись & Очередь`,route:`/operations/booking`,requiredCapability:`booking`,badge:`7`},{id:`vehicles`,label:`Автомобили`,route:`/crm?tab=vehicles`},{id:`work_orders`,label:`Заказ-наряды`,route:`/operations/work-orders`,requiredCapability:`work_orders`,badge:`4`},{id:`pos`,label:`Касса & Оплата`,route:`/operations/pos`,requiredCapability:`pos`},{id:`bays`,label:`Посты & Подъёмники`,route:`/operations/bays`},{id:`catalog`,label:`Услуги & Прайс`,route:`/operations/catalog`},{id:`inventory`,label:`Запчасти & Склад`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Услуга / Деталь`,itemsLabel:`Работы и запчасти`,bookingResourceLabel:`Подъёмник`,orderSourceLabel:`Заказ-наряд`,clientIdentifierLabel:`Владелец ТС (Госномер)`},dashboardPreset:{primaryKpis:[`revenue_today`,`work_orders_active`,`bay_load`,`avg_ticket`,`repeat_rate`],quickActionIds:[`new_booking`,`new_work_order`,`new_vehicle`,`new_payment`,`create_task`]}},fitness:{id:`fitness`,name:`Фитнес-клуб`,label:`Крона Фитнес`,category:`Спорт и здоровье`,companyName:`Крона Фитнес`,locations:[`Клуб на Ленина`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Расписание & Запись`,route:`/operations/booking`,requiredCapability:`booking`},{id:`pos`,label:`Касса & Ресепшн`,route:`/operations/pos`,requiredCapability:`pos`},{id:`trainers`,label:`Тренеры`,route:`/employees`},{id:`catalog`,label:`Абонементы & Услуги`,route:`/operations/catalog`},{id:`inventory`,label:`Склад (Бар/Мерч)`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Абонемент / Тренировка`,itemsLabel:`Прайс-лист`,bookingResourceLabel:`Зал / Тренер`,orderSourceLabel:`Онлайн / Ресепшн`,clientIdentifierLabel:`Член клуба`},dashboardPreset:{primaryKpis:[`revenue_today`,`active_memberships`,`visits_today`,`avg_check`],quickActionIds:[`new_booking`,`new_client`,`pos_sale`,`create_task`]}},clinic:{id:`clinic`,name:`Медицинская клиника / Стоматология`,label:`Крона Мед`,category:`Здоровье`,companyName:`Крона Мед`,locations:[`Главный филиал`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Приемы & Расписание`,route:`/operations/booking`,requiredCapability:`booking`},{id:`pos`,label:`Касса`,route:`/operations/pos`,requiredCapability:`pos`},{id:`doctors`,label:`Врачи`,route:`/employees`},{id:`catalog`,label:`Услуги`,route:`/operations/catalog`},{id:`inventory`,label:`Медикаменты & Расходники`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Услуга`,itemsLabel:`Услуги`,bookingResourceLabel:`Врач / Кабинет`,orderSourceLabel:`Запись`,clientIdentifierLabel:`Пациент`},dashboardPreset:{primaryKpis:[`revenue_today`,`visits_today`,`avg_check`],quickActionIds:[`new_booking`,`new_client`,`pos_sale`,`create_task`]}},coworking:{id:`coworking`,name:`Коворкинг / Аренда пространств`,label:`Крона Коворкинг`,category:`Недвижимость`,companyName:`Крона Коворкинг`,locations:[`Кампус`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!1,booking:!0,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`booking`,label:`Бронирование`,route:`/operations/booking`,requiredCapability:`booking`},{id:`pos`,label:`Оплата`,route:`/operations/pos`,requiredCapability:`pos`},{id:`catalog`,label:`Тарифы`,route:`/operations/catalog`},{id:`inventory`,label:`Склад`,route:`/operations/inventory`,requiredCapability:`inventory`}],terminology:{itemLabel:`Тариф / Опция`,itemsLabel:`Тарифы`,bookingResourceLabel:`Переговорная / Стол`,orderSourceLabel:`Онлайн / Ресепшн`,clientIdentifierLabel:`Резидент`},dashboardPreset:{primaryKpis:[`revenue_today`,`occupancy_rate`,`active_memberships`],quickActionIds:[`new_booking`,`new_client`,`pos_sale`,`create_task`]}},logistics:{id:`logistics`,name:`Логистика / Курьерская служба`,label:`Крона Доставка`,category:`Логистика`,companyName:`Крона Доставка`,locations:[`Сортировочный центр`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!1,purchasing:!1,delivery:!0,booking:!1,pos:!0,kds:!1,dining:!1,work_orders:!1,production:!1,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`delivery`,label:`Заказы & Маршруты`,route:`/operations/delivery`,requiredCapability:`delivery`},{id:`pos`,label:`Оплата`,route:`/operations/pos`,requiredCapability:`pos`}],terminology:{itemLabel:`Услуга доставки`,itemsLabel:`Тарифы`,bookingResourceLabel:`Курьер / Машина`,orderSourceLabel:`Заказ`,clientIdentifierLabel:`Отправитель / Получатель`},dashboardPreset:{primaryKpis:[`orders_today`,`avg_delivery_time`,`success_rate`],quickActionIds:[`new_order`,`assign_courier`,`create_task`]}},custom_meta:{id:`custom_meta`,name:`Кастомный профиль / Meta-profile`,label:`Универсальный Business OS (Все модули)`,category:`Конфигурируемый`,companyName:`Бизнес-экосистема Крона`,locations:[`Главный офис`,`Локация 2`],capabilities:{crm:!0,sales:!0,communications:!0,helpdesk:!0,tasks:!0,cms:!0,marketing:!0,analytics:!0,finance:!0,employees:!0,inventory:!0,purchasing:!0,delivery:!0,booking:!0,pos:!0,kds:!0,dining:!0,work_orders:!0,production:!0,automation:!0,ai:!0},operationsTabs:[{id:`overview`,label:`Обзор`,route:`/operations`},{id:`orders`,label:`Заказы`,route:`/operations/orders`},{id:`pos`,label:`Касса (POS)`,route:`/operations/pos`},{id:`dining`,label:`Зал`,route:`/operations/dining`},{id:`kds`,label:`KDS`,route:`/operations/kds`},{id:`work_orders`,label:`Заказ-наряды`,route:`/operations/work-orders`},{id:`catalog`,label:`Каталог`,route:`/operations/catalog`},{id:`inventory`,label:`Склад`,route:`/operations/inventory`},{id:`purchasing`,label:`Закупки`,route:`/operations/purchasing`},{id:`delivery`,label:`Доставка`,route:`/operations/delivery`},{id:`booking`,label:`Бронирования`,route:`/operations/booking`}],terminology:{itemLabel:`Единица продукции`,itemsLabel:`Каталог сущностей`,bookingResourceLabel:`Бизнес-ресурс`,orderSourceLabel:`Канал продаж`,clientIdentifierLabel:`Клиент / Субъект`},dashboardPreset:{primaryKpis:[`revenue_today`,`orders_count`,`avg_check`,`tasks_open`,`ai_insights`],quickActionIds:[`new_order`,`new_client`,`create_task`,`new_expense`,`chat_message`]}}},Sa=[{id:`kds-1`,orderNumber:`#104`,tableOrChannel:`Стол 4`,status:`cooking`,elapsedMinutes:8,isUrgent:!1,items:[{name:`Филадельфия Премиум`,quantity:2,station:`Суши-цех`},{name:`Том Ям с морепродуктами`,quantity:1,station:`Кухня`}]},{id:`kds-2`,orderNumber:`#105`,tableOrChannel:`Доставка #42`,status:`new`,elapsedMinutes:2,isUrgent:!0,items:[{name:`Калифорния с крабом`,quantity:1,station:`Суши-цех`},{name:`Гёдза со свининой`,quantity:2,station:`Кухня`},{name:`Морс клюквенный 0.5`,quantity:2,station:`Бар`}]},{id:`kds-3`,orderNumber:`#103`,tableOrChannel:`Стол 2`,status:`ready`,elapsedMinutes:14,items:[{name:`Рамен Тонкоцу`,quantity:1,station:`Кухня`},{name:`Эби Темпура`,quantity:1,station:`Гриль`}]}],Ca=[{id:`del-1`,orderId:`#ORD-2041`,recipientName:`Максим Белов`,phone:`+7 (913) 456-78-90`,address:`ул. Ленина 21, кв. 44, подъезд 2, эт. 5`,courierName:`Алексей Смирнов (Авто)`,status:`in_transit`,amount:2450,paymentMethod:`card`,etaMinutes:18},{id:`del-2`,orderId:`#ORD-2042`,recipientName:`Екатерина Морозова`,phone:`+7 (923) 112-33-44`,address:`Красный проспект 99, офис 305`,courierName:`Дмитрий Волков (Самокат)`,status:`pending`,amount:1890,paymentMethod:`online`,etaMinutes:35},{id:`del-3`,orderId:`#ORD-2039`,recipientName:`Олег Савельев`,phone:`+7 (905) 998-21-12`,address:`ул. Кирова 48, кв. 12`,courierName:`Алексей Смирнов (Авто)`,status:`delivered`,amount:3200,paymentMethod:`cash`,etaMinutes:0}],wa=[{id:`book-1`,resourceName:`Стол 4 (у окна, 4 чел)`,time:`19:00`,clientName:`Анна Воронина`,clientPhone:`+7 (913) 777-12-34`,guestsOrCar:`3 гостя`,status:`confirmed`,deposit:1e3},{id:`book-2`,resourceName:`Стол 1 (VIP, 6 чел)`,time:`20:30`,clientName:`Виктор Платонов`,clientPhone:`+7 (923) 888-99-00`,guestsOrCar:`5 гостей`,status:`confirmed`,deposit:2e3},{id:`book-3`,resourceName:`Пост 1 (Мойка + Детейлинг)`,time:`14:00`,clientName:`Сергей Ковалев`,clientPhone:`+7 (903) 445-56-67`,guestsOrCar:`BMW X5 (А001АА 154)`,status:`seated`,deposit:500}],Ta=[{id:`WO-881`,vehicle:`Toyota Land Cruiser (Р777УУ 154)`,ownerName:`Андрей Романов`,phone:`+7 (913) 222-33-44`,bay:`Пост 2 (Подъёмник)`,masterName:`Иван Кузнецов`,services:[`Замена масла ДВС`,`Диагностика ходовой`,`Замена передних колодок`],partsAmount:8600,laborAmount:4200,status:`in_progress`},{id:`WO-882`,vehicle:`Porsche Cayenne (В500ВВ 154)`,ownerName:`Елена Соколова`,phone:`+7 (923) 444-11-22`,bay:`Пост 4 (Детейлинг бокс)`,masterName:`Артем Васильев`,services:[`Комплексная мойка Люкс`,`Керамическое покрытие кузова`,`Консервация кожи`],partsAmount:3500,laborAmount:14e3,status:`ready`}],Ea=[{id:`notif-1`,title:`Критический остаток на складе`,message:`Лосось охлажденный (филе): осталось 2.4 кг (порог 6 кг). Оформите заявку поставщику.`,type:`danger`,timestamp:`12 минут назад`,actionUrl:`/operations/inventory`,read:!1},{id:`notif-2`,title:`Долгий заказ в обработке`,message:`Заказ #104 на Стол 4 готовится уже более 18 минут. Требуется внимание шефа.`,type:`warning`,timestamp:`5 минут назад`,actionUrl:`/operations/kds`,read:!1},{id:`notif-3`,title:`Дневная цель по выручке выполнена`,message:`Выручка за сегодня достигла 184 500 ₽ (108% от плана).`,type:`success`,timestamp:`40 минут назад`,read:!1}],Da=f((e,t)=>({theme:typeof window<`u`&&([`soft-light`,`light`,`dark`].includes(localStorage.getItem(`krona_theme_mode`)||``)?localStorage.getItem(`krona_theme_mode`):null)||`soft-light`,setTheme:t=>{typeof window<`u`&&(localStorage.setItem(`krona_theme_mode`,t),document.documentElement.setAttribute(`data-theme`,t)),e({theme:t})},viewportMode:`desktop`,setViewportMode:t=>e({viewportMode:t}),currentProfileId:typeof window<`u`&&localStorage.getItem(`krona_profile_id`)||`restaurant_hall_delivery`,setProfileId:t=>{typeof window<`u`&&localStorage.setItem(`krona_profile_id`,t);let n=xa[t]||xa.restaurant_hall_delivery;e({currentProfileId:t,customCapabilities:{...n.capabilities},activeLocation:n.locations[0]||`Главная точка`}),p.getState().setCurrentProfileId(t)},currentRoleId:typeof window<`u`&&localStorage.getItem(`krona_role_id`)||`owner`,setRoleId:t=>{typeof window<`u`&&localStorage.setItem(`krona_role_id`,t),e({currentRoleId:t}),p.getState().setCurrentRoleId(t)},activeLocation:`Горский 1/1`,setActiveLocation:t=>e({activeLocation:t}),customCapabilities:{...xa.restaurant_hall_delivery.capabilities},toggleCapability:t=>e(e=>({customCapabilities:{...e.customCapabilities,[t]:!e.customCapabilities[t]}})),resetCapabilitiesToProfile:()=>{e({customCapabilities:{...(xa[t().currentProfileId]||xa.restaurant_hall_delivery).capabilities}})},isCommandPaletteOpen:!1,setIsCommandPaletteOpen:t=>e({isCommandPaletteOpen:t}),isQuickActionsOpen:!1,setIsQuickActionsOpen:t=>e({isQuickActionsOpen:t}),isNotificationsOpen:!1,setIsNotificationsOpen:t=>e({isNotificationsOpen:t}),isAiDrawerOpen:!1,setIsAiDrawerOpen:t=>e({isAiDrawerOpen:t}),isRightPanelCollapsed:!1,setIsRightPanelCollapsed:t=>e({isRightPanelCollapsed:t}),posCart:[{id:`pos-1`,name:`Филадельфия Премиум`,price:690,quantity:1,category:`Роллы`},{id:`pos-2`,name:`Том Ям с креветками`,price:540,quantity:1,category:`Супы`}],posDiscountPercent:0,posCustomerName:`Александр (постоянный гость)`,posOrderType:`hall`,posTableNumber:`Стол 4`,posPaymentModalOpen:!1,posLastReceipt:null,addToCart:t=>e(e=>e.posCart.find(e=>e.id===t.id)?{posCart:e.posCart.map(e=>e.id===t.id?{...e,quantity:e.quantity+1}:e)}:{posCart:[...e.posCart,{...t,quantity:1}]}),removeFromCart:t=>e(e=>({posCart:e.posCart.filter(e=>e.id!==t)})),updateCartQuantity:(t,n)=>e(e=>({posCart:e.posCart.map(e=>e.id===t?{...e,quantity:Math.max(1,e.quantity+n)}:e).filter(e=>e.quantity>0)})),clearCart:()=>e({posCart:[],posDiscountPercent:0}),setPosDiscount:t=>e({posDiscountPercent:t}),setPosCustomer:t=>e({posCustomerName:t}),setPosOrderType:t=>e({posOrderType:t}),setPosTableNumber:t=>e({posTableNumber:t}),setPosPaymentModalOpen:t=>e({posPaymentModalOpen:t}),completeCheckout:n=>{let r=t(),i=r.posCart.reduce((e,t)=>e+t.price*t.quantity,0),a=i*r.posDiscountPercent/100,o=i-a,s={orderNumber:`#${Math.floor(100+Math.random()*900)}`,timestamp:new Date().toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`}),items:[...r.posCart],subtotal:i,discount:a,total:o,paymentType:n,customer:r.posCustomerName,location:r.activeLocation};r.customCapabilities.kds&&e({kdsTickets:[{id:`kds-${Date.now()}`,orderNumber:s.orderNumber,tableOrChannel:r.posOrderType===`hall`?r.posTableNumber:`Навынос / Касса`,status:`new`,elapsedMinutes:0,items:r.posCart.map(e=>({name:e.name,quantity:e.quantity,station:e.category.includes(`Роллы`)||e.category.includes(`Суши`)?`Суши-цех`:`Кухня`}))},...r.kdsTickets]}),e({posLastReceipt:s,posCart:[],posPaymentModalOpen:!1})},kdsTickets:Sa,updateKdsTicketStatus:(t,n)=>e(e=>({kdsTickets:e.kdsTickets.map(e=>e.id===t?{...e,status:n}:e)})),deliveries:Ca,updateDeliveryStatus:(t,n)=>e(e=>({deliveries:e.deliveries.map(e=>e.id===t?{...e,status:n}:e)})),bookings:wa,addBooking:t=>e(e=>({bookings:[...e.bookings,{...t,id:`book-${Date.now()}`}]})),updateBookingStatus:(t,n)=>e(e=>({bookings:e.bookings.map(e=>e.id===t?{...e,status:n}:e)})),workOrders:Ta,updateWorkOrderStatus:(t,n)=>e(e=>({workOrders:e.workOrders.map(e=>e.id===t?{...e,status:n}:e)})),addWorkOrder:t=>e(e=>({workOrders:[{...t,id:`WO-${Math.floor(800+Math.random()*200)}`},...e.workOrders]})),notifications:Ea,dismissNotification:t=>e(e=>({notifications:e.notifications.filter(e=>e.id!==t)})),markAllNotificationsRead:()=>e(e=>({notifications:e.notifications.map(e=>({...e,read:!0}))})),getActiveProfile:()=>xa[t().currentProfileId]||xa.restaurant_hall_delivery,getActiveCapabilities:()=>t().customCapabilities})),Oa=class{entityName;constructor(e){this.entityName=e}resolveContext(e){return e||h()}async applySimulation(){let{simulateLatency:e,latencyMs:t,simulateErrors:n,errorType:r}=p.getState();if(e&&t>0&&await new Promise(e=>setTimeout(e,t)),n||r&&r!==`none`)switch(r){case`forbidden_403`:throw Error(`[403 Forbidden]: Отказано в доступе к ресурсу «${this.entityName}».`);case`conflict_409`:throw Error(`[409 Conflict]: Конфликт параллельного изменения записи «${this.entityName}».`);case`validation_422`:throw Error(`[422 Validation Error]: Ошибка валидации структуры записи «${this.entityName}».`);default:throw Error(`[Сетевая ошибка]: Не удалось связаться с сервером для «${this.entityName}».`)}}async getById(e,t){await this.applySimulation();let n=this.resolveContext(t),r=await g(e,n.tenantId);if(!r||r.entityType!==this.entityName)return null;let i=r.tenant_id||`tenant_main`;if(i!==n.tenantId)throw new te(`Отказано в доступе: запись «${this.entityName}» с ID ${e} принадлежит тенанту «${i}» (запрос от «${n.tenantId}»).`);return r}async list(e,t){await this.applySimulation();let n=this.resolveContext(t),r=e?.sort?{field:String(e.sort.field),order:e.sort.order}:void 0,i=await x(this.entityName,{search:e?.search,filter:e?.filter,sort:r,page:e?.page,pageSize:e?.pageSize,tenantId:n.tenantId});return{items:i.items,total:i.total,page:i.page,pageSize:i.pageSize,totalPages:i.totalPages}}async create(e,t){await this.applySimulation();let n=this.resolveContext(t),r=p.getState().demoDate||new Date().toISOString(),i=n.actorId||p.getState().currentRoleId||`demo_user`,a=d(),o={...e,id:a,entityType:this.entityName,tenant_id:n.tenantId,updatedAt:r,audit:{createdAt:r,createdById:i,updatedAt:r,updatedById:i,version:1,tenantId:n.tenantId,correlationId:n.correlationId}};return await _(o,n.tenantId),await T(`audit_log`,{id:d(),entityType:this.entityName,entityId:a,tenant_id:n.tenantId,correlation_id:n.correlationId,action:`create`,userId:i,userName:`Роль: ${i}`,timestamp:r,summary:`Создана запись «${this.entityName}» (${a.slice(0,8)}...)`},n.tenantId),o}async update(e,t,n){await this.applySimulation();let r=this.resolveContext(n),i=await this.getById(e,r);if(!i)throw new ee(`Запись «${this.entityName}» с ID ${e} не найдена.`);let a=p.getState().demoDate||new Date().toISOString(),o=r.actorId||p.getState().currentRoleId||`demo_user`,s={...i,...t,id:e,entityType:this.entityName,tenant_id:r.tenantId,updatedAt:a,audit:{...i.audit,updatedAt:a,updatedById:o,version:(i.audit?.version||1)+1,tenantId:r.tenantId,correlationId:r.correlationId}};return await _(s,r.tenantId),await T(`audit_log`,{id:d(),entityType:this.entityName,entityId:e,tenant_id:r.tenantId,correlation_id:r.correlationId,action:`update`,userId:o,userName:`Роль: ${o}`,timestamp:a,summary:`Обновлена запись «${this.entityName}» (${e.slice(0,8)}...)`},r.tenantId),s}async delete(e,t){await this.applySimulation();let n=this.resolveContext(t);if(!await this.getById(e,n))return!1;await E(e,this.entityName,n.tenantId);let r=p.getState().demoDate||new Date().toISOString(),i=n.actorId||p.getState().currentRoleId||`demo_user`;return await T(`audit_log`,{id:d(),entityType:this.entityName,entityId:e,tenant_id:n.tenantId,correlation_id:n.correlationId,action:`delete`,userId:i,userName:`Роль: ${i}`,timestamp:r,summary:`Удалена запись «${this.entityName}» (${e.slice(0,8)}...)`},n.tenantId),!0}async batchUpdate(e,t){let n=[];for(let r of e){let e=await this.update(r.id,r.data,t);n.push(e)}return n}async count(e,t){return await this.applySimulation(),(await this.list({filter:e},t)).total}},ka=class{contacts;companies;leads;deals;activities;notes;constructor(){this.contacts=new Oa(`contact`),this.companies=new Oa(`company`),this.leads=new Oa(`lead`),this.deals=new Oa(`deal`),this.activities=new Oa(`activity`),this.notes=new Oa(`note`)}async getTimeline(e,t){let n=[],r=await this.activities.list({filter:{targetEntityType:e,targetEntityId:t}});for(let e of r.items)n.push({id:e.id,timestamp:e.audit?.createdAt||new Date().toISOString(),type:`activity`,title:`${e.type.toUpperCase()}: ${e.title}`,description:e.description,actor:e.assignedTo||`Менеджер`});let i=await this.notes.list({filter:{targetEntityType:e,targetEntityId:t}});for(let e of i.items)n.push({id:e.id,timestamp:e.audit?.createdAt||new Date().toISOString(),type:`note`,title:`Заметка менеджера`,description:e.content,actor:e.authorName});if(e===`contact`||e===`company`){let r=await this.deals.list({filter:e===`contact`?{contactId:t}:{companyId:t}});for(let e of r.items)n.push({id:e.id,timestamp:e.audit?.createdAt||new Date().toISOString(),type:`deal_created`,title:`Сделка: ${e.title}`,description:`Этап: ${e.stage}, сумма: ${(e.amount.minor/100).toLocaleString(`ru-RU`)} ₽`,actor:`Отдел продаж`})}return n.sort((e,t)=>t.timestamp>e.timestamp?1:-1)}async convertLeadToDeal(e,t){let n=await this.leads.getById(e);if(!n)throw Error(`Лид с ID ${e} не найден.`);let r=(n.contactName||`Клиент`).split(` `),i=r[0],a=r.slice(1).join(` `)||`Клиент`,o=await this.contacts.create({firstName:i,lastName:a,phone:n.phone,email:n.email,roles:[`client`],status:`active`}),s=await this.deals.create({title:t||n.title,pipelineId:`pipe_default`,stage:`proposal`,amount:n.estimatedValue||{minor:1e6,currency:`RUB`},probability:60,contactId:o.id});return await this.leads.update(e,{status:`converted`,convertedContactId:o.id,convertedDealId:s.id}),await this.notes.create({targetEntityType:`deal`,targetEntityId:s.id,content:`Сделка создана из лида «${n.title}». Источник: ${n.source}.`,authorName:`Система`}),{deal:s,contact:o}}},Aa=class{products;categories;priceLists;orders;payments;shipments;returns;constructor(){this.products=new Oa(`product`),this.categories=new Oa(`product_category`),this.priceLists=new Oa(`price_list`),this.orders=new Oa(`order`),this.payments=new Oa(`payment`),this.shipments=new Oa(`shipment`),this.returns=new Oa(`return`)}async updateOrderStatus(e,t){return this.orders.update(e,{status:t})}async confirmOrder(e,t=`wh_main`){let n=await this.orders.getById(e);if(!n)throw Error(`Заказ с ID ${e} не найден.`);let r=ao().inventory;if(r&&n.items)for(let i of n.items)await r.reserveStock(e,t,i.productId,i.quantity);return this.orders.update(e,{status:`confirmed`})}async cancelOrder(e){if(!await this.orders.getById(e))throw Error(`Заказ с ID ${e} не найден.`);let t=ao().inventory;return t&&await t.cancelOrderReservations(e),this.orders.update(e,{status:`cancelled`})}async createPayment(e,t,n,r=!1){let i=await this.orders.getById(e);if(!i)throw Error(`Заказ с ID ${e} не найден.`);let a=new Date().toISOString(),o=await this.payments.create({orderId:e,orderNumber:i.orderNumber,amount:t,method:n,status:`completed`,paidAt:a,transactionId:`TXN-${d().slice(0,10)}`});if(await this.orders.update(e,{paymentStatus:`paid`}),r){let n=ao().finance;n&&await n.createTransactionFromPayment(o.id,e,t)}return o}async createShipment(e,t,n){let r=await this.orders.getById(e);if(!r)throw Error(`Заказ с ID ${e} не найден.`);let i=n||r.items.map(e=>({productId:e.productId,sku:e.sku,name:e.name,quantity:e.quantity})),a=await this.shipments.create({orderId:e,orderNumber:r.orderNumber,warehouseId:t,status:`ready`,trackingNumber:`TRK-${d().slice(0,8)}`,carrier:`Krona Экспресс`,dispatchedAt:new Date().toISOString(),items:i});await this.orders.update(e,{fulfillmentStatus:`fulfilled`,status:`shipped`});let o=ao().inventory;return o&&await o.fulfillOrderReservations(e,t,i),a}async processReturn(e,t,n,r=`wh_main`,i=!1){let a=await this.orders.getById(e);if(!a)throw Error(`Заказ с ID ${e} не найден.`);let o=n.reduce((e,t)=>e+t.refundAmount.minor,0),s=await this.returns.create({orderId:e,orderNumber:a.orderNumber,status:`refunded`,reason:t,totalRefund:{minor:o,currency:a.total.currency},items:n});await this.orders.update(e,{fulfillmentStatus:`returned`,paymentStatus:`refunded`});let c=ao().inventory;if(c)for(let e of n)await c.adjustStock(r,e.productId,e.quantity,`Возврат по заказу #${a.orderNumber}: ${t}`);if(i){let t=ao().finance;t&&await t.createTransactionFromReturn(s.id,e,s.totalRefund)}return s}},ja=class{warehouses;stockItems;movements;receipts;reservations;constructor(){this.warehouses=new Oa(`warehouse`),this.stockItems=new Oa(`stock_item`),this.movements=new Oa(`stock_movement`),this.receipts=new Oa(`goods_receipt`),this.reservations=new Oa(`stock_reservation`)}async adjustStock(e,t,n,r){let i=(await this.stockItems.list({filter:{warehouseId:e,productId:t}})).items[0],a=new Date().toISOString();if(!i)i=await this.stockItems.create({warehouseId:e,warehouseName:`Склад`,productId:t,sku:`SKU`,productName:`Товар`,onHand:Math.max(0,n),reserved:0,available:Math.max(0,n),unit:`шт`});else{let e=Math.max(0,i.onHand+n),t=Math.max(0,e-i.reserved);i=await this.stockItems.update(i.id,{onHand:e,available:t})}return await this.movements.create({type:n>=0?`adjustment`:`loss`,productId:t,productName:i.productName,sku:i.sku,targetWarehouseId:e,quantity:Math.abs(n),notes:r,timestamp:a}),i}async reserveStock(e,t,n,r){let i=await this.reservations.create({orderId:e,warehouseId:t,productId:n,quantity:r,status:`active`,expiresAt:new Date(Date.now()+864e5).toISOString()}),a=await this.stockItems.list({filter:{warehouseId:t,productId:n}});if(a.items.length>0){let e=a.items[0],t=e.reserved+r,n=Math.max(0,e.onHand-t);await this.stockItems.update(e.id,{reserved:t,available:n})}return await this.movements.create({type:`transfer`,productId:n,productName:a.items[0]?.productName||`Товар`,sku:a.items[0]?.sku||`SKU`,sourceWarehouseId:t,quantity:r,notes:`Резервирование под заказ #${e.slice(0,8)}`,timestamp:new Date().toISOString()}),i}async cancelOrderReservations(e){let t=await this.reservations.list({filter:{orderId:e,status:`active`}});for(let n of t.items){await this.reservations.update(n.id,{status:`cancelled`});let t=await this.stockItems.list({filter:{warehouseId:n.warehouseId,productId:n.productId}});if(t.items.length>0){let e=t.items[0],r=Math.max(0,e.reserved-n.quantity),i=Math.max(0,e.onHand-r);await this.stockItems.update(e.id,{reserved:r,available:i})}await this.movements.create({type:`adjustment`,productId:n.productId,productName:t.items[0]?.productName||`Товар`,sku:t.items[0]?.sku||`SKU`,targetWarehouseId:n.warehouseId,quantity:n.quantity,notes:`Снятие резерва (отмена заказа #${e.slice(0,8)})`,timestamp:new Date().toISOString()})}}async fulfillOrderReservations(e,t,n){let r=await this.reservations.list({filter:{orderId:e,status:`active`}});for(let e of r.items)await this.reservations.update(e.id,{status:`fulfilled`});if(n&&n.length>0)for(let r of n){let n=await this.stockItems.list({filter:{warehouseId:t,productId:r.productId}});if(n.items.length>0){let e=n.items[0],t=Math.max(0,e.onHand-r.quantity),i=Math.max(0,e.reserved-r.quantity),a=Math.max(0,t-i);await this.stockItems.update(e.id,{onHand:t,reserved:i,available:a})}await this.movements.create({type:`shipment`,productId:r.productId,productName:r.name,sku:r.sku,sourceWarehouseId:t,quantity:r.quantity,notes:`Отгрузка по заказу #${e.slice(0,8)}`,timestamp:new Date().toISOString()})}}async receiveGoods(e){let t=await this.receipts.getById(e);if(!t)throw Error(`Приходная накладная с ID ${e} не найдена.`);let n=await this.receipts.update(e,{status:`received`,receivedAt:new Date().toISOString()});for(let e of t.items)await this.adjustStock(t.warehouseId,e.productId,e.quantity,`Поступление по накладной №${t.receiptNumber}`);return n}async createAndReceiveGoods(e,t,n,r){let i=r.reduce((e,t)=>e+(t.costPrice?.minor||0)*t.quantity,0),a=await this.receipts.create({receiptNumber:t,warehouseId:e,supplierName:n,status:`received`,receivedAt:new Date().toISOString(),totalCost:{minor:i,currency:`RUB`},items:r}),o=(await this.warehouses.getById(e))?.name||`Склад`;for(let i of r){let r=await this.stockItems.list({filter:{warehouseId:e,productId:i.productId}});if(r.items.length>0){let e=r.items[0],t=e.onHand+i.quantity,n=Math.max(0,t-e.reserved);await this.stockItems.update(e.id,{onHand:t,available:n})}else await this.stockItems.create({warehouseId:e,warehouseName:o,productId:i.productId,sku:i.sku,productName:i.name,onHand:i.quantity,reserved:0,available:i.quantity,unit:`шт`});await this.movements.create({type:`receipt`,productId:i.productId,productName:i.name,sku:i.sku,targetWarehouseId:e,quantity:i.quantity,notes:`Приходная накладная №${t} (${n})`,timestamp:new Date().toISOString()})}return a}},Ma=class{accounts;transactions;constructor(){this.accounts=new Oa(`account`),this.transactions=new Oa(`cash_flow_transaction`)}async getPnLMetrics(e=`current_month`){let t=await this.transactions.list({pageSize:500}),n=0,r=0;for(let e of t.items)e.type===`inflow`?n+=e.amount.minor:r+=e.amount.minor;let i=Math.round(n*.42),a=n-i,o=r,s=a-o,c=n>0?Math.round(s/n*1e3)/10:0;return{period:e,revenue:{minor:n,currency:`RUB`},costOfGoodsSold:{minor:i,currency:`RUB`},grossProfit:{minor:a,currency:`RUB`},operatingExpenses:{minor:o,currency:`RUB`},netProfit:{minor:s,currency:`RUB`},operatingMarginPercent:c}}async createTransactionFromPayment(e,t,n){let r=await this.accounts.list(),i=r.items.find(e=>e.isDefault)||r.items[0],a=await this.transactions.create({transactionNumber:`CFT-${d().slice(0,8)}`,type:`inflow`,category:`sales_revenue`,amount:n,accountId:i?.id||`acc_default`,accountName:i?.name||`Основной расчетный счет`,referenceType:`order_payment`,referenceId:e,description:`Оплата по заказу (${t.slice(0,8)}...)`,timestamp:new Date().toISOString()});return i&&await this.accounts.update(i.id,{balance:{minor:i.balance.minor+n.minor,currency:i.balance.currency}}),a}async createTransactionFromReturn(e,t,n){let r=await this.accounts.list(),i=r.items.find(e=>e.isDefault)||r.items[0],a=await this.transactions.create({transactionNumber:`CFT-${d().slice(0,8)}`,type:`outflow`,category:`refund`,amount:n,accountId:i?.id||`acc_default`,accountName:i?.name||`Основной расчетный счет`,referenceType:`order_return`,referenceId:e,description:`Возврат средств по заказу (${t.slice(0,8)}...)`,timestamp:new Date().toISOString()});return i&&await this.accounts.update(i.id,{balance:{minor:Math.max(0,i.balance.minor-n.minor),currency:i.balance.currency}}),a}},Na={contact:{id:`meta_contact`,code:`contact`,name:`Контакт`,pluralName:`Контакты`,description:`Физические лица: клиенты, представители компаний, лиды`,isSystem:!0,category:`crm`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_fn`,key:`firstName`,label:`Имя`,type:`text`,required:!0,system:!0},{id:`f_ln`,key:`lastName`,label:`Фамилия`,type:`text`,required:!0,system:!0},{id:`f_mn`,key:`middleName`,label:`Отчество`,type:`text`,system:!0},{id:`f_ph`,key:`phone`,label:`Телефон`,type:`phone`,system:!0},{id:`f_em`,key:`email`,label:`Email`,type:`email`,system:!0},{id:`f_comp`,key:`companyId`,label:`Компания`,type:`entity_ref`,targetEntity:`company`,system:!0},{id:`f_title`,key:`jobTitle`,label:`Должность`,type:`text`,system:!0},{id:`f_roles`,key:`roles`,label:`Роли`,type:`multiselect`,system:!0,options:[{label:`Клиент`,value:`client`},{label:`Лид`,value:`lead`},{label:`Партнёр`,value:`partner`},{label:`Поставщик`,value:`vendor`},{label:`Подрядчик`,value:`contractor`}]}]},company:{id:`meta_company`,code:`company`,name:`Компания`,pluralName:`Компании`,description:`Юридические лица: клиенты, партнёры, поставщики`,isSystem:!0,category:`crm`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_cname`,key:`name`,label:`Название компании`,type:`text`,required:!0,system:!0},{id:`f_cleg`,key:`legalName`,label:`Юридическое наименование`,type:`text`,system:!0},{id:`f_cinn`,key:`inn`,label:`ИНН`,type:`text`,system:!0},{id:`f_cweb`,key:`website`,label:`Веб-сайт`,type:`text`,system:!0},{id:`f_cph`,key:`phone`,label:`Телефон`,type:`phone`,system:!0},{id:`f_cem`,key:`email`,label:`Email`,type:`email`,system:!0},{id:`f_caddr`,key:`address`,label:`Адрес`,type:`text`,system:!0}]},lead:{id:`meta_lead`,code:`lead`,name:`Лид`,pluralName:`Лиды`,description:`Входящие обращения и потенциальные клиенты`,isSystem:!0,category:`crm`,maturity:`pilot1`,defaultView:`kanban`,fields:[{id:`f_ltitle`,key:`title`,label:`Тема обращения`,type:`text`,required:!0,system:!0},{id:`f_lcname`,key:`contactName`,label:`Контактное лицо`,type:`text`,required:!0,system:!0},{id:`f_lph`,key:`phone`,label:`Телефон`,type:`phone`,system:!0},{id:`f_lem`,key:`email`,label:`Email`,type:`email`,system:!0},{id:`f_lstat`,key:`status`,label:`Статус лида`,type:`select`,system:!0,options:[{label:`Новый`,value:`new`},{label:`В работе`,value:`contacted`},{label:`Квалификация`,value:`qualifying`},{label:`Квалифицирован`,value:`qualified`},{label:`Дисквалифицирован`,value:`disqualified`},{label:`Конвертирован`,value:`converted`}]},{id:`f_lval`,key:`estimatedValue`,label:`Оценочный бюджет`,type:`money`,system:!0}]},deal:{id:`meta_deal`,code:`deal`,name:`Сделка`,pluralName:`Сделки`,description:`Воронка продаж и коммерческие сделки`,isSystem:!0,category:`crm`,maturity:`pilot1`,defaultView:`kanban`,fields:[{id:`f_dtitle`,key:`title`,label:`Название сделки`,type:`text`,required:!0,system:!0},{id:`f_damt`,key:`amount`,label:`Сумма сделки`,type:`money`,required:!0,system:!0},{id:`f_dstg`,key:`stage`,label:`Этап воронки`,type:`select`,system:!0,options:[{label:`Выявление потребности`,value:`discovery`},{label:`Коммерческое предложение`,value:`proposal`},{label:`Переговоры`,value:`negotiation`},{label:`Договор и оплата`,value:`contract`},{label:`Успешно закрыто`,value:`won`},{label:`Закрыто и проиграно`,value:`lost`}]},{id:`f_dprob`,key:`probability`,label:`Вероятность (%)`,type:`number`,system:!0},{id:`f_ddate`,key:`expectedCloseDate`,label:`Планируемая дата`,type:`date`,system:!0},{id:`f_dcont`,key:`contactId`,label:`Контакт`,type:`entity_ref`,targetEntity:`contact`,system:!0},{id:`f_dcomp`,key:`companyId`,label:`Компания`,type:`entity_ref`,targetEntity:`company`,system:!0}]},order:{id:`meta_order`,code:`order`,name:`Заказ`,pluralName:`Заказы`,description:`Заказы клиентов, продажи, чеки и счета`,isSystem:!0,category:`commerce`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_onum`,key:`orderNumber`,label:`Номер заказа`,type:`text`,required:!0,system:!0},{id:`f_ocust`,key:`customerName`,label:`Клиент`,type:`text`,required:!0,system:!0},{id:`f_ostat`,key:`status`,label:`Статус заказа`,type:`select`,system:!0,options:[{label:`Черновик`,value:`draft`},{label:`Подтверждён`,value:`confirmed`},{label:`В обработке`,value:`processing`},{label:`Готов к выдаче`,value:`ready`},{label:`Отправлен`,value:`shipped`},{label:`Доставлен`,value:`delivered`},{label:`Завершён`,value:`completed`},{label:`Отменён`,value:`cancelled`}]},{id:`f_otot`,key:`total`,label:`Итоговая сумма`,type:`money`,required:!0,system:!0},{id:`f_opay`,key:`paymentStatus`,label:`Оплата`,type:`select`,system:!0,options:[{label:`Ожидает оплаты`,value:`pending`},{label:`Частично оплачен`,value:`partially_paid`},{label:`Оплачен`,value:`paid`},{label:`Возврат`,value:`refunded`}]}]},product:{id:`meta_product`,code:`product`,name:`Товар / Услуга`,pluralName:`Товары и услуги`,description:`Номенклатура, товары, услуги и технологические карты`,isSystem:!0,category:`commerce`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_psku`,key:`sku`,label:`Артикул / SKU`,type:`text`,required:!0,system:!0},{id:`f_pname`,key:`name`,label:`Наименование`,type:`text`,required:!0,system:!0},{id:`f_pprice`,key:`price`,label:`Цена продажи`,type:`money`,required:!0,system:!0},{id:`f_pcost`,key:`costPrice`,label:`Себестоимость`,type:`money`,system:!0},{id:`f_punit`,key:`unit`,label:`Единица измерения`,type:`text`,system:!0},{id:`f_psrv`,key:`isService`,label:`Это услуга`,type:`boolean`,system:!0}]},warehouse:{id:`meta_warehouse`,code:`warehouse`,name:`Склад / Локация`,pluralName:`Склады и локации`,description:`Складские помещения, зоны хранения, торговые точки`,isSystem:!0,category:`inventory`,maturity:`pilot1`,defaultView:`table`,fields:[{id:`f_wname`,key:`name`,label:`Название склада`,type:`text`,required:!0,system:!0},{id:`f_wcode`,key:`code`,label:`Код склада`,type:`text`,required:!0,system:!0},{id:`f_wtype`,key:`type`,label:`Тип склада`,type:`select`,system:!0,options:[{label:`Центральный склад`,value:`central`},{label:`Склад магазина`,value:`store`},{label:`Кухонный цех`,value:`kitchen_stock`},{label:`Транзитный склад`,value:`transit`}]},{id:`f_waddr`,key:`address`,label:`Адрес`,type:`text`,system:!0}]}},Pa=class{async listEntities(e){let t=e||A(),n=await w(`entities_meta`,t);return n.length>0?n:Object.values(Na)}async getEntity(e,t){let n=await this.listEntities(t),r=e.trim().toLowerCase();return n.find(e=>e.code.trim().toLowerCase()===r)||null}async createEntity(e,t){let n=d(),r=t||A(),i={...e,id:n,tenant_id:e.tenant_id||r};return await T(`entities_meta`,i,r),i}async updateEntity(e,t){let n=await this.getEntity(e);if(!n)throw Error(`Сущность с кодом «${e}» не найдена.`);let r={...n,...t,code:e};return await T(`entities_meta`,r),r}async deleteEntity(e){let t=await this.getEntity(e);if(!t)return!1;if(t.isSystem)throw Error(`Нельзя удалить системную сущность «${e}».`);return await b(`entities_meta`,t.id),!0}async addField(e,t){let n=await this.getEntity(e);if(!n)throw Error(`Сущность с кодом «${e}» не найдена.`);let r={...t,id:`fld_${d()}`};return n.fields.push(r),await T(`entities_meta`,n),await T(`fields_meta`,{...r,entityCode:e}),r}async updateField(e,t,n){let r=await this.getEntity(e);if(!r)throw Error(`Сущность с кодом «${e}» не найдена.`);let i=r.fields.findIndex(e=>e.id===t);if(i===-1)throw Error(`Поле с ID «${t}» не найдено.`);let a={...r.fields[i],...n,id:t};return r.fields[i]=a,await T(`entities_meta`,r),await T(`fields_meta`,{...a,entityCode:e}),a}async deleteField(e,t){let n=await this.getEntity(e);if(!n)throw Error(`Сущность с кодом «${e}» не найдена.`);let r=n.fields.find(e=>e.id===t);if(r?.system||r?.isSystem)throw Error(`Нельзя удалить системное поле`);return n.fields=n.fields.filter(e=>e.id!==t),await T(`entities_meta`,n),await b(`fields_meta`,t),!0}async listLayouts(e,t){let n=t||A(),r=(await(await D()).transaction(`layouts_meta`,`readonly`).store.index(`by_entity`).getAll(e)).filter(e=>!e.tenant_id||e.tenant_id===`system`||e.tenant_id===n);if(r.length>0)return r;let i=await this.getEntity(e,n);return[{id:`layout_def_${e}`,entityCode:e,name:`Основная форма`,isDefault:!0,sections:[{id:`sec_main`,title:`Основные сведения`,columns:2,fieldKeys:i?.fields.map(e=>e.key)||[]}]}]}async getLayout(e){return k(`layouts_meta`,e)}async saveLayout(e,t){let n=t||A(),r={...e,tenant_id:e.tenant_id||n};return await T(`layouts_meta`,r,n),e}async deleteLayout(e){return await b(`layouts_meta`,e),!0}async listViews(e,t){let n=t||A(),r=(await(await D()).transaction(`views_meta`,`readonly`).store.index(`by_entity`).getAll(e)).filter(e=>!e.tenant_id||e.tenant_id===`system`||e.tenant_id===n);if(r.length>0)return r;let i=await this.getEntity(e,n);return[{id:`view_def_${e}`,entityCode:e,name:`Все записи`,type:i?.defaultView||`table`,isDefault:!0,visibleFieldKeys:i?.fields.map(e=>e.key)||[],filters:[]}]}async getView(e){return k(`views_meta`,e)}async saveView(e,t){let n=t||A(),r={...e,tenant_id:e.tenant_id||n};return await T(`views_meta`,r,n),e}async deleteView(e){return await b(`views_meta`,e),!0}},Fa=class{async log(e){let t=p.getState().demoDate||new Date().toISOString(),n=d(),r={...e,id:n,timestamp:t};return await T(`audit_log`,r),r}async getHistory(e,t){return(await(await D()).transaction(`audit_log`,`readonly`).store.index(`by_entity_id`).getAll(t)).filter(t=>t.entityType===e).sort((e,t)=>t.timestamp>e.timestamp?1:-1)}async listRecent(e=50){return(await w(`audit_log`)).sort((e,t)=>t.timestamp>e.timestamp?1:-1).slice(0,e)}async clearHistory(){await O(`audit_log`)}};function Ia(e){return e instanceof Date?e:new Date(e)}function La(e,t=`ru-RU`){let n=Ia(e);return isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{day:`2-digit`,month:`2-digit`,year:`numeric`}).format(n)}function Ra(e,t=`ru-RU`){let n=Ia(e);return isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{day:`2-digit`,month:`2-digit`,year:`numeric`,hour:`2-digit`,minute:`2-digit`}).format(n)}function za(e,t=`ru-RU`){let n=Ia(e);return isNaN(n.getTime())?`—`:new Intl.DateTimeFormat(t,{hour:`2-digit`,minute:`2-digit`}).format(n)}var Ba=class{static getNow(){let e=p.getState().demoDate;return new Date(e)}static getIso(){return p.getState().demoDate}static setTime(e){let t=typeof e==`string`?e:e.toISOString();p.getState().setDemoDate(t)}static advanceHours(e){p.getState().advanceDemoHours(e)}static advanceMinutes(e){p.getState().advanceDemoHours(e/60)}static formatCurrent(e=!0){let t=this.getNow();return e?Ra(t):La(t)}static formatCurrentTime(){return za(this.getNow())}};function B(e,t=0){let n=Ba.getNow().getTime();return new Date(n+e*864e5+t*36e5).toISOString()}function Va(e){return B(e).slice(0,10)}function Ha(){return[{name:`ООО «СеверТорг»`,inn:`7701234567`,roles:[`client`,`partner`],city:`Москва`},{name:`АО «ТехноЛаб»`,inn:`7812987654`,roles:[`vendor`],city:`Санкт-Петербург`},{name:`ГК «Айсберг Логистик»`,inn:`5405112233`,roles:[`partner`],city:`Новосибирск`},{name:`ООО «Кофе Эксперт»`,inn:`7722445566`,roles:[`vendor`,`client`],city:`Москва`},{name:`ИП «Михайлов Автодеталь»`,inn:`6677889900`,roles:[`client`],city:`Екатеринбург`},{name:`ООО «Бьюти Групп»`,inn:`7733557799`,roles:[`client`],city:`Москва`},{name:`АО «Ресторанный Синдикат»`,inn:`7801334455`,roles:[`client`,`partner`],city:`Санкт-Петербург`},{name:`ООО «ПакТрейд Упаковка»`,inn:`5001223344`,roles:[`vendor`],city:`Мытищи`},{name:`ООО «СтройСервисМонтаж»`,inn:`7744112233`,roles:[`subcontractor`],city:`Москва`},{name:`ИП «Семенова Студио»`,inn:`2311445566`,roles:[`client`],city:`Краснодар`},{name:`ООО «Гурман Продукт»`,inn:`7715667788`,roles:[`vendor`],city:`Москва`},{name:`АО «ФармаХолдинг»`,inn:`7819998877`,roles:[`client`],city:`Санкт-Петербург`}].map((e,t)=>({id:`comp_seed_${t+1}`,name:e.name,legalName:e.name,inn:e.inn,kpp:`770101001`,roles:[...e.roles],phone:`+7 (495) ${100+t*15}-${10+t*2}-${20+t*3}`,email:`contact@${e.name.toLowerCase().replace(/[^a-z0-9]/g,``)||`company`}.ru`,website:`https://${e.name.toLowerCase().replace(/[^a-z0-9]/g,``)||`company`}.example.com`,address:`г. ${e.city}, ул. Деловая, д. ${t+10}`,status:`active`,audit:{createdAt:B(-30+t),createdById:`usr_sys_01`,updatedAt:B(-2),updatedById:`usr_sys_01`,version:1}}))}function Ua(e){return[[`Алексей`,`Морозов`,`Владимирович`],[`Елена`,`Соколова`,`Сергеевна`],[`Михаил`,`Романов`,`Николаевич`],[`Анна`,`Кузнецова`,`Игоревна`],[`Дмитрий`,`Смирнов`,`Алексеевич`],[`Ольга`,`Попова`,`Дмитриевна`],[`Сергей`,`Васильев`,`Петрович`],[`Татьяна`,`Новикова`,`Олеговна`],[`Иван`,`Федоров`,`Сергеевич`],[`Наталья`,`Морозова`,`Андреевна`],[`Артем`,`Волков`,`Михайлович`],[`Мария`,`Алексеева`,`Юрьевна`],[`Виктор`,`Лебедев`,`Борисович`],[`Юлия`,`Семенова`,`Викторовна`],[`Павел`,`Егоров`,`Анатольевич`],[`Ирина`,`Павлова`,`Константиновна`],[`Роман`,`Козлов`,`Евгеньевич`],[`Екатерина`,`Степанова`,`Валерьевна`],[`Денис`,`Николаев`,`Григорьевич`],[`Светлана`,`Орлова`,`Романовна`],[`Константин`,`Андреев`,`Сергеевич`],[`Алина`,`Макарова`,`Ильинична`],[`Максим`,`Захаров`,`Витальевич`],[`Ксения`,`Зайцева`,`Тимуровна`],[`Владимир`,`Соловьев`,`Максимович`],[`Дарья`,`Борисова`,`Денисовна`],[`Андрей`,`Яковлев`,`Станиславович`],[`Виктория`,`Григорьева`,`Аркадьевна`],[`Илья`,`Романов`,`Вадимович`],[`Полина`,`Воробьева`,`Антоновна`],[`Григорий`,`Сергеев`,`Олегович`],[`Александра`,`Кузьмина`,`Федоровна`]].map(([t,n,r],i)=>{let a=e[i%e.length],o=i%4==0?`partner`:i%3==0?`vendor`:`client`;return{id:`cnt_seed_${i+1}`,firstName:t,lastName:n,middleName:r,roles:[o],companyId:i%2==0?a.id:void 0,jobTitle:i%2==0?`Руководитель направления`:`Частный клиент`,email:`${n.toLowerCase()}.${t.toLowerCase()}@example.com`,phone:`+7 (9${10+i%80}) ${200+i*5}-${10+i%80}-${20+i%70}`,telegram:`@${n.toLowerCase()}_${i+1}`,status:`active`,notes:`Клиентский профиль #${i+1}. Приоритетное обслуживание.`,audit:{createdAt:B(-25+i*.5),createdById:`usr_sys_01`,updatedAt:B(-1),updatedById:`usr_sys_01`,version:1}}})}function Wa(){return[{id:`cat_beverages`,name:`Кофе и чайное сырье`,code:`BEV`},{id:`cat_food`,name:`Кулинария и десерты`,code:`FOOD`},{id:`cat_equip`,name:`Кофейное оборудование`,code:`EQUIP`},{id:`cat_auto`,name:`Автохимия и запчасти`,code:`AUTO`},{id:`cat_beauty`,name:`Косметика и уход`,code:`BEAUTY`},{id:`cat_services`,name:`Сервисные работы и ТО`,code:`SRV`}].map(e=>({id:e.id,name:e.name,code:e.code,audit:{createdAt:B(-60),createdById:`usr_sys_01`,updatedAt:B(-10),updatedById:`usr_sys_01`,version:1}}))}function Ga(e){let t=[];return[{cat:`cat_beverages`,name:`Зерновой кофе Espresso Bar 1кг`,price:185e3,cost:95e3,unit:`кг`},{cat:`cat_beverages`,name:`Зерновой кофе Ethiopia Yirgacheffe 1кг`,price:245e3,cost:13e4,unit:`кг`},{cat:`cat_beverages`,name:`Зерновой кофе Colombia Supremo 1кг`,price:21e4,cost:11e4,unit:`кг`},{cat:`cat_beverages`,name:`Чай листовой Ассам Мокалбари 500г`,price:12e4,cost:6e4,unit:`уп`},{cat:`cat_beverages`,name:`Чай зеленый Сенча Премиум 500г`,price:135e3,cost:7e4,unit:`уп`},{cat:`cat_beverages`,name:`Сироп Карамель Соленая 1л`,price:89e3,cost:42e3,unit:`бут`},{cat:`cat_beverages`,name:`Сироп Ваниль Мадагаскар 1л`,price:89e3,cost:42e3,unit:`бут`},{cat:`cat_beverages`,name:`Какао-порошок Barry Callebaut 1кг`,price:16e4,cost:9e4,unit:`кг`},{cat:`cat_food`,name:`Круассан классический на сливочном масле`,price:22e3,cost:9e3,unit:`шт`},{cat:`cat_food`,name:`Круассан миндальный с кремом`,price:29e3,cost:12e3,unit:`шт`},{cat:`cat_food`,name:`Сэндвич с лососем и авокадо`,price:42e3,cost:21e3,unit:`шт`},{cat:`cat_food`,name:`Сэндвич с индейкой и песто`,price:36e3,cost:17e3,unit:`шт`},{cat:`cat_food`,name:`Чизкейк Нью-Йорк классический`,price:34e3,cost:14e3,unit:`порц`},{cat:`cat_food`,name:`Торт Морковный со сливочным кремом`,price:32e3,cost:13e3,unit:`порц`},{cat:`cat_food`,name:`Гранола с греческим йогуртом и ягодами`,price:28e3,cost:11e3,unit:`порц`},{cat:`cat_food`,name:`Печенье Кукис Шоколадное 80г`,price:15e3,cost:6e3,unit:`шт`},{cat:`cat_equip`,name:`Кофемашина La Marzocco Linea PB 2GR`,price:98e6,cost:72e6,unit:`шт`},{cat:`cat_equip`,name:`Кофемашина Nuova Simonelli Appia Life 2GR`,price:45e6,cost:34e6,unit:`шт`},{cat:`cat_equip`,name:`Кофемолка Mahlkonig E65S GBW`,price:23e6,cost:175e5,unit:`шт`},{cat:`cat_equip`,name:`Водоумягчитель DVA 12л`,price:145e4,cost:85e4,unit:`шт`},{cat:`cat_equip`,name:`Темпер динамометрический 58.5мм`,price:95e3,cost:45e3,unit:`шт`},{cat:`cat_equip`,name:`Питчер молочный Motta 500мл`,price:38e3,cost:18e3,unit:`шт`},{cat:`cat_equip`,name:`Весы бариста Acaia Lunar`,price:28e4,cost:19e4,unit:`шт`},{cat:`cat_auto`,name:`Моторное масло синтетическое 5W-40 4л`,price:45e4,cost:27e4,unit:`канистра`},{cat:`cat_auto`,name:`Моторное масло 0W-20 Eco 4л`,price:52e4,cost:31e4,unit:`канистра`},{cat:`cat_auto`,name:`Масляный фильтр Mann-Filter W712`,price:85e3,cost:42e3,unit:`шт`},{cat:`cat_auto`,name:`Воздушный фильтр C25004`,price:95e3,cost:48e3,unit:`шт`},{cat:`cat_auto`,name:`Колодки тормозные передние керамик`,price:42e4,cost:23e4,unit:`компл`},{cat:`cat_auto`,name:`Тормозная жидкость DOT-4 1л`,price:75e3,cost:35e3,unit:`бут`},{cat:`cat_auto`,name:`Очиститель тормозов аэрозоль 500мл`,price:45e3,cost:2e4,unit:`баллон`},{cat:`cat_auto`,name:`Антифриз готовый красный G12+ 5кг`,price:16e4,cost:85e3,unit:`канистра`},{cat:`cat_beauty`,name:`Шампунь восстанавливающий кератин 1л`,price:32e4,cost:16e4,unit:`бут`},{cat:`cat_beauty`,name:`Маска глубокого увлажнения волос 500мл`,price:28e4,cost:135e3,unit:`банка`},{cat:`cat_beauty`,name:`Масло аргановое для кончиков волос 100мл`,price:21e4,cost:95e3,unit:`флакон`},{cat:`cat_beauty`,name:`Крем питательный для рук с маслом ши 75мл`,price:85e3,cost:38e3,unit:`тюбик`},{cat:`cat_beauty`,name:`Гель-лак премиум оттенок Nude 15мл`,price:65e3,cost:28e3,unit:`флакон`},{cat:`cat_beauty`,name:`Сыворотка для лица с гиалуроновой кислотой 30мл`,price:39e4,cost:18e4,unit:`флакон`},{cat:`cat_beauty`,name:`Набор одноразовых пилок для маникюра (50 шт)`,price:95e3,cost:4e4,unit:`уп`},{cat:`cat_services`,name:`Регламентное ТО кофемашины с декальцинацией`,price:65e4,cost:2e5,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Комплексная замена масла и фильтров автомобиля`,price:25e4,cost:8e4,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Диагностика ходовой части автомобиля на вибростенде`,price:18e4,cost:5e4,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Стрижка женская модельная и укладка`,price:35e4,cost:1e5,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Маникюр аппаратный с покрытием гель-лак`,price:28e4,cost:8e4,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Настройка и калибровка кофемолки bar-flow`,price:3e5,cost:9e4,unit:`усл`,isSrv:!0},{cat:`cat_services`,name:`Выездной аудит торговой точки и склада`,price:12e5,cost:4e5,unit:`усл`,isSrv:!0}].forEach((n,r)=>{let i=!!n.isSrv,a=e.find(e=>e.id===n.cat);t.push({id:`prd_seed_${r+1}`,sku:`${a?.code||`GEN`}-${1e3+r}`,name:n.name,categoryId:n.cat,categoryName:a?.name||`Общая`,barcode:`4600000${1e5+r}`,price:{minor:n.price,currency:`RUB`},costPrice:{minor:n.cost,currency:`RUB`},unit:n.unit,isService:i,trackInventory:!i,minStockAlert:i?0:10,status:`active`,audit:{createdAt:B(-45+r%20),createdById:`usr_sys_01`,updatedAt:B(-2),updatedById:`usr_sys_01`,version:1}})}),t}function Ka(){return[{id:`wh_main`,name:`Центральный распределительный склад (Москва-Юг)`,code:`WH-MAIN`,type:`central`,address:`г. Москва, Варшавское шоссе, д. 148`,isDefault:!0,status:`active`,responsibleUserId:`usr_wh_01`,audit:{createdAt:B(-100),createdById:`usr_sys_01`,updatedAt:B(-5),updatedById:`usr_sys_01`,version:1}},{id:`wh_northwest`,name:`Региональный склад (Санкт-Петербург СЗ)`,code:`WH-NW`,type:`store`,address:`г. Санкт-Петербург, Выборгское шоссе, д. 32`,isDefault:!1,status:`active`,responsibleUserId:`usr_wh_02`,audit:{createdAt:B(-80),createdById:`usr_sys_01`,updatedAt:B(-5),updatedById:`usr_sys_01`,version:1}},{id:`wh_showroom`,name:`Склад-шоурум (Флагманский магазин)`,code:`WH-SHOWROOM`,type:`store`,address:`г. Москва, ул. Большая Дмитровка, д. 7`,isDefault:!1,status:`active`,responsibleUserId:`usr_wh_03`,audit:{createdAt:B(-60),createdById:`usr_sys_01`,updatedAt:B(-5),updatedById:`usr_sys_01`,version:1}}]}function qa(e,t){let n=[`discovery`,`proposal`,`negotiation`,`contract`,`won`,`lost`];return[`Поставка кофемашин для сети ресторанов`,`Годовой сервисный контракт на автопарк`,`Оптовая партия премиального зернового кофе`,`Оснащение спа-салона уходовой косметикой`,`Комплекс ТО и замена масел для таксопарка`,`Поставка оборудования для 3 новых кофеен`,`Партия сиропов и чайных смесей для бара`,`Договор на поставку автохимии и фильтров`,`Корпоративные подарочные наборы кофе и чая`,`Обновление кухонного и барного инвентаря`,`Запуск франшизной точки: полное оснащение`,`Поставка косметики для сети барбершопов`,`Договор планового технического обслуживания`,`Спецзаказ на партию динамических темперов`,`Поставка расходных материалов для шиномонтажа`,`Кейтеринг и мобильная кофейня на выставку`,`Автоматизация рабочих мест и кассовой зоны`,`Поставка профессиональных весов и посуды`,`Партия синтетических масел 0W-20 для СТО`,`Поставка десертов и выпечки для кофе-поинтов`,`Сертификация и аудит оборудования фабрики`,`Поставка средств для бережного ухода за кожей`,`Замена группы прокладок и клапанов 12 машин`,`Снабжение автосервиса тормозными колодками`,`Партия крафтового какао для кондитерской`].map((r,i)=>{let a=n[i%n.length],o=15e6+i*37%85*1e6,s=e[i%e.length],c=t[i%t.length],l=a===`won`?100:a===`lost`?0:a===`contract`?85:a===`negotiation`?65:40;return{id:`deal_seed_${i+1}`,title:r,pipelineId:`pipe_b2b`,stage:a,amount:{minor:o,currency:`RUB`},probability:l,expectedCloseDate:Va(5+i%25),contactId:s.id,companyId:c.id,lostReason:a===`lost`?`Бюджет проекта перенесен на следующий квартал`:void 0,audit:{createdAt:B(-20+i%15),createdById:`usr_sys_01`,updatedAt:B(-1),updatedById:`usr_sys_01`,version:1}}})}function Ja(e,t,n){let r=[`delivered`,`delivered`,`completed`,`completed`,`shipped`,`ready`,`confirmed`,`processing`,`draft`,`cancelled`],i=[],a=[],o=[];for(let s=0;s<28;s++){let c=r[s%r.length],l=e[s%e.length],u=n[s%n.length],d=`ORD-2026-${String(1001+s).padStart(4,`0`)}`,f=`ord_seed_${s+1}`,p=2+s%3,m=[],h=0;for(let e=0;e<p;e++){let n=t[(s*3+e)%t.length],r=1+(s+e)%4,i=n.price.minor*r;h+=i,m.push({id:`oi_seed_${s+1}_${e+1}`,productId:n.id,sku:n.sku,name:n.name,quantity:r,unitPrice:n.price,discountMinor:0,totalPrice:{minor:i,currency:`RUB`}})}let g=s%5==0?Math.round(h*.05):0,_=h-g,v=c===`delivered`||c===`completed`||c===`shipped`||s%3==0,y=c===`delivered`||c===`completed`||c===`shipped`,b=v?`paid`:`pending`,x=y?`fulfilled`:c===`ready`?`partially_fulfilled`:`unfulfilled`,S={id:f,orderNumber:d,customerType:`contact`,customerId:l.id,customerName:`${l.firstName} ${l.lastName}`,status:c,paymentStatus:b,fulfillmentStatus:x,items:m,subtotal:{minor:h,currency:`RUB`},discountMinor:g,taxMinor:Math.round(_*.2),shippingMinor:0,total:{minor:_,currency:`RUB`},warehouseId:u.id,channel:s%4==0?`pos`:s%3==0?`web`:`b2b`,shippingAddress:`г. Москва, ул. Клиентская, д. ${s+1}`,audit:{createdAt:B(-18+s*.6),createdById:`usr_sys_01`,updatedAt:B(-1),updatedById:`usr_sys_01`,version:1}};i.push(S),v&&a.push({id:`pmt_seed_${s+1}`,orderId:f,orderNumber:d,amount:{minor:_,currency:`RUB`},method:s%2==0?`bank_transfer`:`card`,status:`completed`,transactionId:`TXN-${1e5+s*17}`,paidAt:B(-17+s*.6),audit:{createdAt:B(-17+s*.6),createdById:`usr_sys_01`,updatedAt:B(-17+s*.6),updatedById:`usr_sys_01`,version:1}}),y&&o.push({id:`shp_seed_${s+1}`,orderId:f,orderNumber:d,warehouseId:u.id,status:c===`delivered`||c===`completed`?`delivered`:`shipped`,trackingNumber:`KRONA-TRK-${7e4+s*11}`,carrier:`Krona Экспресс Доставка`,dispatchedAt:B(-15+s*.6),deliveredAt:c===`delivered`||c===`completed`?B(-14+s*.6):void 0,items:m.map(e=>({productId:e.productId,sku:e.sku,name:e.name,quantity:e.quantity})),audit:{createdAt:B(-15+s*.6),createdById:`usr_sys_01`,updatedAt:B(-1),updatedById:`usr_sys_01`,version:1}})}return{orders:i,payments:a,shipments:o}}function Ya(e,t){let n=[],r=[];return t.forEach(t=>{e.filter(e=>!e.isService).forEach((e,i)=>{let a=30+i*7%150,o=i%5*3,s=a-o;n.push({id:`stk_${t.id}_${e.id}`,warehouseId:t.id,warehouseName:t.name,productId:e.id,sku:e.sku,productName:e.name,onHand:a,reserved:o,available:s,unit:e.unit,minThreshold:e.minStockAlert,audit:{createdAt:B(-40),createdById:`usr_sys_01`,updatedAt:B(-2),updatedById:`usr_sys_01`,version:1}}),i%3==0&&r.push({id:`mov_${t.id}_${e.id}_1`,type:`receipt`,productId:e.id,productName:e.name,sku:e.sku,targetWarehouseId:t.id,quantity:50,referenceNumber:`GR-${1e3+i}`,notes:`Плановое поступление от поставщика`,timestamp:B(-10+i%5),audit:{createdAt:B(-10+i%5),createdById:`usr_sys_01`,updatedAt:B(-10+i%5),updatedById:`usr_sys_01`,version:1}})})}),{stockItems:n,movements:r}}function Xa(e){let t=[{id:`acc_main_bank`,name:`Основной расчетный счет (ПАО Сбербанк)`,type:`bank`,balance:{minor:458e6,currency:`RUB`},currency:`RUB`,accountNumber:`40702810938000012345`,bankName:`ПАО СБЕРБАНК`,isDefault:!0,status:`active`,audit:{createdAt:B(-100),createdById:`usr_sys_01`,updatedAt:B(-1),updatedById:`usr_sys_01`,version:1}},{id:`acc_cash_desk`,name:`Касса наличных (Главный офис)`,type:`cash_desk`,balance:{minor:345e5,currency:`RUB`},currency:`RUB`,isDefault:!1,status:`active`,audit:{createdAt:B(-100),createdById:`usr_sys_01`,updatedAt:B(-1),updatedById:`usr_sys_01`,version:1}},{id:`acc_acquiring`,name:`Эквайринг Т-Банк`,type:`acquiring`,balance:{minor:189e6,currency:`RUB`},currency:`RUB`,isDefault:!1,status:`active`,audit:{createdAt:B(-100),createdById:`usr_sys_01`,updatedAt:B(-1),updatedById:`usr_sys_01`,version:1}}],n=[];return e.forEach((e,t)=>{n.push({id:`tx_seed_${t+1}`,transactionNumber:`CFT-2026-${String(1001+t).padStart(4,`0`)}`,type:`inflow`,category:`sales_revenue`,amount:e.amount,accountId:e.method===`cash`?`acc_cash_desk`:`acc_main_bank`,accountName:e.method===`cash`?`Касса наличных`:`Основной расчетный счет`,referenceType:`order_payment`,referenceId:e.id,description:`Поступление оплаты по заказу №${e.orderNumber}`,timestamp:e.paidAt,audit:{createdAt:e.paidAt,createdById:`usr_sys_01`,updatedAt:e.paidAt,updatedById:`usr_sys_01`,version:1}})}),[{cat:`rent`,name:`Аренда помещений склада и офиса за текущий месяц`,amt:38e6,daysAgo:10},{cat:`payroll`,name:`Выплата аванса сотрудникам`,amt:65e6,daysAgo:15},{cat:`supplier_payment`,name:`Оплата партии сырья поставщику ООО «Кофе Эксперт»`,amt:485e5,daysAgo:7},{cat:`taxes`,name:`Уплата квартальных налоговых платежей (УСН/НДС)`,amt:29e6,daysAgo:12},{cat:`utilities`,name:`Оплата электроэнергии и коммунальных услуг`,amt:85e5,daysAgo:4}].forEach((e,t)=>{let r=B(-e.daysAgo);n.push({id:`tx_outflow_${t+1}`,transactionNumber:`CFT-OUT-${2001+t}`,type:`outflow`,category:e.cat,amount:{minor:e.amt,currency:`RUB`},accountId:`acc_main_bank`,accountName:`Основной расчетный счет`,referenceType:`manual`,description:e.name,timestamp:r,audit:{createdAt:r,createdById:`usr_sys_01`,updatedAt:r,updatedById:`usr_sys_01`,version:1}})}),{accounts:t,transactions:n}}function Za(){return[{id:`aud_seed_1`,entityType:`system`,entityId:`seed_init`,action:`create`,userId:`usr_sys_01`,userName:`Системный администратор`,timestamp:B(-30),summary:`Инициализация демонстрационного контура Krona Universal Business OS`},{id:`aud_seed_2`,entityType:`warehouse`,entityId:`wh_main`,action:`create`,userId:`usr_sys_01`,userName:`Администратор склада`,timestamp:B(-25),summary:`Создан центральный склад «Москва-Юг» с адресным хранением`},{id:`aud_seed_3`,entityType:`company`,entityId:`comp_seed_1`,action:`create`,userId:`usr_sales_01`,userName:`Менеджер по продажам`,timestamp:B(-20),summary:`Зарегистрирован ключевой корпоративный клиент ООО «СеверТорг»`}]}async function Qa(e=!1){if(await C(`contact`)>0&&!e)return!1;e&&await S();let t=Ha(),n=Ua(t),r=Wa(),i=Ga(r),a=Ka(),o=qa(n,t),{orders:s,payments:c,shipments:l}=Ja(n,i,a),{stockItems:u,movements:d}=Ya(i,a),{accounts:f,transactions:p}=Xa(c),m=Za();for(let e of t)await _({...e,entityType:`company`});for(let e of n)await _({...e,entityType:`contact`});for(let e of r)await _({...e,entityType:`product_category`});for(let e of i)await _({...e,entityType:`product`});for(let e of a)await _({...e,entityType:`warehouse`});for(let e of o)await _({...e,entityType:`deal`});for(let e of s)await _({...e,entityType:`order`});for(let e of c)await _({...e,entityType:`payment`});for(let e of l)await _({...e,entityType:`shipment`});for(let e of u)await _({...e,entityType:`stock_item`});for(let e of d)await _({...e,entityType:`stock_movement`});for(let e of f)await _({...e,entityType:`account`});for(let e of p)await _({...e,entityType:`cash_flow_transaction`});for(let e of m)await T(`audit_log`,e);for(let[,e]of Object.entries(Na)){await T(`entities_meta`,e);for(let t of e.fields)await T(`fields_meta`,{...t,entityCode:e.code})}return!0}var $a=new ka,eo=new Aa,to=new ja,no=new Ma,ro=new Pa,io={crm:$a,commerce:eo,inventory:to,finance:no,metadata:ro,audit:new Fa};function ao(){return io}var oo=!1;async function so(e=!1){if(!oo||e)try{await Qa(e),oo=!0}catch(e){console.warn(`[MockServices] Failed to initialize IndexedDB storage:`,e)}}function co(e,t){(0,j.useEffect)(()=>{let n=y.subscribe(e,t);return()=>{n()}},[e,t])}function lo(e){let[t,n]=(0,j.useState)([]),[r,i]=(0,j.useState)(null),[a,o]=(0,j.useState)([]),[s,c]=(0,j.useState)([]),[l,u]=(0,j.useState)(!0),[d,f]=(0,j.useState)(null),p=(0,j.useCallback)(async()=>{try{u(!0),f(null);let t=await ro.listEntities();if(n(t),e){let t=await ro.getEntity(e);i(t);let[n,r]=await Promise.all([ro.listLayouts(e),ro.listViews(e)]);o(n),c(r)}}catch(e){f(e instanceof Error?e:Error(String(e)))}finally{u(!1)}},[e]);(0,j.useEffect)(()=>{let e=!0;return Promise.resolve().then(()=>{e&&p()}),()=>{e=!1}},[p]),co(`entity:changed`,p),co(`storage:reset`,p),co(`snapshot:imported`,p);let m=(0,j.useCallback)(async e=>{let t=await ro.createEntity(e);return await p(),t},[p]),h=(0,j.useCallback)(async(e,t)=>{let n=await ro.updateEntity(e,t);return await p(),n},[p]),g=(0,j.useCallback)(async(e,t)=>{let n=await ro.addField(e,t);return await p(),n},[p]),_=(0,j.useCallback)(async(e,t,n)=>{let r=await ro.updateField(e,t,n);return await p(),r},[p]),v=(0,j.useCallback)(async(e,t)=>{let n=await ro.deleteField(e,t);return await p(),n},[p]);return{entities:t,currentEntity:r,layouts:a,views:s,loading:l,error:d,refetch:p,createEntity:m,updateEntity:h,deleteEntity:(0,j.useCallback)(async e=>{let t=await ro.deleteEntity(e);return await p(),t},[p]),addField:g,updateField:_,deleteField:v,saveLayout:(0,j.useCallback)(async e=>{let t=await ro.saveLayout(e);return await p(),t},[p]),deleteLayout:(0,j.useCallback)(async e=>{let t=await ro.deleteLayout(e);return await p(),t},[p]),saveView:(0,j.useCallback)(async e=>{let t=await ro.saveView(e);return await p(),t},[p]),deleteView:(0,j.useCallback)(async e=>{let t=await ro.deleteView(e);return await p(),t},[p])}}var uo=[{id:`dashboard`,label:`Главная`,iconName:`LayoutDashboard`,route:`/`,sections:[{id:`overview`,label:`Сводка дня`,route:`/`},{id:`alerts`,label:`Требует внимания`,route:`/?tab=alerts`,badge:`3`},{id:`live`,label:`Операционный статус`,route:`/?tab=live`}]},{id:`operations`,label:`Операции`,iconName:`Workflow`,route:`/operations`,sections:[]},{id:`crm`,label:`CRM`,iconName:`Users`,route:`/crm`,requiredCapability:`crm`,sections:[{id:`overview`,label:`Обзор CRM`,route:`/crm`},{id:`clients`,label:`Клиенты`,route:`/crm/clients`,badge:`1,420`},{id:`deals`,label:`Сделки & Воронка`,route:`/crm/deals`,badge:`18`},{id:`leads`,label:`Лиды`,route:`/crm/leads`,badge:`9`},{id:`companies`,label:`Компании`,route:`/crm/companies`},{id:`segments`,label:`Сегменты`,route:`/crm/segments`},{id:`activities`,label:`Активности`,route:`/crm/activities`}]},{id:`sales`,label:`Продажи`,iconName:`ShoppingBag`,route:`/sales`,requiredCapability:`sales`,sections:[{id:`overview`,label:`Обзор`,route:`/sales`},{id:`orders`,label:`Все заказы`,route:`/sales/orders`,badge:`42`},{id:`invoices`,label:`Счета`,route:`/sales/invoices`},{id:`payments`,label:`Оплаты`,route:`/sales/payments`},{id:`refunds`,label:`Возвраты`,route:`/sales/refunds`},{id:`funnels`,label:`Конверсия`,route:`/sales/funnels`}]},{id:`inventory`,label:`Склад`,iconName:`Boxes`,route:`/inventory`,requiredCapability:`inventory`,sections:[{id:`overview`,label:`Обзор склада`,route:`/inventory`},{id:`items`,label:`Остатки товаров`,route:`/inventory/items`},{id:`warehouses`,label:`Склады & Локации`,route:`/inventory/warehouses`},{id:`batches`,label:`Партии & Сроки`,route:`/inventory/batches`},{id:`movements`,label:`Перемещения`,route:`/inventory/movements`},{id:`writeoffs`,label:`Списания`,route:`/inventory/writeoffs`},{id:`audit`,label:`Инвентаризация`,route:`/inventory/audit`}]},{id:`finance`,label:`Финансы`,iconName:`BadgeDollarSign`,route:`/finance`,requiredCapability:`finance`,sections:[{id:`overview`,label:`Обзор & Сальдо`,route:`/finance`},{id:`cashflow`,label:`ДДС (Cash Flow)`,route:`/finance/cashflow`},{id:`pnl`,label:`P&L (Прибыли и убытки)`,route:`/finance/pnl`},{id:`shifts`,label:`Кассовые смены`,route:`/finance/shifts`,badge:`2 открыты`},{id:`transactions`,label:`Платежи`,route:`/finance/transactions`},{id:`debt`,label:`Задолженности`,route:`/finance/debt`}]},{id:`employees`,label:`Сотрудники`,iconName:`UserCheck`,route:`/employees`,requiredCapability:`employees`,sections:[{id:`list`,label:`Команда`,route:`/employees`},{id:`schedule`,label:`Графики & Смены`,route:`/employees/schedule`},{id:`timetrack`,label:`Рабочее время & Табель`,route:`/employees/timetrack`},{id:`roles`,label:`Должности & Ставки`,route:`/employees/roles`},{id:`kpi`,label:`KPI & Мотивация`,route:`/employees/kpi`}]},{id:`communications`,label:`Коммуникации`,iconName:`MessageSquareText`,route:`/communications`,requiredCapability:`communications`,badge:`3`,sections:[{id:`inbox`,label:`Единый Inbox`,route:`/communications`},{id:`telegram`,label:`Telegram Bot & Чат`,route:`/communications?channel=telegram`},{id:`whatsapp`,label:`WhatsApp`,route:`/communications?channel=whatsapp`},{id:`team`,label:`Командный чат`,route:`/communications?channel=team`},{id:`channels`,label:`Подключенные каналы`,route:`/communications/channels`}]},{id:`helpdesk`,label:`HelpDesk`,iconName:`Headset`,route:`/helpdesk`,requiredCapability:`helpdesk`,sections:[{id:`overview`,label:`Обзор поддержки`,route:`/helpdesk`},{id:`tickets`,label:`Очередь тикетов`,route:`/helpdesk/tickets`,badge:`5`},{id:`sla`,label:`SLA & Эскалации`,route:`/helpdesk/sla`},{id:`kb`,label:`База знаний`,route:`/helpdesk/kb`},{id:`analytics`,label:`Метрики поддержки`,route:`/helpdesk/analytics`}]},{id:`tasks`,label:`Задачи и проекты`,iconName:`CheckSquare`,route:`/tasks`,requiredCapability:`tasks`,sections:[{id:`my`,label:`Мои задачи`,route:`/tasks`},{id:`kanban`,label:`Канбан-доска`,route:`/tasks/kanban`},{id:`projects`,label:`Проекты`,route:`/tasks/projects`},{id:`calendar`,label:`Календарь дедлайнов`,route:`/tasks/calendar`},{id:`overdue`,label:`Просроченные`,route:`/tasks/overdue`,badge:`2`}]},{id:`cms`,label:`Сайты`,iconName:`Globe`,route:`/cms`,requiredCapability:`cms`,sections:[{id:`sites`,label:`Мои сайты`,route:`/cms`},{id:`pages`,label:`Страницы & Конструктор`,route:`/cms/pages`},{id:`forms`,label:`Лид-формы`,route:`/cms/forms`},{id:`media`,label:`Медиабиблиотека`,route:`/cms/media`},{id:`seo`,label:`SEO & Аналитика`,route:`/cms/seo`},{id:`domains`,label:`Домены`,route:`/cms/domains`}]},{id:`marketing`,label:`Маркетинг`,iconName:`Megaphone`,route:`/marketing`,requiredCapability:`marketing`,sections:[{id:`overview`,label:`Обзор маркетинга`,route:`/marketing`},{id:`promos`,label:`Акции & Промокоды`,route:`/marketing/promos`},{id:`broadcasts`,label:`Рассылки`,route:`/marketing/broadcasts`},{id:`content`,label:`Контент-план`,route:`/marketing/content`},{id:`ai_marketer`,label:`AI Маркетолог`,route:`/marketing/ai`}]},{id:`analytics`,label:`Аналитика`,iconName:`BarChart3`,route:`/analytics`,requiredCapability:`analytics`,sections:[{id:`overview`,label:`Общий дашборд`,route:`/analytics`},{id:`sales_bi`,label:`Продажи & Выручка`,route:`/analytics/sales`},{id:`abc`,label:`ABC/XYZ анализ`,route:`/analytics/abc`},{id:`retention`,label:`Когорты & LTV`,route:`/analytics/retention`},{id:`forecasts`,label:`ИИ-прогнозы`,route:`/analytics/forecasts`}]},{id:`automation`,label:`Автоматизация`,iconName:`Cpu`,route:`/automation`,requiredCapability:`automation`,sections:[{id:`scenarios`,label:`Сценарии & Workflows`,route:`/automation`},{id:`builder`,label:`Конструктор цепочек`,route:`/automation/builder`},{id:`triggers`,label:`Триггеры событий`,route:`/automation/triggers`},{id:`history`,label:`Лог выполнения`,route:`/automation/history`}]},{id:`ai`,label:`ИИ-центр`,iconName:`Sparkles`,route:`/ai`,requiredCapability:`ai`,badge:`✦`,sections:[{id:`chat`,label:`Диалог с AI`,route:`/ai`},{id:`team`,label:`AI Команда`,route:`/ai/team`},{id:`tasks`,label:`ИИ-задачи в фоне`,route:`/ai/tasks`},{id:`history`,label:`История & Контекст`,route:`/ai/history`},{id:`usage`,label:`Лимиты & Токены`,route:`/ai/usage`}]},{id:`apps`,label:`Приложения`,iconName:`Grid`,route:`/apps`,sections:[{id:`catalog`,label:`Каталог расширений`,route:`/apps`},{id:`installed`,label:`Установленные`,route:`/apps/installed`},{id:`integrations`,label:`Интеграции`,route:`/apps/integrations`}]},{id:`settings`,label:`Настройки`,iconName:`Settings`,route:`/settings`,sections:[{id:`company`,label:`Организация & Точки`,route:`/settings`},{id:`profile`,label:`Бизнес-профиль`,route:`/settings/profile`},{id:`capabilities`,label:`Configuration Studio`,route:`/settings/capabilities`},{id:`users`,label:`Пользователи & Роли`,route:`/settings/users`},{id:`integrations`,label:`API & Webhooks`,route:`/settings/api`},{id:`appearance`,label:`Тема & Брендинг`,route:`/settings/appearance`}]}],fo={owner:{id:`owner`,label:`Владелец бизнеса`,badge:`Owner`,description:`Полный доступ ко всем модулям, финансовой аналитике, настройкам и AI-центру`,allowedModules:[`*`],defaultRoute:`/`},administrator:{id:`administrator`,label:`Администратор`,badge:`Admin`,description:`Управление процессами, персоналом, точками, правами и операционной деятельностью`,allowedModules:[`*`],defaultRoute:`/`},manager:{id:`manager`,label:`Управляющий`,badge:`Manager`,description:`Операции, смены, заказы, доставка, склад, контроль персонала и операционная аналитика`,allowedModules:[`dashboard`,`operations`,`crm`,`sales`,`inventory`,`employees`,`tasks`,`communications`,`analytics`],defaultRoute:`/operations`},cashier:{id:`cashier`,label:`Кассир / Оператор`,badge:`POS`,description:`Кассовый терминал, оформление заказов, прием оплаты, клиентская база`,allowedModules:[`operations`,`sales`,`crm`],defaultRoute:`/operations/pos`},cook:{id:`cook`,label:`Повар / Шеф-повар`,badge:`KDS`,description:`Кухонный дисплей (KDS), отметка готовности блюд, стоп-лист`,allowedModules:[`operations`],defaultRoute:`/operations/kds`},courier:{id:`courier`,label:`Курьер / Доставка`,badge:`Courier`,description:`Мобильный экран доставки: маршруты, заказы, адрес клиента, отметка вручения`,allowedModules:[`operations`],defaultRoute:`/operations/courier`},specialist:{id:`specialist`,label:`Специалист / Мастер`,badge:`Service`,description:`Журнал записи, заказ-наряды постов, расписание смен, услуги`,allowedModules:[`operations`,`crm`,`tasks`],defaultRoute:`/operations/work-orders`},marketer:{id:`marketer`,label:`Маркетолог`,badge:`Marketing`,description:`Маркетинговые кампании, CRM сегменты, сайты/CMS, рассылки, сквозная аналитика, AI`,allowedModules:[`dashboard`,`crm`,`marketing`,`cms`,`communications`,`analytics`,`ai`],defaultRoute:`/marketing`},warehouse:{id:`warehouse`,label:`Складской оператор`,badge:`Warehouse`,description:`Приходные накладные, списания, партии, инвентаризация и поставщики`,allowedModules:[`operations`,`inventory`,`tasks`],defaultRoute:`/operations/inventory`},support:{id:`support`,label:`Специалист поддержки`,badge:`Support`,description:`Очередь тикетов, омниканальные чаты, база знаний и SLA`,allowedModules:[`helpdesk`,`communications`,`crm`],defaultRoute:`/helpdesk`}},po={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};po.node;var mo=a(po),ho={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};ho.node;var go=a(ho),_o={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};_o.node;var vo=a(_o),yo={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};yo.node;var bo=a(yo),xo={name:`badge-dollar-sign`,size:24,node:[[`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:`M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8`,key:`1h4pet`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}]]};xo.node;var So=a(xo),Co={name:`bell-ring`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]};Co.node;var wo=a(Co),To={name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]};To.node;var Eo=a(To),Do={name:`boxes`,size:24,node:[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]};Do.node;var Oo=a(Do),ko={name:`building-2`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]};ko.node;var Ao=a(ko),jo={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};jo.node;var Mo=a(jo),No={name:`car`,size:24,node:[[`path`,{d:`M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2`,key:`5owen`}],[`circle`,{cx:`7`,cy:`17`,r:`2`,key:`u2ysq9`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}],[`circle`,{cx:`17`,cy:`17`,r:`2`,key:`axvx0g`}]]};No.node;var Po=a(No),Fo={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Fo.node;var Io=a(Fo),Lo={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Lo.node;var Ro=a(Lo),zo={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};zo.node;var Bo=a(zo),Vo={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Vo.node;var Ho=a(Vo),V={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};V.node;var H=a(V),Uo={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Uo.node;var Wo=a(Uo),Go={name:`circle-alert`,size:24,node:[[`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`}]],aliases:[`alert-circle`]};Go.node;var Ko=a(Go),qo={name:`circle-check-big`,size:24,node:[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-circle`]};qo.node;var Jo=a(qo),Yo={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Yo.node;var Xo=a(Yo),Zo={name:`circle-user`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}],[`path`,{d:`M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662`,key:`154egf`}]],aliases:[`user-circle`]};Zo.node;var Qo=a(Zo),$o={name:`circle-x`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-circle`]};$o.node;var es=a($o),ts={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};ts.node;var ns=a(ts),rs={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};rs.node;var is=a(rs),as={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};as.node;var os=a(as),ss={name:`corner-down-left`,size:24,node:[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]};ss.node;var cs=a(ss),ls={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};ls.node;var us=a(ls),ds={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}]]};ds.node;var fs=a(ds),ps={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};ps.node;var ms=a(ps),hs={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};hs.node;var gs=a(hs),_s={name:`file-check-corner`,size:24,node:[[`path`,{d:`M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6`,key:`g5mvt7`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14 20 2 2 4-4`,key:`15kota`}]],aliases:[`file-check-2`]};_s.node;var vs=a(_s),ys={name:`flask-conical`,size:24,node:[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]};ys.node;var bs=a(ys),xs={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};xs.node;var Ss=a(xs),Cs={name:`grid-3x3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`grid`,`grid-3-x-3`]};Cs.node;var ws=a(Cs),Ts={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Ts.node;var Es=a(Ts),Ds={name:`headset`,size:24,node:[[`path`,{d:`M3 11h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-5Zm0 0a9 9 0 1 1 18 0m0 0v5a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3Z`,key:`12oyoe`}],[`path`,{d:`M21 16v2a4 4 0 0 1-4 4h-5`,key:`1x7m43`}]]};Ds.node;var Os=a(Ds),ks={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};ks.node;var As=a(ks),js={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};js.node;var Ms=a(js),Ns={name:`key`,size:24,node:[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]};Ns.node;var Ps=a(Ns),Fs={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Fs.node;var Is=a(Fs),Ls={name:`layout-dashboard`,size:24,node:[[`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`}]]};Ls.node;var Rs=a(Ls),zs={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};zs.node;var Bs=a(zs),Vs={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};Vs.node;var Hs=a(Vs),Us={name:`map-pin`,size:24,node:[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]};Us.node;var Ws=a(Us),Gs={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};Gs.node;var Ks=a(Gs),qs={name:`megaphone`,size:24,node:[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]};qs.node;var Js=a(qs),Ys={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};Ys.node;var Xs=a(Ys),Zs={name:`message-square-text`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};Zs.node;var Qs=a(Zs),$s={name:`message-square`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]};$s.node;var ec=a($s),tc={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};tc.node;var nc=a(tc),rc={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};rc.node;var ic=a(rc),ac={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};ac.node;var oc=a(ac),sc={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};sc.node;var cc=a(sc),lc={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};lc.node;var uc=a(lc),dc={name:`package`,size:24,node:[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]};dc.node;var fc=a(dc),pc={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};pc.node;var mc=a(pc),hc={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};hc.node;var gc=a(hc),_c={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};_c.node;var vc=a(_c),yc={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};yc.node;var bc=a(yc),xc={name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]};xc.node;var Sc=a(xc),Cc={name:`refresh-cw`,size:24,node:[[`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`}]]};Cc.node;var wc=a(Cc),Tc={name:`rotate-ccw`,size:24,node:[[`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`}]]};Tc.node;var Ec=a(Tc),Dc={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Dc.node;var Oc=a(Dc),kc={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};kc.node;var Ac=a(kc),jc={name:`server`,size:24,node:[[`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`}]]};jc.node;var Mc=a(jc),Nc={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Nc.node;var Pc=a(Nc),Fc={name:`shield-alert`,size:24,node:[[`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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]};Fc.node;var Ic=a(Fc),Lc={name:`shield-check`,size:24,node:[[`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`}]]};Lc.node;var Rc=a(Lc),zc={name:`shield`,size:24,node:[[`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`}]]};zc.node;var Bc=a(zc),Vc={name:`shopping-bag`,size:24,node:[[`path`,{d:`M16 10a4 4 0 0 1-8 0`,key:`1ltviw`}],[`path`,{d:`M3.103 6.034h17.794`,key:`awc11p`}],[`path`,{d:`M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z`,key:`o988cm`}]]};Vc.node;var Hc=a(Vc),Uc={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]};Uc.node;var Wc=a(Uc),Gc={name:`sliders-vertical`,size:24,node:[[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M12 21v-9`,key:`17s77i`}],[`path`,{d:`M12 8V3`,key:`13r4qs`}],[`path`,{d:`M17 16h4`,key:`h1uq16`}],[`path`,{d:`M19 12V3`,key:`o1uvq1`}],[`path`,{d:`M19 21v-5`,key:`qua636`}],[`path`,{d:`M3 14h4`,key:`bcjad9`}],[`path`,{d:`M5 10V3`,key:`cb8scm`}],[`path`,{d:`M5 21v-7`,key:`1w1uti`}]],aliases:[`sliders`]};Gc.node;var Kc=a(Gc),qc={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};qc.node;var Jc=a(qc),Yc={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Yc.node;var Xc=a(Yc),Zc={name:`square-check-big`,size:24,node:[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]],aliases:[`check-square`]};Zc.node;var Qc=a(Zc),$c={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};$c.node;var el=a($c),tl={name:`tablet`,size:24,node:[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]};tl.node;var nl=a(tl),rl={name:`terminal`,size:24,node:[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]};rl.node;var il=a(rl),al={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};al.node;var ol=a(al),sl={name:`trending-down`,size:24,node:[[`path`,{d:`M16 17h6v-6`,key:`t6n2it`}],[`path`,{d:`m22 17-8.5-8.5-5 5L2 7`,key:`x473p`}]]};sl.node;var cl=a(sl),ll={name:`trending-up`,size:24,node:[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]};ll.node;var ul=a(ll),dl={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};dl.node;var fl=a(dl),pl={name:`user-check`,size:24,node:[[`path`,{d:`m16 11 2 2 4-4`,key:`9rsbq5`}],[`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`}]]};pl.node;var ml=a(pl),hl={name:`user-plus`,size:24,node:[[`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`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]};hl.node;var gl=a(hl),_l={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};_l.node;var vl=a(_l),yl={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};yl.node;var bl=a(yl),xl={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};xl.node;var Sl=a(xl),Cl={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Cl.node;var wl=a(Cl),U=u(),Tl={LayoutDashboard:(0,U.jsx)(Rs,{className:`w-4 h-4 shrink-0`}),Workflow:(0,U.jsx)(bl,{className:`w-4 h-4 shrink-0 text-krona-gold`}),Users:(0,U.jsx)(vl,{className:`w-4 h-4 shrink-0`}),ShoppingBag:(0,U.jsx)(Hc,{className:`w-4 h-4 shrink-0`}),Boxes:(0,U.jsx)(Oo,{className:`w-4 h-4 shrink-0`}),BadgeDollarSign:(0,U.jsx)(So,{className:`w-4 h-4 shrink-0`}),UserCheck:(0,U.jsx)(ml,{className:`w-4 h-4 shrink-0`}),MessageSquareText:(0,U.jsx)(Qs,{className:`w-4 h-4 shrink-0`}),Headset:(0,U.jsx)(Os,{className:`w-4 h-4 shrink-0`}),CheckSquare:(0,U.jsx)(Qc,{className:`w-4 h-4 shrink-0`}),Globe:(0,U.jsx)(Ss,{className:`w-4 h-4 shrink-0`}),Megaphone:(0,U.jsx)(Js,{className:`w-4 h-4 shrink-0`}),BarChart3:(0,U.jsx)(Io,{className:`w-4 h-4 shrink-0`}),Cpu:(0,U.jsx)(us,{className:`w-4 h-4 shrink-0`}),Sparkles:(0,U.jsx)(Xc,{className:`w-4 h-4 shrink-0 text-krona-gold`}),Grid:(0,U.jsx)(ws,{className:`w-4 h-4 shrink-0`}),Settings:(0,U.jsx)(Pc,{className:`w-4 h-4 shrink-0`})},El=()=>{let[e,t]=(0,j.useState)(!1),{currentRoleId:n,getActiveCapabilities:r}=Da(),{entities:i}=lo(),a=i.filter(e=>!e.isSystem),o=r(),s=fo[n],c=uo.filter(e=>!(!s.allowedModules.includes(`*`)&&!s.allowedModules.includes(e.id)||e.requiredCapability&&!o[e.requiredCapability]));return(0,U.jsxs)(`aside`,{className:`relative h-screen bg-[#252722] text-[#D8D8D0] hidden md:flex flex-col border-r border-[#3A3D35] transition-all duration-200 z-20 select-none ${e?`w-16`:`w-56`}`,children:[(0,U.jsxs)(`div`,{className:`h-14 px-3.5 flex items-center justify-between border-b border-[#3A3D35] bg-[#20221E]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 overflow-hidden`,children:[(0,U.jsx)(`img`,{src:`/branding/krona-symbol.png`,alt:`Крона`,className:`w-8 h-8 object-contain shrink-0`}),!e&&(0,U.jsxs)(`div`,{className:`flex flex-col min-w-0 leading-tight select-none`,children:[(0,U.jsx)(`span`,{className:`text-sm font-bold tracking-wider text-[#E5B842] uppercase truncate`,children:`Крона`}),(0,U.jsx)(`span`,{className:`text-[9px] uppercase tracking-widest text-[#B78335] font-semibold`,children:`Business OS`})]})]}),(0,U.jsx)(`button`,{onClick:()=>t(!e),className:`p-1 rounded text-[#858980] hover:text-[#D8D8D0] hover:bg-[#30332C] transition-colors`,title:e?`Развернуть меню`:`Свернуть меню`,children:e?(0,U.jsx)(H,{className:`w-4 h-4`}):(0,U.jsx)(Ho,{className:`w-4 h-4`})})]}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto py-2.5 px-2 space-y-0.5`,children:[c.map(t=>(0,U.jsx)(la,{to:t.route,end:t.route===`/`,className:({isActive:e})=>`group relative flex items-center gap-2.5 px-2.5 py-2 rounded-md text-xs font-medium transition-all ${e?`bg-[#34382F] text-[#F5F0E5] font-semibold`:`text-[#BFC1B9] hover:text-[#F5F0E5] hover:bg-[#30332C]`}`,title:e?t.label:void 0,children:({isActive:n})=>(0,U.jsxs)(U.Fragment,{children:[n&&(0,U.jsx)(`div`,{className:`absolute left-0 top-1.5 bottom-1.5 w-1 bg-[#B78335] rounded-r`}),(0,U.jsx)(`div`,{className:`shrink-0 ${n?`text-[#D4B16D]`:`text-[#BFC1B9]`}`,children:Tl[t.iconName]||(0,U.jsx)(Rs,{className:`w-4 h-4 shrink-0`})}),!e&&(0,U.jsxs)(`div`,{className:`flex-1 flex items-center justify-between truncate`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:t.label}),t.badge&&(0,U.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded-full bg-[#3A3D35] text-[#D8D8D0] font-mono`,children:t.badge})]})]})},t.id)),a.length>0&&(0,U.jsxs)(`div`,{className:`pt-2 mt-2 border-t border-[#3A3D35]/80`,children:[!e&&(0,U.jsx)(`div`,{className:`px-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-[#858980]`,children:`Пользовательские модули`}),a.map(t=>(0,U.jsx)(la,{to:`/entities/${t.code}`,className:({isActive:e})=>`group relative flex items-center gap-2.5 px-2.5 py-1.5 rounded-md text-xs font-medium transition-all ${e?`bg-[#34382F] text-[#F5F0E5] font-semibold`:`text-[#BFC1B9] hover:text-[#F5F0E5] hover:bg-[#30332C]`}`,title:e?t.name:void 0,children:({isActive:n})=>(0,U.jsxs)(U.Fragment,{children:[n&&(0,U.jsx)(`div`,{className:`absolute left-0 top-1.5 bottom-1.5 w-1 bg-[#B78335] rounded-r`}),(0,U.jsx)(`div`,{className:`shrink-0 text-krona-gold`,children:(0,U.jsx)(Xc,{className:`w-3.5 h-3.5`})}),!e&&(0,U.jsx)(`span`,{className:`truncate text-xs`,children:t.name})]})},t.code))]}),(0,U.jsx)(`div`,{className:`pt-1`,children:(0,U.jsx)(la,{to:`/settings/entities`,className:({isActive:e})=>`group relative flex items-center gap-2.5 px-2.5 py-1.5 rounded-md text-xs font-medium transition-all ${e?`bg-[#34382F] text-[#F5F0E5] font-semibold`:`text-[#BFC1B9] hover:text-[#F5F0E5] hover:bg-[#30332C]`}`,title:e?`Конструктор сущностей`:void 0,children:({isActive:t})=>(0,U.jsxs)(U.Fragment,{children:[t&&(0,U.jsx)(`div`,{className:`absolute left-0 top-1.5 bottom-1.5 w-1 bg-[#B78335] rounded-r`}),(0,U.jsx)(`div`,{className:`shrink-0 text-krona-green`,children:(0,U.jsx)(bl,{className:`w-3.5 h-3.5`})}),!e&&(0,U.jsx)(`span`,{className:`truncate text-xs`,children:`Конструктор сущностей`})]})})})]}),(0,U.jsx)(`div`,{className:`p-2.5 border-t border-[#3A3D35] bg-[#20221E]/60 text-xs`,children:e?(0,U.jsx)(`div`,{className:`flex justify-center`,title:`Текущая роль: ${s.label}`,children:(0,U.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-krona-green`})}):(0,U.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`w-2 h-2 rounded-full bg-krona-green animate-pulse`}),(0,U.jsxs)(`div`,{className:`truncate`,children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold text-[#F5F0E5] truncate`,children:s.label}),(0,U.jsxs)(`div`,{className:`text-[9px] text-[#858980]`,children:[`RBAC: `,s.badge]})]})]})})})]})},Dl=j.forwardRef(({icon:t,"aria-label":n,size:r=`md`,className:a,...o},c)=>(0,U.jsx)(i,{ref:c,size:`icon`,"aria-label":n,className:e(s({sm:`p-1.5 text-xs`,md:`p-2 text-sm`,lg:`p-2.5 text-base`}[r],a)),...o,children:t}));Dl.displayName=`IconButton`;var Ol=j.forwardRef(({label:t,error:n,helperText:r,icon:i,endIcon:a,className:o,id:c,...l},u)=>{let d=(0,j.useId)(),f=c||d,p=n?`${f}-error`:void 0,m=r?`${f}-helper`:void 0;return(0,U.jsxs)(`div`,{className:`w-full flex flex-col gap-1.5 text-left`,children:[t&&(0,U.jsx)(`label`,{htmlFor:f,className:`text-xs font-medium text-krona-secondary select-none`,children:t}),(0,U.jsxs)(`div`,{className:`relative flex items-center`,children:[i&&(0,U.jsx)(`div`,{className:`absolute left-3 text-krona-secondary pointer-events-none flex items-center`,"aria-hidden":`true`,children:i}),(0,U.jsx)(`input`,{ref:u,id:f,"aria-invalid":n?`true`:`false`,"aria-describedby":p||m,className:e(s(`w-full bg-krona-surface text-krona-primary border border-krona-border rounded-md px-3 py-2 text-sm placeholder:text-krona-disabled transition-colors focus:outline-none focus:border-krona-green focus:ring-2 focus:ring-krona-green/20 disabled:opacity-50`,i&&`pl-9`,a&&`pr-9`,n&&`border-krona-danger focus:border-krona-danger focus:ring-krona-danger/20`,o)),...l}),a&&(0,U.jsx)(`div`,{className:`absolute right-3 text-krona-secondary pointer-events-none flex items-center`,"aria-hidden":`true`,children:a})]}),n&&(0,U.jsx)(`span`,{id:p,role:`alert`,className:`text-xs text-krona-danger`,children:n}),r&&!n&&(0,U.jsx)(`span`,{id:m,className:`text-xs text-krona-secondary`,children:r})]})});Ol.displayName=`Input`;var kl=j.forwardRef(({label:t,error:n,helperText:r,options:i,className:a,id:o,...c},l)=>{let u=(0,j.useId)(),d=o||u,f=n?`${d}-error`:void 0,p=r?`${d}-helper`:void 0;return(0,U.jsxs)(`div`,{className:`w-full flex flex-col gap-1.5 text-left`,children:[t&&(0,U.jsx)(`label`,{htmlFor:d,className:`text-xs font-medium text-krona-secondary select-none`,children:t}),(0,U.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,U.jsx)(`select`,{ref:l,id:d,"aria-invalid":n?`true`:`false`,"aria-describedby":f||p,className:e(s(`w-full appearance-none bg-krona-surface text-krona-primary border border-krona-border rounded-md px-3 py-2 pr-9 text-sm transition-colors focus:outline-none focus:border-krona-green focus:ring-2 focus:ring-krona-green/20 disabled:opacity-50 cursor-pointer`,n&&`border-krona-danger focus:border-krona-danger focus:ring-krona-danger/20`,a)),...c,children:i.map(e=>(0,U.jsx)(`option`,{value:e.value,disabled:e.disabled,children:e.label},e.value))}),(0,U.jsx)(`div`,{className:`absolute right-3 pointer-events-none text-krona-secondary`,"aria-hidden":`true`,children:(0,U.jsx)(Bo,{className:`w-4 h-4`})})]}),n&&(0,U.jsx)(`span`,{id:f,role:`alert`,className:`text-xs text-krona-danger`,children:n}),r&&!n&&(0,U.jsx)(`span`,{id:p,className:`text-xs text-krona-secondary`,children:r})]})});kl.displayName=`Select`;var Al=j.forwardRef(({label:t,description:n,error:r,className:i,id:a,checked:o,...c},l)=>{let u=(0,j.useId)(),d=a||u;return(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5 text-left`,children:[(0,U.jsxs)(`div`,{className:`relative flex items-center justify-center mt-0.5`,children:[(0,U.jsx)(`input`,{ref:l,id:d,type:`checkbox`,checked:o,className:`peer sr-only`,...c}),(0,U.jsx)(`label`,{htmlFor:d,className:e(s(`w-4 h-4 rounded border border-krona-border bg-krona-surface peer-checked:bg-krona-green peer-checked:border-krona-green flex items-center justify-center transition-all cursor-pointer peer-focus-visible:ring-2 peer-focus-visible:ring-krona-green/30 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed`,r&&`border-krona-danger`,i)),children:o&&(0,U.jsx)(Ro,{className:`w-3 h-3 text-white stroke-[3]`,"aria-hidden":`true`})})]}),(t||n)&&(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[t&&(0,U.jsx)(`label`,{htmlFor:d,className:`text-sm font-medium text-krona-primary cursor-pointer select-none`,children:t}),n&&(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:n}),r&&(0,U.jsx)(`span`,{role:`alert`,className:`text-xs text-krona-danger mt-0.5`,children:r})]})]})});Al.displayName=`Checkbox`;var jl=({title:t,value:n,change:r,subtitle:i,icon:a,actionText:o,onAction:c,className:l})=>(0,U.jsxs)(`div`,{className:e(s(`bg-krona-surface border border-krona-border rounded-lg p-4 shadow-krona-soft flex flex-col justify-between transition-all duration-150 hover:border-krona-border-strong`,l)),children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-krona-secondary truncate`,children:t}),(0,U.jsxs)(`div`,{className:`mt-1.5 flex items-baseline gap-2`,children:[(0,U.jsx)(`span`,{className:`text-2xl font-semibold text-krona-primary tracking-tight`,children:n}),r&&(0,U.jsxs)(`span`,{className:s(`inline-flex items-center text-xs font-medium px-1.5 py-0.5 rounded`,r.trend===`up`&&`text-status-success-text bg-status-success-soft`,r.trend===`down`&&`text-status-danger-text bg-status-danger-soft`,r.trend===`neutral`&&`text-krona-secondary bg-krona-muted`),children:[r.trend===`up`&&(0,U.jsx)(ul,{className:`w-3 h-3 mr-0.5`,"aria-hidden":`true`}),r.trend===`down`&&(0,U.jsx)(cl,{className:`w-3 h-3 mr-0.5`,"aria-hidden":`true`}),r.trend===`neutral`&&(0,U.jsx)(ic,{className:`w-3 h-3 mr-0.5`,"aria-hidden":`true`}),r.value]})]})]}),a&&(0,U.jsx)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border/60 text-krona-secondary shrink-0`,children:a})]}),(i||o)&&(0,U.jsxs)(`div`,{className:`mt-3 pt-2.5 border-t border-krona-border/40 flex items-center justify-between text-xs text-krona-secondary`,children:[i&&(0,U.jsx)(`span`,{children:i}),o&&(0,U.jsxs)(`button`,{type:`button`,onClick:c,className:`text-krona-green hover:text-krona-green-hover font-medium hover:underline focus:outline-none ml-auto cursor-pointer`,children:[o,` →`]})]})]}),Ml=({isOpen:e,onClose:n,title:r,subtitle:a,children:o,footer:s,maxWidth:c,size:l,closeOnBackdropClick:u=!0})=>{let d=l||c||`md`,f=(0,j.useRef)(null),p=(0,j.useRef)(null),m=(0,j.useId)(),h=(0,j.useId)();if((0,j.useEffect)(()=>{if(!e)return;p.current=document.activeElement;let t=f.current;if(t){let e=t.querySelectorAll(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);e.length>0&&e[0].focus()}let r=e=>{if(e.key===`Escape`){e.preventDefault(),n();return}if(e.key===`Tab`){let t=f.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null);if(n.length===0){e.preventDefault();return}let r=n[0],i=n[n.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),i.focus()):document.activeElement===i&&(e.preventDefault(),r.focus())}};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),p.current&&typeof p.current.focus==`function`&&p.current.focus()}},[e,n]),!e)return null;let g={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-xl`,"2xl":`max-w-2xl`,"3xl":`max-w-3xl`,"4xl":`max-w-4xl`};return(0,U.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,U.jsx)(`div`,{className:`fixed inset-0 krona-overlay transition-opacity duration-200 cursor-pointer`,onClick:u?n:void 0,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{ref:f,className:`relative w-full ${g[d]||g.md} bg-krona-raised border border-krona-border rounded-xl shadow-krona-modal z-10 flex flex-col max-h-[90vh] overflow-hidden animate-fade-in`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":m,"aria-describedby":a?h:void 0,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-krona-border/60 bg-krona-surface/50`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{id:m,className:`text-base font-semibold text-krona-primary`,children:r}),a&&(0,U.jsx)(`p`,{id:h,className:`text-xs text-krona-secondary mt-0.5`,children:a})]}),(0,U.jsx)(i,{variant:`ghost`,size:`icon`,onClick:n,"aria-label":`Закрыть диалоговое окно`,children:(0,U.jsx)(t,{className:`w-4 h-4`,"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{className:`px-6 py-5 overflow-y-auto flex-1 text-sm text-krona-primary`,children:o}),s&&(0,U.jsx)(`div`,{className:`flex items-center justify-end gap-2.5 px-6 py-3.5 border-t border-krona-border/60 bg-krona-surface/30`,children:s})]})]})},Nl=({isOpen:e,onClose:n,title:r,subtitle:a,children:o,footer:s,width:c,size:l,side:u=`right`})=>{let d=l||c||`md`,f=(0,j.useRef)(null),p=(0,j.useRef)(null),m=(0,j.useId)(),h=(0,j.useId)();if((0,j.useEffect)(()=>{if(!e)return;p.current=document.activeElement;let t=f.current;if(t){let e=t.querySelectorAll(`button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])`);e.length>0&&e[0].focus()}let r=e=>{if(e.key===`Escape`){e.preventDefault(),n();return}if(e.key===`Tab`){let t=f.current;if(!t)return;let n=Array.from(t.querySelectorAll(`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`)).filter(e=>e.offsetParent!==null);if(n.length===0){e.preventDefault();return}let r=n[0],i=n[n.length-1];e.shiftKey?document.activeElement===r&&(e.preventDefault(),i.focus()):document.activeElement===i&&(e.preventDefault(),r.focus())}};return window.addEventListener(`keydown`,r),()=>{window.removeEventListener(`keydown`,r),p.current&&typeof p.current.focus==`function`&&p.current.focus()}},[e,n]),!e)return null;let g={sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`,xl:`max-w-xl`};return(0,U.jsxs)(`div`,{className:`fixed inset-0 z-50 overflow-hidden`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":m,children:[(0,U.jsx)(`div`,{className:`fixed inset-0 krona-overlay transition-opacity cursor-pointer`,onClick:n,"aria-hidden":`true`}),(0,U.jsx)(`div`,{className:`fixed inset-y-0 ${u===`right`?`right-0 pl-10`:`left-0 pr-10`} max-w-full flex`,children:(0,U.jsxs)(`div`,{ref:f,className:`w-screen ${g[d]||g.md} bg-krona-raised ${u===`right`?`border-l`:`border-r`} border-krona-border shadow-krona-modal flex flex-col animate-fade-in`,"aria-describedby":a?h:void 0,children:[(0,U.jsxs)(`div`,{className:`px-5 py-4 border-b border-krona-border flex items-center justify-between bg-krona-surface/60`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{id:m,className:`text-sm font-semibold text-krona-primary`,children:r}),a&&(0,U.jsx)(`p`,{id:h,className:`text-xs text-krona-secondary mt-0.5`,children:a})]}),(0,U.jsx)(i,{variant:`ghost`,size:`icon`,onClick:n,"aria-label":`Закрыть панель`,children:(0,U.jsx)(t,{className:`w-4 h-4`,"aria-hidden":`true`})})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto p-5 text-sm`,children:o}),s&&(0,U.jsx)(`div`,{className:`p-4 border-t border-krona-border bg-krona-surface/40 flex justify-end gap-2`,children:s})]})})]})},Pl=({children:e})=>{let[t,n]=(0,j.useState)([]),r=(0,j.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),i=(0,j.useCallback)(({type:e,title:t,message:i,durationMs:a=4e3})=>{let o=d(),s={id:o,type:e,title:t,message:i,durationMs:a};return n(e=>[...e,s]),a>0&&setTimeout(()=>{r(o)},a),o},[r]);return(0,U.jsxs)(o.Provider,{value:{toasts:t,showToast:i,dismissToast:r},children:[e,(0,U.jsx)(Fl,{toasts:t,onDismiss:r})]})},Fl=({toasts:e,onDismiss:t})=>e.length===0?null:(0,U.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`false`,className:`fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none`,children:e.map(e=>(0,U.jsx)(Il,{toast:e,onDismiss:()=>t(e.id)},e.id))}),Il=({toast:e,onDismiss:n})=>{let r={success:(0,U.jsx)(Xo,{className:`w-5 h-5 text-krona-green flex-shrink-0`}),error:(0,U.jsx)(Ko,{className:`w-5 h-5 text-krona-danger flex-shrink-0`}),warning:(0,U.jsx)(fl,{className:`w-5 h-5 text-krona-warning flex-shrink-0`}),info:(0,U.jsx)(Ms,{className:`w-5 h-5 text-krona-info flex-shrink-0`})},i={success:`border-krona-green/40`,error:`border-krona-danger/40`,warning:`border-krona-warning/40`,info:`border-krona-info/40`},a=e.type===`error`||e.type===`warning`;return(0,U.jsxs)(`div`,{role:a?`alert`:`status`,className:`pointer-events-auto flex items-start gap-3 p-3.5 bg-krona-raised border ${i[e.type]} rounded-lg shadow-krona-raised text-sm text-krona-primary animate-fade-in`,children:[r[e.type],(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`p`,{className:`font-semibold text-xs text-krona-primary`,children:e.title}),e.message&&(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:e.message})]}),(0,U.jsx)(`button`,{type:`button`,onClick:n,className:`text-krona-secondary hover:text-krona-primary p-1 rounded-md hover:bg-krona-surface cursor-pointer`,"aria-label":`Закрыть уведомление`,children:(0,U.jsx)(t,{className:`w-3.5 h-3.5`,"aria-hidden":`true`})})]})},Ll=({variant:t=`rectangular`,width:n,height:r,lines:i=1,className:a,style:o,...c})=>{let l=`animate-pulse bg-krona-surface-muted`,u={text:`h-4 rounded`,rectangular:`rounded-md`,circular:`rounded-full aspect-square`},d={width:typeof n==`number`?`${n}px`:n,height:typeof r==`number`?`${r}px`:r,...o};return t===`text`&&i>1?(0,U.jsx)(`div`,{className:`flex flex-col gap-2 w-full`,"aria-hidden":`true`,role:`presentation`,children:Array.from({length:i}).map((t,n)=>(0,U.jsx)(`div`,{className:e(s(l,u.text,a)),style:{width:n===i-1&&i>1?`70%`:d.width||`100%`,height:d.height},...c},n))}):(0,U.jsx)(`div`,{className:e(s(l,u[t],a)),style:d,"aria-hidden":`true`,role:`presentation`,...c})},Rl=({title:e})=>(0,U.jsxs)(`div`,{className:`p-6 space-y-6 max-w-7xl mx-auto animate-fade-in`,"aria-busy":`true`,"aria-label":`Загрузка страницы`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`space-y-2`,children:[e?(0,U.jsx)(`h2`,{className:`text-xl font-bold text-krona-primary`,children:e}):(0,U.jsx)(Ll,{variant:`text`,width:220,height:28}),(0,U.jsx)(Ll,{variant:`text`,width:320,height:16})]}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.jsx)(Ll,{variant:`rectangular`,width:100,height:36}),(0,U.jsx)(Ll,{variant:`rectangular`,width:120,height:36})]})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-4 gap-4`,children:Array.from({length:4}).map((e,t)=>(0,U.jsxs)(`div`,{className:`p-4 bg-krona-surface border border-krona-border rounded-lg space-y-3`,children:[(0,U.jsx)(Ll,{variant:`text`,width:`50%`,height:14}),(0,U.jsx)(Ll,{variant:`text`,width:`80%`,height:24}),(0,U.jsx)(Ll,{variant:`text`,width:`40%`,height:12})]},t))}),(0,U.jsxs)(`div`,{className:`bg-krona-surface border border-krona-border rounded-lg p-5 space-y-4`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,U.jsx)(Ll,{variant:`text`,width:180,height:20}),(0,U.jsx)(Ll,{variant:`rectangular`,width:200,height:32})]}),(0,U.jsx)(`div`,{className:`space-y-3`,children:Array.from({length:6}).map((e,t)=>(0,U.jsx)(Ll,{variant:`rectangular`,width:`100%`,height:40},t))})]})]}),zl=class extends j.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){console.error(`[ErrorBoundary${this.props.scope?` - ${this.props.scope}`:``}]:`,e,t)}handleReset=()=>{this.setState({hasError:!1,error:null}),this.props.onReset&&this.props.onReset()};render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,U.jsxs)(`div`,{role:`alert`,className:`p-8 my-6 bg-krona-raised border border-krona-danger/30 rounded-xl shadow-krona-soft max-w-2xl mx-auto text-center animate-fade-in`,children:[(0,U.jsx)(`div`,{className:`w-12 h-12 rounded-full bg-krona-danger/10 text-krona-danger flex items-center justify-center mx-auto mb-4`,children:(0,U.jsx)(fl,{className:`w-6 h-6`,"aria-hidden":`true`})}),(0,U.jsxs)(`h3`,{className:`text-lg font-semibold text-krona-primary mb-2`,children:[`Произошла ошибка в работе `,this.props.scope?`компонента «${this.props.scope}»`:`интерфейса`]}),(0,U.jsx)(`p`,{className:`text-sm text-krona-secondary max-w-md mx-auto mb-4`,children:this.state.error?.message||`Непредвиденная ошибка отображения данных.`}),(0,U.jsxs)(`div`,{className:`flex items-center justify-center gap-3`,children:[(0,U.jsxs)(i,{variant:`primary`,size:`sm`,onClick:this.handleReset,children:[(0,U.jsx)(Ec,{className:`w-4 h-4 mr-1.5`}),`Попробовать снова`]}),(0,U.jsxs)(i,{variant:`outline`,size:`sm`,onClick:()=>{window.location.href=`/`},children:[(0,U.jsx)(As,{className:`w-4 h-4 mr-1.5`}),`На главную`]})]})]}):this.props.children}},Bl=({level:t,size:n=`md`,showDescription:r=!1,className:i,...a})=>{let o={pilot1:{label:`Pilot 1`,description:`Готово к пилоту (IndexedDB, транзакционный контур)`,badgeClass:`bg-emerald-50 text-emerald-800 border-emerald-300 dark:bg-emerald-950/40 dark:text-emerald-300 dark:border-emerald-700`,icon:Xo,iconClass:`text-emerald-600 dark:text-emerald-400`},target:{label:`Target prototype`,description:`Целевой прототип (интерактивный макет с бизнес-логикой)`,badgeClass:`bg-sky-50 text-sky-800 border-sky-300 dark:bg-sky-950/40 dark:text-sky-300 dark:border-sky-700`,icon:Is,iconClass:`text-sky-600 dark:text-sky-400`},demo:{label:`Demo only`,description:`Демонстрационный режим (симуляция)`,badgeClass:`bg-purple-50 text-purple-800 border-purple-300 dark:bg-purple-950/40 dark:text-purple-300 dark:border-purple-700`,icon:bs,iconClass:`text-purple-600 dark:text-purple-400`}}[t],c=o.icon;return(0,U.jsxs)(`span`,{"data-testid":`maturity-badge-${t}`,title:o.description,className:e(s(`inline-flex items-center font-medium rounded-full border border-solid shadow-xs select-none`,o.badgeClass,{sm:`text-[11px] px-2 py-0.5 gap-1`,md:`text-xs px-2.5 py-1 gap-1.5`}[n],i)),...a,children:[(0,U.jsx)(c,{className:s(n===`sm`?`w-3 h-3`:`w-3.5 h-3.5`,o.iconClass)}),(0,U.jsx)(`span`,{children:o.label}),r&&(0,U.jsxs)(`span`,{className:`hidden sm:inline text-[10px] opacity-75 font-normal ml-1`,children:[`• `,o.description]})]})},Vl=()=>{let{theme:e,setTheme:t,viewportMode:n,setViewportMode:r,currentProfileId:a,setProfileId:o,currentRoleId:s,setRoleId:c,activeLocation:l,setActiveLocation:u,setIsCommandPaletteOpen:d,setIsQuickActionsOpen:f,setIsNotificationsOpen:p,setIsAiDrawerOpen:m,notifications:h,getActiveProfile:g,getActiveCapabilities:_}=Da(),v=Ir(),y=zr(),b=g(),x=_(),S=fo[s],[C,w]=j.useState(!1),T=h.filter(e=>!e.read).length,E=v.pathname,D=uo.find(e=>e.route===`/`?E===`/`:E.startsWith(e.route))||uo[0],O=D.id===`operations`?b.operationsTabs.filter(e=>!e.requiredCapability||x[e.requiredCapability]):D.sections.filter(e=>!e.requiredCapability||x[e.requiredCapability]);return(0,U.jsxs)(`header`,{className:`sticky top-0 z-30 bg-krona-workspace/95 backdrop-blur-sm border-b border-krona-border`,children:[(0,U.jsxs)(`div`,{className:`h-14 px-4 flex items-center justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsxs)(`div`,{className:`relative group`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 cursor-pointer hover:border-krona-gold/60 transition-colors shadow-krona-soft`,children:[(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-krona-gold`}),(0,U.jsxs)(`div`,{className:`flex flex-col text-left`,children:[(0,U.jsx)(`span`,{className:`text-[10px] uppercase font-semibold tracking-wider text-krona-secondary`,children:`Профиль бизнеса`}),(0,U.jsx)(`span`,{className:`text-xs font-semibold text-krona-primary max-w-[170px] truncate`,children:b.name})]}),(0,U.jsx)(Bo,{className:`w-3.5 h-3.5 text-krona-secondary`})]}),(0,U.jsxs)(`div`,{className:`absolute left-0 top-full mt-1 w-72 bg-krona-raised border border-krona-border rounded-xl shadow-krona-modal p-1.5 hidden group-hover:block z-50 animate-fade-in`,children:[(0,U.jsx)(`div`,{className:`px-2.5 py-1.5 text-[11px] font-semibold text-krona-secondary uppercase tracking-wider border-b border-krona-border/60`,children:`Отраслевые профили Кроны`}),(0,U.jsx)(`div`,{className:`max-h-80 overflow-y-auto py-1 space-y-0.5`,children:Object.values(xa).map(e=>(0,U.jsxs)(`button`,{onClick:()=>{o(e.id),y(`/operations`)},className:`w-full text-left px-2.5 py-2 rounded-lg text-xs flex items-center justify-between transition-colors ${e.id===a?`bg-krona-gold/15 text-krona-gold-text font-medium`:`hover:bg-krona-workspace text-krona-primary`}`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-medium truncate`,children:e.name}),(0,U.jsx)(`div`,{className:`text-[10px] text-krona-secondary truncate`,children:e.companyName})]}),(0,U.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-krona-muted text-krona-secondary shrink-0`,children:e.category})]},e.id))})]})]}),(0,U.jsxs)(`div`,{className:`relative group`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 cursor-pointer hover:border-krona-border-strong text-xs text-krona-primary shadow-krona-soft`,children:[(0,U.jsx)(Ws,{className:`w-3.5 h-3.5 text-krona-secondary`}),(0,U.jsx)(`span`,{className:`max-w-[130px] truncate font-medium`,children:l}),(0,U.jsx)(Bo,{className:`w-3 h-3 text-krona-secondary`})]}),(0,U.jsxs)(`div`,{className:`absolute left-0 top-full mt-1 w-56 bg-krona-raised border border-krona-border rounded-lg shadow-krona-modal p-1 hidden group-hover:block z-50`,children:[(0,U.jsx)(`div`,{className:`px-2 py-1 text-[10px] font-semibold text-krona-secondary uppercase`,children:`Точки продаж / Локации`}),b.locations.map(e=>(0,U.jsx)(`button`,{onClick:()=>u(e),className:`w-full text-left px-2.5 py-1.5 rounded text-xs transition-colors ${e===l?`bg-krona-green/10 text-krona-green font-medium`:`hover:bg-krona-workspace text-krona-primary`}`,children:e},e))]})]}),(0,U.jsxs)(`div`,{className:`relative group`,children:[(0,U.jsxs)(`div`,{"data-testid":`role-switcher-btn`,onClick:()=>w(e=>!e),className:`flex items-center gap-1.5 bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 cursor-pointer hover:border-krona-border-strong text-xs shadow-krona-soft`,children:[(0,U.jsx)(Bc,{className:`w-3.5 h-3.5 text-krona-green`}),(0,U.jsxs)(`div`,{className:`flex flex-col text-left`,children:[(0,U.jsx)(`span`,{className:`text-[9px] uppercase font-semibold text-krona-secondary`,children:`Роль`}),(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary truncate max-w-[90px]`,children:S.badge})]}),(0,U.jsx)(Bo,{className:`w-3 h-3 text-krona-secondary`})]}),(0,U.jsxs)(`div`,{className:`absolute left-0 top-full mt-1 w-64 bg-krona-raised border border-krona-border rounded-xl shadow-krona-modal p-1.5 z-50 ${C?`block`:`hidden group-hover:block`}`,children:[(0,U.jsx)(`div`,{className:`px-2 py-1 text-[10px] font-semibold text-krona-secondary uppercase border-b border-krona-border/60`,children:`Переключение роли (RBAC)`}),(0,U.jsx)(`div`,{className:`max-h-72 overflow-y-auto py-1 space-y-0.5`,children:Object.values(fo).map(e=>(0,U.jsxs)(`button`,{"data-testid":`role-option-${e.id}`,onClick:()=>{w(!1),c(e.id),y(e.defaultRoute)},className:`w-full text-left px-2.5 py-2 rounded-lg text-xs transition-colors ${e.id===s?`bg-krona-green/15 text-krona-green-text font-medium`:`hover:bg-krona-workspace text-krona-primary`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:e.label}),(0,U.jsx)(`span`,{className:`text-[10px] px-1 py-0.5 rounded bg-krona-muted text-krona-secondary`,children:e.badge})]}),(0,U.jsx)(`div`,{className:`text-[10px] text-krona-secondary truncate mt-0.5`,children:e.description})]},e.id))})]})]})]}),(0,U.jsx)(`div`,{className:`flex-1 max-w-md hidden md:block`,children:(0,U.jsxs)(`button`,{onClick:()=>d(!0),className:`w-full flex items-center justify-between px-3 py-1.5 rounded-lg bg-krona-surface border border-krona-border text-xs text-krona-secondary hover:border-krona-border-strong shadow-krona-soft transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Oc,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:`Поиск по Кроне, клиентам, чекам, KDS...`})]}),(0,U.jsx)(`kbd`,{className:`px-1.5 py-0.5 text-[10px] bg-krona-workspace border border-krona-border rounded text-krona-secondary font-mono`,children:`Ctrl+K`})]})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsxs)(i,{variant:`gold`,size:`sm`,onClick:()=>m(!0),className:`hidden sm:inline-flex text-xs font-medium gap-1.5`,children:[(0,U.jsx)(Xc,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:`✦ Спросить Крону`})]}),(0,U.jsx)(i,{variant:`primary`,size:`sm`,onClick:()=>f(!0),className:`px-2.5`,title:`Быстрое создание`,children:(0,U.jsx)(vc,{className:`w-4 h-4`})}),(0,U.jsxs)(`div`,{className:`flex items-center bg-krona-surface border border-krona-border rounded-lg p-0.5 shadow-krona-soft`,children:[(0,U.jsx)(`button`,{onClick:()=>r(`desktop`),className:`p-1.5 rounded transition-colors ${n===`desktop`?`bg-krona-workspace text-krona-green`:`text-krona-secondary hover:text-krona-primary`}`,title:`Desktop View`,children:(0,U.jsx)(oc,{className:`w-3.5 h-3.5`})}),(0,U.jsx)(`button`,{onClick:()=>r(`tablet-landscape`),className:`p-1.5 rounded transition-colors ${n===`tablet-landscape`?`bg-krona-workspace text-krona-green`:`text-krona-secondary hover:text-krona-primary`}`,title:`Tablet Landscape`,children:(0,U.jsx)(nl,{className:`w-3.5 h-3.5 rotate-90`})}),(0,U.jsx)(`button`,{onClick:()=>r(`tablet-portrait`),className:`p-1.5 rounded transition-colors ${n===`tablet-portrait`?`bg-krona-workspace text-krona-green`:`text-krona-secondary hover:text-krona-primary`}`,title:`Tablet Portrait`,children:(0,U.jsx)(nl,{className:`w-3.5 h-3.5`})}),(0,U.jsx)(`button`,{onClick:()=>r(`mobile`),className:`p-1.5 rounded transition-colors ${n===`mobile`?`bg-krona-workspace text-krona-green`:`text-krona-secondary hover:text-krona-primary`}`,title:`Mobile View`,children:(0,U.jsx)(Jc,{className:`w-3.5 h-3.5`})})]}),(0,U.jsxs)(`div`,{className:`flex items-center bg-krona-surface border border-krona-border rounded-lg p-0.5 shadow-krona-soft`,children:[(0,U.jsx)(`button`,{"data-testid":`theme-toggle-soft`,onClick:()=>t(`soft-light`),className:`px-2 py-1 text-[11px] font-medium rounded transition-colors ${e===`soft-light`?`bg-krona-workspace text-krona-gold-text`:`text-krona-secondary`}`,title:`Soft Light (Основная)`,children:`Soft`}),(0,U.jsx)(`button`,{"data-testid":`theme-toggle-light`,onClick:()=>t(`light`),className:`p-1 rounded transition-colors ${e===`light`?`bg-krona-workspace text-krona-gold`:`text-krona-secondary`}`,title:`Light`,children:(0,U.jsx)(el,{className:`w-3.5 h-3.5`})}),(0,U.jsx)(`button`,{"data-testid":`theme-toggle-dark`,onClick:()=>t(`dark`),className:`p-1 rounded transition-colors ${e===`dark`?`bg-krona-workspace text-krona-gold`:`text-krona-secondary`}`,title:`Dark`,children:(0,U.jsx)(cc,{className:`w-3.5 h-3.5`})})]}),(0,U.jsxs)(`button`,{onClick:()=>p(!0),className:`relative p-2 rounded-lg bg-krona-surface border border-krona-border text-krona-secondary hover:text-krona-primary shadow-krona-soft transition-colors`,title:`Уведомления`,children:[(0,U.jsx)(Eo,{className:`w-4 h-4`}),T>0&&(0,U.jsx)(`span`,{className:`absolute -top-1 -right-1 w-4 h-4 rounded-full bg-krona-danger text-white text-[10px] font-bold flex items-center justify-center`,children:T})]})]})]}),O.length>0&&(0,U.jsxs)(`nav`,{className:`px-4 flex items-center gap-1 overflow-x-auto h-10 border-t border-krona-border/50 bg-krona-workspace/70 text-xs`,children:[(0,U.jsxs)(`span`,{className:`text-[11px] font-bold uppercase tracking-wider text-krona-secondary mr-2 flex items-center gap-1`,children:[(0,U.jsx)(Is,{className:`w-3 h-3 text-krona-secondary`}),D.label,`:`]}),O.map(e=>{let t=E===e.route||e.route!==`/operations`&&e.route!==`/`&&E.startsWith(e.route);return(0,U.jsxs)(`button`,{onClick:()=>y(e.route),className:`px-3 py-1.5 rounded-md font-medium whitespace-nowrap transition-all flex items-center gap-1.5 ${t?`bg-[#2F684C] text-[#F8F6F0] shadow-sm`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-surface/60`}`,children:[(0,U.jsx)(`span`,{children:e.label}),e.badge&&(0,U.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.2 rounded-full font-bold ${t?`bg-white/20 text-white`:`bg-krona-muted text-krona-secondary`}`,children:e.badge})]},e.id)})]})]})},Hl=()=>{let{isRightPanelCollapsed:e,setIsRightPanelCollapsed:t,getActiveProfile:n,setIsQuickActionsOpen:r,activeLocation:a}=Da(),o=n(),s=zr(),[c,u]=(0,j.useState)(`ai`),[f,p]=(0,j.useState)([{id:`1`,sender:`ai`,text:`Приветствую! Я Krona AI. Анализирую точку «${a}» (${o.name}). Выручка в норме, но обратите внимание на запас охлажденного лосося — осталось 2.4 кг. Чем помочь?`,time:`12:30`}]),[m,h]=(0,j.useState)(``),[g,_]=(0,j.useState)(!1),[v,y]=(0,j.useState)(`all`),b=[`Что требует внимания сегодня?`,`Какие позиции скоро закончатся?`,`Самые прибыльные позиции?`,`Каких клиентов стоит вернуть?`],x=e=>{let t=e||m;if(!t.trim())return;let n={id:`usr-${d()}`,sender:`user`,text:t,time:new Date().toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`})};p(e=>[...e,n]),h(``),_(!0),setTimeout(()=>{let e=`Анализирую операционные данные Кроны...`;e=t.includes(`внимания`)?`⚠️ 3 критических алерта: 1) Запас лосося ниже минимума (2.4 кг из 6 кг); 2) Заказ #104 готовится уже 18 минут; 3) Курьер Алексей завершил смену с 24 500 ₽ наличных к инкассации.`:t.includes(`закончатся`)||t.includes(`склад`)?`📦 Скоро закончатся: Лосось атлантический (2.4 кг), Угорь копченый (0.0 кг — в стоп-листе!), Тигровые креветки (4.8 кг). Рекомендую сформировать авто-заявку в СибРыбТорг.`:t.includes(`прибыльные`)||t.includes(`блюда`)?`💰 Топ по маржинальности: 1) Гёдза свинина (маржа 76.1%, food cost 23.9%); 2) Рамен Тонкоцу (маржа 72.1%); 3) Филадельфия Премиум (выручка 58 650 ₽/день).`:t.includes(`клиент`)?`👥 В зоне риска 14 постоянных клиентов (не было визитов более 30 дней). Например: Дмитрий Мельников (LTV 18 500 ₽). Предлагаю запустить триггерную рассылку со скидкой 15% в Telegram-боте.`:`Ответ AI по профилю «${o.name}»: Задача зафиксирована в оркестраторе Кроны. Контекст передан специализированным агентам.`,p(t=>[...t,{id:`ai-${Date.now()}`,sender:`ai`,text:e,time:new Date().toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`})}]),_(!1)},650)};return e?(0,U.jsxs)(`button`,{onClick:()=>t(!1),className:`hidden xl:flex fixed right-0 top-20 bg-krona-surface border-y border-l border-krona-border rounded-l-lg p-2 text-krona-secondary hover:text-krona-primary shadow-krona-soft z-20 flex-col items-center gap-2 transition-all`,title:`Развернуть панель управления`,children:[(0,U.jsx)(Ho,{className:`w-4 h-4 text-krona-gold`}),(0,U.jsx)(`span`,{className:`text-[10px] font-semibold uppercase [writing-mode:vertical-rl] tracking-wider text-krona-secondary`,children:`Command Panel`})]}):(0,U.jsxs)(`aside`,{className:`hidden xl:flex w-80 h-[calc(100vh-3.5rem)] bg-krona-workspace/95 border-l border-krona-border flex-col shrink-0 z-20`,children:[(0,U.jsxs)(`div`,{className:`p-3 border-b border-krona-border flex items-center justify-between bg-krona-surface/50`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1 bg-krona-workspace p-0.5 rounded-lg border border-krona-border text-xs`,children:[(0,U.jsxs)(`button`,{onClick:()=>u(`ai`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1 transition-colors ${c===`ai`?`bg-krona-gold text-white font-semibold shadow-sm`:`text-krona-secondary hover:text-krona-primary`}`,children:[(0,U.jsx)(Xc,{className:`w-3 h-3`}),(0,U.jsx)(`span`,{children:`Krona AI`})]}),(0,U.jsxs)(`button`,{onClick:()=>u(`actions`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1 transition-colors ${c===`actions`?`bg-[#2F684C] text-white font-semibold shadow-sm`:`text-krona-secondary hover:text-krona-primary`}`,children:[(0,U.jsx)(wl,{className:`w-3 h-3`}),(0,U.jsx)(`span`,{children:`Действия`})]}),(0,U.jsxs)(`button`,{onClick:()=>u(`chat`),className:`px-2.5 py-1 rounded-md font-medium flex items-center gap-1 transition-colors ${c===`chat`?`bg-krona-surface text-krona-primary shadow-sm`:`text-krona-secondary hover:text-krona-primary`}`,children:[(0,U.jsx)(ec,{className:`w-3 h-3`}),(0,U.jsx)(`span`,{children:`Чаты`})]})]}),(0,U.jsx)(`button`,{onClick:()=>t(!0),className:`p-1 rounded text-krona-secondary hover:text-krona-primary`,title:`Свернуть панель`,children:(0,U.jsx)(H,{className:`w-4 h-4`})})]}),c===`ai`&&(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,U.jsx)(`div`,{className:`p-2.5 border-b border-krona-border/60 bg-krona-surface/40 flex items-center gap-1.5 overflow-x-auto text-[11px]`,children:b.map((e,t)=>(0,U.jsx)(`button`,{onClick:()=>x(e),className:`whitespace-nowrap px-2 py-1 rounded-full bg-krona-gold/10 hover:bg-krona-gold/20 text-krona-gold-text border border-krona-gold/30 transition-colors`,children:e},t))}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-3 space-y-3 text-xs`,children:[f.map(e=>(0,U.jsxs)(`div`,{className:`flex gap-2 ${e.sender===`user`?`justify-end`:`justify-start`}`,children:[e.sender===`ai`&&(0,U.jsx)(`div`,{className:`w-6 h-6 rounded-full bg-krona-gold/20 border border-krona-gold/40 flex items-center justify-center text-krona-gold shrink-0`,children:(0,U.jsx)(Xc,{className:`w-3.5 h-3.5`})}),(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg max-w-[85%] leading-relaxed ${e.sender===`user`?`bg-[#2F684C] text-[#F8F6F0] rounded-br-none`:`bg-krona-surface border border-krona-border text-krona-primary rounded-bl-none shadow-krona-soft`}`,children:[(0,U.jsx)(`p`,{children:e.text}),(0,U.jsx)(`span`,{className:`block text-[9px] mt-1 text-right ${e.sender===`user`?`text-white/70`:`text-krona-secondary`}`,children:e.time})]})]},e.id)),g&&(0,U.jsxs)(`div`,{className:`flex items-center gap-1 text-krona-gold text-xs italic`,children:[(0,U.jsx)(Xc,{className:`w-3.5 h-3.5 animate-spin`}),(0,U.jsx)(`span`,{children:`Krona AI думает...`})]})]}),(0,U.jsx)(`div`,{className:`p-2.5 border-t border-krona-border bg-krona-surface/60`,children:(0,U.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x()},className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`input`,{type:`text`,value:m,onChange:e=>h(e.target.value),placeholder:`Спросите AI об остатках, выручке...`,className:`flex-1 text-xs bg-krona-surface border border-krona-border rounded-md px-3 py-2 text-krona-primary placeholder:text-krona-secondary focus:outline-none focus:border-krona-gold`}),(0,U.jsx)(i,{type:`submit`,variant:`gold`,size:`sm`,className:`px-2.5`,children:(0,U.jsx)(Ac,{className:`w-3.5 h-3.5`})})]})})]}),c===`actions`&&(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-3 space-y-2 text-xs`,children:[(0,U.jsxs)(`div`,{className:`text-[11px] font-semibold text-krona-secondary uppercase tracking-wider mb-2`,children:[`Быстрые операции: `,o.name]}),(0,U.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>r(!0),children:[(0,U.jsx)(Hc,{className:`w-4 h-4 mr-2 text-krona-green`}),(0,U.jsx)(`span`,{children:`Новый чек / заказ`})]}),o.capabilities.booking&&(0,U.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>r(!0),children:[(0,U.jsx)(Mo,{className:`w-4 h-4 mr-2 text-krona-gold`}),(0,U.jsxs)(`span`,{children:[`Забронировать `,o.terminology.bookingResourceLabel.toLowerCase()]})]}),o.capabilities.work_orders&&(0,U.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>r(!0),children:[(0,U.jsx)(Po,{className:`w-4 h-4 mr-2 text-krona-info`}),(0,U.jsx)(`span`,{children:`Открыть заказ-наряд на пост`})]}),(0,U.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>s(`/operations/pos`),children:[(0,U.jsx)(Sc,{className:`w-4 h-4 mr-2 text-krona-green`}),(0,U.jsx)(`span`,{children:`Открыть кассовый терминал (POS)`})]}),(0,U.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>s(`/tasks`),children:[(0,U.jsx)(Qc,{className:`w-4 h-4 mr-2 text-krona-secondary`}),(0,U.jsx)(`span`,{children:`Поставить задачу сотруднику`})]}),(0,U.jsxs)(i,{variant:`outline`,className:`w-full justify-start text-xs`,onClick:()=>s(`/inventory`),children:[(0,U.jsx)(Ec,{className:`w-4 h-4 mr-2 text-krona-warning`}),(0,U.jsx)(`span`,{children:`Провести списание / инвентаризацию`})]})]}),c===`chat`&&(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`p-2 border-b border-krona-border flex gap-1 text-[11px]`,children:[(0,U.jsx)(`button`,{onClick:()=>y(`all`),className:`px-2 py-0.5 rounded ${v===`all`?`bg-krona-surface font-semibold text-krona-primary`:`text-krona-secondary`}`,children:`Все (3)`}),(0,U.jsx)(`button`,{onClick:()=>y(`clients`),className:`px-2 py-0.5 rounded ${v===`clients`?`bg-krona-surface font-semibold text-krona-primary`:`text-krona-secondary`}`,children:`Клиенты (2)`}),(0,U.jsx)(`button`,{onClick:()=>y(`team`),className:`px-2 py-0.5 rounded ${v===`team`?`bg-krona-surface font-semibold text-krona-primary`:`text-krona-secondary`}`,children:`Команда (1)`})]}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto divide-y divide-krona-border/50 text-xs`,children:[(0,U.jsxs)(`div`,{onClick:()=>s(`/communications`),className:`p-3 hover:bg-krona-surface cursor-pointer transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 font-semibold text-krona-primary`,children:[(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-blue-500`}),(0,U.jsx)(`span`,{children:`Александр Сорокин`})]}),(0,U.jsx)(`span`,{className:`text-[10px] text-krona-secondary`,children:`13:42`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary truncate`,children:`Добрый день! Подскажите, стол 4 у окна сегодня свободен?`}),(0,U.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[(0,U.jsx)(l,{variant:`gold`,size:`sm`,children:`Telegram`}),(0,U.jsx)(l,{variant:`green`,size:`sm`,children:`Новый`})]})]}),(0,U.jsxs)(`div`,{onClick:()=>s(`/communications`),className:`p-3 hover:bg-krona-surface cursor-pointer transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 font-semibold text-krona-primary`,children:[(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-green-500`}),(0,U.jsx)(`span`,{children:`Екатерина Морозова`})]}),(0,U.jsx)(`span`,{className:`text-[10px] text-krona-secondary`,children:`12:15`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary truncate`,children:`Спасибо за быструю доставку! Курьер был очень вежливым.`}),(0,U.jsx)(l,{variant:`info`,size:`sm`,children:`WhatsApp`})]}),(0,U.jsxs)(`div`,{onClick:()=>s(`/communications`),className:`p-3 hover:bg-krona-surface cursor-pointer transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 font-semibold text-krona-primary`,children:[(0,U.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-krona-gold`}),(0,U.jsx)(`span`,{children:`Кухня & Шеф (Внутренний)`})]}),(0,U.jsx)(`span`,{className:`text-[10px] text-krona-secondary`,children:`11:10`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary truncate`,children:`Артур: Заканчивается лосось, переключите позиции на контроль.`}),(0,U.jsx)(l,{variant:`warning`,size:`sm`,children:`Командный чат`})]})]}),(0,U.jsx)(`div`,{className:`p-2 border-t border-krona-border bg-krona-surface/50 text-center`,children:(0,U.jsx)(`button`,{onClick:()=>s(`/communications`),className:`text-xs text-krona-green font-medium hover:underline`,children:`Открыть единый Inbox →`})})]})]})},Ul=()=>{let{setIsQuickActionsOpen:e}=Da(),[n,r]=(0,j.useState)(!1),i=zr();return(0,U.jsxs)(U.Fragment,{children:[n&&(0,U.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col justify-end`,children:[(0,U.jsx)(`div`,{className:`fixed inset-0 krona-overlay`,onClick:()=>r(!1)}),(0,U.jsxs)(`div`,{className:`relative bg-krona-raised border-t border-krona-border rounded-t-2xl p-4 z-10 max-h-[80vh] overflow-y-auto animate-fade-in shadow-krona-modal`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between pb-3 mb-2 border-b border-krona-border`,children:[(0,U.jsx)(`span`,{className:`text-sm font-semibold text-krona-primary`,children:`Все разделы Кроны`}),(0,U.jsx)(`button`,{onClick:()=>r(!1),className:`p-1 text-krona-secondary`,children:(0,U.jsx)(t,{className:`w-5 h-5`})})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-3 gap-2 text-center text-xs pb-4`,children:uo.map(e=>(0,U.jsx)(`button`,{onClick:()=>{r(!1),i(e.route)},className:`p-3 rounded-lg border border-krona-border bg-krona-surface hover:bg-krona-workspace flex flex-col items-center gap-1.5 transition-colors`,children:(0,U.jsx)(`span`,{className:`text-krona-gold font-medium text-xs truncate max-w-full`,children:e.label})},e.id))})]})]}),(0,U.jsxs)(`nav`,{className:`fixed bottom-0 inset-x-0 h-16 bg-[#252722] text-[#D8D8D0] border-t border-[#3A3D35] flex items-center justify-around z-40 px-2`,children:[(0,U.jsxs)(la,{to:`/`,end:!0,className:({isActive:e})=>`flex flex-col items-center gap-1 p-1 text-[11px] ${e?`text-[#D4B16D] font-semibold`:`text-[#858980]`}`,children:[(0,U.jsx)(Rs,{className:`w-5 h-5`}),(0,U.jsx)(`span`,{children:`Главная`})]}),(0,U.jsxs)(la,{to:`/operations`,className:({isActive:e})=>`flex flex-col items-center gap-1 p-1 text-[11px] ${e?`text-[#D4B16D] font-semibold`:`text-[#858980]`}`,children:[(0,U.jsx)(bl,{className:`w-5 h-5`}),(0,U.jsx)(`span`,{children:`Работа`})]}),(0,U.jsx)(`button`,{onClick:()=>e(!0),className:`w-11 h-11 rounded-full bg-[#2F684C] hover:bg-[#285A42] text-white flex items-center justify-center shadow-lg -mt-5 transition-transform active:scale-95`,title:`Быстрое действие`,children:(0,U.jsx)(vc,{className:`w-6 h-6`})}),(0,U.jsxs)(la,{to:`/communications`,className:({isActive:e})=>`flex flex-col items-center gap-1 p-1 text-[11px] ${e?`text-[#D4B16D] font-semibold`:`text-[#858980]`}`,children:[(0,U.jsx)(ec,{className:`w-5 h-5`}),(0,U.jsx)(`span`,{children:`Чаты`})]}),(0,U.jsxs)(`button`,{onClick:()=>r(!0),className:`flex flex-col items-center gap-1 p-1 text-[11px] text-[#858980] hover:text-[#D8D8D0]`,children:[(0,U.jsx)(Xs,{className:`w-5 h-5`}),(0,U.jsx)(`span`,{children:`Ещё`})]})]})]})},Wl=()=>{let{isCommandPaletteOpen:e,setIsCommandPaletteOpen:n,setProfileId:r,setRoleId:i,setTheme:a,setIsQuickActionsOpen:o,theme:s}=Da(),{entities:c}=lo(),[l,u]=(0,j.useState)(``),d=zr();if((0,j.useEffect)(()=>{let t=t=>{(t.ctrlKey||t.metaKey)&&t.key.toLowerCase()===`k`&&(t.preventDefault(),n(!e)),t.key===`Escape`&&e&&n(!1)};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n]),!e)return null;let f=c.filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.code.toLowerCase().includes(l.toLowerCase())),p=uo.filter(e=>e.label.toLowerCase().includes(l.toLowerCase())||e.route.toLowerCase().includes(l.toLowerCase())),m=Object.values(xa).filter(e=>e.name.toLowerCase().includes(l.toLowerCase())||e.label.toLowerCase().includes(l.toLowerCase())),h=Object.values(fo).filter(e=>e.label.toLowerCase().includes(l.toLowerCase())||e.badge.toLowerCase().includes(l.toLowerCase()));return(0,U.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center pt-20 p-4`,children:[(0,U.jsx)(`div`,{className:`fixed inset-0 krona-overlay`,onClick:()=>n(!1)}),(0,U.jsxs)(`div`,{className:`relative w-full max-w-2xl bg-krona-raised border border-krona-border rounded-xl shadow-krona-modal z-10 overflow-hidden flex flex-col max-h-[75vh] animate-fade-in`,children:[(0,U.jsxs)(`div`,{className:`p-3.5 border-b border-krona-border flex items-center gap-3 bg-krona-surface/70`,children:[(0,U.jsx)(Oc,{className:`w-5 h-5 text-krona-secondary shrink-0`}),(0,U.jsx)(`input`,{autoFocus:!0,type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:`Поиск по Кроне, модулям, профилям, ролям или действиям (Ctrl+K)...`,className:`w-full bg-transparent text-krona-primary placeholder:text-krona-secondary text-sm focus:outline-none`}),(0,U.jsx)(`button`,{onClick:()=>n(!1),className:`text-krona-secondary hover:text-krona-primary p-1`,children:(0,U.jsx)(t,{className:`w-4 h-4`})})]}),(0,U.jsxs)(`div`,{className:`overflow-y-auto p-3 space-y-4 text-xs`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5`,children:`Быстрые действия`}),(0,U.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,U.jsxs)(`button`,{onClick:()=>{n(!1),o(!0)},className:`w-full text-left px-3 py-2 rounded-md hover:bg-krona-workspace flex items-center justify-between group transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(vc,{className:`w-4 h-4 text-krona-green`}),(0,U.jsx)(`span`,{className:`font-medium text-krona-primary`,children:`Создать новую сущность (быстрое меню)`})]}),(0,U.jsx)(vo,{className:`w-3.5 h-3.5 text-krona-secondary group-hover:text-krona-primary`})]}),(0,U.jsxs)(`button`,{onClick:()=>{a(s===`dark`?`soft-light`:`dark`),n(!1)},className:`w-full text-left px-3 py-2 rounded-md hover:bg-krona-workspace flex items-center justify-between group transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[s===`dark`?(0,U.jsx)(el,{className:`w-4 h-4 text-krona-gold`}):(0,U.jsx)(cc,{className:`w-4 h-4 text-krona-secondary`}),(0,U.jsxs)(`span`,{className:`font-medium text-krona-primary`,children:[`Переключить тему (`,s===`dark`?`на Светлую`:`на Темную`,`)`]})]}),(0,U.jsx)(vo,{className:`w-3.5 h-3.5 text-krona-secondary group-hover:text-krona-primary`})]})]})]}),p.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5`,children:`Модули платформы`}),(0,U.jsx)(`div`,{className:`space-y-0.5`,children:p.slice(0,8).map(e=>(0,U.jsxs)(`button`,{onClick:()=>{d(e.route),n(!1)},className:`w-full text-left px-3 py-2 rounded-md hover:bg-krona-workspace flex items-center justify-between group transition-colors`,children:[(0,U.jsx)(`span`,{className:`font-medium text-krona-primary`,children:e.label}),(0,U.jsx)(`span`,{className:`text-krona-secondary text-[11px] font-mono`,children:e.route})]},e.id))})]}),f.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5 flex items-center gap-1.5`,children:[(0,U.jsx)(Is,{className:`w-3.5 h-3.5 text-krona-green`}),`Сущности и модели данных (`,f.length,`)`]}),(0,U.jsx)(`div`,{className:`space-y-0.5`,children:f.slice(0,6).map(e=>(0,U.jsxs)(`div`,{className:`w-full px-3 py-2 rounded-md hover:bg-krona-workspace flex items-center justify-between group transition-colors`,children:[(0,U.jsxs)(`button`,{onClick:()=>{d(e.isSystem?`/${e.code}`:`/entities/${e.code}`),n(!1)},className:`flex items-center gap-2 flex-1 text-left min-w-0`,children:[(0,U.jsx)(`span`,{className:`font-medium text-krona-primary truncate`,children:e.name}),(0,U.jsxs)(`span`,{className:`text-krona-secondary text-[10px] font-mono`,children:[`(`,e.code,`)`]}),e.isSystem?(0,U.jsx)(`span`,{className:`text-[9px] px-1 py-0.2 bg-krona-surface border border-krona-border rounded text-krona-secondary`,children:`System`}):(0,U.jsx)(`span`,{className:`text-[9px] px-1 py-0.2 bg-krona-gold/10 text-krona-gold border border-krona-gold/30 rounded font-semibold`,children:`Custom`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:[(0,U.jsx)(`button`,{onClick:()=>{d(`/settings/entities/${e.code}/fields`),n(!1)},className:`p-1 text-[10px] text-krona-secondary hover:text-krona-primary hover:bg-krona-surface rounded`,title:`Конструктор полей`,children:(0,U.jsx)(Kc,{className:`w-3 h-3`})}),(0,U.jsx)(`button`,{onClick:()=>{d(e.isSystem?`/${e.code}`:`/entities/${e.code}`),n(!1)},className:`p-1 text-[10px] text-krona-secondary hover:text-krona-primary hover:bg-krona-surface rounded`,title:`Открыть записи`,children:(0,U.jsx)(vo,{className:`w-3 h-3`})})]})]},e.code))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5 flex items-center gap-1.5`,children:[(0,U.jsx)(Xc,{className:`w-3.5 h-3.5 text-krona-gold`}),`Сменить бизнес-профиль`]}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:m.map(e=>(0,U.jsxs)(`button`,{onClick:()=>{r(e.id),n(!1),d(`/operations`)},className:`text-left p-2 rounded-md border border-krona-border hover:border-krona-green/50 bg-krona-surface hover:bg-krona-workspace transition-all`,children:[(0,U.jsx)(`div`,{className:`font-medium text-krona-primary text-xs truncate`,children:e.name}),(0,U.jsx)(`div`,{className:`text-[10px] text-krona-secondary truncate`,children:e.category})]},e.id))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-krona-secondary px-2 mb-1.5`,children:`Сменить роль (RBAC)`}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:h.slice(0,6).map(e=>(0,U.jsxs)(`button`,{onClick:()=>{i(e.id),n(!1),d(e.defaultRoute)},className:`text-left p-2 rounded-md border border-krona-border hover:border-krona-gold/50 bg-krona-surface hover:bg-krona-workspace transition-all`,children:[(0,U.jsx)(`div`,{className:`font-medium text-krona-primary text-xs`,children:e.label}),(0,U.jsx)(`div`,{className:`text-[10px] text-krona-secondary truncate`,children:e.badge})]},e.id))})]})]}),(0,U.jsxs)(`div`,{className:`px-4 py-2 border-t border-krona-border bg-krona-surface/50 text-[11px] text-krona-secondary flex items-center justify-between`,children:[(0,U.jsx)(`span`,{children:`Навигация: ↑ ↓ \xA0|\xA0 Выбор: Enter \xA0|\xA0 Закрыть: Esc`}),(0,U.jsx)(`span`,{className:`font-medium text-krona-gold`,children:`Крона AGI Universal OS`})]})]})]})},Gl=()=>{let{isQuickActionsOpen:e,setIsQuickActionsOpen:t,getActiveProfile:n,addBooking:r,addWorkOrder:a,activeLocation:o}=Da(),s=n(),[c,l]=(0,j.useState)(`order`),[u,d]=(0,j.useState)(null),[f,p]=(0,j.useState)(``),[m,h]=(0,j.useState)(``),[g,_]=(0,j.useState)(`19:00`),[v,y]=(0,j.useState)(`Стол 3`),[b,x]=(0,j.useState)(`Toyota Camry (А123АА 154)`),[S,C]=(0,j.useState)(`1500`);return(0,U.jsx)(Ml,{isOpen:e,onClose:()=>t(!1),title:`Быстрое создание`,subtitle:`Профиль: ${s.name} • ${o}`,maxWidth:`lg`,children:u?(0,U.jsxs)(`div`,{className:`py-10 flex flex-col items-center justify-center text-center`,children:[(0,U.jsx)(Xo,{className:`w-12 h-12 text-krona-green mb-3`}),(0,U.jsx)(`h4`,{className:`text-base font-semibold text-krona-primary`,children:u}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-1`,children:`Данные синхронизированы в локальном mock API`})]}):(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pb-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l(`order`),className:`p-2.5 rounded-lg border text-left flex items-center gap-2.5 transition-all ${c===`order`?`border-krona-green bg-krona-green/10 text-krona-green-text font-medium`:`border-krona-border bg-krona-surface text-krona-secondary hover:bg-krona-workspace`}`,children:[(0,U.jsx)(Hc,{className:`w-4 h-4 shrink-0`}),(0,U.jsx)(`div`,{className:`text-xs truncate`,children:`Новый заказ / чек`})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l(`booking`),className:`p-2.5 rounded-lg border text-left flex items-center gap-2.5 transition-all ${c===`booking`?`border-krona-green bg-krona-green/10 text-krona-green-text font-medium`:`border-krona-border bg-krona-surface text-krona-secondary hover:bg-krona-workspace`}`,children:[(0,U.jsx)(Mo,{className:`w-4 h-4 shrink-0`}),(0,U.jsx)(`div`,{className:`text-xs truncate`,children:`Запись / Бронь`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>l(s.capabilities.work_orders?`work_order`:`client`),className:`p-2.5 rounded-lg border text-left flex items-center gap-2.5 transition-all ${c===`work_order`||c===`client`?`border-krona-green bg-krona-green/10 text-krona-green-text font-medium`:`border-krona-border bg-krona-surface text-krona-secondary hover:bg-krona-workspace`}`,children:s.capabilities.work_orders?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Sl,{className:`w-4 h-4 shrink-0`}),(0,U.jsx)(`div`,{className:`text-xs truncate`,children:`Заказ-наряд`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(gl,{className:`w-4 h-4 shrink-0`}),(0,U.jsx)(`div`,{className:`text-xs truncate`,children:`Новый клиент`})]})})]}),(0,U.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),c===`booking`?(r({clientName:f||`Новый клиент`,clientPhone:m||`+7 (900) 000-00-00`,resourceName:v,time:g,status:`confirmed`,deposit:Number(S)||0}),d(`Бронирование ресурса "${v}" успешно создано!`)):c===`work_order`?(a({vehicle:b||`Автомобиль клиента`,ownerName:f||`Владелец`,phone:m||`+7 (900) 000-00-00`,bay:`Пост 1`,masterName:`Иван Кузнецов`,services:[`Комплексная диагностика`,`Мойка / ТО`],partsAmount:1200,laborAmount:Number(S)||2500,status:`in_progress`}),d(`Заказ-наряд на ${b} открыт!`)):d(`Действие успешно выполнено для точки "${o}"!`),setTimeout(()=>{d(null),t(!1)},1200)},className:`space-y-3 pt-2`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsx)(Ol,{label:`Имя клиента`,value:f,onChange:e=>p(e.target.value),placeholder:`Иван Петров`,required:!0}),(0,U.jsx)(Ol,{label:`Номер телефона`,value:m,onChange:e=>h(e.target.value),placeholder:`+7 (913) 000-00-00`,required:!0})]}),c===`booking`&&(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsx)(Ol,{label:`Ресурс (${s.terminology.bookingResourceLabel})`,value:v,onChange:e=>y(e.target.value),placeholder:`Стол 4 / Пост 2 / Мастер`}),(0,U.jsx)(Ol,{label:`Время записи`,type:`time`,value:g,onChange:e=>_(e.target.value)})]}),c===`work_order`&&(0,U.jsx)(`div`,{className:`space-y-3`,children:(0,U.jsx)(Ol,{label:`Автомобиль и госномер`,value:b,onChange:e=>x(e.target.value),placeholder:`BMW X5 (А001АА 154)`,icon:(0,U.jsx)(Po,{className:`w-4 h-4`})})}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsx)(Ol,{label:`Сумма / Депозит (₽)`,type:`number`,value:S,onChange:e=>C(e.target.value),placeholder:`2500`}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 text-left`,children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-krona-secondary`,children:`Точка бизнеса`}),(0,U.jsx)(`input`,{disabled:!0,value:o,className:`w-full bg-krona-workspace text-krona-secondary border border-krona-border rounded-md px-3 py-2 text-sm`})]})]}),(0,U.jsxs)(`div`,{className:`pt-3 flex justify-end gap-2`,children:[(0,U.jsx)(i,{type:`button`,variant:`secondary`,onClick:()=>t(!1),children:`Отмена`}),(0,U.jsx)(i,{type:`submit`,variant:`primary`,children:`Создать сущность`})]})]})]})})},Kl=()=>{let{isNotificationsOpen:e,setIsNotificationsOpen:t,notifications:n,dismissNotification:r,markAllNotificationsRead:a}=Da(),o=zr(),s=e=>{switch(e){case`danger`:return(0,U.jsx)(Ko,{className:`w-4 h-4 text-krona-danger`});case`warning`:return(0,U.jsx)(fl,{className:`w-4 h-4 text-krona-warning`});case`success`:return(0,U.jsx)(Xo,{className:`w-4 h-4 text-krona-green`});default:return(0,U.jsx)(Ms,{className:`w-4 h-4 text-krona-info`})}};return(0,U.jsx)(Nl,{isOpen:e,onClose:()=>t(!1),title:`Центр внимания и уведомлений`,subtitle:`Срочные алерты, статус кассы, стоп-листы и опоздания`,width:`md`,footer:(0,U.jsxs)(`div`,{className:`w-full flex items-center justify-between`,children:[(0,U.jsxs)(i,{variant:`ghost`,size:`sm`,onClick:a,children:[(0,U.jsx)(Ro,{className:`w-3.5 h-3.5 mr-1.5`}),`Прочитать все`]}),(0,U.jsx)(i,{variant:`secondary`,size:`sm`,onClick:()=>t(!1),children:`Закрыть`})]}),children:(0,U.jsx)(`div`,{className:`space-y-3`,children:n.length===0?(0,U.jsxs)(`div`,{className:`py-12 text-center text-krona-secondary text-xs`,children:[(0,U.jsx)(Eo,{className:`w-8 h-8 mx-auto mb-2 opacity-30`}),`Нет активных уведомлений. Все системы в норме!`]}):n.map(e=>(0,U.jsx)(`div`,{className:`p-3.5 rounded-lg border transition-all ${e.read?`bg-krona-surface/40 border-krona-border/60 opacity-80`:`bg-krona-surface border-krona-border shadow-krona-soft`}`,children:(0,U.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,U.jsx)(`div`,{className:`mt-0.5 shrink-0`,children:s(e.type)}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 mb-1`,children:[(0,U.jsx)(`h5`,{className:`text-xs font-semibold text-krona-primary truncate`,children:e.title}),(0,U.jsx)(`span`,{className:`text-[10px] text-krona-secondary whitespace-nowrap`,children:e.timestamp})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary leading-relaxed`,children:e.message}),(0,U.jsxs)(`div`,{className:`mt-2.5 flex items-center justify-between pt-1 border-t border-krona-border/40`,children:[e.actionUrl?(0,U.jsx)(`button`,{onClick:()=>{t(!1),o(e.actionUrl)},className:`text-xs text-krona-green font-medium hover:underline`,children:`Перейти к решению →`}):(0,U.jsx)(`span`,{}),(0,U.jsx)(`button`,{onClick:()=>r(e.id),className:`text-krona-secondary hover:text-krona-danger p-1 rounded`,title:`Удалить`,children:(0,U.jsx)(ol,{className:`w-3.5 h-3.5`})})]})]})]})},e.id))})})},ql=()=>{let{theme:e,viewportMode:t,isAiDrawerOpen:n,setIsAiDrawerOpen:r,getActiveProfile:a,activeLocation:o}=Da(),s=a();(0,j.useEffect)(()=>{document.documentElement.setAttribute(`data-theme`,e)},[e]);let c=()=>{switch(t){case`mobile`:return`max-w-[420px] h-[880px] my-6 border-8 border-[#3A3D35] rounded-[36px] overflow-hidden shadow-2xl relative`;case`tablet-portrait`:return`max-w-[820px] h-[1050px] my-6 border-8 border-[#3A3D35] rounded-[28px] overflow-hidden shadow-2xl relative`;case`tablet-landscape`:return`max-w-[1180px] h-[800px] my-6 border-8 border-[#3A3D35] rounded-[24px] overflow-hidden shadow-2xl relative`;default:return`w-full min-h-screen`}},l=t!==`desktop`,u=t===`mobile`;return(0,U.jsx)(`div`,{className:`min-h-screen bg-[#191B18] flex items-center justify-center ${l?`p-4`:``}`,children:(0,U.jsxs)(`div`,{className:`w-full bg-krona-app text-krona-primary flex flex-col transition-all duration-300 ${c()}`,children:[(0,U.jsxs)(`div`,{className:`flex-1 flex overflow-hidden w-full h-full relative`,children:[!u&&(0,U.jsx)(El,{}),(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden bg-krona-workspace`,children:[(0,U.jsx)(Vl,{}),(0,U.jsx)(`main`,{className:`flex-1 overflow-y-auto ${u?`pb-20`:`pb-8`} p-4 md:p-6`,children:(0,U.jsx)(Si,{})})]}),t===`desktop`&&(0,U.jsx)(Hl,{})]}),u&&(0,U.jsx)(Ul,{}),(0,U.jsx)(Wl,{}),(0,U.jsx)(Gl,{}),(0,U.jsx)(Kl,{}),(0,U.jsx)(Nl,{isOpen:n,onClose:()=>r(!1),title:`✦ Krona AI — Бизнес-оркестратор`,subtitle:`Контекст: ${s.name} • ${o}`,width:`md`,children:(0,U.jsxs)(`div`,{className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`p-3 bg-krona-gold/10 border border-krona-gold/30 rounded-lg text-xs leading-relaxed text-krona-gold-text`,children:[(0,U.jsx)(`strong`,{children:`Krona AI Core v1:`}),` Интеллектуальный помощник подключен к локальной модели данных бизнеса, остаткам, расписанию смен и фискальным отчетам.`]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`span`,{className:`text-xs font-semibold text-krona-secondary uppercase tracking-wider`,children:`Ролевые агенты команды:`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg border border-krona-border bg-krona-surface`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Бизнес-аналитик`}),(0,U.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:`Food cost, выручка, чеки`})]}),(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg border border-krona-border bg-krona-surface`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Складской агент`}),(0,U.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:`Списания, закупки, пороги`})]}),(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg border border-krona-border bg-krona-surface`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Маркетолог`}),(0,U.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:`Сегменты, LTV, рассылки`})]}),(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg border border-krona-border bg-krona-surface`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Финансовый аудитор`}),(0,U.jsx)(`div`,{className:`text-[11px] text-krona-secondary`,children:`Кассовые смены, ДДС, P&L`})]})]})]}),(0,U.jsx)(`div`,{className:`pt-2`,children:(0,U.jsx)(i,{variant:`primary`,className:`w-full text-xs`,onClick:()=>{r(!1),window.location.href=`/ai`},children:`Открыть полноэкранный AI-центр →`})})]})})]})})},Jl=({requiredPermission:e,moduleName:t})=>{let n=zr(),{currentRoleId:r,setCurrentRoleId:a}=p();return(0,U.jsx)(`div`,{"data-testid":`forbidden-page`,className:`min-h-[70vh] flex items-center justify-center p-6 animate-fade-in`,children:(0,U.jsxs)(`div`,{className:`max-w-md w-full bg-krona-surface border border-krona-border rounded-2xl p-8 text-center shadow-krona-soft`,children:[(0,U.jsx)(`div`,{className:`w-16 h-16 bg-krona-danger/10 text-krona-danger rounded-2xl flex items-center justify-center mx-auto mb-5`,children:(0,U.jsx)(Ic,{className:`w-8 h-8`,"aria-hidden":`true`})}),(0,U.jsx)(`span`,{className:`inline-block px-2.5 py-1 text-xs font-semibold bg-krona-danger/15 text-krona-danger rounded-full mb-3`,children:`403 Доступ ограничен`}),(0,U.jsxs)(`h1`,{className:`text-xl font-bold text-krona-primary mb-2`,children:[`Нет прав на просмотр `,t?`«${t}»`:`раздела`]}),(0,U.jsxs)(`p`,{className:`text-sm text-krona-secondary mb-6`,children:[`Текущая роль `,(0,U.jsxs)(`strong`,{className:`text-krona-primary font-semibold`,children:[`«`,r,`»`]}),` не имеет разрешений на этот модуль`,e?` (требуется: ${e})`:``,`.`]}),(0,U.jsxs)(`div`,{className:`p-3 bg-krona-workspace rounded-lg text-xs text-krona-secondary text-left mb-6 space-y-1`,children:[(0,U.jsx)(`p`,{className:`font-medium text-krona-primary`,children:`Быстрое решение для демонстрации:`}),(0,U.jsx)(`p`,{children:`Переключите роль на «Владелец» (owner) или «Администратор» (admin) для полного доступа.`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2.5 sm:flex-row sm:justify-center`,children:[(0,U.jsxs)(i,{variant:`primary`,size:`md`,"data-testid":`switch-to-owner-btn`,onClick:()=>{a(`owner`),Da.getState().setRoleId(`owner`)},children:[(0,U.jsx)(wc,{className:`w-4 h-4 mr-1.5`}),`Переключить на Owner`]}),(0,U.jsxs)(i,{variant:`outline`,size:`md`,"data-testid":`go-home-btn`,onClick:()=>n(`/`),children:[(0,U.jsx)(As,{className:`w-4 h-4 mr-1.5`}),`На главную`]})]})]})})},Yl=({module:e,moduleName:t,requiredCapability:n,children:r})=>{let{currentRoleId:i,currentProfileId:a,stateOverride:o}=p();if(o===`permission_denied`)return(0,U.jsx)(Jl,{moduleName:t||e,requiredPermission:`demo:permission_denied`});if(o===`loading`)return(0,U.jsx)(Rl,{title:t});if(o===`error`)throw Error(`[Демо-ошибка]: Имитация сбоя при загрузке раздела «${t||e}».`);let s=fo[i];if(s&&!(s.id===`owner`||s.id===`administrator`||s.allowedModules.includes(`*`))&&!s.allowedModules.includes(e))return(0,U.jsx)(Jl,{moduleName:t||e,requiredPermission:`Доступ к модулю «${e}» для роли «${s.label}»`});let c=xa[a];return c&&n&&c.capabilities[n]===!1?(0,U.jsx)(Jl,{moduleName:t||e,requiredPermission:`Возможность «${n}» в бизнес-профиле «${c.name}»`}):(0,U.jsx)(U.Fragment,{children:r})},Xl=(0,j.lazy)(()=>M(()=>import(`./DynamicDashboard-BWfBzitG.js`).then(e=>({default:e.DynamicDashboard})),__vite__mapDeps([0,1,2,3,4,5,6]))),Zl=()=>(0,U.jsx)(Yl,{module:`dashboard`,moduleName:`Дашборд`,children:(0,U.jsx)(zl,{scope:`Модуль Дашборд`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Дашборд`}),children:(0,U.jsx)(Xl,{})})})}),Ql=(0,j.lazy)(()=>M(()=>import(`./OperationsModule-DlDaJDmo.js`).then(e=>({default:e.OperationsModule})),__vite__mapDeps([7,1,8,2,9,3,10,4,5,11,12,13,14,15,16]))),$l=()=>(0,U.jsx)(Yl,{module:`operations`,moduleName:`Операции`,children:(0,U.jsx)(zl,{scope:`Модуль Операции`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Операции`}),children:(0,U.jsx)(Ql,{})})})}),eu=(0,j.lazy)(()=>M(()=>import(`./CrmModule-l7PoMLhA.js`).then(e=>({default:e.CrmModule})),__vite__mapDeps([17,1,18,19,20,21,22,23,14,8,13]))),tu=()=>(0,U.jsx)(Yl,{module:`crm`,moduleName:`CRM & Клиенты`,children:(0,U.jsx)(zl,{scope:`Модуль CRM`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`CRM & Клиенты`}),children:(0,U.jsx)(eu,{})})})}),nu=(0,j.lazy)(()=>M(()=>import(`./SalesModule-Cf0nSO8B.js`).then(e=>({default:e.SalesModule})),__vite__mapDeps([16,1,3,13,14,15]))),ru=()=>(0,U.jsx)(Yl,{module:`sales`,moduleName:`Продажи`,children:(0,U.jsx)(zl,{scope:`Модуль Продажи`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Продажи`}),children:(0,U.jsx)(nu,{})})})}),iu=(0,j.lazy)(()=>M(()=>import(`./InventoryModule-VpTxuRuh.js`).then(e=>({default:e.InventoryModule})),__vite__mapDeps([12,1,13,14,15]))),au=()=>(0,U.jsx)(Yl,{module:`inventory`,moduleName:`Склад и остатки`,children:(0,U.jsx)(zl,{scope:`Модуль Склад`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Склад и остатки`}),children:(0,U.jsx)(iu,{})})})}),W=(0,j.lazy)(()=>M(()=>import(`./FinanceModule-D-3_6PUg.js`).then(e=>({default:e.FinanceModule})),__vite__mapDeps([24,1,8,14]))),ou=()=>(0,U.jsx)(Yl,{module:`finance`,moduleName:`Финансы и касса`,children:(0,U.jsx)(zl,{scope:`Модуль Финансы`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Финансы и касса`}),children:(0,U.jsx)(W,{})})})}),su=(0,j.lazy)(()=>M(()=>import(`./EmployeesModule-70hl9DMi.js`).then(e=>({default:e.EmployeesModule})),__vite__mapDeps([25,1,9,22,11]))),cu=()=>(0,U.jsx)(Yl,{module:`employees`,moduleName:`Сотрудники и смены`,children:(0,U.jsx)(zl,{scope:`Модуль Сотрудники`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Сотрудники и смены`}),children:(0,U.jsx)(su,{})})})}),lu=(0,j.lazy)(()=>M(()=>import(`./CommunicationsModule-gCjT_vNw.js`).then(e=>({default:e.CommunicationsModule})),__vite__mapDeps([26,1,11]))),uu=()=>(0,U.jsx)(Yl,{module:`communications`,moduleName:`Коммуникации`,children:(0,U.jsx)(zl,{scope:`Модуль Коммуникации`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Коммуникации`}),children:(0,U.jsx)(lu,{})})})}),du=(0,j.lazy)(()=>M(()=>import(`./HelpDeskModule-BIrYP26C.js`).then(e=>({default:e.HelpDeskModule})),__vite__mapDeps([27,1,11]))),fu=()=>(0,U.jsx)(Yl,{module:`helpdesk`,moduleName:`Поддержка (HelpDesk)`,children:(0,U.jsx)(zl,{scope:`Модуль Поддержка`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Поддержка (HelpDesk)`}),children:(0,U.jsx)(du,{})})})}),pu=(0,j.lazy)(()=>M(()=>import(`./TasksModule-D4E78liD.js`).then(e=>({default:e.TasksModule})),__vite__mapDeps([28,1,29,11]))),mu=()=>(0,U.jsx)(Yl,{module:`tasks`,moduleName:`Задачи`,children:(0,U.jsx)(zl,{scope:`Модуль Задачи`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Задачи`}),children:(0,U.jsx)(pu,{})})})}),hu=(0,j.lazy)(()=>M(()=>import(`./CmsModule-DuJnf1QM.js`).then(e=>({default:e.CmsModule})),__vite__mapDeps([30,1,31,32,33,34]))),gu=()=>(0,U.jsx)(Yl,{module:`cms`,moduleName:`Сайты и CMS`,children:(0,U.jsx)(zl,{scope:`Модуль CMS`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Сайты и CMS`}),children:(0,U.jsx)(hu,{})})})}),_u=(0,j.lazy)(()=>M(()=>import(`./MarketingModule-DyvYzuoi.js`).then(e=>({default:e.MarketingModule})),__vite__mapDeps([35,1,5]))),vu=()=>(0,U.jsx)(Yl,{module:`marketing`,moduleName:`Маркетинг & Промо`,children:(0,U.jsx)(zl,{scope:`Модуль Маркетинг`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Маркетинг & Промо`}),children:(0,U.jsx)(_u,{})})})}),yu=(0,j.lazy)(()=>M(()=>import(`./AnalyticsModule-xduYpRUy.js`).then(e=>({default:e.AnalyticsModule})),__vite__mapDeps([36,1,2,5,6]))),bu=()=>(0,U.jsx)(Yl,{module:`analytics`,moduleName:`Аналитика & BI`,children:(0,U.jsx)(zl,{scope:`Модуль Аналитика`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Аналитика & BI`}),children:(0,U.jsx)(yu,{})})})}),xu=(0,j.lazy)(()=>M(()=>import(`./AutomationModule-DO2GmeS1.js`).then(e=>({default:e.AutomationModule})),__vite__mapDeps([37,1,31]))),Su=()=>(0,U.jsx)(Yl,{module:`automation`,moduleName:`Автоматизация & Сценарии`,children:(0,U.jsx)(zl,{scope:`Модуль Автоматизация`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Автоматизация & Сценарии`}),children:(0,U.jsx)(xu,{})})})}),Cu=(0,j.lazy)(()=>M(()=>import(`./AiCenterModule-BBao0YAQ.js`).then(e=>({default:e.AiCenterModule})),__vite__mapDeps([38,1,20]))),wu=()=>(0,U.jsx)(Yl,{module:`ai`,moduleName:`AI Центр`,children:(0,U.jsx)(zl,{scope:`Модуль AI Центр`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`AI Центр`}),children:(0,U.jsx)(Cu,{})})})}),Tu=(0,j.lazy)(()=>M(()=>import(`./AppsCatalogModule-rSx-Kisy.js`).then(e=>({default:e.AppsCatalogModule})),__vite__mapDeps([39,1,40]))),Eu=()=>(0,U.jsx)(Yl,{module:`apps`,moduleName:`Каталог приложений`,children:(0,U.jsx)(zl,{scope:`Модуль Приложения`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Каталог приложений`}),children:(0,U.jsx)(Tu,{})})})}),Du=(0,j.lazy)(()=>M(()=>import(`./SettingsModule-BbqUjWn1.js`).then(e=>({default:e.SettingsModule})),__vite__mapDeps([41,1,42,8,23,40]))),Ou=()=>(0,U.jsx)(Yl,{module:`settings`,moduleName:`Настройки платформы`,children:(0,U.jsx)(zl,{scope:`Модуль Настройки`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Настройки платформы`}),children:(0,U.jsx)(Du,{})})})}),ku=(0,j.lazy)(()=>M(()=>import(`./EntityCatalog-CAg8Pzny.js`).then(e=>({default:e.EntityCatalog})),__vite__mapDeps([43,1,44,45]))),Au=()=>(0,U.jsx)(Yl,{module:`settings`,moduleName:`Каталог сущностей`,children:(0,U.jsx)(zl,{scope:`Каталог сущностей`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Каталог сущностей платформы`}),children:(0,U.jsx)(ku,{})})})}),ju=(0,j.lazy)(()=>M(()=>import(`./FieldBuilder-CLdLCeVX.js`).then(e=>({default:e.FieldBuilder})),__vite__mapDeps([46,1,47,19,8,20,33,29,21,48,9,22,10,49,50]))),Mu=()=>(0,U.jsx)(Yl,{module:`settings`,moduleName:`Конструктор полей`,children:(0,U.jsx)(zl,{scope:`Конструктор полей`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Конструктор полей сущности`}),children:(0,U.jsx)(ju,{})})})}),Nu=(0,j.lazy)(()=>M(()=>import(`./FormBuilder-d4z6JEl5.js`).then(e=>({default:e.FormBuilder})),__vite__mapDeps([51,1,47,19,8,20,33,29,21,48,9,22,10,49,52,53]))),Pu=()=>(0,U.jsx)(Yl,{module:`settings`,moduleName:`Конструктор форм`,children:(0,U.jsx)(zl,{scope:`Конструктор форм`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Конструктор экранных форм`}),children:(0,U.jsx)(Nu,{})})})}),Fu=(0,j.lazy)(()=>M(()=>import(`./CardLayoutBuilder-CiBozXyO.js`).then(e=>({default:e.CardLayoutBuilder})),__vite__mapDeps([54,1,42,49,21,52,53,34,10,14]))),Iu=()=>(0,U.jsx)(Yl,{module:`settings`,moduleName:`Конструктор карточки`,children:(0,U.jsx)(zl,{scope:`Конструктор карточки`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Конструктор детальной карточки`}),children:(0,U.jsx)(Fu,{})})})}),Lu=(0,j.lazy)(()=>M(()=>import(`./ViewBuilder-zR702NRL.js`).then(e=>({default:e.ViewBuilder})),__vite__mapDeps([55,1,42,56,49,53,45,14]))),Ru=()=>(0,U.jsx)(Yl,{module:`settings`,moduleName:`Конструктор представлений`,children:(0,U.jsx)(zl,{scope:`Конструктор представлений`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Конструктор представлений и списков`}),children:(0,U.jsx)(Lu,{})})})}),zu=(0,j.lazy)(()=>M(()=>import(`./CustomEntityPage-B_J0Fvzq.js`).then(e=>({default:e.CustomEntityPage})),__vite__mapDeps([57,1,42,31,56,32,19,18,20,21,22,23,14,49,48,44,50,9,45]))),Bu=()=>(0,U.jsx)(zl,{scope:`Модуль сущности`,children:(0,U.jsx)(j.Suspense,{fallback:(0,U.jsx)(Rl,{title:`Загрузка данных сущности...`}),children:(0,U.jsx)(zu,{})})}),Vu=()=>{let e=zr(),t=Ir();return(0,U.jsx)(`div`,{className:`min-h-[70vh] flex items-center justify-center p-6 animate-fade-in`,children:(0,U.jsxs)(`div`,{className:`max-w-md w-full bg-krona-surface border border-krona-border rounded-2xl p-8 text-center shadow-krona-soft`,children:[(0,U.jsx)(`div`,{className:`w-16 h-16 bg-krona-surface-muted text-krona-gold rounded-2xl flex items-center justify-center mx-auto mb-5`,children:(0,U.jsx)(is,{className:`w-8 h-8`,"aria-hidden":`true`})}),(0,U.jsx)(`span`,{className:`inline-block px-2.5 py-1 text-xs font-semibold bg-krona-surface-muted text-krona-secondary rounded-full mb-3`,children:`404 Страница не найдена`}),(0,U.jsx)(`h1`,{className:`text-xl font-bold text-krona-primary mb-2`,children:`Раздел не существует`}),(0,U.jsx)(`p`,{className:`text-sm text-krona-secondary mb-2`,children:`Запрошенный адрес не найден в системе Krona Business OS:`}),(0,U.jsx)(`code`,{className:`inline-block px-2 py-1 text-xs bg-krona-workspace text-krona-primary rounded border border-krona-border font-mono mb-6 max-w-full truncate`,children:t.pathname}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-2.5 sm:flex-row sm:justify-center`,children:[(0,U.jsxs)(i,{variant:`outline`,size:`md`,onClick:()=>e(-1),children:[(0,U.jsx)(go,{className:`w-4 h-4 mr-1.5`}),`Назад`]}),(0,U.jsxs)(i,{variant:`primary`,size:`md`,onClick:()=>e(`/`),children:[(0,U.jsx)(As,{className:`w-4 h-4 mr-1.5`}),`На главную`]})]})]})})},Hu={platform_owner:{label:`Владелец платформы`,description:`Полный доступ ко всем управленческим, финансовым, релизным и инфраструктурным операциям.`,permissions:{canManagePlatformStatus:!0,canGrantTrialGrace:!0,canEditEntitlements:!0,canTriggerRollouts:!0,canPauseRollbackRollouts:!0,canManageIncidents:!0,canCreateAnnouncements:!0,canScheduleMaintenance:!0,canRequestDiagnostics:!0,canExportAudit:!0,canViewBillingDetails:!0}},platform_admin:{label:`Системный администратор`,description:`Управление организациями, инфраструктурой, инцидентами и техническими операциями.`,permissions:{canManagePlatformStatus:!0,canGrantTrialGrace:!0,canEditEntitlements:!1,canTriggerRollouts:!0,canPauseRollbackRollouts:!0,canManageIncidents:!0,canCreateAnnouncements:!0,canScheduleMaintenance:!0,canRequestDiagnostics:!0,canExportAudit:!0,canViewBillingDetails:!1}},support_operator:{label:`Оператор поддержки`,description:`Диагностика инцидентов, запрос телеметрии, отправка точечных сервисных сообщений.`,permissions:{canManagePlatformStatus:!1,canGrantTrialGrace:!1,canEditEntitlements:!1,canTriggerRollouts:!1,canPauseRollbackRollouts:!1,canManageIncidents:!0,canCreateAnnouncements:!0,canScheduleMaintenance:!1,canRequestDiagnostics:!0,canExportAudit:!1,canViewBillingDetails:!1}},billing_manager:{label:`Биллинг-менеджер`,description:`Управление подписками, тарифами, продлениями, выдача пробных и льготных периодов.`,permissions:{canManagePlatformStatus:!0,canGrantTrialGrace:!0,canEditEntitlements:!0,canTriggerRollouts:!1,canPauseRollbackRollouts:!1,canManageIncidents:!1,canCreateAnnouncements:!0,canScheduleMaintenance:!1,canRequestDiagnostics:!1,canExportAudit:!1,canViewBillingDetails:!0}},security_auditor:{label:`Аудитор безопасности`,description:`Read-only доступ ко всем операциям с правом полного аудита и экспорта защищённого журнала.`,permissions:{canManagePlatformStatus:!1,canGrantTrialGrace:!1,canEditEntitlements:!1,canTriggerRollouts:!1,canPauseRollbackRollouts:!1,canManageIncidents:!1,canCreateAnnouncements:!1,canScheduleMaintenance:!1,canRequestDiagnostics:!0,canExportAudit:!0,canViewBillingDetails:!0}},release_manager:{label:`Релиз-менеджер`,description:`Управление каталогом модулей, compatibility matrix, запуск пилотных и фазовых раскаток.`,permissions:{canManagePlatformStatus:!1,canGrantTrialGrace:!1,canEditEntitlements:!1,canTriggerRollouts:!0,canPauseRollbackRollouts:!0,canManageIncidents:!0,canCreateAnnouncements:!0,canScheduleMaintenance:!1,canRequestDiagnostics:!1,canExportAudit:!1,canViewBillingDetails:!1}}},Uu=[{tenantId:`01918a20-0001-7000-8000-000000000001`,displayName:`ООО «Северная Ритейл Группа»`,inn:`7801234567`,domain:`nordretail.ru`,platformStatus:`active`,userCount:142,branchCount:18,installedModulesCount:6,mrrMinorUnits:289e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Enterprise Max`,subscriptionEndAt:`2026-11-15T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:40:00Z`,sourceRevision:`rev-2026-09-08-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`it-dir@nordretail.ru`,contactPhone:`+7 (812) 300-11-22`},{tenantId:`01918a20-0002-7000-8000-000000000002`,displayName:`АО «Балтийская Логистика»`,inn:`7810987654`,domain:`baltlogistics.ru`,platformStatus:`active`,userCount:88,branchCount:7,installedModulesCount:5,mrrMinorUnits:175e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Pro`,subscriptionEndAt:`2026-09-14T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:35:00Z`,sourceRevision:`rev-2026-09-08-02`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`admin@baltlogistics.ru`,contactPhone:`+7 (812) 450-99-88`},{tenantId:`01918a20-0003-7000-8000-000000000003`,displayName:`Сеть кофеен «Эспрессо Поинт»`,inn:`7705432198`,domain:`espressopoint.com`,platformStatus:`trial`,userCount:34,branchCount:9,installedModulesCount:4,mrrMinorUnits:0,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Trial Pilot (POS + Omnichannel)`,subscriptionEndAt:`2026-09-17T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:10:00Z`,sourceRevision:`rev-2026-09-07-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`ceo@espressopoint.com`,contactPhone:`+7 (495) 777-12-34`},{tenantId:`01918a20-0004-7000-8000-000000000004`,displayName:`ООО «ТехноПромСнаб»`,inn:`5406123987`,domain:`tehnoprom-snab.ru`,platformStatus:`grace`,userCount:52,branchCount:3,installedModulesCount:5,mrrMinorUnits:12e6,outstandingDebtMinorUnits:12e6,currency:`RUB`,tariffPlan:`Business Standard`,subscriptionEndAt:`2026-09-05T00:00:00Z`,gracePeriodUntil:`2026-09-15T00:00:00Z`,lastActiveAt:`2026-09-10T17:50:00Z`,sourceRevision:`rev-2026-09-05-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`finance@tehnoprom-snab.ru`,contactPhone:`+7 (383) 220-44-55`},{tenantId:`01918a20-0005-7000-8000-000000000005`,displayName:`ИП Смирнов А. В. («Уральский Крепёж»)`,inn:`667100234567`,domain:`ural-krepezh.ru`,platformStatus:`suspended`,userCount:16,branchCount:2,installedModulesCount:3,mrrMinorUnits:45e5,outstandingDebtMinorUnits:9e6,currency:`RUB`,tariffPlan:`Starter Ops`,subscriptionEndAt:`2026-08-20T00:00:00Z`,gracePeriodUntil:`2026-08-30T00:00:00Z`,lastActiveAt:`2026-08-29T14:20:00Z`,sourceRevision:`rev-2026-08-20-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`smirnov@ural-krepezh.ru`,contactPhone:`+7 (343) 310-20-30`},{tenantId:`01918a20-0006-7000-8000-000000000006`,displayName:`Клиника «Здоровая Семья»`,inn:`7728901234`,domain:`healthfamily-med.ru`,platformStatus:`active`,userCount:110,branchCount:5,installedModulesCount:6,mrrMinorUnits:245e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Pro`,subscriptionEndAt:`2026-10-01T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:25:00Z`,sourceRevision:`rev-2026-09-01-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`med-it@healthfamily-med.ru`,contactPhone:`+7 (495) 890-77-66`},{tenantId:`01918a20-0007-7000-8000-000000000007`,displayName:`ООО «Волга-Агротрейд»`,inn:`6315678901`,domain:`volga-agro.ru`,platformStatus:`active`,userCount:64,branchCount:4,installedModulesCount:4,mrrMinorUnits:14e6,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Standard`,subscriptionEndAt:`2026-09-16T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:05:00Z`,sourceRevision:`rev-2026-09-08-03`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`ops@volga-agro.ru`,contactPhone:`+7 (846) 990-11-44`},{tenantId:`01918a20-0008-7000-8000-000000000008`,displayName:`ООО «Ювелирный Дом Аврора»`,inn:`7709876543`,domain:`aurora-jewel.ru`,platformStatus:`active`,userCount:40,branchCount:6,installedModulesCount:5,mrrMinorUnits:195e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Pro`,subscriptionEndAt:`2026-12-31T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:38:00Z`,sourceRevision:`rev-2026-09-09-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`sec@aurora-jewel.ru`,contactPhone:`+7 (495) 340-55-66`},{tenantId:`01918a20-0009-7000-8000-000000000009`,displayName:`Фитнес-клубы «Атлетика Плюс»`,inn:`7814567890`,domain:`atletika-plus.ru`,platformStatus:`trial`,userCount:28,branchCount:3,installedModulesCount:4,mrrMinorUnits:0,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Trial Pilot (Omnichannel)`,subscriptionEndAt:`2026-09-28T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T17:15:00Z`,sourceRevision:`rev-2026-09-02-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`director@atletika-plus.ru`,contactPhone:`+7 (812) 670-80-90`},{tenantId:`01918a20-0010-7000-8000-000000000010`,displayName:`ООО «Сибирский Лесокомбинат»`,inn:`2466123456`,domain:`sibles-group.ru`,platformStatus:`active`,userCount:95,branchCount:6,installedModulesCount:5,mrrMinorUnits:21e6,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Business Pro`,subscriptionEndAt:`2026-10-05T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T16:40:00Z`,sourceRevision:`rev-2026-09-01-02`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`it@sibles-group.ru`,contactPhone:`+7 (391) 211-33-77`},{tenantId:`01918a20-0011-7000-8000-000000000011`,displayName:`ООО «Казань Экспресс Доставка»`,inn:`1655345678`,domain:`kzn-express-delivery.ru`,platformStatus:`grace`,userCount:45,branchCount:4,installedModulesCount:4,mrrMinorUnits:98e5,outstandingDebtMinorUnits:98e5,currency:`RUB`,tariffPlan:`Business Standard`,subscriptionEndAt:`2026-09-08T00:00:00Z`,gracePeriodUntil:`2026-09-18T00:00:00Z`,lastActiveAt:`2026-09-10T17:45:00Z`,sourceRevision:`rev-2026-09-08-04`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`buh@kzn-express.ru`,contactPhone:`+7 (843) 520-10-20`},{tenantId:`01918a20-0012-7000-8000-000000000012`,displayName:`ИП Ковалева М. И. («Шоколадница на Невском»)`,inn:`784200112233`,domain:`choconeva.spb.ru`,platformStatus:`active`,userCount:22,branchCount:2,installedModulesCount:3,mrrMinorUnits:65e5,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Starter Ops`,subscriptionEndAt:`2026-09-13T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T18:30:00Z`,sourceRevision:`rev-2026-09-06-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`kovaleva@choconeva.spb.ru`,contactPhone:`+7 (812) 998-77-11`},{tenantId:`01918a20-0013-7000-8000-000000000013`,displayName:`АО «Приморский Рыбокомбинат»`,inn:`2540112233`,domain:`prim-fish.ru`,platformStatus:`active`,userCount:160,branchCount:8,installedModulesCount:7,mrrMinorUnits:32e6,outstandingDebtMinorUnits:0,currency:`RUB`,tariffPlan:`Enterprise Max`,subscriptionEndAt:`2026-11-30T00:00:00Z`,gracePeriodUntil:null,lastActiveAt:`2026-09-10T15:20:00Z`,sourceRevision:`rev-2026-09-04-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`dispatch@prim-fish.ru`,contactPhone:`+7 (423) 240-50-60`},{tenantId:`01918a20-0014-7000-8000-000000000014`,displayName:`ООО «АвтоДизель Сервис»`,inn:`7604123456`,domain:`autodiesel-yar.ru`,platformStatus:`suspended`,userCount:18,branchCount:1,installedModulesCount:2,mrrMinorUnits:39e5,outstandingDebtMinorUnits:78e5,currency:`RUB`,tariffPlan:`Starter Ops`,subscriptionEndAt:`2026-07-15T00:00:00Z`,gracePeriodUntil:`2026-07-25T00:00:00Z`,lastActiveAt:`2026-07-24T11:00:00Z`,sourceRevision:`rev-2026-07-15-01`,projectedAt:`2026-09-10T18:45:00Z`,contactEmail:`info@autodiesel-yar.ru`,contactPhone:`+7 (4852) 77-88-99`}],Wu=[{moduleId:`krona-core`,name:`Krona Core System`,code:`core`,category:`core`,description:`Системное ядро: пользователи, роли, RBAC, аутентификация и метаданные сущностей.`,latestVersion:`2.4.0`,availableVersions:[`2.4.0`,`2.3.2`,`2.2.0`],requiredCapabilities:[`system:base`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:14,instancesCount:14,dependencies:[],releaseHistory:[{version:`2.4.0`,releasedAt:`2026-08-25T10:00:00Z`,changelog:`Оптимизация кеша метаданных, поддержка новых типов колонок.`,compatibleCore:`>=2.4.0`},{version:`2.3.2`,releasedAt:`2026-07-10T12:00:00Z`,changelog:`Патч безопасности для сессионных токенов.`,compatibleCore:`>=2.3.0`}]},{moduleId:`krona-crm`,name:`CRM & Клиенты`,code:`crm`,category:`crm`,description:`Управление сделками, воронки продаж, контакты клиентов и карточки лидов.`,latestVersion:`2.1.2`,availableVersions:[`2.1.2`,`2.1.0`,`2.0.4`],requiredCapabilities:[`crm:deals`,`crm:contacts`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:12,instancesCount:12,dependencies:[`krona-core`],releaseHistory:[{version:`2.1.2`,releasedAt:`2026-08-30T14:00:00Z`,changelog:`Авторасчет конверсий и drag-and-drop в канбан-доске.`,compatibleCore:`>=2.3.0`}]},{moduleId:`krona-operations`,name:`Операционный склад и логистика`,code:`operations`,category:`operations`,description:`Складской учет, перемещения, штрихкодирование партий, инвентаризации.`,latestVersion:`1.9.5`,availableVersions:[`1.9.5`,`1.9.0`,`1.8.4`],requiredCapabilities:[`ops:inventory`,`ops:warehouses`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:10,instancesCount:10,dependencies:[`krona-core`],releaseHistory:[{version:`1.9.5`,releasedAt:`2026-08-15T09:00:00Z`,changelog:`Поддержка сериализованного учета весового товара.`,compatibleCore:`>=2.3.0`}]},{moduleId:`krona-finance`,name:`Финансы и казначейство`,code:`finance`,category:`finance`,description:`Платежи, статьи ДДС, банковские выписки, бюджетирование и сверки.`,latestVersion:`2.0.1`,availableVersions:[`2.0.1`,`2.0.0`,`1.8.9`],requiredCapabilities:[`fin:ledger`,`fin:cashflow`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:9,instancesCount:9,dependencies:[`krona-core`],releaseHistory:[{version:`2.0.1`,releasedAt:`2026-09-02T16:00:00Z`,changelog:`Интеграция с новыми форматами 1С и валютными minor units.`,compatibleCore:`>=2.4.0`}]},{moduleId:`krona-staff`,name:`Кадры и смены`,code:`staff`,category:`staff`,description:`Графики смен, табелирование, карточки сотрудников, KPI.`,latestVersion:`1.5.0`,availableVersions:[`1.5.0`,`1.4.2`],requiredCapabilities:[`staff:shifts`,`staff:attendance`],manifestVersion:`1.0`,rolloutChannel:`pilot`,activeTenantsCount:7,instancesCount:7,dependencies:[`krona-core`],releaseHistory:[{version:`1.5.0`,releasedAt:`2026-09-01T11:00:00Z`,changelog:`Пилотный биометрический учет и гибкие смены.`,compatibleCore:`>=2.4.0`}]},{moduleId:`krona-omnichannel`,name:`Омниканальные коммуникации`,code:`omnichannel`,category:`omnichannel`,description:`Единый центр диалогов: Telegram, WhatsApp, MAX-бот, телефония и почта.`,latestVersion:`3.0.0-rc2`,availableVersions:[`3.0.0-rc2`,`2.8.4`,`2.7.0`],requiredCapabilities:[`comm:channels`,`comm:chat`],manifestVersion:`1.0`,rolloutChannel:`pilot`,activeTenantsCount:6,instancesCount:6,dependencies:[`krona-core`,`krona-crm`],releaseHistory:[{version:`3.0.0-rc2`,releasedAt:`2026-09-06T15:30:00Z`,changelog:`Новый WebSocket транспорт и ускоренная доставка медиа.`,compatibleCore:`>=2.4.0`}]},{moduleId:`krona-pos`,name:`Кассовый узел POS`,code:`pos`,category:`pos`,description:`Рабочее место кассира: ФЗ-54, печать чеков, сканер, быстрые продажи.`,latestVersion:`1.8.2`,availableVersions:[`1.8.2`,`1.8.0`,`1.7.5`],requiredCapabilities:[`pos:fiscal`,`pos:sales`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:5,instancesCount:5,dependencies:[`krona-core`,`krona-operations`],releaseHistory:[{version:`1.8.2`,releasedAt:`2026-08-18T10:00:00Z`,changelog:`Драйверы для АТОЛ 5.0 и оффлайн-буферизация чеков.`,compatibleCore:`>=2.3.0`}]},{moduleId:`krona-analytics`,name:`Бизнес-Аналитика и дашборды`,code:`analytics`,category:`analytics`,description:`OLAP-кубы, когортный анализ, план-факт, автоотчеты руководству.`,latestVersion:`2.2.0`,availableVersions:[`2.2.0`,`2.1.1`,`2.0.0`],requiredCapabilities:[`analytics:bi`,`analytics:export`],manifestVersion:`1.0`,rolloutChannel:`stable`,activeTenantsCount:8,instancesCount:8,dependencies:[`krona-core`],releaseHistory:[{version:`2.2.0`,releasedAt:`2026-08-28T12:00:00Z`,changelog:`Предиктивные графики выручки и экспорт в Excel/PDF.`,compatibleCore:`>=2.3.0`}]}],Gu=[{subscriptionId:`sub-001`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,billingAccountRef:`ACC-NORD-7801`,planCode:`enterprise-max`,period:`year`,amountMinorUnits:3468e5,currency:`RUB`,status:`normal`,renewsAt:`2026-11-15T00:00:00Z`,validFrom:`2025-11-15T00:00:00Z`,validUntil:`2026-11-15T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`,`krona-staff`,`krona-pos`],autoRenew:!0,history:[{eventAt:`2025-11-15T10:00:00Z`,type:`renewed`,description:`Годовое продление тарифа Enterprise Max`,actor:`billing_manager`}]},{subscriptionId:`sub-002`,tenantId:`01918a20-0002-7000-8000-000000000002`,tenantName:`АО «Балтийская Логистика»`,billingAccountRef:`ACC-BALT-7810`,planCode:`business-pro`,period:`month`,amountMinorUnits:175e5,currency:`RUB`,status:`expiring_7d`,renewsAt:`2026-09-14T00:00:00Z`,validFrom:`2026-08-14T00:00:00Z`,validUntil:`2026-09-14T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`,`krona-analytics`],autoRenew:!1,history:[{eventAt:`2026-08-14T10:00:00Z`,type:`renewed`,description:`Месячный счет оплачен по безналичному расчету`,actor:`billing_manager`}]},{subscriptionId:`sub-003`,tenantId:`01918a20-0003-7000-8000-000000000003`,tenantName:`Сеть кофеен «Эспрессо Поинт»`,billingAccountRef:`ACC-ESPRESSO-7705`,planCode:`trial-pilot`,period:`month`,amountMinorUnits:0,currency:`RUB`,status:`expiring_7d`,renewsAt:null,validFrom:`2026-08-17T00:00:00Z`,validUntil:`2026-09-17T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-pos`,`krona-operations`,`krona-omnichannel`],autoRenew:!1,history:[{eventAt:`2026-08-17T11:00:00Z`,type:`trial_added`,description:`Выдан промо-триал на 30 дней для тестирования POS касс`,actor:`platform_owner`}]},{subscriptionId:`sub-004`,tenantId:`01918a20-0004-7000-8000-000000000004`,tenantName:`ООО «ТехноПромСнаб»`,billingAccountRef:`ACC-TPS-5406`,planCode:`business-std`,period:`month`,amountMinorUnits:12e6,currency:`RUB`,status:`grace`,renewsAt:null,validFrom:`2026-08-05T00:00:00Z`,validUntil:`2026-09-05T00:00:00Z`,graceUntil:`2026-09-15T00:00:00Z`,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`,`krona-staff`],autoRenew:!1,history:[{eventAt:`2026-09-06T09:00:00Z`,type:`grace_granted`,description:`Предоставлен Grace Period 10 дней по запросу финдиректора`,actor:`billing_manager`}]},{subscriptionId:`sub-005`,tenantId:`01918a20-0005-7000-8000-000000000005`,tenantName:`ИП Смирнов А. В. («Уральский Крепёж»)`,billingAccountRef:`ACC-SMIRNOV-6671`,planCode:`starter-ops`,period:`month`,amountMinorUnits:45e5,currency:`RUB`,status:`suspended`,renewsAt:null,validFrom:`2026-07-20T00:00:00Z`,validUntil:`2026-08-20T00:00:00Z`,graceUntil:`2026-08-30T00:00:00Z`,activeModules:[`krona-core`,`krona-operations`,`krona-crm`],autoRenew:!1,history:[{eventAt:`2026-08-31T00:01:00Z`,type:`plan_changed`,description:`Приостановлено за неоплату после окончания льготного периода`,actor:`platform_admin`}]},{subscriptionId:`sub-006`,tenantId:`01918a20-0006-7000-8000-000000000006`,tenantName:`Клиника «Здоровая Семья»`,billingAccountRef:`ACC-MED-7728`,planCode:`business-pro`,period:`month`,amountMinorUnits:245e5,currency:`RUB`,status:`expiring_30d`,renewsAt:`2026-10-01T00:00:00Z`,validFrom:`2026-09-01T00:00:00Z`,validUntil:`2026-10-01T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-crm`,`krona-staff`,`krona-finance`,`krona-analytics`,`krona-omnichannel`],autoRenew:!0,history:[{eventAt:`2026-09-01T08:00:00Z`,type:`renewed`,description:`Автосписание успешно выполнено`,actor:`billing_manager`}]},{subscriptionId:`sub-007`,tenantId:`01918a20-0007-7000-8000-000000000007`,tenantName:`ООО «Волга-Агротрейд»`,billingAccountRef:`ACC-AGRO-6315`,planCode:`business-std`,period:`month`,amountMinorUnits:14e6,currency:`RUB`,status:`expiring_7d`,renewsAt:`2026-09-16T00:00:00Z`,validFrom:`2026-08-16T00:00:00Z`,validUntil:`2026-09-16T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`],autoRenew:!1,history:[]},{subscriptionId:`sub-011`,tenantId:`01918a20-0011-7000-8000-000000000011`,tenantName:`ООО «Казань Экспресс Доставка»`,billingAccountRef:`ACC-KZN-1655`,planCode:`business-std`,period:`month`,amountMinorUnits:98e5,currency:`RUB`,status:`grace`,renewsAt:null,validFrom:`2026-08-08T00:00:00Z`,validUntil:`2026-09-08T00:00:00Z`,graceUntil:`2026-09-18T00:00:00Z`,activeModules:[`krona-core`,`krona-crm`,`krona-operations`,`krona-finance`],autoRenew:!1,history:[{eventAt:`2026-09-08T18:00:00Z`,type:`grace_granted`,description:`Предоставлен Grace Period 10 дней`,actor:`billing_manager`}]},{subscriptionId:`sub-012`,tenantId:`01918a20-0012-7000-8000-000000000012`,tenantName:`ИП Ковалева М. И. («Шоколадница на Невском»)`,billingAccountRef:`ACC-CHOC-7842`,planCode:`starter-ops`,period:`month`,amountMinorUnits:65e5,currency:`RUB`,status:`expiring_7d`,renewsAt:`2026-09-13T00:00:00Z`,validFrom:`2026-08-13T00:00:00Z`,validUntil:`2026-09-13T00:00:00Z`,graceUntil:null,activeModules:[`krona-core`,`krona-pos`,`krona-operations`],autoRenew:!1,history:[]}],Ku=[{serverId:`srv-001-sel-spb`,name:`vps-sel-spb-prod-01`,hostname:`node-spb-01.infra.krona.systems`,ipAddress:`178.212.13.102`,hostingProvider:`Selectel`,region:`ru-spb-1`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-08-15T00:00:00Z`,certificateDaysRemaining:338,cpuLoadPercent:24,ramUsedBytes:6871947673,ramTotalBytes:17179869184,diskUsedBytes:53687091200,diskTotalBytes:161061273600,inodeUsedPercent:31,networkRxBytesPerSec:142e4,networkTxBytesPerSec:289e4,uptimeSeconds:7894e3,latencyMs:12,deployedInstancesCount:5,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T03:00:00Z`,sizeBytes:12884901888,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-15T04:00:00Z`,verifiedAt:`2026-08-15T04:22:00Z`,drillDurationSeconds:1320},sshConfig:{port:22,username:`krona`,authMethod:`key`,publicKey:`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPeQZ5+614cK1c3Qz1xL3rY7uK9zM8v2n1j4b krona@ochenstarik.ru`,privateKeyName:`id_ed25519_ochenstarik`,fingerprint:`SHA256:KccSpbProd01Ed25519HostKeyFingerprint`,lastConnectedAt:`2026-09-10T18:40:00Z`,status:`connected`}},{serverId:`srv-002-sel-msk`,name:`vps-sel-msk-prod-02`,hostname:`node-msk-02.infra.krona.systems`,ipAddress:`185.129.50.44`,hostingProvider:`Selectel`,region:`ru-msk-2`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-06-20T00:00:00Z`,certificateDaysRemaining:282,cpuLoadPercent:38,ramUsedBytes:12884901888,ramTotalBytes:34359738368,diskUsedBytes:128849018880,diskTotalBytes:322122547200,inodeUsedPercent:44,networkRxBytesPerSec:38e5,networkTxBytesPerSec:72e5,uptimeSeconds:432e4,latencyMs:18,deployedInstancesCount:6,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T03:30:00Z`,sizeBytes:25769803776,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-20T04:00:00Z`,verifiedAt:`2026-08-20T04:35:00Z`,drillDurationSeconds:2100},sshConfig:{port:22,username:`krona-admin`,authMethod:`key`,publicKey:`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMskProd02KeyAdminKronaInfrastructure`,privateKeyName:`id_ed25519_msk_admin`,fingerprint:`SHA256:MskProd02Ed25519KeyFingerprint9912`,lastConnectedAt:`2026-09-10T18:35:00Z`,status:`connected`}},{serverId:`srv-003-tw-msk`,name:`vps-tw-msk-cluster-03`,hostname:`node-msk-tw-03.infra.krona.systems`,ipAddress:`194.87.112.89`,hostingProvider:`Timeweb Cloud`,region:`msk-dc1`,status:`warning`,agentVersion:`1.4.1`,agentStatus:`enrolled`,certificateExpiresAt:`2026-10-10T00:00:00Z`,certificateDaysRemaining:29,cpuLoadPercent:78,ramUsedBytes:14602888806,ramTotalBytes:17179869184,diskUsedBytes:171798691840,diskTotalBytes:214748364800,inodeUsedPercent:72,networkRxBytesPerSec:54e5,networkTxBytesPerSec:91e5,uptimeSeconds:1209600,latencyMs:34,deployedInstancesCount:4,lastSeenAt:`2026-09-10T18:44:12Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T02:15:00Z`,sizeBytes:19327352832,encryptedExternalCopy:!0,targetProvider:`Yandex Object Storage`},restoreDrill:{state:`overdue`,lastAttemptAt:`2026-05-10T03:00:00Z`,verifiedAt:`2026-05-10T03:40:00Z`,drillDurationSeconds:2400},sshConfig:{port:2222,username:`root`,authMethod:`key`,publicKey:`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAITwClusterMskKeyAdminKronaInfrastructure`,fingerprint:`SHA256:TwMskCluster03KeyFingerprint1190`,lastConnectedAt:`2026-09-10T17:20:00Z`,status:`connected`}},{serverId:`srv-004-tw-spb`,name:`vps-tw-spb-omni-04`,hostname:`node-spb-tw-04.infra.krona.systems`,ipAddress:`194.87.214.15`,hostingProvider:`Timeweb Cloud`,region:`spb-dc2`,status:`critical`,agentVersion:`1.4.0`,agentStatus:`enrolled`,certificateExpiresAt:`2027-02-14T00:00:00Z`,certificateDaysRemaining:156,cpuLoadPercent:94,ramUsedBytes:16106127360,ramTotalBytes:17179869184,diskUsedBytes:198642237440,diskTotalBytes:214748364800,inodeUsedPercent:88,networkRxBytesPerSec:128e5,networkTxBytesPerSec:184e5,uptimeSeconds:604800,latencyMs:95,deployedInstancesCount:3,lastSeenAt:`2026-09-10T18:43:05Z`,backup:{state:`failed`,lastSuccessfulAt:`2026-09-08T02:00:00Z`,sizeBytes:0,encryptedExternalCopy:!1,targetProvider:`Timeweb S3`},restoreDrill:{state:`failed`,lastAttemptAt:`2026-09-09T04:00:00Z`,verifiedAt:null,drillDurationSeconds:0},sshConfig:{port:22,username:`krona`,authMethod:`password`,fingerprint:`SHA256:TwSpbOmni04KeyFingerprint8810`,lastConnectedAt:`2026-09-09T14:10:00Z`,status:`connected`,allowPasswordFallback:!0}},{serverId:`srv-005-sel-msk`,name:`vps-sel-msk-db-05`,hostname:`db-replica-01.infra.krona.systems`,ipAddress:`185.129.50.99`,hostingProvider:`Selectel`,region:`ru-msk-2`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-09-01T00:00:00Z`,certificateDaysRemaining:355,cpuLoadPercent:19,ramUsedBytes:21474836480,ramTotalBytes:68719476736,diskUsedBytes:429496729600,diskTotalBytes:0xfa00000000,inodeUsedPercent:26,networkRxBytesPerSec:89e5,networkTxBytesPerSec:42e5,uptimeSeconds:15552e3,latencyMs:14,deployedInstancesCount:2,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T01:00:00Z`,sizeBytes:85899345920,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-01T02:00:00Z`,verifiedAt:`2026-08-01T02:55:00Z`,drillDurationSeconds:3300},sshConfig:{port:2200,username:`postgres-ops`,authMethod:`key`,publicKey:`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDbReplicaOpsKeyAdminKronaInfrastructure`,fingerprint:`SHA256:SelMskDb05KeyFingerprint4412`,lastConnectedAt:`2026-09-10T18:42:00Z`,status:`connected`}},{serverId:`srv-006-tw-kzn`,name:`vps-tw-kzn-pilot-06`,hostname:`node-kzn-01.infra.krona.systems`,ipAddress:`194.87.180.22`,hostingProvider:`Timeweb Cloud`,region:`kzn-dc1`,status:`offline`,agentVersion:`1.3.8`,agentStatus:`unreachable`,certificateExpiresAt:`2026-11-20T00:00:00Z`,certificateDaysRemaining:70,cpuLoadPercent:0,ramUsedBytes:0,ramTotalBytes:8589934592,diskUsedBytes:0,diskTotalBytes:107374182400,inodeUsedPercent:0,networkRxBytesPerSec:0,networkTxBytesPerSec:0,uptimeSeconds:0,latencyMs:999,deployedInstancesCount:2,lastSeenAt:`2026-09-10T16:12:00Z`,backup:{state:`overdue`,lastSuccessfulAt:`2026-09-07T03:00:00Z`,sizeBytes:5368709120,encryptedExternalCopy:!0,targetProvider:`Timeweb S3`},restoreDrill:{state:`never`,lastAttemptAt:null,verifiedAt:null},sshConfig:{port:22,username:`root`,authMethod:`key`,fingerprint:`SHA256:TwKznPilot06KeyFingerprint0019`,lastConnectedAt:null,status:`unreachable`}},{serverId:`srv-007-sel-spb`,name:`vps-sel-spb-worker-07`,hostname:`worker-spb-01.infra.krona.systems`,ipAddress:`178.212.13.205`,hostingProvider:`Selectel`,region:`ru-spb-1`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-05-10T00:00:00Z`,certificateDaysRemaining:241,cpuLoadPercent:42,ramUsedBytes:10737418240,ramTotalBytes:17179869184,diskUsedBytes:64424509440,diskTotalBytes:161061273600,inodeUsedPercent:38,networkRxBytesPerSec:21e5,networkTxBytesPerSec:34e5,uptimeSeconds:3110400,latencyMs:13,deployedInstancesCount:4,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T04:00:00Z`,sizeBytes:10737418240,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-07-28T05:00:00Z`,verifiedAt:`2026-07-28T05:25:00Z`,drillDurationSeconds:1500},sshConfig:{port:22,username:`worker-admin`,authMethod:`key`,publicKey:`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAISpbWorker07KeyAdminKronaInfrastructure`,fingerprint:`SHA256:SelSpbWorker07Fingerprint3310`,lastConnectedAt:`2026-09-10T18:15:00Z`,status:`connected`}},{serverId:`srv-008-tw-msk`,name:`vps-tw-msk-ingress-08`,hostname:`ingress-01.infra.krona.systems`,ipAddress:`194.87.112.10`,hostingProvider:`Timeweb Cloud`,region:`msk-dc1`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-04-18T00:00:00Z`,certificateDaysRemaining:219,cpuLoadPercent:15,ramUsedBytes:4294967296,ramTotalBytes:8589934592,diskUsedBytes:21474836480,diskTotalBytes:85899345920,inodeUsedPercent:19,networkRxBytesPerSec:154e5,networkTxBytesPerSec:162e5,uptimeSeconds:5184e3,latencyMs:16,deployedInstancesCount:1,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T02:00:00Z`,sizeBytes:2147483648,encryptedExternalCopy:!0,targetProvider:`Timeweb S3`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-10T03:00:00Z`,verifiedAt:`2026-08-10T03:15:00Z`,drillDurationSeconds:900},sshConfig:{port:22,username:`krona`,authMethod:`key`,publicKey:`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIngress08KeyAdminKronaInfrastructure`,fingerprint:`SHA256:TwMskIngress08Fingerprint2201`,lastConnectedAt:`2026-09-10T18:30:00Z`,status:`connected`}},{serverId:`srv-009-sel-nov`,name:`vps-sel-nov-edge-09`,hostname:`edge-nov-01.infra.krona.systems`,ipAddress:`185.129.88.19`,hostingProvider:`Selectel`,region:`ru-nov-1`,status:`warning`,agentVersion:`1.4.1`,agentStatus:`enrolled`,certificateExpiresAt:`2027-01-05T00:00:00Z`,certificateDaysRemaining:116,cpuLoadPercent:62,ramUsedBytes:11811160064,ramTotalBytes:17179869184,diskUsedBytes:96636764160,diskTotalBytes:128849018880,inodeUsedPercent:68,networkRxBytesPerSec:42e5,networkTxBytesPerSec:51e5,uptimeSeconds:2592e3,latencyMs:46,deployedInstancesCount:3,lastSeenAt:`2026-09-10T18:44:30Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-09T03:00:00Z`,sizeBytes:8589934592,encryptedExternalCopy:!0,targetProvider:`Selectel S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-07-15T04:00:00Z`,verifiedAt:`2026-07-15T04:30:00Z`,drillDurationSeconds:1800},sshConfig:{port:2222,username:`edge-operator`,authMethod:`key`,publicKey:`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEdgeNov09KeyAdminKronaInfrastructure`,fingerprint:`SHA256:SelNovEdge09Fingerprint7719`,lastConnectedAt:`2026-09-10T16:50:00Z`,status:`connected`}},{serverId:`srv-010-tw-spb`,name:`vps-tw-spb-analytics-10`,hostname:`bi-worker-01.infra.krona.systems`,ipAddress:`194.87.214.90`,hostingProvider:`Timeweb Cloud`,region:`spb-dc2`,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:`2027-08-30T00:00:00Z`,certificateDaysRemaining:353,cpuLoadPercent:32,ramUsedBytes:25769803776,ramTotalBytes:34359738368,diskUsedBytes:171798691840,diskTotalBytes:429496729600,inodeUsedPercent:41,networkRxBytesPerSec:62e5,networkTxBytesPerSec:84e5,uptimeSeconds:6912e3,latencyMs:14,deployedInstancesCount:3,lastSeenAt:`2026-09-10T18:45:00Z`,backup:{state:`ok`,lastSuccessfulAt:`2026-09-10T03:00:00Z`,sizeBytes:34359738368,encryptedExternalCopy:!0,targetProvider:`Timeweb S3`},restoreDrill:{state:`passed`,lastAttemptAt:`2026-08-25T04:00:00Z`,verifiedAt:`2026-08-25T04:40:00Z`,drillDurationSeconds:2400},sshConfig:{port:22,username:`bi-ops`,authMethod:`key`,publicKey:`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBiAnalytics10KeyAdminKronaInfrastructure`,fingerprint:`SHA256:TwSpbAnalytics10Fingerprint6640`,lastConnectedAt:`2026-09-10T18:00:00Z`,status:`connected`}}],qu=[{moduleInstanceId:`inst-001`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,moduleId:`krona-core`,moduleName:`Krona Core System`,deploymentId:`dep-001`,serverId:`srv-001-sel-spb`,serverName:`vps-sel-spb-prod-01`,mode:`platform`,currentVersion:`2.4.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:50Z`,uptimeSeconds:7894e3},{moduleInstanceId:`inst-002`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,moduleId:`krona-operations`,moduleName:`Операционный склад и логистика`,deploymentId:`dep-001`,serverId:`srv-001-sel-spb`,serverName:`vps-sel-spb-prod-01`,mode:`platform`,currentVersion:`1.9.5`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:50Z`,uptimeSeconds:7894e3},{moduleInstanceId:`inst-003`,tenantId:`01918a20-0002-7000-8000-000000000002`,tenantName:`АО «Балтийская Логистика»`,moduleId:`krona-crm`,moduleName:`CRM & Клиенты`,deploymentId:`dep-002`,serverId:`srv-002-sel-msk`,serverName:`vps-sel-msk-prod-02`,mode:`platform`,currentVersion:`2.1.2`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:30Z`,uptimeSeconds:432e4},{moduleInstanceId:`inst-004`,tenantId:`01918a20-0003-7000-8000-000000000003`,tenantName:`Сеть кофеен «Эспрессо Поинт»`,moduleId:`krona-pos`,moduleName:`Кассовый узел POS`,deploymentId:`dep-003`,serverId:`srv-003-tw-msk`,serverName:`vps-tw-msk-cluster-03`,mode:`platform`,currentVersion:`1.8.2`,health:`degraded`,lastHeartbeatAt:`2026-09-10T18:43:55Z`,uptimeSeconds:1209600},{moduleInstanceId:`inst-005`,tenantId:`01918a20-0004-7000-8000-000000000004`,tenantName:`ООО «ТехноПромСнаб»`,moduleId:`krona-finance`,moduleName:`Финансы и казначейство`,deploymentId:`dep-004`,serverId:`srv-003-tw-msk`,serverName:`vps-tw-msk-cluster-03`,mode:`platform`,currentVersion:`2.0.1`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:10Z`,uptimeSeconds:1209600},{moduleInstanceId:`inst-006`,tenantId:`01918a20-0006-7000-8000-000000000006`,tenantName:`Клиника «Здоровая Семья»`,moduleId:`krona-omnichannel`,moduleName:`Омниканальные коммуникации`,deploymentId:`dep-005`,serverId:`srv-004-tw-spb`,serverName:`vps-tw-spb-omni-04`,mode:`platform`,currentVersion:`3.0.0-rc2`,health:`degraded`,lastHeartbeatAt:`2026-09-10T18:42:15Z`,uptimeSeconds:604800},{moduleInstanceId:`inst-007`,tenantId:`01918a20-0007-7000-8000-000000000007`,tenantName:`ООО «Волга-Агротрейд»`,moduleId:`krona-operations`,moduleName:`Операционный склад и логистика`,deploymentId:`dep-006`,serverId:`srv-006-tw-kzn`,serverName:`vps-tw-kzn-pilot-06`,mode:`platform`,currentVersion:`1.9.0`,health:`offline`,lastHeartbeatAt:`2026-09-10T16:12:00Z`,uptimeSeconds:0},{moduleInstanceId:`inst-008`,tenantId:`01918a20-0008-7000-8000-000000000008`,tenantName:`ООО «Ювелирный Дом Аврора»`,moduleId:`krona-core`,moduleName:`Krona Core System`,deploymentId:`dep-007`,serverId:`srv-002-sel-msk`,serverName:`vps-sel-msk-prod-02`,mode:`platform`,currentVersion:`2.4.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:45:00Z`,uptimeSeconds:432e4},{moduleInstanceId:`inst-009`,tenantId:`01918a20-0008-7000-8000-000000000008`,tenantName:`ООО «Ювелирный Дом Аврора»`,moduleId:`krona-crm`,moduleName:`CRM & Клиенты`,deploymentId:`dep-007`,serverId:`srv-002-sel-msk`,serverName:`vps-sel-msk-prod-02`,mode:`platform`,currentVersion:`2.1.2`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:45:00Z`,uptimeSeconds:432e4},{moduleInstanceId:`inst-010`,tenantId:`01918a20-0009-7000-8000-000000000009`,tenantName:`Фитнес-клубы «Атлетика Плюс»`,moduleId:`krona-staff`,moduleName:`Кадры и смены`,deploymentId:`dep-008`,serverId:`srv-007-sel-spb`,serverName:`vps-sel-spb-worker-07`,mode:`platform`,currentVersion:`1.5.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:45Z`,uptimeSeconds:3110400},{moduleInstanceId:`inst-011`,tenantId:`01918a20-0010-7000-8000-000000000010`,tenantName:`ООО «Сибирский Лесокомбинат»`,moduleId:`krona-analytics`,moduleName:`Бизнес-Аналитика и дашборды`,deploymentId:`dep-009`,serverId:`srv-010-tw-spb`,serverName:`vps-tw-spb-analytics-10`,mode:`platform`,currentVersion:`2.2.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:45:00Z`,uptimeSeconds:6912e3},{moduleInstanceId:`inst-012`,tenantId:`01918a20-0011-7000-8000-000000000011`,tenantName:`ООО «Казань Экспресс Доставка»`,moduleId:`krona-operations`,moduleName:`Операционный склад и логистика`,deploymentId:`dep-010`,serverId:`srv-006-tw-kzn`,serverName:`vps-tw-kzn-pilot-06`,mode:`platform`,currentVersion:`1.8.4`,health:`offline`,lastHeartbeatAt:`2026-09-10T16:12:00Z`,uptimeSeconds:0},{moduleInstanceId:`inst-013`,tenantId:`01918a20-0012-7000-8000-000000000012`,tenantName:`ИП Ковалева М. И. («Шоколадница на Невском»)`,moduleId:`krona-pos`,moduleName:`Кассовый узел POS`,deploymentId:`dep-011`,serverId:`srv-007-sel-spb`,serverName:`vps-sel-spb-worker-07`,mode:`platform`,currentVersion:`1.8.2`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:20Z`,uptimeSeconds:3110400},{moduleInstanceId:`inst-014`,tenantId:`01918a20-0013-7000-8000-000000000013`,tenantName:`АО «Приморский Рыбокомбинат»`,moduleId:`krona-core`,moduleName:`Krona Core System`,deploymentId:`dep-012`,serverId:`srv-009-sel-nov`,serverName:`vps-sel-nov-edge-09`,mode:`standalone`,currentVersion:`2.4.0`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:15Z`,uptimeSeconds:2592e3},{moduleInstanceId:`inst-015`,tenantId:`01918a20-0013-7000-8000-000000000013`,tenantName:`АО «Приморский Рыбокомбинат»`,moduleId:`krona-finance`,moduleName:`Финансы и казначейство`,deploymentId:`dep-012`,serverId:`srv-009-sel-nov`,serverName:`vps-sel-nov-edge-09`,mode:`standalone`,currentVersion:`2.0.1`,health:`healthy`,lastHeartbeatAt:`2026-09-10T18:44:15Z`,uptimeSeconds:2592e3}],Ju=[{installationId:`inst-dev-001`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,kind:`android`,deviceName:`Zebra TC26 Barcode Terminal`,osVersion:`Android 11 (API 30)`,appVersion:`1.2.0`,status:`outdated`,registeredAt:`2025-10-12T08:00:00Z`,lastSeenAt:`2026-09-10T18:40:00Z`,ipAddressMasked:`10.20.1.*`},{installationId:`inst-dev-002`,tenantId:`01918a20-0001-7000-8000-000000000001`,tenantName:`ООО «Северная Ритейл Группа»`,kind:`android`,deviceName:`Honeywell ScanPal EDA51`,osVersion:`Android 10 (API 29)`,appVersion:`1.1.8`,status:`outdated`,registeredAt:`2025-09-01T10:00:00Z`,lastSeenAt:`2026-09-10T17:15:00Z`,ipAddressMasked:`10.20.1.*`},{installationId:`inst-dev-003`,tenantId:`01918a20-0002-7000-8000-000000000002`,tenantName:`АО «Балтийская Логистика»`,kind:`desktop`,deviceName:`Workstation-Logistics-Office-04`,osVersion:`Windows 11 Pro 23H2`,appVersion:`2.4.0`,status:`supported`,registeredAt:`2026-01-15T12:00:00Z`,lastSeenAt:`2026-09-10T18:35:00Z`,ipAddressMasked:`192.168.10.*`},{installationId:`inst-dev-004`,tenantId:`01918a20-0003-7000-8000-000000000003`,tenantName:`Сеть кофеен «Эспрессо Поинт»`,kind:`android`,deviceName:`iMin Swan 1 POS Desktop`,osVersion:`Android 11 (API 30)`,appVersion:`1.1.5`,status:`outdated`,registeredAt:`2026-04-10T09:00:00Z`,lastSeenAt:`2026-09-10T18:10:00Z`,ipAddressMasked:`192.168.1.*`},{installationId:`inst-dev-005`,tenantId:`01918a20-0003-7000-8000-000000000003`,tenantName:`Сеть кофеен «Эспрессо Поинт»`,kind:`web`,deviceName:`Chrome 128 / macOS Sequoia`,osVersion:`macOS 15.0`,appVersion:`2.4.0`,status:`supported`,registeredAt:`2026-05-01T14:00:00Z`,lastSeenAt:`2026-09-10T18:12:00Z`,ipAddressMasked:`85.140.22.*`},{installationId:`inst-dev-006`,tenantId:`01918a20-0004-7000-8000-000000000004`,tenantName:`ООО «ТехноПромСнаб»`,kind:`desktop`,deviceName:`Buh-Accountant-PC`,osVersion:`Windows 10 Enterprise`,appVersion:`2.3.2`,status:`supported`,registeredAt:`2025-11-20T11:00:00Z`,lastSeenAt:`2026-09-10T17:50:00Z`,ipAddressMasked:`172.16.0.*`},{installationId:`inst-dev-007`,tenantId:`01918a20-0006-7000-8000-000000000006`,tenantName:`Клиника «Здоровая Семья»`,kind:`android`,deviceName:`Samsung Galaxy Tab Active3 (Dr. Mobile)`,osVersion:`Android 12`,appVersion:`1.2.0`,status:`outdated`,registeredAt:`2026-02-18T10:00:00Z`,lastSeenAt:`2026-09-10T18:20:00Z`,ipAddressMasked:`10.100.2.*`},{installationId:`inst-dev-008`,tenantId:`01918a20-0007-7000-8000-000000000007`,tenantName:`ООО «Волга-Агротрейд»`,kind:`android`,deviceName:`Urovo DT50 4G Rugged`,osVersion:`Android 9 (API 28)`,appVersion:`1.0.4`,status:`blocked`,registeredAt:`2025-06-01T08:00:00Z`,lastSeenAt:`2026-09-08T14:00:00Z`,ipAddressMasked:`192.168.4.*`},{installationId:`inst-dev-009`,tenantId:`01918a20-0008-7000-8000-000000000008`,tenantName:`ООО «Ювелирный Дом Аврора»`,kind:`web`,deviceName:`Safari 18 / iPadOS 18`,osVersion:`iPadOS 18.0`,appVersion:`2.4.0`,status:`supported`,registeredAt:`2026-07-01T15:00:00Z`,lastSeenAt:`2026-09-10T18:38:00Z`,ipAddressMasked:`94.25.17.*`},{installationId:`inst-dev-010`,tenantId:`01918a20-0012-7000-8000-000000000012`,tenantName:`ИП Ковалева М. И. («Шоколадница на Невском»)`,kind:`android`,deviceName:`Эвотор Power Smart-Касса`,osVersion:`Android 10 (API 29)`,appVersion:`1.1.9`,status:`outdated`,registeredAt:`2026-03-15T09:00:00Z`,lastSeenAt:`2026-09-10T18:29:00Z`,ipAddressMasked:`192.168.88.*`},{installationId:`inst-dev-011`,tenantId:`01918a20-0013-7000-8000-000000000013`,tenantName:`АО «Приморский Рыбокомбинат»`,kind:`desktop`,deviceName:`Torg-Server-Dock-01`,osVersion:`Ubuntu 24.04 LTS Desktop`,appVersion:`2.4.0`,status:`supported`,registeredAt:`2026-05-12T07:00:00Z`,lastSeenAt:`2026-09-10T15:20:00Z`,ipAddressMasked:`10.50.0.*`}],Yu=[{incidentId:`inc-2026-09-001`,incidentNumber:`INC-1048`,severity:`critical`,status:`open`,summary:`Узел vps-tw-kzn-pilot-06 не отвечает на heartbeat > 2 часов`,description:`Сервер hosting-провайдера Timeweb Cloud в дата-центре Казань потерял сетевую связность. Затронуты экземпляры модулей для ООО «Волга-Агротрейд» и ООО «Казань Экспресс Доставка». Серверный монитор перешел в статус unreachable.`,affectedTenantIds:[`01918a20-0007-7000-8000-000000000007`,`01918a20-0011-7000-8000-000000000011`],affectedServerIds:[`srv-006-tw-kzn`],affectedModuleIds:[`krona-operations`],ownerName:`Алексей Смирнов (Platform Admin)`,openedAt:`2026-09-10T16:30:00Z`,timeline:[{timestamp:`2026-09-10T16:30:00Z`,author:`System Monitor Watchdog`,message:`Heartbeat missed > 3 cycles. Host 194.87.180.22 state changed to unreachable.`},{timestamp:`2026-09-10T16:45:00Z`,author:`Алексей Смирнов`,message:`Открыт тикет в техподдержку Timeweb Cloud #TW-94812. Ожидается ответ сетевого дежурного.`},{timestamp:`2026-09-10T17:15:00Z`,author:`Алексей Смирнов`,message:`Провайдер подтвердил аварию на коммутаторе стойки DC-KZN-01.`}]},{incidentId:`inc-2026-09-002`,incidentNumber:`INC-1049`,severity:`high`,status:`mitigating`,summary:`Перегрузка дисковой подсистемы и сбой бэкапа на vps-tw-spb-omni-04`,description:`Диск заполнен на 92%, резервное копирование завершилось ошибкой No space left on device. WebSocket-соединения омниканального модуля испытывают задержки до 95ms.`,affectedTenantIds:[`01918a20-0006-7000-8000-000000000006`],affectedServerIds:[`srv-004-tw-spb`],affectedModuleIds:[`krona-omnichannel`],ownerName:`Дмитрий Волков (Platform Admin)`,openedAt:`2026-09-10T17:00:00Z`,timeline:[{timestamp:`2026-09-10T17:00:00Z`,author:`System Monitor Watchdog`,message:`Disk threshold 90% exceeded, nightly backup job exit code 1.`},{timestamp:`2026-09-10T17:30:00Z`,author:`Дмитрий Волков`,message:`Запущена очистка временных логов WebSocket и ротация старых дампов.`}]},{incidentId:`inc-2026-09-003`,incidentNumber:`INC-1045`,severity:`medium`,status:`resolved`,summary:`Задержка фискализации чеков в модуле POS для «Эспрессо Поинт»`,description:`Служба очереди чеков накапливала буфер из-за таймаутов ОФД. Очередь успешно сброшена, фискальные накопители синхронизированы.`,affectedTenantIds:[`01918a20-0003-7000-8000-000000000003`],affectedServerIds:[`srv-003-tw-msk`],affectedModuleIds:[`krona-pos`],ownerName:`Елена Соколова (Support Operator)`,openedAt:`2026-09-09T14:10:00Z`,resolvedAt:`2026-09-09T16:40:00Z`,timeline:[{timestamp:`2026-09-09T14:10:00Z`,author:`Елена Соколова`,message:`Поступили обращения о задержках чеков. Запрошена телеметрия с узла.`},{timestamp:`2026-09-09T16:40:00Z`,author:`Елена Соколова`,message:`Канал связи с ОФД восстановлен, очередь 0. Инцидент закрыт.`}]}],Xu=[{announcementId:`anc-001`,audience:{allTenants:!0},title:`Плановые технические работы на инфраструктуре Selectel`,body:`В ночь с 14 на 15 сентября с 03:00 до 05:00 МСК будут проводиться работы по обновлению гипервизоров. Возможны кратковременные перерывы до 5 минут.`,priority:`important`,channels:[`in_app`],status:`completed`,validFrom:`2026-09-09T10:00:00Z`,validUntil:`2026-09-15T06:00:00Z`,createdAt:`2026-09-09T09:30:00Z`,author:`Алексей Смирнов (Platform Admin)`,stats:{totalTargeted:14,queued:0,delivered:14,failed:0}},{announcementId:`anc-002`,audience:{requiredModuleId:`krona-omnichannel`,tenantIds:[`01918a20-0003-7000-8000-000000000003`,`01918a20-0006-7000-8000-000000000006`,`01918a20-0009-7000-8000-000000000009`]},title:`Доступна новая версия Omnichannel 3.0 (Пилотная программа)`,body:`Приглашаем принять участие в тестировании нового WebSocket-транспорта и ускоренной обработки диалогов Telegram/WhatsApp.`,priority:`normal`,channels:[`in_app`,`comm_adapter`],status:`scheduled`,validFrom:`2026-09-12T09:00:00Z`,validUntil:`2026-09-30T23:59:00Z`,createdAt:`2026-09-10T15:00:00Z`,author:`Мария Лебедева (Release Manager)`,stats:{totalTargeted:3,queued:3,delivered:0,failed:0}}],Zu=[{rolloutId:`rol-001`,moduleId:`krona-omnichannel`,moduleName:`Омниканальные коммуникации`,targetVersion:`3.0.0-rc2`,stage:`pilot`,pilotTenantIds:[`01918a20-0003-7000-8000-000000000003`,`01918a20-0006-7000-8000-000000000006`],percentage:15,startedAt:`2026-09-08T10:00:00Z`,updatedAt:`2026-09-10T14:00:00Z`,notes:`Пилотный запуск на 2 организациях перед общей раскаткой.`},{rolloutId:`rol-002`,moduleId:`krona-staff`,moduleName:`Кадры и смены`,targetVersion:`1.5.0`,stage:`percentage`,pilotTenantIds:[`01918a20-0009-7000-8000-000000000009`],percentage:25,startedAt:`2026-09-05T09:00:00Z`,updatedAt:`2026-09-09T11:00:00Z`,notes:`Постепенная раскатка 25% тенантов, жалоб на производительность нет.`}],Qu=[{eventId:`evt-000001`,occurredAt:`2026-09-08T10:00:00Z`,operatorId:`op-001`,operatorName:`Михаил Романов`,operatorRole:`platform_owner`,action:`rollout.pilot_started`,target:{type:`rollout`,id:`rol-001`,displayName:`Омниканальные коммуникации 3.0.0-rc2`},reason:`Запуск пилотной программы Omnichannel 3.0 для тестовых организаций`,impactSummary:`Затронуты 2 пилотные организации, переключение на новый WebSocket транспорт`,correlationId:`corr-init-001`,idempotencyKey:`idem-rol-001`,previousHash:`GENESIS_HASH_00000000000000000000000000000000000000000000000000000000000000`,hash:`8f4a1c6e9d2b3a4f5c6e7d8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c`},{eventId:`evt-000002`,occurredAt:`2026-09-08T18:00:00Z`,operatorId:`op-002`,operatorName:`Анна Кузнецова`,operatorRole:`billing_manager`,action:`subscription.grace_period_granted`,target:{type:`subscription`,id:`sub-011`,displayName:`ООО «Казань Экспресс Доставка»`,tenantId:`01918a20-0011-7000-8000-000000000011`},reason:`Задержка платежного поручения в банке, обращение финдиректора`,impactSummary:`Продление льготного доступа на 10 дней без блокировки пользователей`,correlationId:`corr-grace-011`,idempotencyKey:`idem-grace-011`,previousHash:`8f4a1c6e9d2b3a4f5c6e7d8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c`,hash:`a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2`},{eventId:`evt-000003`,occurredAt:`2026-09-10T16:30:00Z`,operatorId:`op-003`,operatorName:`Алексей Смирнов`,operatorRole:`platform_admin`,action:`incident.created`,target:{type:`incident`,id:`inc-2026-09-001`,displayName:`INC-1048 (vps-tw-kzn-pilot-06 unreachable)`},reason:`Автоматический триггер сторожевого таймера телеметрии ноды`,impactSummary:`Критический инцидент, уведомление дежурной смены инфраструктуры`,correlationId:`corr-inc-1048`,previousHash:`a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2`,hash:`7c8d9e0f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d`}],$u=`krona_control_center_db`,ed=null;async function G(){return ed||=v($u,1,{upgrade(e){e.objectStoreNames.contains(`organizations`)||e.createObjectStore(`organizations`,{keyPath:`tenantId`}),e.objectStoreNames.contains(`modules`)||e.createObjectStore(`modules`,{keyPath:`moduleId`}),e.objectStoreNames.contains(`subscriptions`)||e.createObjectStore(`subscriptions`,{keyPath:`subscriptionId`}),e.objectStoreNames.contains(`installations`)||e.createObjectStore(`installations`,{keyPath:`installationId`}),e.objectStoreNames.contains(`instances`)||e.createObjectStore(`instances`,{keyPath:`moduleInstanceId`}),e.objectStoreNames.contains(`servers`)||e.createObjectStore(`servers`,{keyPath:`serverId`}),e.objectStoreNames.contains(`incidents`)||e.createObjectStore(`incidents`,{keyPath:`incidentId`}),e.objectStoreNames.contains(`announcements`)||e.createObjectStore(`announcements`,{keyPath:`announcementId`}),e.objectStoreNames.contains(`rollouts`)||e.createObjectStore(`rollouts`,{keyPath:`rolloutId`}),e.objectStoreNames.contains(`audit_events`)||e.createObjectStore(`audit_events`,{keyPath:`eventId`}).createIndex(`by_occurred`,`occurredAt`)}}),ed}async function td(e=!1){let t=await G();if(await t.count(`organizations`)===0||e){let n=t.transaction([`organizations`,`modules`,`subscriptions`,`installations`,`instances`,`servers`,`incidents`,`announcements`,`rollouts`,`audit_events`],`readwrite`);e&&await Promise.all([n.objectStore(`organizations`).clear(),n.objectStore(`modules`).clear(),n.objectStore(`subscriptions`).clear(),n.objectStore(`installations`).clear(),n.objectStore(`instances`).clear(),n.objectStore(`servers`).clear(),n.objectStore(`incidents`).clear(),n.objectStore(`announcements`).clear(),n.objectStore(`rollouts`).clear(),n.objectStore(`audit_events`).clear()]);for(let e of Uu)await n.objectStore(`organizations`).put(e);for(let e of Wu)await n.objectStore(`modules`).put(e);for(let e of Gu)await n.objectStore(`subscriptions`).put(e);for(let e of Ju)await n.objectStore(`installations`).put(e);for(let e of qu)await n.objectStore(`instances`).put(e);for(let e of Ku)await n.objectStore(`servers`).put(e);for(let e of Yu)await n.objectStore(`incidents`).put(e);for(let e of Xu)await n.objectStore(`announcements`).put(e);for(let e of Zu)await n.objectStore(`rollouts`).put(e);for(let e of Qu)await n.objectStore(`audit_events`).put(e);await n.done}let[n,r,i,a,o,s,c,l,u,d]=await Promise.all([t.getAll(`organizations`),t.getAll(`modules`),t.getAll(`subscriptions`),t.getAll(`installations`),t.getAll(`instances`),t.getAll(`servers`),t.getAll(`incidents`),t.getAll(`announcements`),t.getAll(`rollouts`),t.getAll(`audit_events`)]);return d.sort((e,t)=>new Date(t.occurredAt).getTime()-new Date(e.occurredAt).getTime()),{organizations:n,modules:r,subscriptions:i,installations:a,instances:o,servers:s,incidents:c,announcements:l,rollouts:u,auditLog:d}}async function K(e,t){await(await G()).put(e,t)}async function q(e){if(typeof window<`u`&&window.crypto&&window.crypto.subtle){let t=new TextEncoder().encode(e),n=await window.crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return`fallback_sha256_${Math.abs(t).toString(16).padStart(8,`0`)}_${e.length}`}var J={platform_owner:{id:`op-001`,name:`Михаил Романов`,role:`platform_owner`,email:`m.romanov@krona.systems`,title:`Владелец платформы & Архитектор`},platform_admin:{id:`op-002`,name:`Алексей Смирнов`,role:`platform_admin`,email:`a.smirnov@krona.systems`,title:`Главный системный администратор`},support_operator:{id:`op-003`,name:`Елена Соколова`,role:`support_operator`,email:`e.sokolova@krona.systems`,title:`Ведущий инженер поддержки L2`},billing_manager:{id:`op-004`,name:`Анна Кузнецова`,role:`billing_manager`,email:`a.kuznetsova@krona.systems`,title:`Руководитель биллинговых операций`},security_auditor:{id:`op-005`,name:`Сергей Белов`,role:`security_auditor`,email:`s.belov@krona.systems`,title:`Офицер информационной безопасности`},release_manager:{id:`op-006`,name:`Мария Лебедева`,role:`release_manager`,email:`m.lebedeva@krona.systems`,title:`Руководитель релизного конвейера`}},Y=f((e,t)=>({activeRole:`platform_owner`,activeOperator:J.platform_owner,isAccessGatePassed:typeof window<`u`&&localStorage.getItem(`kcc_access_gate`)===`1`,isLoading:!1,isInitialized:!1,serverMonitorOutage:!1,organizations:[],modules:[],subscriptions:[],installations:[],instances:[],servers:[],incidents:[],announcements:[],rollouts:[],auditLog:[],inspectorTarget:null,pendingConfirmModal:null,initialize:async(t=!1)=>{e({isLoading:!0});try{e({...await td(t),isInitialized:!0,isLoading:!1})}catch(t){console.error(`[KCC DB] Failed to init indexedDB:`,t),e({isLoading:!1})}},setActiveRole:t=>{e({activeRole:t,activeOperator:J[t]})},setAccessGatePassed:t=>{typeof window<`u`&&(t?localStorage.setItem(`kcc_access_gate`,`1`):localStorage.removeItem(`kcc_access_gate`)),e({isAccessGatePassed:t})},openInspector:(t,n)=>e({inspectorTarget:{type:t,id:n}}),closeInspector:()=>e({inspectorTarget:null}),setServerMonitorOutage:t=>e({serverMonitorOutage:t}),toggleServerMonitorOutage:()=>e(e=>({serverMonitorOutage:!e.serverMonitorOutage})),openConfirmModal:t=>e({pendingConfirmModal:t}),closeConfirmModal:()=>e({pendingConfirmModal:null}),recordAuditEvent:async({action:n,target:r,reason:i,impactSummary:a})=>{let{activeOperator:o,auditLog:s}=t(),c=s[0],l=c?c.hash:`GENESIS_HASH_00000000000000000000000000000000000000000000000000000000000000`,u=`evt-${Date.now().toString(36)}-${Math.random().toString(36).substring(2,6)}`,d=new Date().toISOString(),f=`corr-${Date.now().toString(36)}`,p=await q(`${l}|${d}|${o.id}|${o.role}|${n}|${r.type}:${r.id}|${i}|${f}`),m={eventId:u,occurredAt:d,operatorId:o.id,operatorName:o.name,operatorRole:o.role,action:n,target:r,reason:i,impactSummary:a,correlationId:f,previousHash:l,hash:p};return await K(`audit_events`,m),e(e=>({auditLog:[m,...e.auditLog]})),m},updateOrganizationStatus:async(n,r,i)=>{let{organizations:a,recordAuditEvent:o}=t(),s=a.find(e=>e.tenantId===n);if(!s)return;let c=s.platformStatus,l={...s,platformStatus:r,projectedAt:new Date().toISOString()};await K(`organizations`,l),e(e=>({organizations:e.organizations.map(e=>e.tenantId===n?l:e)})),await o({action:`organization.status_changed`,target:{type:`organization`,id:n,displayName:s.displayName,tenantId:n},reason:i,impactSummary:`Статус организации изменен с «${c}» на «${r}»`})},grantModuleTrial:async(n,r,i,a)=>{let{organizations:o,modules:s,recordAuditEvent:c}=t(),l=o.find(e=>e.tenantId===n),u=s.find(e=>e.moduleId===r);if(!l||!u)return;let d=new Date(Date.now()+i*24*3600*1e3).toISOString(),f={...l,installedModulesCount:l.installedModulesCount+1,tariffPlan:`${l.tariffPlan} (+Trial ${u.name})`,projectedAt:new Date().toISOString()};await K(`organizations`,f),e(e=>({organizations:e.organizations.map(e=>e.tenantId===n?f:e)})),await c({action:`entitlement.trial_granted`,target:{type:`organization`,id:n,displayName:l.displayName,tenantId:n},reason:a,impactSummary:`Выдан пробный доступ к модулю «${u.name}» на ${i} дней (до ${d.slice(0,10)})`})},grantGracePeriod:async(n,r,i)=>{let{subscriptions:a,recordAuditEvent:o}=t(),s=a.find(e=>e.subscriptionId===n);if(!s)return;let c=new Date(Date.now()+r*24*3600*1e3).toISOString(),l={...s,status:`grace`,graceUntil:c,history:[{eventAt:new Date().toISOString(),type:`grace_granted`,description:`Предоставлен льготный период на ${r} дней`,actor:t().activeOperator.name},...s.history]};await K(`subscriptions`,l),e(e=>({subscriptions:e.subscriptions.map(e=>e.subscriptionId===n?l:e)})),await o({action:`subscription.grace_period_granted`,target:{type:`subscription`,id:n,displayName:s.tenantName,tenantId:s.tenantId},reason:i,impactSummary:`Установлен Grace Period на ${r} дней (до ${c.slice(0,10)})`})},renewSubscription:async(n,r,i,a)=>{let{subscriptions:o,recordAuditEvent:s}=t(),c=o.find(e=>e.subscriptionId===n);if(!c)return;let l=new Date(c.validUntil).getTime(),u=(r===`year`?365:30)*24*3600*1e3,d=new Date(Math.max(Date.now(),l)+u).toISOString(),f={...c,period:r,activeModules:i,status:`normal`,validUntil:d,renewsAt:d,graceUntil:null,history:[{eventAt:new Date().toISOString(),type:`renewed`,description:`Продление тарифа на ${r===`year`?`1 год`:`1 месяц`}`,actor:t().activeOperator.name},...c.history]};await K(`subscriptions`,f),e(e=>({subscriptions:e.subscriptions.map(e=>e.subscriptionId===n?f:e)})),await s({action:`subscription.renewed`,target:{type:`subscription`,id:n,displayName:c.tenantName,tenantId:c.tenantId},reason:a,impactSummary:`Продление подписки до ${d.slice(0,10)}, активных модулей: ${i.length}`})},createIncidentFromAlert:async(n,r,i,a)=>{let{servers:o,instances:s,recordAuditEvent:c,incidents:l}=t(),u=o.find(e=>e.serverId===n),d=s.filter(e=>e.serverId===n).map(e=>e.tenantId),f=Array.from(new Set(s.filter(e=>e.serverId===n).map(e=>e.moduleId))),p=`INC-${1050+l.length}`,m=`inc-${Date.now().toString(36)}`,h=new Date().toISOString(),g={incidentId:m,incidentNumber:p,severity:i,status:`open`,summary:r,description:`Инцидент открыт оператором из телеметрического оповещения узла ${u?u.name:n}.`,affectedTenantIds:d,affectedServerIds:[n],affectedModuleIds:f,ownerName:t().activeOperator.name,openedAt:h,timeline:[{timestamp:h,author:t().activeOperator.name,message:`Инцидент зарегистрирован в системе. Причина: ${a}`}]};await K(`incidents`,g),e(e=>({incidents:[g,...e.incidents]})),await c({action:`incident.created`,target:{type:`incident`,id:m,displayName:`${p} (${r})`},reason:a,impactSummary:`Создан инцидент ${p} со степенью критичности ${i}`})},resolveIncident:async(n,r)=>{let{incidents:i,recordAuditEvent:a,activeOperator:o}=t(),s=i.find(e=>e.incidentId===n);if(!s)return;let c=new Date().toISOString(),l={...s,status:`resolved`,resolvedAt:c,timeline:[...s.timeline,{timestamp:c,author:o.name,message:`Инцидент переведен в статус resolved. Решение: ${r}`}]};await K(`incidents`,l),e(e=>({incidents:e.incidents.map(e=>e.incidentId===n?l:e)})),await a({action:`incident.resolved`,target:{type:`incident`,id:n,displayName:s.incidentNumber},reason:r,impactSummary:`Инцидент ${s.incidentNumber} успешно разрешен`})},createAnnouncement:async(n,r)=>{let{recordAuditEvent:i,activeOperator:a,organizations:o}=t(),s=`anc-${Date.now().toString(36)}`,c=new Date().toISOString(),l=o.length;n.audience.tenantIds&&n.audience.tenantIds.length>0&&(l=n.audience.tenantIds.length);let u={...n,announcementId:s,createdAt:c,author:a.name,stats:{totalTargeted:l,queued:l,delivered:0,failed:0}};await K(`announcements`,u),e(e=>({announcements:[u,...e.announcements]})),await i({action:`announcement.created`,target:{type:`announcement`,id:s,displayName:n.title},reason:r,impactSummary:`Создано оповещение «${n.title}» для ${l} организаций`})},triggerRolloutStage:async(n,r,i,a)=>{let{rollouts:o,recordAuditEvent:s}=t(),c=o.find(e=>e.rolloutId===n);if(!c)return;let l={...c,stage:r,percentage:i,updatedAt:new Date().toISOString()};await K(`rollouts`,l),e(e=>({rollouts:e.rollouts.map(e=>e.rolloutId===n?l:e)})),await s({action:`rollout.stage_${r}`,target:{type:`rollout`,id:n,displayName:`${c.moduleName} ${c.targetVersion}`},reason:a,impactSummary:`Раскатка переведена в стадию «${r}» (${i}%)`})},createRollout:async(n,r,i,a,o,s,c)=>{let{modules:l,recordAuditEvent:u}=t(),d=l.find(e=>e.moduleId===n),f=`rol-${Date.now().toString(36)}`,p=new Date().toISOString(),m={rolloutId:f,moduleId:n,moduleName:d?d.name:n,targetVersion:r,stage:i,pilotTenantIds:a,percentage:o,startedAt:p,updatedAt:p,notes:s};await K(`rollouts`,m),e(e=>({rollouts:[m,...e.rollouts]})),await u({action:`rollout.created`,target:{type:`rollout`,id:f,displayName:`${m.moduleName} ${r}`},reason:c,impactSummary:`Инициирован конвейер раскатки ${m.moduleName} ${r} (стадия ${i})`})},requestServerDiagnostics:async(e,n)=>{let{servers:r,recordAuditEvent:i}=t(),a=r.find(t=>t.serverId===e);a&&await i({action:`infrastructure.diagnostics_requested`,target:{type:`infrastructure`,id:e,displayName:a.name},reason:n,impactSummary:`Запрошен полный дамп телеметрии и логов с узла ${a.name}`})},scheduleServerMaintenance:async(e,n)=>{let{servers:r,recordAuditEvent:i}=t(),a=r.find(t=>t.serverId===e);a&&await i({action:`infrastructure.maintenance_scheduled`,target:{type:`infrastructure`,id:e,displayName:a.name},reason:n,impactSummary:`Запланировано регламентное техническое обслуживание для узла ${a.name}`})},addServerNode:async(n,r)=>{let{recordAuditEvent:i}=t(),a=`srv-${Date.now().toString(36)}`,o=new Date().toISOString(),s={serverId:a,name:n.name,hostname:n.hostname,ipAddress:n.ipAddress,hostingProvider:n.hostingProvider,region:n.region,status:`healthy`,agentVersion:`1.4.2`,agentStatus:`enrolled`,certificateExpiresAt:new Date(Date.now()+31536e6).toISOString(),certificateDaysRemaining:365,cpuLoadPercent:12,ramUsedBytes:3221225472,ramTotalBytes:17179869184,diskUsedBytes:21474836480,diskTotalBytes:161061273600,inodeUsedPercent:18,networkRxBytesPerSec:12e5,networkTxBytesPerSec:18e5,uptimeSeconds:60,latencyMs:15,deployedInstancesCount:0,lastSeenAt:o,backup:{state:`ok`,lastSuccessfulAt:o,sizeBytes:1073741824,encryptedExternalCopy:!0,targetProvider:`${n.hostingProvider} S3 Cold`},restoreDrill:{state:`passed`,lastAttemptAt:o,verifiedAt:o,drillDurationSeconds:600},sshConfig:{...n.sshConfig,lastConnectedAt:o,status:`connected`}};return await K(`servers`,s),e(e=>({servers:[s,...e.servers]})),await i({action:`infrastructure.server_connected`,target:{type:`infrastructure`,id:a,displayName:s.name},reason:r,impactSummary:`Подключен новый инфраструктурный узел ${s.name} (${s.ipAddress}) по SSH (порт ${s.sshConfig?.port||22}, польз. ${s.sshConfig?.username||`root`})`}),s},updateServerSshConfig:async(n,r,i)=>{let{servers:a,recordAuditEvent:o}=t(),s=a.find(e=>e.serverId===n);if(!s)return;let c={port:22,username:`root`,authMethod:`key`,status:`connected`,...s.sshConfig,...r},l={...s,sshConfig:c};await K(`servers`,l),e(e=>({servers:e.servers.map(e=>e.serverId===n?l:e)})),await o({action:`infrastructure.ssh_config_updated`,target:{type:`infrastructure`,id:n,displayName:s.name},reason:i,impactSummary:`Обновлены параметры SSH-подключения для узла ${s.name}: порт ${c.port}, пользователь ${c.username}, аутентификация ${c.authMethod}`})},executeTerminalCommand:async(e,n)=>{let{servers:r,recordAuditEvent:i}=t(),a=r.find(t=>t.serverId===e),o=n.trim(),s=o.toLowerCase(),c=``;return c=s===`uptime`?`${new Date().toTimeString().split(` `)[0]} up 91 days, 4:12, 1 user, load average: 0.24, 0.31, 0.28`:s===`docker ps`||s.startsWith(`docker ps `)?`CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a1b2c3d4e5f6 krona-reverse-proxy:latest "/entrypoint.sh cadd…" 3 weeks ago Up 3 weeks 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp krona-reverse-proxy
f7e8d9c0b1a2 krona-control-center:demo "nginx -g 'daemon of…" 2 days ago Up 2 days 0.0.0.0:8080->80/tcp kccdemo-web
b3c4d5e6f7a8 krona-core-api:1.4.2 "node dist/server.js" 10 days ago Up 10 days 127.0.0.1:3000->3000/tcp krona-core
c5d6e7f8a9b0 postgres:16-alpine "docker-entrypoint.s…" 2 months ago Up 2 months 127.0.0.1:5432->5432/tcp krona-postgres`:s.startsWith(`free`)?` total used free shared buff/cache available
Mem: 16Gi 6.4Gi 7.8Gi 142Mi 1.8Gi 9.2Gi
Swap: 4.0Gi 180Mi 3.8Gi`:s.startsWith(`df`)?`Filesystem Size Used Avail Use% Mounted on
/dev/vda1 148G 50G 92G 35% /
devtmpfs 7.8G 0 7.8G 0% /dev
tmpfs 7.9G 0 7.9G 0% /dev/shm
/dev/vdb1 200G 24G 166G 13% /mnt/backups`:s.includes(`systemctl status`)?`● krona.service - Krona Business OS Platform Daemon
Loaded: loaded (/etc/systemd/system/krona.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2026-06-11 14:32:00 MSK; 91 days ago
Main PID: 1248 (krona-orchestra)
Tasks: 28 (limit: 19124)
Memory: 412.0M
CPU: 1h 24min 12.441s
CGroup: /system.slice/krona.service
└─1248 /usr/local/bin/krona-orchestrator --config /etc/krona/daemon.yaml`:s.includes(`docker logs`)?`{"level":"info","ts":1789091800,"logger":"tls.obtain","msg":"certificate valid","identifier":"kccdemo.ochenstarik.ru"}
{"level":"info","ts":1789092110,"logger":"http.log.access","msg":"handled request","request":{"remote_ip":"178.212.13.102","method":"GET","uri":"/control/infrastructure","proto":"HTTP/2.0"},"status":200}
{"level":"info","ts":1789092115,"logger":"tls.cache","msg":"cleaned expired certificates","count":0}
{"level":"info","ts":1789092200,"logger":"admin.api","msg":"received telemetry ping","source":"node-spb-01"}`:s===`uname -a`?`Linux ${a?.hostname||`node-spb-01.infra.krona.systems`} 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC x86_64 x86_64 x86_64 GNU/Linux`:s===`whoami`?a?.sshConfig?.username||`krona`:s===`hostname`?a?.hostname||`node-spb-01.infra.krona.systems`:s.includes(`os-release`)?`PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
ID=ubuntu`:s===`clear`?``:`[${a?.sshConfig?.username||`krona`}@${a?.name||`server`}:~]$ ${o}\nВыполнено успешно (exit code: 0)`,a&&s!==`clear`&&await i({action:`infrastructure.terminal_command`,target:{type:`infrastructure`,id:e,displayName:a.name},reason:`Выполнение оператором команды в интерактивном терминале`,impactSummary:`Выполнена команда \`${o}\` на узле ${a.name} (${a.ipAddress})`}),{output:c,exitCode:0}},resetToDefaults:async()=>{await t().initialize(!0)}}));function nd(){let e=Y(e=>e.activeRole),t=Y(e=>e.activeOperator),n=Hu[e];return{role:e,operator:t,definition:n,permissions:n.permissions}}var rd={platform_owner:{label:`Владелец платформы`,shortLabel:`Владелец`,description:`Полный доступ ко всей инфраструктуре, биллингу, лицензиям и управлению платформой`},platform_admin:{label:`Администратор платформы`,shortLabel:`Админ`,description:`Управление организациями, инсталляциями, серверами и техническими параметрами`},support_operator:{label:`Оператор поддержки`,shortLabel:`Поддержка`,description:`Диагностика организаций, сброс кэша, техническая помощь и расследования`},billing_manager:{label:`Менеджер биллинга`,shortLabel:`Биллинг`,description:`Финансовые показатели, тарифы, подписки, продления и льготные периоды`},security_auditor:{label:`Аудитор безопасности`,shortLabel:`Аудитор`,description:`Только чтение: сквозной журнал аудита (SHA-256), события безопасности и логи`},release_manager:{label:`Релиз-инженер`,shortLabel:`Релизы`,description:`Управление версиями модулей, каталогом расширений и плановыми обновлениями`}},id={critical:{label:`Критическая авария`,short:`Критическая`},high:{label:`Высокая важность`,short:`Высокая`},medium:{label:`Средняя важность`,short:`Средняя`},low:{label:`Низкая важность`,short:`Низкая`},P0_CRITICAL:{label:`P0 Критическая авария`,short:`P0 Критическая`},P1_MAJOR:{label:`P1 Серьёзный инцидент`,short:`P1 Серьёзный`},P2_DEGRADED:{label:`P2 Ограничение работы`,short:`P2 Деградация`},P3_INFO:{label:`P3 Информационный`,short:`P3 Инфо`}},ad={open:`Открыт`,mitigating:`Устраняется`,resolved:`Устранён`,investigating:`Расследуется`,identified:`Локализован`,monitoring:`Мониторинг устранения`},od={suspend_tenant:`Приостановка организации`,resume_tenant:`Возобновление организации`,drain_node:`Вывод сервера на обслуживание (Drain)`,enable_maintenance:`Включение режима тех. обслуживания`,disable_maintenance:`Выключение режима тех. обслуживания`,grant_grace_period:`Предоставление льготного периода`,restart_gateway:`Перезапуск шлюза обмена`,invalidate_cache:`Инвалидация распределённого кэша`,rollback_module:`Откат версии модуля`,circuit_breaker_trip:`Аварийное срабатывание Circuit Breaker`,circuit_breaker_reset:`Восстановление связи мониторинга`},sd={core:`Базовые модули`,trade:`Торговля и продажи`,kitchen:`Кухня и производство`,finance:`Финансы и учёт`,management:`Управление персоналом`,analytics:`Аналитика и AI`},cd={web:`Веб-версия`,desktop:`Компьютеры (Desktop)`,android:`Android-устройства`},ld={"soft-light":`Мягкая светлая`,light:`Классическая светлая`,dark:`Тёмная`},ud={draft:`Черновик`,pilot:`Пилот (15%)`,percentage:`Раскатка (50%)`,general_availability:`Полный релиз (100%)`,paused:`На паузе`,rolled_back:`Откат`},dd={supported:`Поддерживается`,outdated:`Устарела`,blocked:`Заблокирована`,revoked:`Отозвана`},fd={normal:`Обычный`,important:`Важный`,critical:`Критический`},X={brand:`Krona Control Center`,tagline:`Кабинет оператора платформы`,scope:`Контур платформы`,productionScope:`Боевой контур (Production)`,gateTitle:`Защита доступа оператора`,gateSubtitle:`Демонстрационный стенд закрытого кабинета оператора платформы`,gatePinPlaceholder:`Введите код доступа (например: krona2026 или 8492)...`,gateSubmit:`Войти в консоль оператора`,gateDemoLogin:`Быстрый демо-вход в 1 клик (Режим ревьюера)`,gateError:`Неверный код доступа. Попробуйте krona2026 или 8492.`,forbiddenTitle:`Доступ ограничен политикой безопасности`,forbiddenDescription:`У текущей роли оператора недостаточно прав для выполнения этого действия.`,forbiddenBack:`Вернуться в Обзор`,nav:{overview:`Обзор`,organizations:`Организации`,incidents:`Инциденты`,servers:`Серверы`,more:`Ещё`,billing:`Подписки и платежи`,modules:`Каталог модулей`,installations:`Установки`,announcements:`Оповещения`,audit:`Журнал аудита`,settings:`Настройки оператора`},overviewTabs:{attention:`Требует внимания`,metrics:`Показатели`,infrastructure:`Инфраструктура`},filters:{title:`Фильтры`,apply:`Применить`,reset:`Сбросить фильтры`,searchPlaceholder:`Поиск...`,statusAll:`Все статусы`,roleAll:`Все роли`},inspector:{title:`Инспектор объекта 360°`,tabOverview:`Сводка`,tabModules:`Модули`,tabInstallations:`Установки`,tabBilling:`Биллинг`,close:`Закрыть`},system:{synced:`Синхронизировано`,syncing:`Синхронизация...`,nodeLabel:`Узел`,resetDemo:`Сбросить демоданные`,simulateOutage:`Имитировать сбой мониторинга`,restoreMonitoring:`Восстановить мониторинг`,themeLabel:`Тема оформления`,exitToClient:`Перейти в Krona Business OS`,operatorProfile:`Профиль оператора`},connectServer:{title:`Подключение нового сервера`,step1:`Параметры узла`,step2:`Настройка SSH`,step3:`Проверка связи`,serverName:`Название сервера`,serverNamePlaceholder:`например, vps-sel-msk-worker-01`,hostname:`Сетевое имя (FQDN)`,hostnamePlaceholder:`node-worker-01.infra.krona.systems`,ipAddress:`IP-адрес`,ipAddressPlaceholder:`178.212.13.102`,provider:`Провайдер хостинга`,region:`Регион / ДЦ`,regionPlaceholder:`ru-spb-1 или msk-dc1`,sshPort:`SSH порт`,sshUser:`Пользователь SSH`,authMethod:`Метод аутентификации`,authKey:`SSH-ключ (рекомендуется)`,authPassword:`Пароль (fallback)`,publicKey:`Публичный ключ SSH`,generateKey:`Сгенерировать ed25519 ключ`,copyKey:`Скопировать публичный ключ`,testConnection:`Проверить SSH-соединение`,connecting:`Проверка соединения с сервером...`,connectionSuccess:`SSH-соединение успешно установлено (RTT: 14ms, OpenSSH 9.3)`,connectionFailed:`Не удалось установить соединение по SSH`,finish:`Подключить сервер`,cancel:`Отмена`,next:`Далее`,back:`Назад`},terminal:{title:`Терминал сервера`,connectedTo:`Подключено к`,placeholder:`Введите bash команду (например: docker ps, uptime, free -h)...`,clear:`Очистить экран`,copy:`Копировать вывод`,copied:`Скопировано в буфер`,close:`Закрыть терминал`,quickActions:`Быстрые команды диагностики`,executing:`Выполнение команды...`,enterPrompt:`Нажмите Enter для отправки`}},pd=[{cmd:`uptime`,label:`Аптайм и нагрузка`},{cmd:`docker ps`,label:`Docker контейнеры`},{cmd:`free -h`,label:`Использование RAM`},{cmd:`df -h`,label:`Свободное место`},{cmd:`systemctl status krona`,label:`Статус Krona`},{cmd:`docker logs --tail 20 krona-reverse-proxy`,label:`Логи Reverse Proxy`}],Z=X,md=({onRoleChange:e,variant:t=`full`})=>{let{role:n,operator:r}=nd(),i=Y(e=>e.setActiveRole),[a,o]=(0,j.useState)(!1),s=(0,j.useRef)(null);(0,j.useEffect)(()=>{let e=e=>{s.current&&!s.current.contains(e.target)&&o(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]);let c=[`platform_owner`,`platform_admin`,`support_operator`,`billing_manager`,`security_auditor`,`release_manager`],l=t=>{i(t),o(!1),e?.(t)},u=rd[n]||{label:n,shortLabel:n,description:``};return(0,U.jsxs)(`div`,{className:`relative inline-block text-left`,ref:s,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>o(!a),className:`flex items-center gap-2 px-3 py-2 min-h-[44px] rounded-lg border border-krona-gold/30 bg-krona-gold/10 hover:bg-krona-gold/20 text-krona-gold-text transition-colors text-xs font-medium focus:outline-hidden focus:ring-2 focus:ring-krona-gold`,"aria-expanded":a,"aria-haspopup":`true`,"aria-label":`Сессия оператора`,title:`Сменить роль оператора платформы (RBAC)`,"data-testid":`operator-session-button`,children:[(0,U.jsx)(Rc,{className:`w-4 h-4 text-krona-gold shrink-0`}),(0,U.jsxs)(`div`,{className:`text-left leading-tight`,children:[t===`full`&&(0,U.jsx)(`div`,{className:`font-bold text-krona-primary hidden sm:block`,children:r.name}),(0,U.jsx)(`div`,{className:`text-[11px] text-krona-gold font-semibold uppercase tracking-wider`,children:u.label})]}),(0,U.jsx)(Bo,{className:`w-3.5 h-3.5 text-krona-gold transition-transform ${a?`rotate-180`:``}`})]}),a&&(0,U.jsxs)(`div`,{className:`absolute right-0 mt-2 w-80 max-w-[calc(100vw-2rem)] rounded-xl border border-krona-border bg-krona-surface shadow-2xl z-50 p-2 text-krona-primary animate-in fade-in slide-in-from-top-2 duration-150`,role:`menu`,children:[(0,U.jsxs)(`div`,{className:`px-3 py-2 border-b border-krona-border text-xs text-krona-secondary`,children:[(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Роль оператора (RBAC)`}),(0,U.jsx)(`p`,{className:`text-[11px] text-krona-tertiary mt-0.5`,children:`Выберите роль для проверки разграничения прав доступа:`})]}),(0,U.jsx)(`div`,{className:`py-1 space-y-1 max-h-72 overflow-y-auto`,children:c.map(e=>{let t=rd[e],r=e===n;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l(e),className:`w-full text-left px-3 py-2.5 min-h-[44px] rounded-lg text-xs transition-colors flex items-start gap-2.5 ${r?`bg-krona-gold/15 text-krona-gold font-semibold border border-krona-gold/30`:`hover:bg-krona-hover text-krona-secondary hover:text-krona-primary`}`,role:`menuitem`,"data-testid":`role-option-${e}`,children:[(0,U.jsx)(Qo,{className:`w-4 h-4 mt-0.5 shrink-0 ${r?`text-krona-gold`:`text-krona-tertiary`}`}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`font-medium text-krona-primary`,children:t.label}),r&&(0,U.jsx)(`span`,{className:`text-[10px] bg-krona-gold/20 text-krona-gold px-1.5 py-0.2 rounded font-mono`,children:`Текущая`})]}),(0,U.jsx)(`p`,{className:`text-[11px] text-krona-tertiary mt-0.5 line-clamp-2`,children:t.description})]})]},e)})})]})]})},hd=({status:e,customLabel:t,size:n=`md`})=>{let r=n===`sm`,i=r?`w-3 h-3`:`w-3.5 h-3.5`,a={active:{label:`Активна`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,U.jsx)(Xo,{className:i,"aria-hidden":`true`})},trial:{label:`Пробный период`,className:`bg-status-info-soft text-status-info-text border-status-info-border`,icon:(0,U.jsx)(ns,{className:i,"aria-hidden":`true`})},grace:{label:`Льготный период`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,U.jsx)(fl,{className:i,"aria-hidden":`true`})},suspended:{label:`Приостановлена`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,U.jsx)(es,{className:i,"aria-hidden":`true`})},closed:{label:`Закрыта`,className:`bg-krona-muted text-krona-secondary border-krona-border`,icon:(0,U.jsx)(es,{className:i,"aria-hidden":`true`})},normal:{label:`Оплачена`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,U.jsx)(Xo,{className:i,"aria-hidden":`true`})},overdue:{label:`Просрочена`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,U.jsx)(es,{className:i,"aria-hidden":`true`})},expiring_7d:{label:`Истекает (< 7 дн.)`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border font-semibold`,icon:(0,U.jsx)(ns,{className:i,"aria-hidden":`true`})},expiring_30d:{label:`Истекает (< 30 дн.)`,className:`bg-status-info-soft text-status-info-text border-status-info-border`,icon:(0,U.jsx)(ns,{className:i,"aria-hidden":`true`})},healthy:{label:`Работает нормально`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,U.jsx)(Xo,{className:i,"aria-hidden":`true`})},degraded:{label:`Деградация`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,U.jsx)(fl,{className:i,"aria-hidden":`true`})},warning:{label:`Предупреждение`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,U.jsx)(fl,{className:i,"aria-hidden":`true`})},critical:{label:`Критическое состояние`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border font-semibold animate-pulse`,icon:(0,U.jsx)(Ic,{className:i,"aria-hidden":`true`})},offline:{label:`Недоступен`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,U.jsx)(bc,{className:i,"aria-hidden":`true`})},unknown:{label:`Неизвестно`,className:`bg-krona-muted text-krona-secondary border-krona-border`,icon:(0,U.jsx)(bc,{className:i,"aria-hidden":`true`})},supported:{label:`Поддерживается`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,U.jsx)(Xo,{className:i,"aria-hidden":`true`})},outdated:{label:`Устарела`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,U.jsx)(Jc,{className:i,"aria-hidden":`true`})},blocked:{label:`Заблокирована`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,U.jsx)(es,{className:i,"aria-hidden":`true`})},revoked:{label:`Отозвана`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,U.jsx)(es,{className:i,"aria-hidden":`true`})},pilot:{label:`Пилот (Pilot)`,className:`bg-status-info-soft text-status-info-text border-status-info-border`,icon:(0,U.jsx)(wl,{className:i,"aria-hidden":`true`})},draft:{label:`Черновик (Draft)`,className:`bg-krona-muted text-krona-secondary border-krona-border`,icon:(0,U.jsx)(ns,{className:i,"aria-hidden":`true`})},percentage:{label:`Поэтапный релиз`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,U.jsx)(wl,{className:i,"aria-hidden":`true`})},general_availability:{label:`Общая доступность (GA)`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,U.jsx)(Xo,{className:i,"aria-hidden":`true`})},paused:{label:`Приостановлен`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,U.jsx)(fl,{className:i,"aria-hidden":`true`})},rolled_back:{label:`Отозван (Rollback)`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border`,icon:(0,U.jsx)(es,{className:i,"aria-hidden":`true`})},open:{label:`Открыт`,className:`bg-status-danger-soft text-status-danger-text border-status-danger-border font-semibold`,icon:(0,U.jsx)(Ic,{className:i,"aria-hidden":`true`})},mitigating:{label:`Устраняется`,className:`bg-status-warning-soft text-status-warning-text border-status-warning-border`,icon:(0,U.jsx)(Mc,{className:i,"aria-hidden":`true`})},resolved:{label:`Устранён`,className:`bg-status-success-soft text-status-success-text border-status-success-border`,icon:(0,U.jsx)(Xo,{className:i,"aria-hidden":`true`})}}[e]||{label:e,className:`bg-krona-muted text-krona-secondary border-krona-border`,icon:(0,U.jsx)(bc,{className:i,"aria-hidden":`true`})},o=t||a.label;return(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 font-medium transition-colors ${r?`text-xs py-0.5 px-2`:`text-xs`} ${a.className}`,"data-testid":`status-badge`,"data-status":e,children:[a.icon,(0,U.jsx)(`span`,{children:o})]})},gd=({minorUnits:e,currency:t=`RUB`,className:n=``,showZeroAsFree:r=!1})=>{if(r&&e===0)return(0,U.jsx)(`span`,{className:`text-emerald-400 font-medium ${n}`,children:`0 ₽ (Бесплатно / Trial)`});let i=e/100,a=new Intl.NumberFormat(`ru-RU`,{style:`currency`,currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(i);return(0,U.jsx)(`span`,{className:`tabular-nums font-medium ${n}`,children:a})},_d=({status:e,count:t=24,className:n=``})=>{let r=Array.from({length:t},(n,r)=>r===t-1?e:e===`offline`?r>=t-4?`offline`:r>=t-8?`warning`:`healthy`:e===`critical`?r>=t-3?`critical`:r>=t-6?`warning`:`healthy`:e===`warning`?r>=t-2?`warning`:`healthy`:r===7||r===18?`warning`:`healthy`),i=e=>{switch(e){case`healthy`:return`bg-emerald-500 hover:bg-emerald-400`;case`warning`:case`degraded`:return`bg-amber-400 hover:bg-amber-300`;case`critical`:return`bg-rose-500 hover:bg-rose-400`;case`offline`:return`bg-zinc-700 hover:bg-zinc-600`;default:return`bg-zinc-600`}};return(0,U.jsx)(`div`,{className:`flex items-center gap-1 ${n}`,title:`Heartbeat status: ${e}`,children:r.map((e,n)=>(0,U.jsx)(`div`,{className:`h-4 w-1.5 rounded-xs transition-all duration-150 ${i(e)}`,title:`Интервал -${t-1-n}h: ${e}`},n))})};function vd(e){return[{id:`init`,command:`ssh -p ${e.sshConfig?.port||22} ${e.sshConfig?.username||`krona`}@${e.ipAddress}`,output:`Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-40-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of ${new Date().toUTCString()}:\n System load: ${(e.cpuLoadPercent/100).toFixed(2)} Processes: 164\n Usage of /: ${Math.round(e.diskUsedBytes/e.diskTotalBytes*100)}% of ${Math.round(e.diskTotalBytes/1073741824)}GB Users logged in: 1\n Memory usage: ${Math.round(e.ramUsedBytes/e.ramTotalBytes*100)}% of ${Math.round(e.ramTotalBytes/1073741824)}GB IP address for eth0: ${e.ipAddress}\n\nLast login: ${e.sshConfig?.lastConnectedAt?new Date(e.sshConfig.lastConnectedAt).toLocaleString(`ru-RU`):`recently`} from 178.212.13.102 (mTLS control session)`,exitCode:0,timestamp:new Date().toLocaleTimeString(`ru-RU`)}]}var yd=({server:e,isOpen:t,onClose:n})=>!t||!e?null:(0,U.jsx)(bd,{server:e,onClose:n},e.serverId),bd=({server:e,onClose:n})=>{let r=Y(e=>e.executeTerminalCommand),[i,a]=(0,j.useState)(``),[o,s]=(0,j.useState)(()=>vd(e)),[c,l]=(0,j.useState)(-1),[u,d]=(0,j.useState)([]),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(!1),[g,_]=(0,j.useState)(!1),v=(0,j.useRef)(null),y=(0,j.useRef)(null);(0,j.useEffect)(()=>{v.current?.scrollIntoView?.({behavior:`smooth`})},[o,f]),(0,j.useEffect)(()=>{let e=setTimeout(()=>y.current?.focus(),150);return()=>clearTimeout(e)},[]);let b=async t=>{let n=(t===void 0?i:t).trim();if(n&&!f){if(n.toLowerCase()===`clear`){s([]),a(``);return}p(!0),d(e=>[...e,n]),l(-1),a(``);try{let t=await r(e.serverId,n),i={id:`cmd-${Date.now()}`,command:n,output:t.output,exitCode:t.exitCode,timestamp:new Date().toLocaleTimeString(`ru-RU`)};s(e=>[...e,i])}finally{p(!1)}}},x=e=>{if(e.key===`Enter`)e.preventDefault(),b();else if(e.key===`ArrowUp`){if(e.preventDefault(),u.length===0)return;let t=c===-1?u.length-1:Math.max(0,c-1);l(t),a(u[t]||``)}else if(e.key===`ArrowDown`){if(e.preventDefault(),c===-1)return;let t=c+1;t>=u.length?(l(-1),a(``)):(l(t),a(u[t]||``))}},S=()=>{let t=o.map(t=>`[${e.sshConfig?.username||`krona`}@${e.name}:~]$ ${t.command}\n${t.output}`).join(`
`);navigator.clipboard.writeText(t),h(!0),setTimeout(()=>h(!1),2e3)},C=()=>{s([])},w=e.sshConfig?.username||`krona`,T=e.name;return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-2 sm:p-4 bg-black/75 backdrop-blur-xs`,"data-testid":`server-terminal-modal`,children:(0,U.jsxs)(`div`,{className:`relative w-full flex flex-col bg-gray-950 border border-gray-800 rounded-2xl shadow-2xl overflow-hidden text-gray-200 transition-all duration-200 ${g?`h-full max-h-screen`:`max-w-4xl h-[85vh] max-h-[750px]`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 bg-gray-900 border-b border-gray-800 shrink-0 select-none`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,U.jsx)(`span`,{className:`w-3 h-3 rounded-full bg-rose-500/80 inline-block`}),(0,U.jsx)(`span`,{className:`w-3 h-3 rounded-full bg-amber-500/80 inline-block`}),(0,U.jsx)(`span`,{className:`w-3 h-3 rounded-full bg-emerald-500/80 inline-block`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0 ml-1`,children:[(0,U.jsx)(il,{className:`w-4 h-4 text-emerald-400 shrink-0`}),(0,U.jsxs)(`span`,{className:`text-xs font-semibold text-gray-200 truncate`,children:[w,`@`,T]}),(0,U.jsxs)(`span`,{className:`hidden sm:inline-block text-[11px] font-mono text-gray-500 truncate`,children:[`(`,e.ipAddress,`:`,e.sshConfig?.port||22,`)`]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:S,title:Z.terminal.copy,className:`min-h-[44px] min-w-[44px] p-2 text-gray-400 hover:text-gray-200 rounded-lg hover:bg-gray-800 flex items-center justify-center transition-colors`,children:m?(0,U.jsx)(Ro,{className:`w-4 h-4 text-emerald-400`}):(0,U.jsx)(os,{className:`w-4 h-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:C,title:Z.terminal.clear,className:`min-h-[44px] min-w-[44px] p-2 text-gray-400 hover:text-gray-200 rounded-lg hover:bg-gray-800 flex items-center justify-center transition-colors`,children:(0,U.jsx)(ol,{className:`w-4 h-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>_(e=>!e),title:g?`Свернуть`:`Развернуть`,className:`hidden sm:flex min-h-[44px] min-w-[44px] p-2 text-gray-400 hover:text-gray-200 rounded-lg hover:bg-gray-800 items-center justify-center transition-colors`,children:g?(0,U.jsx)(nc,{className:`w-4 h-4`}):(0,U.jsx)(Ks,{className:`w-4 h-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:n,title:Z.terminal.close,className:`min-h-[44px] min-w-[44px] p-2 text-gray-400 hover:text-rose-400 rounded-lg hover:bg-gray-800 flex items-center justify-center transition-colors`,children:(0,U.jsx)(t,{className:`w-5 h-5`})})]})]}),(0,U.jsxs)(`div`,{className:`px-3 py-2 bg-gray-900/60 border-b border-gray-800/80 flex items-center gap-1.5 overflow-x-auto shrink-0 no-scrollbar`,children:[(0,U.jsxs)(`span`,{className:`text-[10px] text-gray-500 uppercase tracking-wider font-semibold shrink-0 mr-1 flex items-center gap-1`,children:[(0,U.jsx)(mo,{className:`w-3 h-3 text-sky-400`}),(0,U.jsx)(`span`,{children:`Команды:`})]}),pd.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>b(e.cmd),disabled:f,className:`min-h-[44px] px-2.5 py-1 rounded-lg bg-gray-800 hover:bg-gray-700 text-gray-300 hover:text-emerald-300 text-[11px] font-mono border border-gray-700/60 transition-colors shrink-0 disabled:opacity-50 flex items-center justify-center`,children:e.cmd},e.cmd))]}),(0,U.jsxs)(`div`,{className:`flex-1 p-3 sm:p-4 overflow-y-auto font-mono text-xs sm:text-[13px] leading-relaxed space-y-3 bg-gray-950 text-gray-300 select-text`,onClick:()=>y.current?.focus(),children:[o.map(e=>(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-emerald-400 flex-wrap`,children:[(0,U.jsxs)(`span`,{className:`text-emerald-500 font-bold`,children:[w,`@`,T]}),(0,U.jsx)(`span`,{className:`text-gray-500`,children:`:`}),(0,U.jsx)(`span`,{className:`text-sky-400`,children:`~`}),(0,U.jsx)(`span`,{className:`text-gray-400`,children:`$`}),(0,U.jsx)(`span`,{className:`text-gray-100 font-bold`,children:e.command}),(0,U.jsx)(`span`,{className:`ml-auto text-[10px] text-gray-600 font-sans`,children:e.timestamp})]}),e.output&&(0,U.jsx)(`pre`,{className:`text-gray-300 whitespace-pre-wrap break-all font-mono pl-2 border-l-2 border-gray-800/80`,children:e.output})]},e.id)),f&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-gray-500 py-1`,children:[(0,U.jsx)(Bs,{className:`w-3.5 h-3.5 animate-spin text-emerald-400`}),(0,U.jsx)(`span`,{className:`text-xs`,children:Z.terminal.executing})]}),(0,U.jsx)(`div`,{ref:v})]}),(0,U.jsx)(`div`,{className:`p-3 bg-gray-900 border-t border-gray-800 shrink-0`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 bg-gray-950 border border-gray-700 rounded-xl px-3 py-1.5 focus-within:border-emerald-500 transition-colors`,children:[(0,U.jsxs)(`span`,{className:`text-emerald-500 font-bold text-xs font-mono shrink-0 select-none`,children:[w,`@`,T,`:$`]}),(0,U.jsx)(`input`,{ref:y,type:`text`,value:i,onChange:e=>a(e.target.value),onKeyDown:x,disabled:f,placeholder:Z.terminal.placeholder,className:`flex-1 bg-transparent text-gray-100 text-xs sm:text-sm font-mono focus:outline-hidden min-h-[44px]`,"data-testid":`terminal-input`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>b(),disabled:!i.trim()||f,className:`min-h-[44px] min-w-[44px] p-2 text-gray-400 hover:text-emerald-400 rounded-lg hover:bg-gray-800 disabled:opacity-30 transition-colors flex items-center justify-center shrink-0`,title:Z.terminal.enterPrompt,children:(0,U.jsx)(cs,{className:`w-4 h-4`})})]})})]})})},xd=()=>{let e=Y(e=>e.inspectorTarget),n=Y(e=>e.closeInspector),{permissions:r}=nd(),i=Y(e=>e.organizations),a=Y(e=>e.servers),o=Y(e=>e.incidents),s=Y(e=>e.modules),c=Y(e=>e.installations),l=Y(e=>e.subscriptions),u=Y(e=>e.instances),d=Y(e=>e.auditLog),f=Y(e=>e.openConfirmModal),p=Y(e=>e.updateOrganizationStatus),m=Y(e=>e.grantModuleTrial),h=Y(e=>e.resolveIncident),g=Y(e=>e.requestServerDiagnostics),_=Y(e=>e.scheduleServerMaintenance),[v,y]=(0,j.useState)(`overview`),[b,x]=(0,j.useState)(`krona-omnichannel`),[S,C]=(0,j.useState)(14),[w,T]=(0,j.useState)(!1);return e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/60 backdrop-blur-xs transition-opacity`,onClick:n,"aria-hidden":`true`}),(0,U.jsxs)(`div`,{className:`fixed inset-y-0 right-0 z-50 w-full sm:max-w-xl bg-krona-surface border-l border-krona-border shadow-2xl flex flex-col text-krona-primary animate-in slide-in-from-right duration-200`,role:`complementary`,"aria-label":`Контекстный инспектор`,children:[(0,U.jsxs)(`div`,{className:`px-5 md:px-6 py-4 border-b border-krona-border flex items-center justify-between bg-krona-workspace/80`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-semibold text-krona-secondary uppercase tracking-wider`,children:[(0,U.jsx)(mo,{className:`w-4 h-4 text-amber-500`}),(0,U.jsx)(`span`,{children:`Контекстный инспектор объекта`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:n,className:`min-w-[44px] min-h-[44px] rounded-lg flex items-center justify-center text-krona-secondary hover:bg-krona-workspace hover:text-krona-primary transition-colors`,"aria-label":`Закрыть инспектор`,children:(0,U.jsx)(t,{className:`w-5 h-5`})})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4 md:p-6`,children:(()=>{switch(e.type){case`organization`:{let t=i.find(t=>t.tenantId===e.id);if(!t)return(0,U.jsx)(`div`,{className:`p-6 text-krona-secondary`,children:`Организация не найдена`});let n=l.find(e=>e.tenantId===t.tenantId),a=u.filter(e=>e.tenantId===t.tenantId),h=c.filter(e=>e.tenantId===t.tenantId),g=o.filter(e=>e.affectedTenantIds.includes(t.tenantId)),_=d.filter(e=>e.target.tenantId===t.tenantId||e.target.id===t.tenantId),w=e=>{f({title:`Смена статуса организации: ${t.displayName}`,actionName:`organization.status_changed -> ${e}`,impactSummary:`Доступ всех ${t.userCount} пользователей к платформе будет переведен в состояние «${e}».`,targetType:`organization`,targetId:t.tenantId,targetName:t.displayName,onConfirm:async n=>{await p(t.tenantId,e,n)}})};return(0,U.jsxs)(`div`,{className:`space-y-6`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,U.jsx)(hd,{status:t.platformStatus}),(0,U.jsxs)(`span`,{className:`text-xs text-krona-secondary font-mono`,children:[`ИНН: `,t.inn]})]}),(0,U.jsx)(`h2`,{className:`text-lg font-bold text-krona-primary`,children:t.displayName}),(0,U.jsxs)(`p`,{className:`text-xs text-krona-secondary font-mono`,children:[t.domain,` • ID: `,t.tenantId.slice(0,8),`...`]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl bg-krona-workspace/60 border border-krona-border p-3.5 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`text-xs font-semibold text-krona-primary flex items-center gap-1.5`,children:[(0,U.jsx)(Ic,{className:`w-4 h-4 text-amber-500`}),(0,U.jsx)(`span`,{children:`Действия оператора платформы`})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.platformStatus!==`active`&&(0,U.jsx)(`button`,{disabled:!r.canManagePlatformStatus,onClick:()=>w(`active`),className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30 hover:bg-emerald-500/20 disabled:opacity-40 transition-colors flex items-center justify-center`,children:`Активировать (Active)`}),t.platformStatus!==`grace`&&(0,U.jsx)(`button`,{disabled:!r.canGrantTrialGrace,onClick:()=>w(`grace`),className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/30 hover:bg-amber-500/20 disabled:opacity-40 transition-colors flex items-center justify-center`,children:`Назначить Grace`}),t.platformStatus!==`suspended`&&(0,U.jsx)(`button`,{disabled:!r.canManagePlatformStatus,onClick:()=>w(`suspended`),className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-rose-500/10 text-rose-600 dark:text-rose-400 border border-rose-500/30 hover:bg-rose-500/20 disabled:opacity-40 transition-colors flex items-center justify-center`,children:`Заблокировать (Suspend)`})]}),r.canGrantTrialGrace&&(0,U.jsxs)(`div`,{className:`pt-2 border-t border-krona-border space-y-2 text-xs`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Выдать Trial на модуль:`}),(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2 items-center`,children:[(0,U.jsx)(`select`,{value:b,onChange:e=>x(e.target.value),className:`min-h-[44px] bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 text-krona-primary text-xs focus:outline-hidden focus:ring-1 focus:ring-amber-500`,children:s.map(e=>(0,U.jsx)(`option`,{value:e.moduleId,children:e.name},e.moduleId))}),(0,U.jsxs)(`select`,{value:S,onChange:e=>C(Number(e.target.value)),className:`min-h-[44px] bg-krona-surface border border-krona-border rounded-lg px-2.5 py-1.5 text-krona-primary text-xs focus:outline-hidden focus:ring-1 focus:ring-amber-500`,children:[(0,U.jsx)(`option`,{value:7,children:`7 дней`}),(0,U.jsx)(`option`,{value:14,children:`14 дней`}),(0,U.jsx)(`option`,{value:30,children:`30 дней`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{let e=s.find(e=>e.moduleId===b);f({title:`Выдача Trial: ${e?.name||b}`,actionName:`entitlement.grant_trial (${b})`,impactSummary:`Организации будет предоставлен временный доступ к модулю ${e?.name} на ${S} дней без списания средств.`,targetType:`organization`,targetId:t.tenantId,targetName:t.displayName,onConfirm:async e=>{await m(t.tenantId,b,S,e)}})},className:`min-h-[44px] px-3 py-2 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs transition-colors shrink-0 flex items-center justify-center`,children:`Выдать Trial`})]})]})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-1 border-b border-krona-border overflow-x-auto pb-1 text-xs`,children:[{id:`overview`,label:`Обзор`},{id:`users`,label:`Пользователи (${t.userCount})`},{id:`modules`,label:`Модули (${a.length})`},{id:`installations`,label:`Установки (${h.length})`},{id:`billing`,label:`Платежи`},{id:`incidents`,label:`Инциденты (${g.length})`},{id:`audit`,label:`Аудит`}].map(e=>(0,U.jsx)(`button`,{onClick:()=>y(e.id),className:`min-h-[44px] px-3 py-2 rounded-t-lg font-medium whitespace-nowrap transition-colors flex items-center ${v===e.id?`bg-amber-500/10 text-amber-500 border-b-2 border-amber-500`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-workspace`}`,children:e.label},e.id))}),v===`overview`&&(0,U.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`Тарифный план`}),(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary text-sm`,children:t.tariffPlan})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`MRR доход`}),(0,U.jsx)(gd,{minorUnits:t.mrrMinorUnits,className:`text-sm font-bold text-amber-500`})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`Филиалов / точек`}),(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary text-sm`,children:t.branchCount})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`Задолженность`}),(0,U.jsx)(gd,{minorUnits:t.outstandingDebtMinorUnits,className:`text-sm font-bold ${t.outstandingDebtMinorUnits>0?`text-rose-500`:`text-emerald-500`}`})]})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-krona-workspace/60 border border-krona-border p-3 space-y-2`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Контакты организации:`}),(0,U.jsxs)(`div`,{className:`text-krona-secondary`,children:[`Email: `,(0,U.jsx)(`span`,{className:`text-krona-primary`,children:t.contactEmail})]}),(0,U.jsxs)(`div`,{className:`text-krona-secondary`,children:[`Телефон: `,(0,U.jsx)(`span`,{className:`text-krona-primary`,children:t.contactPhone})]}),(0,U.jsxs)(`div`,{className:`text-krona-secondary`,children:[`Последняя активность: `,(0,U.jsx)(`span`,{className:`text-krona-primary`,children:new Date(t.lastActiveAt).toLocaleString(`ru-RU`)})]}),(0,U.jsxs)(`div`,{className:`text-krona-secondary`,children:[`Окончание подписки: `,(0,U.jsx)(`span`,{className:`text-krona-primary`,children:new Date(t.subscriptionEndAt).toLocaleDateString(`ru-RU`)})]})]})]}),v===`users`&&(0,U.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center mb-2`,children:[(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Пользователи-агрегаты`}),(0,U.jsxs)(`span`,{className:`text-amber-500 font-bold`,children:[t.userCount,` учетных записей`]})]}),(0,U.jsx)(`p`,{className:`text-krona-secondary text-[11px] leading-relaxed`,children:`В соответствии с контрактом безопасности Control Center отображает только деперсонализированные агрегаты тенанта. Персональные данные сотрудников защищены контуром организации.`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-krona-primary`,children:[(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary`,children:`Администраторы`}),(0,U.jsx)(`div`,{className:`font-bold text-sm text-krona-primary`,children:`2`})]}),(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary`,children:`Менеджеры / операторы`}),(0,U.jsx)(`div`,{className:`font-bold text-sm text-krona-primary`,children:Math.max(0,t.userCount-6)})]})]})]}),v===`modules`&&(0,U.jsx)(`div`,{className:`space-y-2 text-xs`,children:a.map(e=>(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:e.moduleName}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-secondary font-mono mt-0.5`,children:[`v`,e.currentVersion,` • `,e.serverName]})]}),(0,U.jsx)(hd,{status:e.health,size:`sm`})]},e.moduleInstanceId))}),v===`installations`&&(0,U.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[h.map(e=>(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center gap-1.5`,children:[(0,U.jsx)(Jc,{className:`w-3.5 h-3.5 text-krona-secondary`}),(0,U.jsx)(`span`,{children:e.deviceName})]}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-secondary font-mono mt-0.5`,children:[cd[e.kind]||e.kind,` • v`,e.appVersion,` • `,e.osVersion]})]}),(0,U.jsx)(hd,{status:e.status,size:`sm`})]},e.installationId)),h.length===0&&(0,U.jsx)(`div`,{className:`text-krona-secondary py-4 text-center`,children:`Нет активных установок`})]}),v===`billing`&&(0,U.jsx)(`div`,{className:`space-y-3 text-xs`,children:n?(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Тарифная подписка`}),(0,U.jsx)(hd,{status:n.status,size:`sm`})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,U.jsx)(`span`,{children:`Период:`}),(0,U.jsx)(`span`,{className:`text-krona-primary`,children:n.period===`year`?`Годовой`:`Ежемесячный`})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,U.jsx)(`span`,{children:`Сумма тарифа:`}),(0,U.jsx)(gd,{minorUnits:n.amountMinorUnits,className:`text-amber-500 font-bold`})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,U.jsx)(`span`,{children:`Действует до:`}),(0,U.jsx)(`span`,{className:`text-krona-primary`,children:new Date(n.validUntil).toLocaleDateString(`ru-RU`)})]})]}):(0,U.jsx)(`div`,{className:`text-krona-secondary py-4 text-center`,children:`Данные подписки отсутствуют`})}),v===`incidents`&&(0,U.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[g.map(e=>(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,U.jsx)(`span`,{className:`font-bold text-krona-primary font-mono`,children:e.incidentNumber}),(0,U.jsx)(hd,{status:e.status,size:`sm`})]}),(0,U.jsx)(`p`,{className:`text-krona-primary`,children:e.summary})]},e.incidentId)),g.length===0&&(0,U.jsx)(`div`,{className:`text-krona-secondary py-4 text-center`,children:`Инцидентов нет`})]}),v===`audit`&&(0,U.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[_.map(e=>(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary font-mono text-[10px]`,children:[(0,U.jsx)(`span`,{children:e.action}),(0,U.jsx)(`span`,{children:new Date(e.occurredAt).toLocaleTimeString(`ru-RU`)})]}),(0,U.jsx)(`p`,{className:`text-krona-primary text-[11px]`,children:e.reason}),(0,U.jsxs)(`div`,{className:`text-[10px] text-amber-500`,children:[e.operatorName,` (`,rd[e.operatorRole]?.shortLabel||e.operatorRole,`)`]})]},e.eventId)),_.length===0&&(0,U.jsx)(`div`,{className:`text-krona-secondary py-4 text-center`,children:`Записей аудита нет`})]})]})}case`server`:{let t=a.find(t=>t.serverId===e.id);if(!t)return(0,U.jsx)(`div`,{className:`p-6 text-krona-secondary`,children:`Сервер не найден`});let n=u.filter(e=>e.serverId===t.serverId);return(0,U.jsxs)(`div`,{className:`space-y-6 text-xs`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,U.jsx)(hd,{status:t.status}),(0,U.jsxs)(`span`,{className:`text-xs text-krona-secondary font-mono`,children:[t.hostingProvider,` • `,t.region]})]}),(0,U.jsx)(`h2`,{className:`text-lg font-bold text-krona-primary`,children:t.name}),(0,U.jsxs)(`p`,{className:`text-xs text-krona-secondary font-mono`,children:[t.ipAddress,` • `,t.hostname]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl bg-krona-workspace/60 border border-krona-border p-3.5 space-y-2.5`,children:[(0,U.jsxs)(`div`,{className:`text-xs font-semibold text-krona-primary flex items-center gap-1.5`,children:[(0,U.jsx)(Ic,{className:`w-4 h-4 text-amber-500`}),(0,U.jsx)(`span`,{children:`Операции с инфраструктурным узлом`})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>T(!0),className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30 hover:bg-emerald-500/20 transition-colors flex items-center gap-1.5`,"data-testid":`btn-inspector-terminal`,children:[(0,U.jsx)(il,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:`Открыть терминал`})]}),(0,U.jsxs)(`button`,{disabled:!r.canRequestDiagnostics,onClick:()=>{f({title:`Запрос диагностики: ${t.name}`,actionName:`infrastructure.request_diagnostics`,impactSummary:`На узел ${t.ipAddress} будет отправлен запрос сбора расширенного дампа метрик, журнала dmesg и состояния процессов без раскрытия секретов.`,targetType:`infrastructure`,targetId:t.serverId,targetName:t.name,onConfirm:async e=>{await g(t.serverId,e)}})},className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-krona-workspace text-krona-primary hover:bg-krona-surface border border-krona-border disabled:opacity-40 transition-colors flex items-center gap-1.5`,children:[(0,U.jsx)(mo,{className:`w-3.5 h-3.5 text-sky-400`}),(0,U.jsx)(`span`,{children:`Запросить диагностику`})]}),(0,U.jsxs)(`button`,{disabled:!r.canScheduleMaintenance,onClick:()=>{f({title:`Запланировать ТО: ${t.name}`,actionName:`infrastructure.schedule_maintenance`,impactSummary:`Узел ${t.name} будет помечен как обслуживаемый. Маршрутизация трафика будет плавно перенаправлена на резервные ноды.`,targetType:`infrastructure`,targetId:t.serverId,targetName:t.name,onConfirm:async e=>{await _(t.serverId,e)}})},className:`min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/30 hover:bg-amber-500/20 disabled:opacity-40 transition-colors flex items-center gap-1.5`,children:[(0,U.jsx)(ns,{className:`w-3.5 h-3.5 text-amber-500`}),(0,U.jsx)(`span`,{children:`Запланировать ТО`})]})]})]}),t.sshConfig&&(0,U.jsxs)(`div`,{className:`rounded-xl bg-krona-workspace/60 border border-krona-border p-3.5 space-y-2.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center gap-1.5`,children:[(0,U.jsx)(Ps,{className:`w-4 h-4 text-krona-gold`}),(0,U.jsx)(`span`,{children:`SSH-конфигурация узла:`})]}),(0,U.jsx)(`span`,{className:`text-[11px] font-medium px-2 py-0.5 rounded-md border ${t.sshConfig.status===`connected`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30`:t.sshConfig.status===`unreachable`?`bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/30`:`bg-krona-surface text-krona-secondary border-krona-border`}`,children:t.sshConfig.status===`connected`?`SSH доступен`:t.sshConfig.status===`unreachable`?`Хост недоступен`:t.sshConfig.status})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-krona-secondary text-[11px]`,children:[(0,U.jsxs)(`div`,{children:[`Порт SSH: `,(0,U.jsx)(`span`,{className:`font-mono text-krona-primary font-semibold`,children:t.sshConfig.port})]}),(0,U.jsxs)(`div`,{children:[`Пользователь: `,(0,U.jsx)(`span`,{className:`font-mono text-krona-primary font-semibold`,children:t.sshConfig.username})]}),(0,U.jsxs)(`div`,{children:[`Метод входа: `,(0,U.jsx)(`span`,{className:`text-krona-primary font-medium`,children:t.sshConfig.authMethod===`key`?`SSH-ключ ed25519`:`Пароль`})]}),(0,U.jsxs)(`div`,{children:[`Fingerprint: `,(0,U.jsx)(`span`,{className:`font-mono text-krona-primary truncate block`,children:t.sshConfig.fingerprint||`—`})]})]}),t.sshConfig.lastConnectedAt&&(0,U.jsxs)(`div`,{className:`text-[10px] text-krona-tertiary pt-1 border-t border-krona-border/60`,children:[`Последний сеанс SSH: `,new Date(t.sshConfig.lastConnectedAt).toLocaleString(`ru-RU`)]})]}),(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center justify-between`,children:[(0,U.jsx)(`span`,{children:`Телеметрия узла (Server Monitor Agent):`}),(0,U.jsxs)(`span`,{className:`text-[11px] text-krona-secondary font-mono`,children:[`Agent v`,t.agentVersion,` (`,t.agentStatus,`)`]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary mb-1`,children:[(0,U.jsx)(`span`,{children:`CPU Нагрузка:`}),(0,U.jsxs)(`span`,{className:`font-bold text-krona-primary`,children:[t.cpuLoadPercent,`%`]})]}),(0,U.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full ${t.cpuLoadPercent>80?`bg-rose-500`:`bg-emerald-500`}`,style:{width:`${t.cpuLoadPercent}%`}})})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary mb-1`,children:[(0,U.jsx)(`span`,{children:`RAM Память:`}),(0,U.jsxs)(`span`,{className:`font-bold text-krona-primary`,children:[Math.round(t.ramUsedBytes/1073741824),` / `,Math.round(t.ramTotalBytes/1073741824),` GB`]})]}),(0,U.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full bg-emerald-500`,style:{width:`${t.ramUsedBytes/t.ramTotalBytes*100}%`}})})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary mb-1`,children:[(0,U.jsx)(`span`,{children:`Диск:`}),(0,U.jsxs)(`span`,{className:`font-bold text-krona-primary`,children:[Math.round(t.diskUsedBytes/1073741824),` / `,Math.round(t.diskTotalBytes/1073741824),` GB`]})]}),(0,U.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full ${t.diskUsedBytes/t.diskTotalBytes>.85?`bg-rose-500`:`bg-amber-500`}`,style:{width:`${t.diskUsedBytes/t.diskTotalBytes*100}%`}})})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary mb-1`,children:`Сеть (Rx / Tx):`}),(0,U.jsxs)(`div`,{className:`font-mono text-krona-primary`,children:[(t.networkRxBytesPerSec/1024/1024).toFixed(1),` / `,(t.networkTxBytesPerSec/1024/1024).toFixed(1),` MB/s`]})]})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Пульс узла (Heartbeat 24h):`}),(0,U.jsxs)(`span`,{className:`text-[11px] text-krona-secondary font-mono`,children:[`RTT: `,t.latencyMs,`ms`]})]}),(0,U.jsx)(_d,{status:t.status,count:24})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-1`,children:[(0,U.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center justify-between`,children:[(0,U.jsx)(`span`,{children:`Резервная копия:`}),(0,U.jsx)(hd,{status:t.backup.state===`ok`?`healthy`:t.backup.state===`failed`?`critical`:`warning`,size:`sm`,customLabel:t.backup.state===`ok`?`УСПЕШНО`:t.backup.state===`failed`?`ОШИБКА`:`В ПРОЦЕССЕ`})]}),(0,U.jsx)(`div`,{className:`text-krona-secondary text-[11px]`,children:t.backup.lastSuccessfulAt?new Date(t.backup.lastSuccessfulAt).toLocaleString(`ru-RU`):`Нет успешных копий`}),(0,U.jsx)(`div`,{className:`text-krona-secondary text-[10px]`,children:t.backup.targetProvider})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace/60 border border-krona-border space-y-1`,children:[(0,U.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center justify-between`,children:[(0,U.jsx)(`span`,{children:`Тест восстановления:`}),(0,U.jsx)(hd,{status:t.restoreDrill.state===`passed`?`healthy`:t.restoreDrill.state===`failed`?`critical`:`warning`,size:`sm`,customLabel:t.restoreDrill.state===`passed`?`ПРОЙДЕН`:t.restoreDrill.state===`failed`?`СБОЙ`:`ОЖИДАНИЕ`})]}),(0,U.jsx)(`div`,{className:`text-krona-secondary text-[11px]`,children:t.restoreDrill.verifiedAt?new Date(t.restoreDrill.verifiedAt).toLocaleDateString(`ru-RU`):`Никогда / Устарел`}),(0,U.jsx)(`div`,{className:`text-krona-secondary text-[10px]`,children:t.restoreDrill.drillDurationSeconds?`Время восстановления: ${Math.round(t.restoreDrill.drillDurationSeconds/60)} мин.`:`Тест не проводился`})]})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`font-semibold text-krona-primary`,children:[`Модули на узле (`,n.length,`):`]}),n.map(e=>(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace/60 border border-krona-border flex justify-between items-center`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:e.moduleName}),(0,U.jsx)(`div`,{className:`text-krona-secondary text-[11px]`,children:e.tenantName})]}),(0,U.jsx)(hd,{status:e.health,size:`sm`})]},e.moduleInstanceId))]})]}),(0,U.jsx)(yd,{server:t,isOpen:w,onClose:()=>T(!1)})]})}case`incident`:{let t=o.find(t=>t.incidentId===e.id);return t?(0,U.jsxs)(`div`,{className:`space-y-6 text-xs`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,U.jsx)(hd,{status:t.status}),(0,U.jsx)(`span`,{className:`font-bold text-amber-500 uppercase tracking-wider`,children:id[t.severity]?.label||t.severity})]}),(0,U.jsx)(`h2`,{className:`text-lg font-bold text-krona-primary`,children:t.incidentNumber}),(0,U.jsx)(`p`,{className:`text-sm text-krona-primary mt-1 font-medium`,children:t.summary})]}),t.status!==`resolved`&&(0,U.jsxs)(`div`,{className:`p-3.5 rounded-xl bg-krona-workspace/60 border border-krona-border flex flex-wrap gap-2 justify-between items-center`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Действие оператора:`}),(0,U.jsx)(`div`,{className:`text-krona-secondary text-[11px]`,children:`Отметить инцидент как устраненный с обоснованием`})]}),(0,U.jsx)(`button`,{disabled:!r.canManageIncidents,onClick:()=>{f({title:`Разрешение инцидента ${t.incidentNumber}`,actionName:`incident.resolve`,impactSummary:`Инцидент будет переведен в статус resolved, дежурная смена будет оповещена об устранении причин.`,targetType:`incident`,targetId:t.incidentId,targetName:t.incidentNumber,onConfirm:async e=>{await h(t.incidentId,e)}})},className:`min-h-[44px] px-4 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-zinc-950 font-bold text-xs transition-colors disabled:opacity-40 flex items-center justify-center`,children:`Разрешить инцидент`})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-krona-workspace/60 p-3.5 border border-krona-border space-y-2`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Описание инцидента:`}),(0,U.jsx)(`p`,{className:`text-krona-primary leading-relaxed`,children:t.description}),(0,U.jsxs)(`div`,{className:`text-krona-secondary pt-2 border-t border-krona-border`,children:[`Ответственный: `,(0,U.jsx)(`span`,{className:`text-krona-primary`,children:t.ownerName})]})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary`,children:`Хронология расследования (Timeline):`}),(0,U.jsx)(`div`,{className:`space-y-2 relative border-l border-krona-border ml-2 pl-3`,children:t.timeline.map((e,t)=>(0,U.jsxs)(`div`,{className:`relative space-y-1`,children:[(0,U.jsx)(`div`,{className:`absolute -left-[17px] top-1 w-2 h-2 rounded-full bg-amber-500`}),(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary text-[10px]`,children:[(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.author}),(0,U.jsx)(`span`,{children:new Date(e.timestamp).toLocaleTimeString(`ru-RU`)})]}),(0,U.jsx)(`p`,{className:`text-krona-primary`,children:e.message})]},t))})]})]}):(0,U.jsx)(`div`,{className:`p-6 text-krona-secondary`,children:`Инцидент не найден`})}default:return(0,U.jsx)(`div`,{className:`p-6 text-krona-secondary`,children:`Детальная информация для данного типа пока формируется`})}})()})]})]}):null},Sd=({pendingModal:e,onClose:n})=>{let{operator:r,role:i}=nd(),[a,o]=(0,j.useState)(``),[s,c]=(0,j.useState)(null),[l,u]=(0,j.useState)(!1),d=(0,j.useRef)(null);(0,j.useEffect)(()=>{d.current?.focus()},[]);let f=async t=>{t.preventDefault();let r=a.trim();if(r.length<5){c(`Обоснование операции обязательно (минимум 5 символов).`);return}u(!0);try{await e.onConfirm(r),n()}catch(e){c(`Ошибка выполнения: ${e instanceof Error?e.message:String(e)}`),u(!1)}},p=rd[i]?.label||i;return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs p-4 animate-in fade-in duration-150`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`confirm-modal-title`,onKeyDown:e=>{e.key===`Escape`&&!l&&n()},children:(0,U.jsxs)(`div`,{className:`w-full max-w-lg rounded-xl border border-amber-500/40 bg-krona-surface text-krona-primary shadow-2xl p-5 md:p-6 space-y-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`p-2.5 rounded-lg bg-amber-500/15 text-amber-500 border border-amber-500/30 shrink-0`,children:(0,U.jsx)(Ic,{className:`w-6 h-6`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{id:`confirm-modal-title`,className:`text-base md:text-lg font-bold text-krona-primary`,children:e.title}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary`,children:`Требуется авторизация оператора и запись в журнал аудита`})]})]}),(0,U.jsx)(`button`,{onClick:n,disabled:l,className:`min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-krona-secondary hover:bg-krona-workspace hover:text-krona-primary transition-colors`,"aria-label":`Закрыть`,children:(0,U.jsx)(t,{className:`w-5 h-5`})})]}),(0,U.jsxs)(`form`,{onSubmit:f,className:`space-y-4`,children:[(0,U.jsxs)(`div`,{className:`rounded-lg bg-krona-workspace border border-krona-border p-3.5 space-y-2 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,U.jsx)(`span`,{children:`Целевой объект:`}),(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.targetName})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,U.jsx)(`span`,{children:`Операция:`}),(0,U.jsx)(`span`,{className:`font-mono text-amber-500 font-semibold`,children:e.actionName})]}),(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,U.jsx)(`span`,{children:`Оператор:`}),(0,U.jsxs)(`span`,{className:`text-krona-primary font-medium`,children:[r.name,` (`,p,`)`]})]})]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-amber-500/10 border border-amber-500/30 p-3.5 text-xs text-amber-600 dark:text-amber-300 flex gap-2.5 items-start`,children:[(0,U.jsx)(fl,{className:`w-4 h-4 text-amber-500 shrink-0 mt-0.5`}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-semibold text-amber-600 dark:text-amber-300 mb-0.5`,children:`Влияние операции:`}),(0,U.jsx)(`div`,{className:`text-krona-secondary`,children:e.impactSummary})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{htmlFor:`action-reason-input`,className:`block text-xs font-semibold text-krona-primary mb-1.5`,children:[`Обоснование операции (Reason) `,(0,U.jsx)(`span`,{className:`text-rose-500`,children:`*`})]}),(0,U.jsx)(`textarea`,{id:`action-reason-input`,ref:d,rows:3,value:a,onChange:e=>{o(e.target.value),s&&c(null)},placeholder:`Укажите причину выполнения действия (номер заявки, обоснование, согласование)...`,className:`w-full rounded-lg bg-krona-workspace border border-krona-border p-3 text-sm text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 transition-colors resize-none`,disabled:l}),s&&(0,U.jsx)(`p`,{className:`mt-1 text-xs text-rose-500 font-medium`,children:s})]}),(0,U.jsxs)(`div`,{className:`flex flex-col-reverse sm:flex-row items-center justify-end gap-2 pt-3 border-t border-krona-border`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:n,disabled:l,className:`w-full sm:w-auto min-h-[44px] px-4 py-2.5 text-xs font-medium rounded-lg border border-krona-border text-krona-secondary hover:text-krona-primary transition-colors flex items-center justify-center`,children:`Отмена`}),(0,U.jsxs)(`button`,{type:`submit`,disabled:l,className:`w-full sm:w-auto min-h-[44px] px-5 py-2.5 text-xs font-bold rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 transition-colors flex items-center justify-center gap-2 shadow-xs disabled:opacity-50`,children:[(0,U.jsx)(Jo,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:l?`Подтверждение...`:`Подтвердить операцию`})]})]})]})]})})},Cd=()=>{let e=Y(e=>e.pendingConfirmModal),t=Y(e=>e.closeConfirmModal);return e?(0,U.jsx)(Sd,{pendingModal:e,onClose:t}):null},wd=()=>{let e=Y(e=>e.serverMonitorOutage),t=Y(e=>e.toggleServerMonitorOutage);return e?(0,U.jsxs)(`div`,{className:`mb-4 rounded-xl border border-status-danger-border bg-status-danger-soft p-4 text-status-danger-text flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 shadow-md animate-in fade-in slide-in-from-top-1`,role:`alert`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`div`,{className:`p-2 rounded-lg bg-status-danger-text/10 text-status-danger-text border border-status-danger-border shrink-0 mt-0.5`,children:(0,U.jsx)(uc,{className:`w-5 h-5`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-bold text-sm`,children:`Авария: Сервис мониторинга недоступен (Circuit Breaker Tripped)`}),(0,U.jsx)(`div`,{className:`text-xs opacity-90 mt-0.5`,children:`Прямой mTLS-канал с агентами узлов не отвечает. Разделы организаций, подписок и биллинга продолжают штатную работу. Показаны последние закешированные данные телеметрии.`})]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:t,className:`shrink-0 px-3 py-2 min-h-[44px] rounded-lg border border-status-danger-border bg-krona-surface hover:bg-krona-hover text-status-danger-text text-xs font-semibold flex items-center gap-2 transition-colors self-stretch sm:self-auto justify-center`,children:[(0,U.jsx)(wc,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:`Восстановить связь`})]})]}):null},Td=`krona_theme_mode`;function Ed(){if(typeof window>`u`)return`soft-light`;let e=localStorage.getItem(Td);return e&&[`soft-light`,`light`,`dark`].includes(e)?e:`soft-light`}function Dd(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}var Od=f((e,t)=>{let n=Ed();return Dd(n),{themeMode:n,setTheme:t=>{localStorage.setItem(Td,t),Dd(t),e({themeMode:t})},toggleTheme:()=>{let e=t().themeMode,n=e===`soft-light`?`light`:e===`light`?`dark`:`soft-light`;t().setTheme(n)}}}),kd=[{to:`/control`,label:`Обзор`,icon:Rs,end:!0},{to:`/control/organizations`,label:`Организации`,icon:Ao},{to:`/control/billing`,label:`Подписки и платежи`,icon:fs},{to:`/control/modules`,label:`Каталог модулей`,icon:fc},{to:`/control/installations`,label:`Установки`,icon:Jc},{to:`/control/infrastructure`,label:`Серверы`,icon:Mc},{to:`/control/announcements`,label:`Оповещения`,icon:wo},{to:`/control/incidents`,label:`Инциденты`,icon:fl},{to:`/control/audit`,label:`Журнал аудита`,icon:vs}],Ad=()=>{let e=Ir(),n=zr(),r=Y(e=>e.isInitialized),i=Y(e=>e.initialize),a=Y(e=>e.resetToDefaults),o=Y(e=>e.serverMonitorOutage),s=Y(e=>e.toggleServerMonitorOutage),c=Y(e=>e.incidents),{role:l,operator:u}=nd(),d=Od(e=>e.themeMode),f=Od(e=>e.setTheme),[p,m]=(0,j.useState)(``),[h,g]=(0,j.useState)(!1),[_,v]=(0,j.useState)(!1),[y,b]=(0,j.useState)(!1),[x,S]=(0,j.useState)(!1),[C,w]=(0,j.useState)(e.pathname);C!==e.pathname&&(w(e.pathname),b(!1)),(0,j.useEffect)(()=>{r||i()},[r,i]),(0,j.useEffect)(()=>{let e=()=>{m(`${new Date().toUTCString().slice(17,25)} UTC`)};e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[]);let T=async()=>{confirm(`Сбросить демонстрационные данные платформы к исходному состоянию?`)&&(g(!0),await a(),g(!1),v(!0),setTimeout(()=>v(!1),3e3))},E=(0,j.useMemo)(()=>{let e=0;return o&&(e+=1),e+=c.filter(e=>e.status!==`resolved`&&(e.severity===`critical`||e.severity===`high`)).length,e},[o,c]),D=(0,j.useMemo)(()=>[{to:`/control`,label:`Обзор`,icon:Rs,end:!0},{to:`/control/organizations`,label:`Организации`,icon:Ao},{to:`/control/incidents`,label:`Инциденты`,icon:fl,badge:E>0?E:void 0},{to:`/control/infrastructure`,label:`Серверы`,icon:Mc}],[E]),O=(0,j.useMemo)(()=>kd.map(e=>({...e,badge:e.to===`/control/incidents`&&E>0?E:void 0})),[E]),k=(0,j.useMemo)(()=>kd.find(t=>t.end?e.pathname===t.to:e.pathname.startsWith(t.to))?.label||`Control Center`,[e.pathname]),ee=rd[l]?.shortLabel||l;return(0,U.jsxs)(`div`,{className:`min-h-screen max-w-full overflow-x-hidden bg-krona-app text-krona-primary flex flex-col font-sans selection:bg-krona-gold selection:text-zinc-950 transition-colors duration-200`,"data-testid":`control-center-shell`,children:[(0,U.jsxs)(`header`,{className:`hidden md:flex h-14 border-b border-krona-border bg-krona-workspace/95 backdrop-blur-md px-4 items-center justify-between z-30 shrink-0 max-w-full`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 lg:gap-4 min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,U.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-krona-surface border border-krona-gold/40 flex items-center justify-center text-krona-gold font-extrabold shadow-sm shrink-0`,children:`K`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`text-xs font-black tracking-wider text-krona-primary uppercase flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`shrink-0`,children:`Krona Control Center`}),(0,U.jsx)(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded-sm bg-status-success-soft text-status-success-text font-mono`,children:`PROD v1.0`})]}),(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary font-mono tracking-wider`,children:`Кабинет владельца платформы`})]})]}),(0,U.jsxs)(`div`,{className:`hidden xl:flex items-center gap-2 text-[11px] text-krona-tertiary font-mono pl-3 border-l border-krona-border shrink-0`,children:[(0,U.jsx)(`span`,{children:p}),(0,U.jsx)(`span`,{children:`•`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-1 text-status-success-text`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-status-success-text animate-pulse shrink-0`}),(0,U.jsx)(`span`,{children:X.system.synced})]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 lg:gap-3 shrink-0`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:s,className:`min-h-[38px] px-2.5 py-1.5 rounded-lg border text-xs font-medium flex items-center gap-1.5 transition-colors ${o?`border-status-danger-border bg-status-danger-soft text-status-danger-text animate-pulse font-semibold`:`border-krona-border bg-krona-surface hover:bg-krona-hover text-krona-secondary`}`,title:`Имитация сбоя канала телеметрии Server Monitor (Circuit Breaker)`,"data-testid":`simulate-outage-toggle`,children:[(0,U.jsx)(bc,{className:`w-3.5 h-3.5 shrink-0`}),(0,U.jsx)(`span`,{className:`hidden lg:inline`,children:o?`Сбой мониторинга (Активен)`:`Имитировать сбой`})]}),(0,U.jsxs)(`div`,{className:`flex items-center bg-krona-surface border border-krona-border rounded-lg p-0.5`,role:`radiogroup`,"aria-label":`Выбор темы`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>f(`soft-light`),className:`p-1.5 rounded-md text-xs transition-colors ${d===`soft-light`?`bg-krona-workspace text-krona-gold font-semibold shadow-xs`:`text-krona-secondary hover:text-krona-primary`}`,title:`Мягкая светлая тема`,"data-testid":`theme-toggle-soft-light`,children:(0,U.jsx)(Xc,{className:`w-3.5 h-3.5`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>f(`light`),className:`p-1.5 rounded-md text-xs transition-colors ${d===`light`?`bg-krona-workspace text-krona-gold font-semibold shadow-xs`:`text-krona-secondary hover:text-krona-primary`}`,title:`Классическая светлая тема`,"data-testid":`theme-toggle-light`,children:(0,U.jsx)(el,{className:`w-3.5 h-3.5`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>f(`dark`),className:`p-1.5 rounded-md text-xs transition-colors ${d===`dark`?`bg-krona-workspace text-krona-gold font-semibold shadow-xs`:`text-krona-secondary hover:text-krona-primary`}`,title:`Тёмная тема`,"data-testid":`theme-toggle-dark`,children:(0,U.jsx)(cc,{className:`w-3.5 h-3.5`})})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:T,disabled:h,className:`min-h-[38px] px-2.5 py-1.5 rounded-lg border border-krona-border bg-krona-surface hover:bg-krona-hover text-krona-secondary transition-colors text-xs flex items-center gap-1.5`,title:`Сброс демонстрационных данных к начальным`,"data-testid":`reset-demo-button`,children:[(0,U.jsx)(Ec,{className:`w-3.5 h-3.5 ${h?`animate-spin text-krona-gold`:``}`}),(0,U.jsx)(`span`,{className:`hidden xl:inline`,children:`Сбросить данные`})]}),(0,U.jsx)(md,{})]})]}),(0,U.jsxs)(`header`,{className:`md:hidden h-14 border-b border-krona-border bg-krona-workspace/95 backdrop-blur-md px-3 flex items-center justify-between z-30 shrink-0 sticky top-0`,"data-testid":`mobile-header`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>b(!0),className:`min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg border border-krona-border bg-krona-surface text-krona-primary hover:bg-krona-hover transition-colors`,"aria-label":`Открыть меню панели оператора`,"data-testid":`mobile-menu-button`,children:(0,U.jsx)(Xs,{className:`w-5 h-5`})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,U.jsx)(`div`,{className:`w-7 h-7 rounded-md bg-krona-surface border border-krona-gold/40 flex items-center justify-center text-krona-gold font-extrabold text-xs shrink-0`,children:`K`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-xs font-bold text-krona-primary truncate leading-tight`,children:k}),(0,U.jsx)(`div`,{className:`text-[10px] text-krona-gold font-medium truncate`,children:`Control Center`})]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[E>0&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(`/control/incidents`),className:`min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg bg-status-danger-soft border border-status-danger-border text-status-danger-text text-xs font-bold`,"aria-label":`Критические события: ${E}`,title:`Есть критические события платформы`,"data-testid":`mobile-critical-indicator`,children:[(0,U.jsx)(Ic,{className:`w-4 h-4 animate-pulse mr-1`}),(0,U.jsx)(`span`,{children:E})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>b(!0),className:`min-w-[44px] min-h-[44px] px-2.5 flex items-center gap-1.5 rounded-lg border border-krona-gold/30 bg-krona-gold/10 text-krona-gold-text text-xs font-semibold`,"aria-label":`Профиль оператора: ${ee}`,title:`Профиль оператора платформы`,"data-testid":`mobile-operator-profile-btn`,children:[(0,U.jsx)(Rc,{className:`w-4 h-4 text-krona-gold shrink-0`}),(0,U.jsx)(`span`,{className:`truncate max-w-[80px]`,children:ee})]})]})]}),(0,U.jsxs)(`div`,{className:`flex-1 flex min-h-0 relative max-w-full`,children:[(0,U.jsxs)(`aside`,{className:`hidden md:flex flex-col border-r border-krona-border bg-krona-workspace transition-all duration-200 shrink-0 z-20 ${x?`w-16`:`w-56 lg:w-64`}`,"data-testid":`desktop-sidebar`,children:[(0,U.jsxs)(`div`,{className:`p-2 border-b border-krona-border flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider px-2 ${x?`hidden`:`block`}`,children:`Навигация`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>S(!x),className:`p-1.5 rounded-md hover:bg-krona-hover text-krona-secondary hover:text-krona-primary transition-colors ml-auto`,title:x?`Развернуть меню`:`Свернуть меню`,children:x?(0,U.jsx)(H,{className:`w-4 h-4`}):(0,U.jsx)(Ho,{className:`w-4 h-4`})})]}),(0,U.jsx)(`nav`,{className:`flex-1 p-2 space-y-1 overflow-y-auto`,children:O.map(e=>{let t=e.icon;return(0,U.jsxs)(la,{to:e.to,end:e.end,className:({isActive:e})=>`flex items-center min-h-[40px] px-3 py-2 rounded-lg text-xs font-medium transition-colors ${e?`bg-krona-gold/15 text-krona-gold font-bold border border-krona-gold/30`:`text-krona-secondary hover:bg-krona-hover hover:text-krona-primary`}`,title:e.label,"data-testid":`nav-${e.to.replace(`/control`,``).replace(`/`,``)||`overview`}`,children:[(0,U.jsx)(t,{className:`w-4 h-4 shrink-0`}),!x&&(0,U.jsx)(`span`,{className:`ml-2.5 truncate flex-1`,children:e.label}),!x&&e.badge&&e.badge>0&&(0,U.jsx)(`span`,{className:`ml-auto px-1.5 py-0.5 rounded-full text-[10px] font-mono font-bold bg-status-danger-soft text-status-danger-text border border-status-danger-border`,children:e.badge})]},e.to)})}),!x&&(0,U.jsxs)(`div`,{className:`p-3 border-t border-krona-border text-[11px] text-krona-tertiary font-mono space-y-1 bg-krona-surface/30`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`span`,{children:[X.system.nodeLabel,`:`]}),(0,U.jsx)(`span`,{className:`font-semibold text-krona-secondary`,children:`srv-msk-prod-01`})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`span`,{children:[X.scope,`:`]}),(0,U.jsx)(`span`,{className:`text-status-success-text`,children:`Боевой (Live)`})]}),(0,U.jsxs)(la,{to:`/`,className:`mt-2 pt-2 border-t border-krona-border flex items-center gap-1.5 text-krona-gold hover:underline text-[11px]`,children:[(0,U.jsx)(gs,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:X.system.exitToClient})]})]})]}),(0,U.jsx)(`main`,{className:`flex-1 min-w-0 max-w-full overflow-y-auto overflow-x-hidden p-3 sm:p-5 lg:p-6 pb-20 md:pb-6`,children:(0,U.jsxs)(`div`,{className:`max-w-7xl mx-auto w-full`,children:[_&&(0,U.jsxs)(`div`,{className:`mb-4 p-3.5 rounded-xl border border-status-success-border bg-status-success-soft text-status-success-text text-xs flex items-center gap-2 shadow-md animate-in fade-in`,role:`status`,children:[(0,U.jsx)(Xo,{className:`w-4 h-4 shrink-0`}),(0,U.jsx)(`span`,{children:`Демонстрационные данные успешно сброшены к эталонному состоянию.`})]}),(0,U.jsx)(wd,{}),(0,U.jsx)(Si,{})]})})]}),(0,U.jsxs)(`nav`,{className:`md:hidden fixed bottom-0 left-0 right-0 h-16 border-t border-krona-border bg-krona-workspace/95 backdrop-blur-md px-1 flex items-center justify-around z-40`,"data-testid":`mobile-bottom-bar`,"aria-label":`Основная мобильная навигация`,children:[D.map(t=>{let n=t.icon,r=t.end?e.pathname===t.to:e.pathname.startsWith(t.to);return(0,U.jsxs)(la,{to:t.to,end:t.end,className:`flex-1 min-h-[48px] min-w-[44px] flex flex-col items-center justify-center rounded-lg py-1 transition-colors relative ${r?`text-krona-gold font-bold`:`text-krona-secondary hover:text-krona-primary`}`,"data-testid":`bottom-nav-${t.to.replace(`/control`,``).replace(`/`,``)||`overview`}`,children:[(0,U.jsx)(n,{className:`w-5 h-5 ${r?`stroke-[2.5]`:``}`}),(0,U.jsx)(`span`,{className:`text-[10px] mt-0.5 leading-none truncate max-w-[64px]`,children:t.label}),t.badge&&t.badge>0&&(0,U.jsx)(`span`,{className:`absolute top-1 right-3 w-4 h-4 rounded-full bg-status-danger-text text-white text-[9px] font-bold flex items-center justify-center animate-pulse`,children:t.badge})]},t.to)}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>b(!0),className:`flex-1 min-h-[48px] min-w-[44px] flex flex-col items-center justify-center rounded-lg py-1 transition-colors ${y?`text-krona-gold font-bold`:`text-krona-secondary hover:text-krona-primary`}`,"aria-label":`Ещё разделы и настройки`,"data-testid":`bottom-nav-more`,children:[(0,U.jsx)(Wc,{className:`w-5 h-5`}),(0,U.jsx)(`span`,{className:`text-[10px] mt-0.5 leading-none`,children:`Ещё`})]})]}),y&&(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex flex-col justify-end bg-black/60 backdrop-blur-xs md:hidden animate-in fade-in duration-200`,role:`dialog`,"aria-modal":`true`,"aria-label":`Меню оператора платформы`,onClick:()=>b(!1),children:(0,U.jsxs)(`div`,{className:`w-full max-h-[85vh] bg-krona-workspace border-t border-krona-border rounded-t-2xl flex flex-col overflow-hidden shadow-2xl animate-in slide-in-from-bottom duration-250`,onClick:e=>e.stopPropagation(),children:[(0,U.jsxs)(`div`,{className:`px-4 py-3 border-b border-krona-border flex items-center justify-between shrink-0 bg-krona-surface`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`w-6 h-6 rounded-md bg-krona-gold/20 text-krona-gold font-bold flex items-center justify-center text-xs`,children:`K`}),(0,U.jsx)(`span`,{className:`font-bold text-sm text-krona-primary`,children:`Панель оператора`})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>b(!1),className:`min-w-[44px] min-h-[44px] flex items-center justify-center rounded-lg text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`,"aria-label":`Закрыть меню`,"data-testid":`close-mobile-drawer`,children:(0,U.jsx)(t,{className:`w-5 h-5`})})]}),(0,U.jsxs)(`div`,{className:`p-4 overflow-y-auto space-y-4`,children:[(0,U.jsxs)(`div`,{className:`p-3 rounded-xl bg-krona-surface border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider mb-2`,children:`Сессия оператора`}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`font-bold text-sm text-krona-primary`,children:u.name}),(0,U.jsx)(`div`,{className:`text-xs text-krona-gold font-medium`,children:rd[l]?.label})]}),(0,U.jsx)(md,{variant:`compact`})]})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-xl bg-krona-surface border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider mb-2`,children:X.system.themeLabel}),(0,U.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[`soft-light`,`light`,`dark`].map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>f(e),className:`min-h-[44px] px-2 py-2 rounded-lg text-xs font-semibold flex flex-col items-center justify-center transition-colors border ${d===e?`border-krona-gold bg-krona-gold/15 text-krona-gold shadow-xs`:`border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary`}`,"data-testid":`mobile-theme-${e}`,children:[e===`soft-light`&&(0,U.jsx)(Xc,{className:`w-4 h-4 mb-0.5`}),e===`light`&&(0,U.jsx)(el,{className:`w-4 h-4 mb-0.5`}),e===`dark`&&(0,U.jsx)(cc,{className:`w-4 h-4 mb-0.5`}),(0,U.jsx)(`span`,{className:`text-[10px] text-center leading-tight`,children:ld[e]})]},e))})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-xl bg-krona-surface border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider mb-2`,children:`Все разделы`}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-1.5`,children:O.map(t=>{let n=t.icon,r=t.end?e.pathname===t.to:e.pathname.startsWith(t.to);return(0,U.jsxs)(la,{to:t.to,end:t.end,className:`min-h-[44px] px-3 py-2.5 rounded-lg text-xs flex items-center justify-between border transition-colors ${r?`border-krona-gold/40 bg-krona-gold/15 text-krona-gold font-bold`:`border-transparent text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`}`,"data-testid":`drawer-nav-${t.to.replace(`/control`,``).replace(`/`,``)||`overview`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,U.jsx)(n,{className:`w-4 h-4 shrink-0`}),(0,U.jsx)(`span`,{className:`truncate`,children:t.label})]}),t.badge&&t.badge>0&&(0,U.jsx)(`span`,{className:`px-2 py-0.5 rounded-full text-[10px] font-bold bg-status-danger-soft text-status-danger-text border border-status-danger-border`,children:t.badge})]},t.to)})})]}),(0,U.jsxs)(`div`,{className:`p-3 rounded-xl bg-krona-surface border border-krona-border space-y-2`,children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-tertiary uppercase tracking-wider`,children:`Сервисные действия`}),(0,U.jsxs)(`button`,{type:`button`,onClick:s,className:`w-full min-h-[44px] px-3 py-2 rounded-lg text-xs font-semibold flex items-center justify-between border transition-colors ${o?`border-status-danger-border bg-status-danger-soft text-status-danger-text`:`border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary`}`,"data-testid":`drawer-toggle-outage`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(bc,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Сбой мониторинга (Circuit Breaker)`})]}),(0,U.jsx)(`span`,{className:`text-[11px] font-mono`,children:o?`ВКЛ`:`ВЫКЛ`})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:T,disabled:h,className:`w-full min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium border border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary flex items-center justify-center gap-2 transition-colors`,"data-testid":`drawer-reset-data`,children:[(0,U.jsx)(Ec,{className:`w-4 h-4 ${h?`animate-spin text-krona-gold`:``}`}),(0,U.jsx)(`span`,{children:`Сбросить демоданные к эталону`})]}),(0,U.jsxs)(la,{to:`/`,className:`w-full min-h-[44px] px-3 py-2 rounded-lg text-xs font-medium border border-krona-border bg-krona-workspace text-krona-gold hover:bg-krona-hover flex items-center justify-center gap-2 transition-colors`,children:[(0,U.jsx)(gs,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Перейти в Krona Business OS`})]})]}),(0,U.jsx)(`div`,{className:`text-center text-[11px] text-krona-tertiary font-mono pt-1 pb-2`,children:`srv-msk-prod-01 • Данные синхронизированы (IndexedDB)`})]})]})}),(0,U.jsx)(xd,{}),(0,U.jsx)(Cd,{})]})},jd=()=>(0,U.jsx)(`div`,{className:`min-h-screen bg-krona-app text-krona-primary flex items-center justify-center p-4 md:p-6 transition-colors duration-200`,children:(0,U.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-rose-500/40 bg-krona-surface p-6 md:p-8 text-center space-y-5 shadow-xl`,children:[(0,U.jsx)(`div`,{className:`w-16 h-16 rounded-2xl bg-rose-500/15 border border-rose-500/30 flex items-center justify-center text-rose-500 mx-auto`,children:(0,U.jsx)(Ic,{className:`w-8 h-8`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-xs font-mono font-bold uppercase tracking-widest text-rose-500`,children:`HTTP 403 • Доступ ограничен`}),(0,U.jsx)(`h1`,{className:`text-xl md:text-2xl font-black text-krona-primary mt-1`,children:X.forbiddenTitle}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-2 leading-relaxed`,children:X.forbiddenDescription})]}),(0,U.jsx)(`div`,{className:`p-3.5 rounded-xl bg-krona-workspace border border-krona-border text-xs text-krona-secondary`,children:`Если вы оператор демонстрационного стенда, переключитесь на роль Владельца или Администратора в сессионном переключателе профиля.`}),(0,U.jsx)(`div`,{className:`flex flex-col gap-2 pt-2`,children:(0,U.jsxs)(la,{to:`/control`,className:`w-full min-h-[44px] py-2.5 px-4 rounded-xl bg-amber-500 hover:bg-amber-400 text-zinc-950 text-xs font-bold flex items-center justify-center gap-2 transition-colors shadow-xs`,children:[(0,U.jsx)(go,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:X.forbiddenBack})]})})]})}),Md=[`platform_owner`,`platform_admin`,`support_operator`,`billing_manager`,`security_auditor`,`release_manager`],Nd=({children:e})=>{let t=Y(e=>e.activeRole);return Y(e=>e.isAccessGatePassed)?Md.includes(t)?(0,U.jsx)(U.Fragment,{children:e}):(0,U.jsx)(jd,{}):(0,U.jsx)(xi,{to:`/control/gate`,replace:!0})},Pd=()=>{let e=zr(),{role:t,operator:n}=nd(),r=Y(e=>e.organizations),i=Y(e=>e.subscriptions),a=Y(e=>e.installations),o=Y(e=>e.instances),s=Y(e=>e.servers),c=Y(e=>e.incidents),l=Y(e=>e.openInspector),u=Y(e=>e.serverMonitorOutage),d=r.length,f=r.filter(e=>e.platformStatus===`active`).length,p=r.filter(e=>e.platformStatus===`trial`).length,m=r.filter(e=>e.platformStatus===`grace`).length,h=r.filter(e=>e.platformStatus===`suspended`).length,g=r.reduce((e,t)=>e+t.userCount,0),_=r.reduce((e,t)=>e+t.branchCount,0),v=r.reduce((e,t)=>e+t.mrrMinorUnits,0),y=i.filter(e=>e.status===`expiring_7d`),b=i.filter(e=>e.status===`overdue`),x=a.filter(e=>e.kind===`web`).length,S=a.filter(e=>e.kind===`desktop`).length,C=a.filter(e=>e.kind===`android`).length,w=a.filter(e=>e.kind===`android`&&e.status===`outdated`).length,T=o.filter(e=>e.health===`offline`),E=o.filter(e=>e.health===`degraded`),D=s.filter(e=>e.status===`healthy`).length,O=s.filter(e=>e.status!==`healthy`),k=c.filter(e=>e.status!==`resolved`),ee=(0,j.useMemo)(()=>{let e=k.length;return e+=O.length,e+=T.length,e+=E.length,e+=y.length,e+=b.length,u&&(e+=1),e},[k,O,T,E,y,b,u]),[A,te]=(0,j.useState)(()=>ee>0?`attention`:`metrics`);return(0,U.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,"data-testid":`overview-page`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2.5 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg sm:text-xl font-bold text-krona-primary flex items-center gap-2 flex-wrap`,children:[(0,U.jsx)(`span`,{children:`Сводная операторская панель`}),(0,U.jsx)(`span`,{className:`text-[11px] px-2.5 py-0.5 rounded-full bg-status-success-soft text-status-success-text border border-status-success-border font-medium`,children:`Контур платформы`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Оперативный контроль организаций, лицензий, модульных инстансов и серверных узлов Krona`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,U.jsx)(`span`,{className:`text-krona-tertiary`,children:`Оператор:`}),(0,U.jsxs)(`span`,{className:`font-semibold text-krona-gold bg-krona-gold/10 px-2.5 py-1 rounded-md border border-krona-gold/20`,children:[n.name,` (`,rd[t]?.shortLabel||t,`)`]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 p-1 bg-krona-surface border border-krona-border rounded-xl max-w-full overflow-x-auto`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>te(`attention`),className:`flex-1 min-h-[44px] min-w-[120px] px-3 py-2 rounded-lg text-xs font-semibold flex items-center justify-center gap-2 transition-colors ${A===`attention`?`bg-krona-workspace text-krona-primary shadow-xs border border-krona-border font-bold`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`}`,"data-testid":`tab-attention`,children:[(0,U.jsx)(Ic,{className:`w-4 h-4 shrink-0 ${ee>0?`text-status-danger-text`:`text-status-success-text`}`}),(0,U.jsx)(`span`,{children:`Требует внимания`}),ee>0&&(0,U.jsx)(`span`,{className:`px-1.5 py-0.2 rounded-full text-[10px] font-mono font-bold bg-status-danger-soft text-status-danger-text border border-status-danger-border`,children:ee})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>te(`metrics`),className:`flex-1 min-h-[44px] min-w-[110px] px-3 py-2 rounded-lg text-xs font-semibold flex items-center justify-center gap-2 transition-colors ${A===`metrics`?`bg-krona-workspace text-krona-primary shadow-xs border border-krona-border font-bold`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`}`,"data-testid":`tab-metrics`,children:[(0,U.jsx)(mo,{className:`w-4 h-4 shrink-0 text-krona-gold`}),(0,U.jsx)(`span`,{children:`Показатели`})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>te(`infrastructure`),className:`flex-1 min-h-[44px] min-w-[120px] px-3 py-2 rounded-lg text-xs font-semibold flex items-center justify-center gap-2 transition-colors ${A===`infrastructure`?`bg-krona-workspace text-krona-primary shadow-xs border border-krona-border font-bold`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-hover`}`,"data-testid":`tab-infrastructure`,children:[(0,U.jsx)(Mc,{className:`w-4 h-4 shrink-0 text-krona-gold`}),(0,U.jsx)(`span`,{children:`Инфраструктура`})]})]}),A===`attention`&&(0,U.jsxs)(`div`,{className:`space-y-4 animate-in fade-in duration-150`,"data-testid":`attention-section`,children:[ee===0&&(0,U.jsxs)(`div`,{className:`p-6 rounded-xl border border-status-success-border bg-status-success-soft text-status-success-text text-center space-y-2`,children:[(0,U.jsx)(Xo,{className:`w-10 h-10 mx-auto text-status-success-text`}),(0,U.jsx)(`div`,{className:`font-bold text-base`,children:`Все системы работают в штатном режиме`}),(0,U.jsx)(`p`,{className:`text-xs opacity-90 max-w-md mx-auto`,children:`Нет открытых аварий, серверов с деградацией или просроченных подписок, требующих вмешательства оператора.`})]}),k.length>0&&(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Ic,{className:`w-4 h-4 text-status-danger-text`}),(0,U.jsxs)(`span`,{className:`font-bold text-sm text-krona-primary`,children:[`Открытые инциденты (`,k.length,`)`]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/incidents`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,U.jsx)(`span`,{children:`Все инциденты`}),(0,U.jsx)(bo,{className:`w-3.5 h-3.5`})]})]}),(0,U.jsx)(`div`,{className:`space-y-2`,children:k.map(e=>(0,U.jsxs)(`div`,{onClick:()=>l(`incident`,e.incidentId),className:`p-3.5 rounded-lg border border-status-danger-border bg-status-danger-soft cursor-pointer hover:opacity-95 transition-opacity space-y-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-mono font-bold bg-status-danger-text text-white px-2 py-0.5 rounded-sm`,children:id[e.severity]?.short||e.severity}),(0,U.jsx)(`span`,{className:`font-bold text-xs text-status-danger-text`,children:e.summary})]}),(0,U.jsx)(`span`,{className:`text-[11px] font-medium text-status-danger-text`,children:ad[e.status]||e.status})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary line-clamp-2`,children:e.description}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[`Затронуто: `,e.affectedTenantIds.length,` орг. • Узлов: `,e.affectedServerIds.length]})]},e.incidentId))})]}),O.length>0&&(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Mc,{className:`w-4 h-4 text-status-warning-text`}),(0,U.jsxs)(`span`,{className:`font-bold text-sm text-krona-primary`,children:[`Серверы с предупреждениями (`,O.length,`)`]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/infrastructure`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,U.jsx)(`span`,{children:`Инфраструктура`}),(0,U.jsx)(bo,{className:`w-3.5 h-3.5`})]})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:O.map(e=>{let t=e.cpuLoadPercent,n=Math.round(e.ramUsedBytes/(e.ramTotalBytes||1)*100),r=Math.round(e.diskUsedBytes/(e.diskTotalBytes||1)*100);return(0,U.jsxs)(`div`,{onClick:()=>l(`server`,e.serverId),className:`p-3.5 rounded-lg border border-krona-border bg-krona-workspace cursor-pointer hover:border-krona-gold/40 transition-colors space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`div`,{className:`font-bold text-xs text-krona-primary font-mono`,children:e.hostname}),(0,U.jsx)(hd,{status:e.status,size:`sm`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-3 gap-1 text-[11px] text-krona-secondary font-mono`,children:[(0,U.jsxs)(`div`,{children:[`CPU: `,(0,U.jsxs)(`span`,{className:t>80?`text-status-danger-text font-bold`:``,children:[t,`%`]})]}),(0,U.jsxs)(`div`,{children:[`RAM: `,(0,U.jsxs)(`span`,{className:n>80?`text-status-danger-text font-bold`:``,children:[n,`%`]})]}),(0,U.jsxs)(`div`,{children:[`Диск: `,(0,U.jsxs)(`span`,{className:r>85?`text-status-danger-text font-bold`:``,children:[r,`%`]})]})]}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[`Провайдер: `,e.hostingProvider,` (`,e.region,`)`]})]},e.serverId)})})]}),(T.length>0||E.length>0)&&(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Is,{className:`w-4 h-4 text-status-warning-text`}),(0,U.jsxs)(`span`,{className:`font-bold text-sm text-krona-primary`,children:[`Модули с деградацией (`,T.length+E.length,`)`]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/modules`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,U.jsx)(`span`,{children:`Каталог`}),(0,U.jsx)(bo,{className:`w-3.5 h-3.5`})]})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2.5`,children:[...T,...E].map(e=>(0,U.jsxs)(`div`,{onClick:()=>l(`organization`,e.tenantId),className:`p-3 rounded-lg border border-krona-border bg-krona-workspace cursor-pointer hover:border-krona-gold/40 transition-colors flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`font-bold text-xs text-krona-primary`,children:[e.moduleName,` v`,e.currentVersion]}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[`Тенант: `,e.tenantName]})]}),(0,U.jsx)(hd,{status:e.health,size:`sm`})]},e.moduleInstanceId))})]}),(y.length>0||b.length>0)&&(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(fs,{className:`w-4 h-4 text-status-warning-text`}),(0,U.jsxs)(`span`,{className:`font-bold text-sm text-krona-primary`,children:[`Истекающие подписки (`,y.length+b.length,`)`]})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/billing`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,U.jsx)(`span`,{children:`Биллинг`}),(0,U.jsx)(bo,{className:`w-3.5 h-3.5`})]})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2.5`,children:[...b,...y].map(e=>(0,U.jsxs)(`div`,{onClick:()=>l(`organization`,e.tenantId),className:`p-3 rounded-lg border border-krona-border bg-krona-workspace cursor-pointer hover:border-krona-gold/40 transition-colors flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-bold text-xs text-krona-primary`,children:e.tenantName}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[`Тариф: `,e.planCode,` • До: `,new Date(e.validUntil).toLocaleDateString(`ru-RU`)]})]}),(0,U.jsxs)(`div`,{className:`text-right`,children:[(0,U.jsx)(gd,{minorUnits:e.amountMinorUnits,currency:e.currency,className:`font-bold text-xs text-krona-primary`}),(0,U.jsx)(`div`,{className:`mt-1`,children:(0,U.jsx)(hd,{status:e.status,size:`sm`})})]})]},e.subscriptionId))})]})]}),A===`metrics`&&(0,U.jsxs)(`div`,{className:`space-y-4 animate-in fade-in duration-150`,"data-testid":`metrics-section`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 xl:grid-cols-6 gap-2.5 sm:gap-3`,children:[(0,U.jsxs)(`div`,{onClick:()=>e(`/control/organizations`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Организации`}),(0,U.jsx)(Ao,{className:`w-4 h-4 text-krona-gold`})]}),(0,U.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:d}),(0,U.jsxs)(`div`,{className:`text-[11px] text-status-success-text mt-0.5`,children:[f,` активных`]})]}),(0,U.jsxs)(`div`,{className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Пользователи`}),(0,U.jsx)(vl,{className:`w-4 h-4 text-krona-gold`})]}),(0,U.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:g}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-secondary mt-0.5`,children:[_,` филиалов`]})]}),(0,U.jsxs)(`div`,{onClick:()=>e(`/control/billing`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors col-span-2 sm:col-span-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Выручка (MRR)`}),(0,U.jsx)(fs,{className:`w-4 h-4 text-krona-gold`})]}),(0,U.jsx)(gd,{minorUnits:v,currency:`RUB`,className:`text-lg sm:text-xl font-bold text-krona-gold`}),(0,U.jsx)(`div`,{className:`text-[11px] text-krona-secondary mt-0.5`,children:`В месяц`})]}),(0,U.jsxs)(`div`,{onClick:()=>e(`/control/billing`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Подписки`}),(0,U.jsx)(ns,{className:`w-4 h-4 text-krona-gold`})]}),(0,U.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:i.length}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-secondary mt-0.5`,children:[y.length,` истекают`]})]}),(0,U.jsxs)(`div`,{onClick:()=>e(`/control/installations`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Установки`}),(0,U.jsx)(Jc,{className:`w-4 h-4 text-krona-gold`})]}),(0,U.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:a.length}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-secondary mt-0.5`,children:[`Android: `,C]})]}),(0,U.jsxs)(`div`,{onClick:()=>e(`/control/infrastructure`),className:`p-3.5 rounded-xl border border-krona-border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-krona-tertiary mb-1`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium`,children:`Серверы`}),(0,U.jsx)(Mc,{className:`w-4 h-4 text-krona-gold`})]}),(0,U.jsx)(`div`,{className:`text-lg sm:text-xl font-bold text-krona-primary`,children:s.length}),(0,U.jsxs)(`div`,{className:`text-[11px] text-status-success-text mt-0.5`,children:[D,` в норме`]})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`font-bold text-sm text-krona-primary flex items-center justify-between`,children:[(0,U.jsx)(`span`,{children:`Статус организаций`}),(0,U.jsxs)(`span`,{className:`text-xs text-krona-secondary font-normal`,children:[`Всего: `,d]})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-status-success-text`}),(0,U.jsx)(`span`,{className:`text-krona-secondary`,children:`Активные организации`})]}),(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:f})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-status-info-text`}),(0,U.jsx)(`span`,{className:`text-krona-secondary`,children:`Пробный период (Trial)`})]}),(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:p})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-status-warning-text`}),(0,U.jsx)(`span`,{className:`text-krona-secondary`,children:`Льготный период (Grace)`})]}),(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:m})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`w-2.5 h-2.5 rounded-full bg-status-danger-text`}),(0,U.jsx)(`span`,{className:`text-krona-secondary`,children:`Приостановлены (Suspended)`})]}),(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:h})]})]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`font-bold text-sm text-krona-primary flex items-center justify-between`,children:[(0,U.jsx)(`span`,{children:`Платформы клиентов`}),(0,U.jsxs)(`span`,{className:`text-xs text-krona-secondary font-normal`,children:[`Всего: `,a.length]})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsx)(`span`,{className:`text-krona-secondary`,children:`Веб-приложения (Web SPA)`}),(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:x})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsx)(`span`,{className:`text-krona-secondary`,children:`Рабочие станции (Desktop)`}),(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:S})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,U.jsx)(`span`,{className:`text-krona-secondary`,children:`Мобильные кассы (Android)`}),(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:C})]}),w>0&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-status-warning-text font-medium pt-1 border-t border-krona-border`,children:[(0,U.jsx)(`span`,{children:`Устаревшие версии Android:`}),(0,U.jsx)(`span`,{className:`font-bold`,children:w})]})]})]})]})]}),A===`infrastructure`&&(0,U.jsx)(`div`,{className:`space-y-4 animate-in fade-in duration-150`,"data-testid":`infrastructure-section`,children:(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`font-bold text-sm text-krona-primary`,children:`Инфраструктурные серверы Krona`}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary`,children:`Текущая загрузка вычислительных узлов платформы`})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>e(`/control/infrastructure`),className:`min-h-[44px] px-3 text-xs text-krona-gold hover:underline flex items-center gap-1 font-medium`,children:[(0,U.jsx)(`span`,{children:`Управление`}),(0,U.jsx)(bo,{className:`w-3.5 h-3.5`})]})]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3`,children:s.map(e=>{let t=e.cpuLoadPercent,n=Math.round(e.ramUsedBytes/(e.ramTotalBytes||1)*100),r=Math.round(e.diskUsedBytes/(e.diskTotalBytes||1)*100);return(0,U.jsxs)(`div`,{onClick:()=>l(`server`,e.serverId),className:`p-3.5 rounded-lg border border-krona-border bg-krona-workspace cursor-pointer hover:border-krona-gold/40 transition-colors space-y-2.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-bold text-xs text-krona-primary font-mono`,children:e.hostname}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary`,children:[e.hostingProvider,` (`,e.region,`)`]})]}),(0,U.jsx)(hd,{status:e.status,size:`sm`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 text-center text-xs py-1 bg-krona-surface/40 rounded-md border border-krona-border`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`CPU`}),(0,U.jsxs)(`div`,{className:`font-mono font-bold ${t>80?`text-status-danger-text`:`text-krona-primary`}`,children:[t,`%`]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`RAM`}),(0,U.jsxs)(`div`,{className:`font-mono font-bold ${n>80?`text-status-danger-text`:`text-krona-primary`}`,children:[n,`%`]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Диск`}),(0,U.jsxs)(`div`,{className:`font-mono font-bold ${r>85?`text-status-danger-text`:`text-krona-primary`}`,children:[r,`%`]})]})]}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary flex items-center justify-between`,children:[(0,U.jsx)(`span`,{children:`Резервная копия:`}),(0,U.jsx)(`span`,{className:e.backup.state===`failed`?`text-status-danger-text font-bold`:`text-status-success-text`,children:e.backup.state===`ok`?`Успешно`:e.backup.state===`failed`?`Ошибка`:e.backup.state})]}),(0,U.jsx)(`div`,{className:`pt-1`,children:(0,U.jsx)(_d,{status:e.status,count:24})})]},e.serverId)})})]})})]})},Fd=()=>{let e=Y(e=>e.organizations),t=Y(e=>e.openInspector),[n,r]=(0,j.useState)(``),[i,a]=(0,j.useState)(`all`),o=e.filter(e=>{let t=!n||e.displayName.toLowerCase().includes(n.toLowerCase())||e.inn.includes(n)||e.domain.toLowerCase().includes(n.toLowerCase()),r=i===`all`||e.platformStatus===i;return t&&r});return(0,U.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,"data-testid":`organizations-page`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2.5 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg sm:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,U.jsx)(Ao,{className:`w-5 h-5 text-krona-gold`}),(0,U.jsx)(`span`,{children:`Организации платформы`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Реестр организаций, управление статусами, тарифами и 360°-анализ тенантов`})]}),(0,U.jsxs)(`div`,{className:`text-xs text-krona-secondary`,children:[`Всего: `,(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.length}),` (найдено:`,` `,(0,U.jsx)(`span`,{className:`font-bold text-krona-gold`,children:o.length}),`)`]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-3 items-stretch md:items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,U.jsx)(Oc,{className:`w-4 h-4 text-krona-tertiary absolute left-3 top-1/2 -translate-y-1/2`}),(0,U.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:`Поиск по названию, ИНН или домену...`,className:`w-full bg-krona-surface border border-krona-border rounded-lg pl-9 pr-3 py-2.5 min-h-[44px] text-xs text-krona-primary placeholder-krona-tertiary focus:outline-hidden focus:border-krona-gold transition-colors`})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 text-xs`,children:[{id:`all`,label:`Все`},{id:`active`,label:`Активные`},{id:`trial`,label:`Пробные`},{id:`grace`,label:`Льготные`},{id:`suspended`,label:`Приостановленные`}].map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(e.id),className:`min-h-[44px] px-3.5 py-2 rounded-lg font-medium transition-colors shrink-0 ${i===e.id?`bg-krona-gold/15 text-krona-gold border border-krona-gold/30 font-bold`:`bg-krona-surface text-krona-secondary border border-krona-border hover:text-krona-primary hover:bg-krona-hover`}`,children:e.label},e.id))})]}),(0,U.jsxs)(`div`,{className:`lg:hidden space-y-3`,"data-testid":`orgs-mobile-cards`,children:[o.map(e=>(0,U.jsxs)(`div`,{onClick:()=>t(`organization`,e.tenantId),className:`rounded-xl border border-krona-border bg-krona-surface p-4 space-y-3 shadow-sm hover:border-krona-gold/40 transition-colors cursor-pointer`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h3`,{className:`font-bold text-sm text-krona-primary truncate`,children:e.displayName}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary font-mono mt-0.5`,children:[`ИНН `,e.inn,` • `,e.domain]})]}),(0,U.jsx)(hd,{status:e.platformStatus,size:`sm`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 py-2 border-y border-krona-border text-center text-xs`,children:[(0,U.jsxs)(`div`,{className:`p-1 rounded-md bg-krona-workspace/50`,children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Пользователи`}),(0,U.jsxs)(`div`,{className:`font-bold text-krona-primary`,children:[e.userCount,` `,(0,U.jsxs)(`span`,{className:`text-[10px] font-normal text-krona-tertiary`,children:[`/ `,e.branchCount,` т.`]})]})]}),(0,U.jsxs)(`div`,{className:`p-1 rounded-md bg-krona-workspace/50`,children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Модули`}),(0,U.jsx)(`div`,{className:`font-bold text-krona-primary`,children:e.installedModulesCount})]}),(0,U.jsxs)(`div`,{className:`p-1 rounded-md bg-krona-workspace/50`,children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`MRR`}),(0,U.jsx)(gd,{minorUnits:e.mrrMinorUnits,className:`font-bold text-krona-gold text-xs`})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between pt-1`,children:[(0,U.jsxs)(`div`,{className:`text-xs text-krona-secondary`,children:[`Тариф: `,(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.tariffPlan})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(`organization`,e.tenantId)},className:`min-h-[44px] min-w-[44px] px-3 flex items-center gap-1 text-xs font-semibold text-krona-gold bg-krona-gold/10 hover:bg-krona-gold/20 rounded-lg border border-krona-gold/30 transition-colors`,"data-testid":`inspect-org-${e.tenantId}`,children:[(0,U.jsx)(`span`,{children:`360° Карточка`}),(0,U.jsx)(H,{className:`w-4 h-4`})]})]})]},e.tenantId)),o.length===0&&(0,U.jsx)(`div`,{className:`p-8 text-center text-krona-tertiary rounded-xl border border-krona-border bg-krona-surface text-xs`,children:`Организации не найдены по заданным критериям фильтрации`})]}),(0,U.jsx)(`div`,{className:`hidden lg:block rounded-xl border border-krona-border bg-krona-surface overflow-hidden shadow-sm`,children:(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`w-full text-left text-xs border-collapse`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`border-b border-krona-border bg-krona-workspace text-krona-tertiary font-semibold uppercase tracking-wider text-[11px]`,children:[(0,U.jsx)(`th`,{className:`py-3 px-4`,children:`Организация / ИНН`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Статус`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Тарифный план`}),(0,U.jsx)(`th`,{className:`py-3 px-3 text-center`,children:`Польз. / Точки`}),(0,U.jsx)(`th`,{className:`py-3 px-3 text-center`,children:`Модули`}),(0,U.jsx)(`th`,{className:`py-3 px-3 text-right`,children:`MRR Доход`}),(0,U.jsx)(`th`,{className:`py-3 px-3 text-right`,children:`Задолженность`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Активность`}),(0,U.jsx)(`th`,{className:`py-3 px-4 text-right`,children:`Действие`})]})}),(0,U.jsxs)(`tbody`,{className:`divide-y divide-krona-border`,children:[o.map(e=>(0,U.jsxs)(`tr`,{onClick:()=>t(`organization`,e.tenantId),className:`hover:bg-krona-hover cursor-pointer transition-colors group`,children:[(0,U.jsxs)(`td`,{className:`py-3 px-4`,children:[(0,U.jsx)(`div`,{className:`font-bold text-krona-primary group-hover:text-krona-gold transition-colors`,children:e.displayName}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary font-mono mt-0.5`,children:[`ИНН `,e.inn,` • `,e.domain]})]}),(0,U.jsx)(`td`,{className:`py-3 px-3`,children:(0,U.jsx)(hd,{status:e.platformStatus,size:`sm`})}),(0,U.jsx)(`td`,{className:`py-3 px-3 font-medium text-krona-primary`,children:e.tariffPlan}),(0,U.jsxs)(`td`,{className:`py-3 px-3 text-center tabular-nums`,children:[(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.userCount}),(0,U.jsxs)(`span`,{className:`text-krona-tertiary text-[10px]`,children:[` / `,e.branchCount]})]}),(0,U.jsx)(`td`,{className:`py-3 px-3 text-center font-bold text-krona-primary tabular-nums`,children:e.installedModulesCount}),(0,U.jsx)(`td`,{className:`py-3 px-3 text-right`,children:(0,U.jsx)(gd,{minorUnits:e.mrrMinorUnits,className:`text-krona-gold font-bold`})}),(0,U.jsx)(`td`,{className:`py-3 px-3 text-right`,children:(0,U.jsx)(gd,{minorUnits:e.outstandingDebtMinorUnits,className:e.outstandingDebtMinorUnits>0?`text-status-danger-text font-bold`:`text-krona-tertiary`})}),(0,U.jsx)(`td`,{className:`py-3 px-3 text-krona-tertiary text-[11px]`,children:new Date(e.lastActiveAt).toLocaleString(`ru-RU`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}),(0,U.jsx)(`td`,{className:`py-3 px-4 text-right`,children:(0,U.jsxs)(`button`,{type:`button`,onClick:n=>{n.stopPropagation(),t(`organization`,e.tenantId)},className:`inline-flex items-center gap-1 px-3 py-2 min-h-[38px] rounded-lg bg-krona-workspace border border-krona-border text-krona-primary hover:text-krona-gold hover:border-krona-gold/40 text-[11px] font-medium transition-colors`,"data-testid":`inspect-org-btn-${e.tenantId}`,children:[(0,U.jsx)(`span`,{children:`360° Карточка`}),(0,U.jsx)(H,{className:`w-3.5 h-3.5`})]})})]},e.tenantId)),o.length===0&&(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:9,className:`py-8 text-center text-krona-tertiary`,children:`Организации не найдены по заданным критериям фильтрации`})})]})]})})})]})},Id=()=>{let e=Y(e=>e.subscriptions),t=Y(e=>e.modules),n=Y(e=>e.renewSubscription),r=Y(e=>e.grantGracePeriod),i=Y(e=>e.openConfirmModal),a=Y(e=>e.openInspector),{permissions:o}=nd(),[s,c]=(0,j.useState)(`all`),[l,u]=(0,j.useState)(e[0]?.subscriptionId||null),d=e.find(e=>e.subscriptionId===l)||e[0],[f,p]=(0,j.useState)(`year`),[m,h]=(0,j.useState)(null),g=m??(d?d.activeModules:[]),_=e.filter(e=>s===`all`||e.status===s),v=15e5+g.length*4e5,y=f===`year`?v*10:v,b=()=>{d&&i({title:`Продление подписки: ${d.tenantName}`,actionName:`grant_grace_period`,impactSummary:`Подписка будет продлена на ${f===`year`?`1 год`:`1 месяц`}. Состав модулей: ${g.join(`, `)}. Расчётная сумма: ${y/100} ₽.`,targetType:`subscription`,targetId:d.subscriptionId,targetName:d.tenantName,onConfirm:async e=>{await n(d.subscriptionId,f,g,e)}})},x=()=>{d&&i({title:`Предоставление льготного периода: ${d.tenantName}`,actionName:`grant_grace_period`,impactSummary:`Организации будет предоставлен льготный период (Grace Period) на 14 дней с сохранением доступа ко всем модулям.`,targetType:`subscription`,targetId:d.subscriptionId,targetName:d.tenantName,onConfirm:async e=>{await r(d.subscriptionId,14,e)}})},S=e=>{g.includes(e)?h(g.filter(t=>t!==e)):h([...g,e])};return(0,U.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,"data-testid":`billing-page`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2.5 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg sm:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,U.jsx)(fs,{className:`w-5 h-5 text-krona-gold`}),(0,U.jsx)(`span`,{children:`Подписки и биллинг платформы`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Контроль сроков действия лицензий, предоставление льготных периодов и продление тарифов`})]}),(0,U.jsxs)(`div`,{className:`text-xs text-krona-secondary`,children:[`Всего подписок: `,(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.length}),` (найдено:`,` `,(0,U.jsx)(`span`,{className:`font-bold text-krona-gold`,children:_.length}),`)`]})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 text-xs`,children:[{id:`all`,label:`Все подписки`},{id:`expiring_7d`,label:`Истекают (< 7 дн.)`},{id:`expiring_30d`,label:`Истекают (< 30 дн.)`},{id:`grace`,label:`Льготный период`},{id:`overdue`,label:`Просроченные`}].map(e=>(0,U.jsx)(`button`,{type:`button`,"data-testid":`filter-${e.id}`,onClick:()=>c(e.id),className:`min-h-[44px] px-3.5 py-2 rounded-lg font-medium transition-colors shrink-0 ${s===e.id?`bg-krona-gold/15 text-krona-gold border border-krona-gold/30 font-bold`:`bg-krona-surface text-krona-secondary border border-krona-border hover:text-krona-primary hover:bg-krona-hover`}`,children:e.label},e.id))}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-4`,children:[(0,U.jsxs)(`div`,{className:`lg:col-span-7 space-y-3`,children:[_.map(e=>{let t=e.subscriptionId===d?.subscriptionId,n=new Date(e.validUntil);return(0,U.jsxs)(`div`,{onClick:()=>{u(e.subscriptionId),h(null)},className:`p-4 rounded-xl border transition-all cursor-pointer space-y-3 ${t?`border-krona-gold bg-krona-surface shadow-md ring-1 ring-krona-gold/30`:`border-krona-border bg-krona-surface/60 hover:bg-krona-surface hover:border-krona-border`}`,"data-testid":`subscription-card-${e.subscriptionId}`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`font-bold text-sm text-krona-primary`,children:e.tenantName}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary mt-0.5`,children:[`Тарифный план: `,(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.planCode})]})]}),(0,U.jsx)(hd,{status:e.status,size:`sm`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs py-2 border-y border-krona-border`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Стоимость в месяц`}),(0,U.jsx)(gd,{minorUnits:e.amountMinorUnits,currency:e.currency,className:`font-bold text-krona-gold text-xs`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-tertiary`,children:`Действует до`}),(0,U.jsxs)(`div`,{className:`font-bold text-krona-primary flex items-center gap-1`,children:[(0,U.jsx)(Mo,{className:`w-3.5 h-3.5 text-krona-gold`}),(0,U.jsx)(`span`,{children:n.toLocaleDateString(`ru-RU`)})]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between pt-1`,children:[(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-secondary`,children:[`Подключено модулей: `,(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.activeModules.length})]}),(0,U.jsx)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),a(`organization`,e.tenantId)},className:`min-h-[44px] px-3 text-xs font-semibold text-krona-gold hover:underline flex items-center gap-1`,children:(0,U.jsx)(`span`,{children:`360° Инспектор`})})]})]},e.subscriptionId)}),_.length===0&&(0,U.jsx)(`div`,{className:`p-8 text-center text-krona-tertiary rounded-xl border border-krona-border bg-krona-surface text-xs`,children:`Подписки не найдены по выбранным критериям`})]}),(0,U.jsx)(`div`,{className:`lg:col-span-5`,children:d?(0,U.jsxs)(`div`,{className:`p-5 rounded-xl border border-krona-border bg-krona-surface space-y-4 sticky top-20 shadow-sm`,children:[(0,U.jsxs)(`div`,{className:`border-b border-krona-border pb-3`,children:[(0,U.jsx)(`div`,{className:`text-[11px] font-semibold text-krona-gold uppercase tracking-wider`,children:`Управление подпиской`}),(0,U.jsx)(`h2`,{className:`text-base font-bold text-krona-primary mt-0.5`,children:d.tenantName}),(0,U.jsxs)(`div`,{className:`text-xs text-krona-secondary mt-0.5`,children:[`Текущий статус: `,(0,U.jsx)(hd,{status:d.status,size:`sm`})]})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsx)(`label`,{className:`block text-xs font-semibold text-krona-secondary`,children:`Период продления лицензии`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>p(`month`),className:`min-h-[44px] py-2 px-3 rounded-lg text-xs font-semibold border transition-colors ${f===`month`?`border-krona-gold bg-krona-gold/15 text-krona-gold`:`border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary`}`,children:`1 месяц (Базовый)`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>p(`year`),className:`min-h-[44px] py-2 px-3 rounded-lg text-xs font-semibold border transition-colors ${f===`year`?`border-krona-gold bg-krona-gold/15 text-krona-gold`:`border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary`}`,children:`1 год (Скидка 16%)`})]})]}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`label`,{className:`block text-xs font-semibold text-krona-secondary`,children:[`Состав модулей (`,g.length,`)`]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-1.5 max-h-48 overflow-y-auto p-1`,children:t.map(e=>{let t=g.includes(e.code);return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>S(e.code),className:`min-h-[40px] px-2.5 py-1.5 rounded-lg text-xs border text-left flex items-center justify-between transition-colors ${t?`border-krona-gold/40 bg-krona-gold/10 text-krona-primary`:`border-krona-border bg-krona-workspace text-krona-tertiary hover:text-krona-secondary`}`,children:[(0,U.jsx)(`span`,{className:`truncate`,children:e.name}),t&&(0,U.jsx)(Xo,{className:`w-3.5 h-3.5 text-krona-gold shrink-0 ml-1`})]},e.code)})})]}),(0,U.jsxs)(`div`,{className:`p-3.5 rounded-xl bg-krona-workspace border border-krona-border flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[11px] text-krona-tertiary`,children:`Расчётная стоимость продления`}),(0,U.jsx)(gd,{minorUnits:y,currency:d.currency,className:`text-lg font-bold text-krona-gold`})]}),(0,U.jsx)(`div`,{className:`text-right text-[11px] text-krona-secondary`,children:f===`year`?`За 12 месяцев`:`За 1 месяц`})]}),(0,U.jsxs)(`div`,{className:`space-y-2 pt-2`,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:!o.canGrantTrialGrace,onClick:b,className:`w-full min-h-[44px] px-4 py-2.5 rounded-lg bg-krona-gold hover:bg-krona-gold-hover text-zinc-950 font-bold text-xs flex items-center justify-center gap-2 transition-colors shadow-sm disabled:opacity-40`,"data-testid":`renew-subscription-btn`,children:[(0,U.jsx)(wc,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Продлить подписку (Выставить счёт)`})]}),(0,U.jsxs)(`button`,{type:`button`,disabled:!o.canGrantTrialGrace,onClick:x,className:`w-full min-h-[44px] px-4 py-2 rounded-lg border border-status-warning-border bg-status-warning-soft text-status-warning-text font-semibold text-xs flex items-center justify-center gap-2 transition-colors disabled:opacity-40`,"data-testid":`grant-grace-btn`,children:[(0,U.jsx)(ns,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Предоставить льготный период (14 дн.)`})]})]})]}):(0,U.jsx)(`div`,{className:`p-8 text-center text-krona-tertiary rounded-xl border border-krona-border bg-krona-surface text-xs`,children:`Выберите организацию из списка для продления или изменения состава модулей`})})]})]})},Ld=()=>{let e=Y(e=>e.modules),t=Y(e=>e.rollouts),n=Y(e=>e.organizations),r=Y(e=>e.openConfirmModal),i=Y(e=>e.triggerRolloutStage),a=Y(e=>e.createRollout),{permissions:o}=nd(),[s,c]=(0,j.useState)(e[0]?.moduleId||`krona-core`),l=e.find(e=>e.moduleId===s),u=l?.latestVersion||`1.0.0`,d=n.slice(0,2).map(e=>e.tenantId),f=t.find(e=>e.moduleId===s),p=(e,t)=>{if(!f)return;let n=ud[e]||e;r({title:`Смена фазы раскатки: ${f.moduleName}`,actionName:`rollout.stage_${e}`,impactSummary:`Конвейер раскатки будет переведен в состояние «${n}» (${t}% трафика).`,targetType:`rollout`,targetId:f.rolloutId,targetName:f.moduleName,onConfirm:async n=>{await i(f.rolloutId,e,t,n)}})};return(0,U.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,U.jsx)(fc,{className:`w-5 h-5 text-amber-500 shrink-0`}),(0,U.jsx)(`span`,{children:`Каталог модулей и Rollout конвейер`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Управление версиями модулей, совместимостью с ядром, пилотными группами и канареечным развертыванием`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-krona-secondary`,children:[(0,U.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-krona-workspace border border-krona-border`,children:[`Всего модулей: `,(0,U.jsx)(`strong`,{className:`text-krona-primary`,children:e.length})]}),(0,U.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-amber-500/10 border border-amber-500/30 text-amber-500 font-semibold`,children:[`Активных раскаток: `,(0,U.jsx)(`strong`,{children:t.length})]})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-4 md:gap-6`,children:[(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-3 md:p-4 space-y-3 shadow-xs`,children:[(0,U.jsx)(`div`,{className:`text-xs font-semibold text-krona-secondary uppercase tracking-wider px-1`,children:`Каталог системных модулей`}),(0,U.jsx)(`div`,{className:`space-y-2 max-h-[480px] lg:max-h-none overflow-y-auto`,children:e.map(e=>{let n=e.moduleId===s,r=t.some(t=>t.moduleId===e.moduleId);return(0,U.jsxs)(`div`,{onClick:()=>c(e.moduleId),className:`min-h-[44px] p-3 rounded-lg border text-xs cursor-pointer transition-colors space-y-1.5 ${n?`bg-amber-500/15 border-amber-500/40 text-krona-primary shadow-xs`:`bg-krona-workspace border-krona-border text-krona-secondary hover:bg-krona-surface hover:text-krona-primary`}`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.name}),(0,U.jsxs)(`span`,{className:`text-[10px] font-mono px-1.5 py-0.5 rounded-md bg-krona-surface border border-krona-border text-amber-500 font-semibold`,children:[`v`,e.latestVersion]})]}),(0,U.jsx)(`p`,{className:`text-[11px] text-krona-secondary line-clamp-1`,children:e.description}),(0,U.jsxs)(`div`,{className:`flex justify-between items-center text-[10px] text-krona-secondary/80 pt-1`,children:[(0,U.jsxs)(`span`,{children:[`Организаций: `,e.activeTenantsCount,` • Установок: `,e.instancesCount]}),r&&(0,U.jsx)(`span`,{className:`px-1.5 py-0.5 rounded-md bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/30 font-bold uppercase text-[9px]`,children:`Раскатка`})]})]},e.moduleId)})})]}),(0,U.jsx)(`div`,{className:`lg:col-span-2 space-y-4 md:space-y-6`,children:l&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 md:p-5 space-y-4 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mb-1`,children:[(0,U.jsx)(`span`,{className:`font-mono text-xs text-amber-500 font-bold`,children:l.code}),(0,U.jsx)(`span`,{className:`text-krona-secondary`,children:`•`}),(0,U.jsxs)(`span`,{className:`text-xs text-krona-secondary`,children:[`Категория: `,sd[l.category]||l.category]})]}),(0,U.jsx)(`h2`,{className:`text-base md:text-lg font-bold text-krona-primary`,children:l.name}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-1`,children:l.description})]}),(0,U.jsxs)(`div`,{className:`text-left sm:text-right shrink-0`,children:[(0,U.jsx)(`span`,{className:`text-xs text-krona-secondary`,children:`Текущая версия:`}),(0,U.jsxs)(`div`,{className:`font-mono font-bold text-lg text-emerald-600 dark:text-emerald-400`,children:[`v`,l.latestVersion]})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2 text-xs pt-3 border-t border-krona-border`,children:[(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary mb-0.5`,children:`Канал релиза:`}),(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary uppercase`,children:l.rolloutChannel})]}),(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary mb-0.5`,children:`Манифест:`}),(0,U.jsxs)(`div`,{className:`font-semibold text-krona-primary font-mono`,children:[`v`,l.manifestVersion]})]}),(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary mb-0.5`,children:`Зависимости:`}),(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary truncate`,children:l.dependencies.length>0?l.dependencies.join(`, `):`Базовый`})]})]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 md:p-5 space-y-4 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Kc,{className:`w-4 h-4 text-amber-500`}),(0,U.jsx)(`h3`,{className:`text-sm font-bold text-krona-primary`,children:`Управление конвейером раскатки (Rollout)`})]}),f&&(0,U.jsx)(hd,{status:f.stage,size:`sm`,customLabel:ud[f.stage]||f.stage})]}),f?(0,U.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[(0,U.jsxs)(`div`,{className:`p-4 rounded-xl bg-krona-workspace border border-krona-border space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,U.jsxs)(`span`,{className:`font-semibold text-krona-primary`,children:[`Целевая версия:`,` `,(0,U.jsxs)(`span`,{className:`font-mono text-amber-500 font-bold`,children:[`v`,f.targetVersion]})]}),(0,U.jsxs)(`span`,{className:`font-bold text-amber-500 font-mono text-sm`,children:[f.percentage,`%`]})]}),(0,U.jsx)(`div`,{className:`w-full bg-krona-border h-2 rounded-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full bg-amber-500 transition-all duration-300 rounded-full`,style:{width:`${f.percentage}%`}})}),(0,U.jsxs)(`div`,{className:`flex flex-wrap justify-between gap-2 text-[11px] text-krona-secondary`,children:[(0,U.jsxs)(`span`,{children:[`Стадия:`,` `,(0,U.jsx)(`strong`,{className:`text-krona-primary`,children:ud[f.stage]||f.stage})]}),(0,U.jsxs)(`span`,{children:[`Пилотных организаций: `,f.pilotTenantIds.length]}),(0,U.jsxs)(`span`,{children:[`Старт: `,new Date(f.startedAt).toLocaleDateString(`ru-RU`)]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-2`,children:[(0,U.jsx)(`button`,{type:`button`,disabled:!o.canTriggerRollouts||f.stage===`pilot`,onClick:()=>p(`pilot`,15),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-krona-workspace border border-krona-border text-krona-primary hover:bg-krona-surface text-xs font-medium disabled:opacity-40 transition-colors shadow-xs`,children:`Фаза 1: Пилот (15%)`}),(0,U.jsx)(`button`,{type:`button`,disabled:!o.canTriggerRollouts||f.stage===`percentage`,onClick:()=>p(`percentage`,50),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-krona-workspace border border-krona-border text-krona-primary hover:bg-krona-surface text-xs font-medium disabled:opacity-40 transition-colors shadow-xs`,children:`Фаза 2: 50% организаций`}),(0,U.jsx)(`button`,{type:`button`,disabled:!o.canTriggerRollouts||f.stage===`general_availability`,onClick:()=>p(`general_availability`,100),className:`min-h-[44px] px-4 py-2 rounded-lg bg-emerald-500/15 text-emerald-600 dark:text-emerald-300 border border-emerald-500/40 hover:bg-emerald-500/25 text-xs font-bold disabled:opacity-40 transition-colors shadow-xs`,children:`Фаза 3: Полный релиз (100% GA)`}),f.stage===`paused`?(0,U.jsxs)(`button`,{type:`button`,disabled:!o.canTriggerRollouts,onClick:()=>p(`pilot`,f.percentage),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-amber-500 text-zinc-950 font-bold text-xs hover:bg-amber-400 transition-colors flex items-center gap-1.5 shadow-xs`,children:[(0,U.jsx)(gc,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Снять с паузы`})]}):(0,U.jsxs)(`button`,{type:`button`,disabled:!o.canPauseRollbackRollouts,onClick:()=>p(`paused`,f.percentage),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/40 hover:bg-amber-500/25 text-xs font-bold disabled:opacity-40 transition-colors flex items-center gap-1.5 shadow-xs`,children:[(0,U.jsx)(mc,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`На паузу`})]}),(0,U.jsxs)(`button`,{type:`button`,disabled:!o.canPauseRollbackRollouts||f.stage===`rolled_back`,onClick:()=>p(`rolled_back`,0),className:`min-h-[44px] px-3.5 py-2 rounded-lg bg-rose-500/15 text-rose-600 dark:text-rose-300 border border-rose-500/40 hover:bg-rose-500/25 text-xs font-bold disabled:opacity-40 transition-colors flex items-center gap-1.5 shadow-xs`,children:[(0,U.jsx)(Ec,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Откат (Rollback)`})]})]})]}):(0,U.jsxs)(`div`,{className:`p-4 rounded-xl bg-krona-workspace border border-krona-border text-xs space-y-3`,children:[(0,U.jsxs)(`p`,{className:`text-krona-secondary`,children:[`Для модуля `,(0,U.jsx)(`strong`,{className:`text-krona-primary`,children:l.name}),` нет активных раскаток. Вы можете запустить пилотный релиз новой версии для проверки совместимости.`]}),(0,U.jsxs)(`button`,{type:`button`,disabled:!o.canTriggerRollouts,onClick:()=>{l&&r({title:`Запуск новой раскатки: ${l.name}`,actionName:`rollout.start_pilot (${u})`,impactSummary:`Будет запущен пилотный этап обновления до версии ${u} для ${d.length} пилотных организаций.`,targetType:`rollout`,targetId:l.moduleId,targetName:l.name,onConfirm:async e=>{await a(l.moduleId,u,`pilot`,d,15,`Пилотная фаза раскатки обновления`,e)}})},className:`min-h-[44px] px-4 py-2.5 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs transition-colors flex items-center gap-2 disabled:opacity-40 shadow-xs`,children:[(0,U.jsx)(gc,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Запустить пилотную раскатку`})]})]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 md:p-5 space-y-3 text-xs shadow-xs`,children:[(0,U.jsxs)(`h3`,{className:`text-sm font-bold text-krona-primary flex items-center gap-1.5`,children:[(0,U.jsx)(Xc,{className:`w-4 h-4 text-amber-500`}),(0,U.jsx)(`span`,{children:`История релизов и совместимость`})]}),(0,U.jsx)(`div`,{className:`space-y-2`,children:l.releaseHistory.map(e=>(0,U.jsxs)(`div`,{className:`p-3 rounded-lg bg-krona-workspace border border-krona-border space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,U.jsxs)(`span`,{className:`font-bold text-amber-500 font-mono`,children:[`v`,e.version]}),(0,U.jsx)(`span`,{className:`text-[11px] text-krona-secondary`,children:new Date(e.releasedAt).toLocaleDateString(`ru-RU`)})]}),(0,U.jsx)(`p`,{className:`text-krona-primary text-[11px]`,children:e.changelog}),(0,U.jsxs)(`div`,{className:`text-[10px] text-krona-secondary font-mono pt-1`,children:[`Совместимость с ядром: `,e.compatibleCore]})]},e.version))})]})]})})]})]})},Rd=()=>{let e=Y(e=>e.installations),[t,n]=(0,j.useState)(``),[r,i]=(0,j.useState)(`all`),[a,o]=(0,j.useState)(`all`),s=e.filter(e=>{let n=cd[e.kind]||``,i=!t||e.deviceName.toLowerCase().includes(t.toLowerCase())||e.tenantName.toLowerCase().includes(t.toLowerCase())||e.appVersion.includes(t)||n.toLowerCase().includes(t.toLowerCase()),o=r===`all`||e.kind===r,s=a===`all`||e.status===a;return i&&o&&s}),c=e.filter(e=>e.kind===`android`&&(e.status===`outdated`||e.status===`blocked`)),l=e=>{switch(e){case`android`:return(0,U.jsx)(Jc,{className:`w-4 h-4 text-emerald-500`});case`desktop`:return(0,U.jsx)(oc,{className:`w-4 h-4 text-sky-500`});case`web`:return(0,U.jsx)(Ss,{className:`w-4 h-4 text-amber-500`})}};return(0,U.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,U.jsx)(Jc,{className:`w-5 h-5 text-amber-500 shrink-0`}),(0,U.jsx)(`span`,{children:`Установки и клиентские приложения`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Мониторинг клиентских устройств Web, Desktop и Android (ТСД терминалы сбора данных и кассы)`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-krona-secondary`,children:[(0,U.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-krona-workspace border border-krona-border`,children:[`Всего: `,(0,U.jsx)(`strong`,{className:`text-krona-primary`,children:e.length})]}),(0,U.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-amber-500/10 border border-amber-500/30 text-amber-500 font-semibold`,children:[`Найдено: `,(0,U.jsx)(`strong`,{children:s.length})]})]})]}),c.length>0&&(0,U.jsxs)(`div`,{className:`rounded-xl border border-amber-500/40 bg-amber-500/10 p-4 flex flex-col md:flex-row items-start md:items-center justify-between gap-3 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,U.jsx)(`div`,{className:`p-2 rounded-lg bg-amber-500/20 text-amber-500 border border-amber-500/30 shrink-0 mt-0.5`,children:(0,U.jsx)(fl,{className:`w-5 h-5`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`text-sm font-bold text-amber-600 dark:text-amber-300`,children:[`Обнаружены устаревшие Android-установки (`,c.length,` устройств)`]}),(0,U.jsx)(`div`,{className:`text-xs text-krona-secondary mt-0.5 leading-relaxed`,children:`Терминалы сбора данных Zebra, Honeywell и кассы Эвотор работают на устаревших версиях клиента (v1.0.4 – v1.2.0). Рекомендуется запланировать push-обновление APK пакета через MDM канал.`})]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{i(`android`),o(`outdated`)},className:`shrink-0 min-h-[44px] px-4 py-2 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs transition-colors shadow-xs`,children:`Показать только устаревшие Android`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-3 items-stretch md:items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,U.jsx)(Oc,{className:`w-4 h-4 text-krona-secondary absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none`}),(0,U.jsx)(`input`,{type:`text`,value:t,onChange:e=>n(e.target.value),placeholder:`Поиск по устройству, организации или версии...`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg pl-9 pr-3 py-2.5 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 transition-colors min-h-[44px]`})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1 overflow-x-auto pb-1`,children:[(0,U.jsx)(`span`,{className:`text-krona-secondary text-[11px] mr-1 hidden sm:inline`,children:`Платформа:`}),[{id:`all`,label:`Все`},{id:`android`,label:`Android`},{id:`desktop`,label:`Desktop`},{id:`web`,label:`Web`}].map(e=>(0,U.jsx)(`button`,{onClick:()=>i(e.id),className:`min-h-[44px] px-3 py-2 rounded-lg font-medium transition-colors ${r===e.id?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/40 font-bold shadow-xs`:`bg-krona-workspace text-krona-secondary border border-krona-border hover:text-krona-primary`}`,children:e.label},e.id))]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 pl-2 border-l border-krona-border overflow-x-auto pb-1`,children:[(0,U.jsx)(`span`,{className:`text-krona-secondary text-[11px] mr-1 hidden sm:inline`,children:`Статус:`}),[{id:`all`,label:`Все`},{id:`outdated`,label:`Устарели`},{id:`supported`,label:`В норме`},{id:`blocked`,label:`Блок`}].map(e=>(0,U.jsx)(`button`,{onClick:()=>o(e.id),className:`min-h-[44px] px-3 py-2 rounded-lg font-medium transition-colors ${a===e.id?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/40 font-bold shadow-xs`:`bg-krona-workspace text-krona-secondary border border-krona-border hover:text-krona-primary`}`,children:e.label},e.id))]})]})]}),(0,U.jsxs)(`div`,{className:`block lg:hidden space-y-3`,children:[s.map(e=>{let t=cd[e.kind]||e.kind,n=dd[e.status]||e.status;return(0,U.jsxs)(`div`,{className:`p-4 rounded-xl border border-krona-border bg-krona-surface space-y-3 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-start gap-2 border-b border-krona-border pb-2.5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l(e.kind),(0,U.jsx)(`span`,{className:`font-bold text-sm text-krona-primary`,children:e.deviceName})]}),(0,U.jsxs)(`div`,{className:`text-xs text-krona-secondary mt-0.5`,children:[e.tenantName,` • `,t]})]}),(0,U.jsx)(hd,{status:e.status,size:`sm`,customLabel:n})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,U.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,U.jsx)(`span`,{className:`text-[10px] text-krona-secondary block`,children:`Версия клиента`}),(0,U.jsxs)(`span`,{className:`font-mono font-bold text-amber-500`,children:[`v`,e.appVersion]})]}),(0,U.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border`,children:[(0,U.jsx)(`span`,{className:`text-[10px] text-krona-secondary block`,children:`ОС устройства`}),(0,U.jsx)(`span`,{className:`font-mono text-krona-primary truncate block`,children:e.osVersion})]})]}),(0,U.jsxs)(`div`,{className:`pt-2 border-t border-krona-border flex items-center justify-between text-[11px] text-krona-secondary`,children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-1 font-mono`,children:[(0,U.jsx)(bc,{className:`w-3 h-3 text-emerald-500`}),e.ipAddressMasked]}),(0,U.jsxs)(`span`,{children:[`Активность: `,new Date(e.lastSeenAt).toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`})]})]})]},e.installationId)}),s.length===0&&(0,U.jsx)(`div`,{className:`p-8 rounded-xl border border-krona-border bg-krona-surface text-center text-xs text-krona-secondary`,children:`Установки не найдены по выбранным критериям`})]}),(0,U.jsx)(`div`,{className:`hidden lg:block rounded-xl border border-krona-border bg-krona-surface overflow-hidden shadow-xs`,children:(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`w-full text-left text-xs border-collapse`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`border-b border-krona-border bg-krona-workspace text-krona-secondary font-semibold uppercase tracking-wider text-[11px]`,children:[(0,U.jsx)(`th`,{className:`py-3 px-4`,children:`Платформа`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Устройство / Модель`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Организация`}),(0,U.jsx)(`th`,{className:`py-3 px-3 font-mono`,children:`Версия клиента`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`ОС устройства`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Статус поддержки`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Последняя активность`}),(0,U.jsx)(`th`,{className:`py-3 px-4`,children:`Сегмент IP`})]})}),(0,U.jsxs)(`tbody`,{className:`divide-y divide-krona-border/60`,children:[s.map(e=>(0,U.jsxs)(`tr`,{className:`hover:bg-krona-workspace/50 transition-colors`,children:[(0,U.jsx)(`td`,{className:`py-3 px-4`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-krona-primary`,children:[l(e.kind),(0,U.jsx)(`span`,{children:cd[e.kind]||e.kind})]})}),(0,U.jsx)(`td`,{className:`py-3 px-3 font-semibold text-krona-primary`,children:e.deviceName}),(0,U.jsx)(`td`,{className:`py-3 px-3 text-krona-secondary font-medium`,children:e.tenantName}),(0,U.jsxs)(`td`,{className:`py-3 px-3 font-mono font-bold text-amber-500`,children:[`v`,e.appVersion]}),(0,U.jsx)(`td`,{className:`py-3 px-3 text-krona-secondary font-mono text-[11px]`,children:e.osVersion}),(0,U.jsx)(`td`,{className:`py-3 px-3`,children:(0,U.jsx)(hd,{status:e.status,size:`sm`,customLabel:dd[e.status]||e.status})}),(0,U.jsx)(`td`,{className:`py-3 px-3 text-krona-secondary text-[11px]`,children:new Date(e.lastSeenAt).toLocaleString(`ru-RU`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`})}),(0,U.jsx)(`td`,{className:`py-3 px-4 font-mono text-krona-secondary text-[11px]`,children:e.ipAddressMasked})]},e.installationId)),s.length===0&&(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:8,className:`py-8 text-center text-krona-secondary`,children:`Установки не найдены по выбранным критериям фильтрации`})})]})]})})})]})},zd=({isOpen:e,onClose:n,onServerAdded:r})=>{let i=Y(e=>e.addServerNode),[a,o]=(0,j.useState)(1),[s,c]=(0,j.useState)(``),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(``),[p,m]=(0,j.useState)(`Selectel`),[h,g]=(0,j.useState)(`ru-spb-1`),[_,v]=(0,j.useState)(22),[y,b]=(0,j.useState)(`krona`),[x,S]=(0,j.useState)(`key`),[C,w]=(0,j.useState)(`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPeQZ5+614cK1c3Qz1xL3rY7uK9zM8v2n1j4b krona@ochenstarik.ru`),[T,E]=(0,j.useState)(``),[D,O]=(0,j.useState)(!1),[k,ee]=(0,j.useState)(!1),[A,te]=(0,j.useState)(`none`),[ne,re]=(0,j.useState)(!1),[ie,ae]=(0,j.useState)(null);return e?(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4 bg-black/60 backdrop-blur-xs overflow-y-auto`,"data-testid":`connect-server-modal`,children:(0,U.jsxs)(`div`,{className:`relative w-full max-w-lg bg-krona-surface border border-krona-border rounded-2xl shadow-2xl overflow-hidden my-auto`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between p-4 sm:p-5 border-b border-krona-border`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(`div`,{className:`w-9 h-9 rounded-xl bg-krona-gold/10 border border-krona-gold/30 flex items-center justify-center text-krona-gold`,children:(0,U.jsx)(Mc,{className:`w-5 h-5`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-base font-bold text-krona-primary leading-tight`,children:Z.connectServer.title}),(0,U.jsxs)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:[`Шаг `,a,` из 3: `,a===1?Z.connectServer.step1:a===2?Z.connectServer.step2:Z.connectServer.step3]})]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Закрыть`,className:`min-h-[44px] min-w-[44px] p-2 text-krona-secondary hover:text-krona-primary rounded-xl hover:bg-krona-workspace transition-colors flex items-center justify-center`,children:(0,U.jsx)(t,{className:`w-5 h-5`})})]}),(0,U.jsx)(`div`,{className:`w-full bg-krona-workspace h-1.5 flex`,children:(0,U.jsx)(`div`,{className:`h-full bg-krona-gold transition-all duration-300`,style:{width:`${a/3*100}%`}})}),(0,U.jsxs)(`div`,{className:`p-4 sm:p-5 space-y-4 max-h-[70vh] overflow-y-auto`,children:[ie&&(0,U.jsxs)(`div`,{className:`p-3 rounded-xl bg-rose-500/10 border border-rose-500/30 text-rose-600 dark:text-rose-400 text-xs flex items-center gap-2`,children:[(0,U.jsx)(Ko,{className:`w-4 h-4 shrink-0`}),(0,U.jsx)(`span`,{children:ie})]}),a===1&&(0,U.jsxs)(`div`,{className:`space-y-3.5 text-xs`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:[Z.connectServer.serverName,` `,(0,U.jsx)(`span`,{className:`text-rose-500`,children:`*`})]}),(0,U.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),placeholder:Z.connectServer.serverNamePlaceholder,className:`w-full min-h-[44px] px-3 py-2 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-xs focus:outline-hidden focus:ring-1 focus:ring-krona-gold`,"data-testid":`input-server-name`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:[Z.connectServer.ipAddress,` `,(0,U.jsx)(`span`,{className:`text-rose-500`,children:`*`})]}),(0,U.jsx)(`input`,{type:`text`,value:d,onChange:e=>f(e.target.value),placeholder:Z.connectServer.ipAddressPlaceholder,className:`w-full min-h-[44px] px-3 py-2 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-xs font-mono focus:outline-hidden focus:ring-1 focus:ring-krona-gold`,"data-testid":`input-server-ip`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:Z.connectServer.hostname}),(0,U.jsx)(`input`,{type:`text`,value:l,onChange:e=>u(e.target.value),placeholder:Z.connectServer.hostnamePlaceholder,className:`w-full min-h-[44px] px-3 py-2 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-xs font-mono focus:outline-hidden focus:ring-1 focus:ring-krona-gold`})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:Z.connectServer.provider}),(0,U.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),className:`w-full min-h-[44px] px-3 py-2 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-xs focus:outline-hidden focus:ring-1 focus:ring-krona-gold`,children:[(0,U.jsx)(`option`,{value:`Selectel`,children:`Selectel`}),(0,U.jsx)(`option`,{value:`Timeweb Cloud`,children:`Timeweb Cloud`}),(0,U.jsx)(`option`,{value:`VK Cloud`,children:`VK Cloud`}),(0,U.jsx)(`option`,{value:`Self-hosted`,children:`Self-hosted / Свой ДЦ`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:Z.connectServer.region}),(0,U.jsx)(`input`,{type:`text`,value:h,onChange:e=>g(e.target.value),placeholder:Z.connectServer.regionPlaceholder,className:`w-full min-h-[44px] px-3 py-2 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-xs focus:outline-hidden focus:ring-1 focus:ring-krona-gold`})]})]})]}),a===2&&(0,U.jsxs)(`div`,{className:`space-y-3.5 text-xs`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:Z.connectServer.sshPort}),(0,U.jsx)(`input`,{type:`number`,value:_,onChange:e=>v(Number(e.target.value)),className:`w-full min-h-[44px] px-3 py-2 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-xs font-mono focus:outline-hidden focus:ring-1 focus:ring-krona-gold`,"data-testid":`input-ssh-port`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:Z.connectServer.sshUser}),(0,U.jsx)(`input`,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`krona или root`,className:`w-full min-h-[44px] px-3 py-2 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-xs font-mono focus:outline-hidden focus:ring-1 focus:ring-krona-gold`,"data-testid":`input-ssh-username`})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1.5`,children:Z.connectServer.authMethod}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>S(`key`),className:`min-h-[44px] p-2.5 rounded-xl border flex items-center justify-center gap-2 text-xs font-medium transition-colors ${x===`key`?`bg-krona-gold/10 border-krona-gold text-krona-gold`:`bg-krona-workspace border-krona-border text-krona-secondary hover:text-krona-primary`}`,children:[(0,U.jsx)(Ps,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`SSH-ключ (ed25519)`})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>S(`password`),className:`min-h-[44px] p-2.5 rounded-xl border flex items-center justify-center gap-2 text-xs font-medium transition-colors ${x===`password`?`bg-krona-gold/10 border-krona-gold text-krona-gold`:`bg-krona-workspace border-krona-border text-krona-secondary hover:text-krona-primary`}`,children:[(0,U.jsx)(Bc,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Пароль`})]})]})]}),x===`key`?(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:Z.connectServer.publicKey}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{let e=Array.from({length:32},()=>Math.floor(Math.random()*16).toString(16)).join(``);w(`ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI${e.slice(0,43)} kcc-agent@${s||`krona-node`}`)},className:`text-krona-gold hover:underline text-[11px]`,children:Z.connectServer.generateKey})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`textarea`,{readOnly:!0,rows:3,value:C,className:`w-full p-2.5 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-[11px] font-mono resize-none focus:outline-hidden`}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{navigator.clipboard.writeText(C),O(!0),setTimeout(()=>O(!1),2e3)},className:`absolute top-2 right-2 min-h-[36px] min-w-[36px] px-2 py-1 bg-krona-surface border border-krona-border rounded-lg text-krona-secondary hover:text-krona-primary flex items-center gap-1 text-[11px] shadow-xs`,title:Z.connectServer.copyKey,children:[D?(0,U.jsx)(Ro,{className:`w-3.5 h-3.5 text-emerald-500`}):(0,U.jsx)(os,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:D?`Скопировано`:`Копировать`})]})]}),(0,U.jsxs)(`p`,{className:`text-[11px] text-krona-secondary`,children:[`Скопируйте этот ключ и добавьте его в файл `,(0,U.jsx)(`code`,{className:`text-krona-primary font-mono`,children:`~/.ssh/authorized_keys`}),` на целевом сервере.`]})]}):(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`block font-semibold text-krona-primary mb-1`,children:`Пароль пользователя SSH`}),(0,U.jsx)(`input`,{type:`password`,value:T,onChange:e=>E(e.target.value),placeholder:`Введите пароль...`,className:`w-full min-h-[44px] px-3 py-2 bg-krona-workspace rounded-xl border border-krona-border text-krona-primary text-xs focus:outline-hidden focus:ring-1 focus:ring-krona-gold`})]})]}),a===3&&(0,U.jsxs)(`div`,{className:`space-y-4 text-xs`,children:[(0,U.jsxs)(`div`,{className:`p-3.5 rounded-xl bg-krona-workspace border border-krona-border space-y-2`,children:[(0,U.jsxs)(`div`,{className:`font-semibold text-krona-primary flex items-center justify-between`,children:[(0,U.jsx)(`span`,{children:`Сводка параметров узла:`}),(0,U.jsx)(`span`,{className:`font-mono text-krona-gold`,children:p})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-krona-secondary text-[11px]`,children:[(0,U.jsxs)(`div`,{children:[`Сервер: `,(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:s||`—`})]}),(0,U.jsxs)(`div`,{children:[`IP-адрес: `,(0,U.jsx)(`span`,{className:`font-mono text-krona-primary`,children:d||`—`})]}),(0,U.jsxs)(`div`,{children:[`SSH порт: `,(0,U.jsx)(`span`,{className:`font-mono text-krona-primary`,children:_})]}),(0,U.jsxs)(`div`,{children:[`Пользователь: `,(0,U.jsx)(`span`,{className:`font-mono text-krona-primary`,children:y})]}),(0,U.jsxs)(`div`,{children:[`Метод входа: `,(0,U.jsx)(`span`,{className:`text-krona-primary`,children:x===`key`?`SSH-ключ ed25519`:`Пароль`})]}),(0,U.jsxs)(`div`,{children:[`Регион: `,(0,U.jsx)(`span`,{className:`text-krona-primary`,children:h})]})]})]}),(0,U.jsxs)(`div`,{className:`p-3.5 rounded-xl bg-krona-workspace/60 border border-krona-border space-y-2.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:`Проверка связи с сервером:`}),(0,U.jsxs)(`button`,{type:`button`,onClick:async()=>{ee(!0),te(`none`),ae(null);try{await new Promise(e=>setTimeout(e,800)),d.trim()===`0.0.0.0`?(te(`failed`),ae(`Таймаут соединения: хост не отвечает по порту `+_)):te(`success`)}finally{ee(!1)}},disabled:k,className:`min-h-[44px] px-3.5 py-1.5 rounded-xl bg-krona-surface border border-krona-border text-krona-primary hover:bg-krona-workspace text-xs font-medium flex items-center gap-1.5 disabled:opacity-50 transition-colors`,"data-testid":`btn-test-ssh`,children:[k?(0,U.jsx)(Bs,{className:`w-3.5 h-3.5 animate-spin text-krona-gold`}):(0,U.jsx)(il,{className:`w-3.5 h-3.5 text-sky-400`}),(0,U.jsx)(`span`,{children:k?Z.connectServer.connecting:Z.connectServer.testConnection})]})]}),A===`success`&&(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 dark:text-emerald-400 text-xs flex items-center gap-2`,children:[(0,U.jsx)(Xo,{className:`w-4 h-4 shrink-0 text-emerald-500`}),(0,U.jsx)(`span`,{children:Z.connectServer.connectionSuccess})]}),A===`failed`&&(0,U.jsxs)(`div`,{className:`p-2.5 rounded-lg bg-rose-500/10 border border-rose-500/30 text-rose-600 dark:text-rose-400 text-xs flex items-center gap-2`,children:[(0,U.jsx)(Ko,{className:`w-4 h-4 shrink-0 text-rose-500`}),(0,U.jsx)(`span`,{children:Z.connectServer.connectionFailed})]})]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between p-4 sm:p-5 border-t border-krona-border bg-krona-workspace/40`,children:[a>1?(0,U.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>e-1),className:`min-h-[44px] px-4 py-2 rounded-xl text-xs font-medium text-krona-secondary hover:text-krona-primary border border-krona-border hover:bg-krona-workspace flex items-center gap-1 transition-colors`,children:[(0,U.jsx)(Ho,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:Z.connectServer.back})]}):(0,U.jsx)(`button`,{type:`button`,onClick:n,className:`min-h-[44px] px-4 py-2 rounded-xl text-xs font-medium text-krona-secondary hover:text-krona-primary transition-colors`,children:Z.connectServer.cancel}),a<3?(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{if(a===1&&(!s.trim()||!d.trim())){ae(`Заполните название сервера и IP-адрес`);return}ae(null),o(e=>e+1)},className:`min-h-[44px] px-5 py-2 rounded-xl text-xs font-semibold bg-krona-gold text-krona-gold-contrast hover:brightness-110 flex items-center gap-1 shadow-md transition-all`,"data-testid":`btn-connect-next`,children:[(0,U.jsx)(`span`,{children:Z.connectServer.next}),(0,U.jsx)(H,{className:`w-4 h-4`})]}):(0,U.jsxs)(`button`,{type:`button`,onClick:async()=>{if(!s.trim()||!d.trim()){ae(`Пожалуйста, заполните имя сервера и IP-адрес`);return}re(!0);try{let e={name:s.trim(),hostname:l.trim()||`${s.trim().toLowerCase()}.infra.krona.systems`,ipAddress:d.trim(),hostingProvider:p,region:h.trim()||`ru-dc1`,sshConfig:{port:Number(_)||22,username:y.trim()||`root`,authMethod:x,publicKey:x===`key`?C:void 0,fingerprint:`SHA256:${Array.from({length:24},()=>Math.floor(Math.random()*16).toString(16)).join(``)}`,status:`connected`}},t=await i(e,`Подключение нового инфраструктурного сервера через мастер онбординга`);r?.(t.serverId),n()}catch(e){ae(e instanceof Error?e.message:`Ошибка при добавлении сервера`)}finally{re(!1)}},disabled:ne,className:`min-h-[44px] px-5 py-2 rounded-xl text-xs font-semibold bg-emerald-500 text-white hover:bg-emerald-600 flex items-center gap-1.5 shadow-md disabled:opacity-50 transition-all`,"data-testid":`btn-connect-finish`,children:[ne?(0,U.jsx)(Bs,{className:`w-4 h-4 animate-spin`}):(0,U.jsx)(Ro,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:Z.connectServer.finish})]})]})]})}):null},Bd=z([{path:`/control/gate`,element:(0,U.jsx)(()=>{let e=zr(),t=Y(e=>e.setAccessGatePassed),[n,r]=(0,j.useState)(``),[i,a]=(0,j.useState)(!1),o=Od(e=>e.themeMode),s=Od(e=>e.setTheme),c=[{id:`soft-light`,label:ld[`soft-light`],icon:(0,U.jsx)(Xc,{className:`w-3.5 h-3.5`})},{id:`light`,label:ld.light,icon:(0,U.jsx)(el,{className:`w-3.5 h-3.5`})},{id:`dark`,label:ld.dark,icon:(0,U.jsx)(cc,{className:`w-3.5 h-3.5`})}];return(0,U.jsxs)(`div`,{className:`min-h-screen bg-krona-app text-krona-primary flex flex-col items-center justify-center p-4 md:p-6 transition-colors duration-200`,children:[(0,U.jsx)(`div`,{className:`absolute top-4 right-4 flex items-center gap-1 p-1 rounded-xl bg-krona-surface border border-krona-border shadow-xs`,children:c.map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>s(e.id),title:e.label,className:`min-w-[40px] min-h-[40px] px-2.5 py-1 rounded-lg text-xs font-medium flex items-center gap-1.5 transition-colors ${o===e.id?`bg-amber-500 text-zinc-950 font-bold shadow-xs`:`text-krona-secondary hover:text-krona-primary hover:bg-krona-workspace`}`,children:[e.icon,(0,U.jsx)(`span`,{className:`hidden sm:inline`,children:e.label})]},e.id))}),(0,U.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-krona-border bg-krona-surface p-6 md:p-8 text-center space-y-6 shadow-xl`,children:[(0,U.jsx)(`div`,{className:`w-16 h-16 rounded-2xl bg-amber-500/15 border border-amber-500/30 flex items-center justify-center text-amber-500 mx-auto`,children:(0,U.jsx)(Hs,{className:`w-8 h-8`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-xs font-mono font-bold uppercase tracking-widest text-amber-500`,children:X.brand}),(0,U.jsx)(`h1`,{className:`text-xl md:text-2xl font-black text-krona-primary mt-1`,children:X.gateTitle}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-2`,children:X.gateSubtitle})]}),(0,U.jsxs)(`form`,{onSubmit:r=>{r.preventDefault(),n===`krona2026`||n===`kcc`||n===`admin`||n===`8492`?(t(!0),e(`/control`)):a(!0)},className:`space-y-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`input`,{type:`password`,value:n,"data-testid":`pin-input`,onChange:e=>{r(e.target.value),i&&a(!1)},placeholder:X.gatePinPlaceholder,className:`w-full bg-krona-workspace border border-krona-border rounded-xl px-4 py-3 text-center text-sm text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 tracking-wider font-mono min-h-[48px]`}),i&&(0,U.jsx)(`p`,{className:`text-xs text-rose-500 font-medium mt-1.5`,"data-testid":`pin-error`,children:X.gateError})]}),(0,U.jsxs)(`button`,{type:`submit`,"data-testid":`pin-submit`,className:`w-full min-h-[48px] py-3 px-4 rounded-xl bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs flex items-center justify-center gap-2 transition-colors shadow-xs`,children:[(0,U.jsx)(`span`,{children:X.gateSubmit}),(0,U.jsx)(vo,{className:`w-4 h-4`})]})]}),(0,U.jsx)(`div`,{className:`pt-2 border-t border-krona-border`,children:(0,U.jsx)(`button`,{type:`button`,"data-testid":`pin-demo-login`,onClick:()=>{t(!0),e(`/control`)},className:`min-h-[44px] inline-flex items-center text-xs text-krona-secondary hover:text-amber-500 transition-colors underline underline-offset-4`,children:X.gateDemoLogin})})]})]})},{})},{path:`/control/403`,element:(0,U.jsx)(jd,{})},{path:`/control`,element:(0,U.jsx)(Nd,{children:(0,U.jsx)(Ad,{})}),errorElement:(0,U.jsx)(`div`,{className:`p-8 bg-[#07130e] text-zinc-100 min-h-screen`,children:(0,U.jsx)(zl,{scope:`Krona Control Center`,children:(0,U.jsx)(jd,{})})}),children:[{index:!0,element:(0,U.jsx)(Pd,{})},{path:`organizations`,element:(0,U.jsx)(Fd,{})},{path:`billing`,element:(0,U.jsx)(Id,{})},{path:`modules`,element:(0,U.jsx)(Ld,{})},{path:`installations`,element:(0,U.jsx)(Rd,{})},{path:`infrastructure`,element:(0,U.jsx)(()=>{let e=Y(e=>e.servers),t=Y(e=>e.instances),n=Y(e=>e.openInspector),r=Y(e=>e.openConfirmModal),i=Y(e=>e.createIncidentFromAlert),a=Y(e=>e.requestServerDiagnostics),[o,s]=(0,j.useState)(``),[c,l]=(0,j.useState)(`all`),[u,d]=(0,j.useState)({}),[f,p]=(0,j.useState)(!1),[m,h]=(0,j.useState)(null),g=(e,t)=>{t.stopPropagation(),d(t=>({...t,[e]:!t[e]}))},_=e.filter(e=>{let t=!o||e.name.toLowerCase().includes(o.toLowerCase())||e.ipAddress.includes(o)||e.hostname.toLowerCase().includes(o.toLowerCase())||e.hostingProvider.toLowerCase().includes(o.toLowerCase()),n=c===`all`||e.hostingProvider===c;return t&&n}),v=(e,t)=>{t.stopPropagation(),r({title:`Создать инцидент для сервера: ${e.name}`,actionName:`circuit_breaker_trip`,impactSummary:`Будет открыт критический инцидент платформы, затронутые организации получат уведомление о расследовании.`,targetType:`infrastructure`,targetId:e.serverId,targetName:e.name,onConfirm:async t=>{await i(e.serverId,`Сбой сервера ${e.name} (${e.status})`,`critical`,t)}})},y=(e,t)=>{t.stopPropagation(),r({title:`Запрос телеметрии: ${e.name}`,actionName:`invalidate_cache`,impactSummary:`Агенту мониторинга v${e.agentVersion} будет направлен запрос выгрузки моментального снимка состояния.`,targetType:`infrastructure`,targetId:e.serverId,targetName:e.name,onConfirm:async t=>{await a(e.serverId,t)}})};return(0,U.jsxs)(`div`,{className:`space-y-4 sm:space-y-6`,"data-testid":`infrastructure-page`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg sm:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,U.jsx)(Mc,{className:`w-5 h-5 text-krona-gold`}),(0,U.jsx)(`span`,{children:`Инфраструктурные серверы`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Управление вычислительными узлами, SSH-доступом, телеметрией mTLS, бэкапами и нагрузкой`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 self-start sm:self-auto flex-wrap`,children:[(0,U.jsxs)(`div`,{className:`text-xs text-krona-secondary`,children:[`Узлов: `,(0,U.jsx)(`span`,{className:`font-bold text-krona-primary`,children:e.length}),` (Selectel:`,` `,(0,U.jsx)(`span`,{className:`font-bold text-krona-gold`,children:e.filter(e=>e.hostingProvider===`Selectel`).length}),`, Timeweb:`,` `,(0,U.jsx)(`span`,{className:`font-bold text-krona-gold`,children:e.filter(e=>e.hostingProvider===`Timeweb Cloud`).length}),`)`]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>p(!0),className:`min-h-[44px] px-3.5 py-2 bg-krona-gold text-krona-gold-contrast hover:brightness-110 font-bold text-xs rounded-xl shadow-md flex items-center gap-2 transition-all shrink-0`,"data-testid":`btn-open-connect-server`,children:[(0,U.jsx)(vc,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Подключить сервер`})]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-3 items-stretch md:items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,U.jsx)(Oc,{className:`w-4 h-4 text-krona-tertiary absolute left-3 top-1/2 -translate-y-1/2`}),(0,U.jsx)(`input`,{type:`text`,value:o,onChange:e=>s(e.target.value),placeholder:`Поиск по имени сервера, IP, хосту или организации...`,className:`w-full bg-krona-surface border border-krona-border rounded-lg pl-9 pr-3 py-2.5 min-h-[44px] text-xs text-krona-primary placeholder-krona-tertiary focus:outline-hidden focus:border-krona-gold transition-colors`})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 text-xs`,children:[{id:`all`,label:`Все провайдеры`},{id:`Selectel`,label:`Selectel`},{id:`Timeweb Cloud`,label:`Timeweb Cloud`}].map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>l(e.id),className:`min-h-[44px] px-3.5 py-2 rounded-lg font-medium transition-colors shrink-0 ${c===e.id?`bg-krona-gold/15 text-krona-gold border border-krona-gold/30 font-bold`:`bg-krona-surface text-krona-secondary border border-krona-border hover:text-krona-primary hover:bg-krona-hover`}`,children:e.label},e.id))})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4`,"data-testid":`servers-list`,children:[_.map(e=>{let r=t.filter(t=>t.serverId===e.serverId),i=!!u[e.serverId],a=new Date(e.lastSeenAt),o=e.cpuLoadPercent,s=Math.round(e.ramUsedBytes/(e.ramTotalBytes||1)*100),c=Math.round(e.diskUsedBytes/(e.diskTotalBytes||1)*100);return(0,U.jsxs)(`div`,{onClick:()=>n(`server`,e.serverId),className:`p-4 rounded-xl border bg-krona-surface hover:border-krona-gold/40 cursor-pointer transition-all space-y-3 relative shadow-xs ${e.status===`critical`||e.status===`offline`?`border-status-danger-border bg-status-danger-soft/20`:e.status===`warning`?`border-status-warning-border bg-status-warning-soft/20`:`border-krona-border`}`,"data-testid":`server-card-${e.serverId}`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,U.jsx)(`span`,{className:`font-bold text-sm text-krona-primary truncate`,children:e.name}),(0,U.jsx)(hd,{status:e.status,size:`sm`})]}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary font-mono mt-0.5 truncate`,children:[e.hostname,` • `,e.ipAddress,` • `,e.hostingProvider,` (`,e.region,`)`]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0 flex-wrap justify-end`,children:[e.sshConfig&&(0,U.jsxs)(`span`,{className:`text-[10px] font-mono px-2 py-0.5 rounded-sm border ${e.sshConfig.status===`connected`?`bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border-emerald-500/30`:e.sshConfig.status===`unreachable`?`bg-rose-500/10 text-rose-600 dark:text-rose-400 border-rose-500/30`:`bg-krona-workspace text-krona-secondary border-krona-border`}`,children:[`SSH:`,e.sshConfig.port]}),(0,U.jsxs)(`span`,{className:`text-[10px] text-krona-tertiary font-mono bg-krona-workspace px-2 py-0.5 rounded-sm border border-krona-border`,children:[`v`,e.agentVersion]})]})]}),(0,U.jsxs)(`div`,{className:`text-xs text-krona-secondary flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-krona-tertiary`,children:`Провайдер: `}),(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.hostingProvider})]}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-tertiary flex items-center gap-1`,children:[(0,U.jsx)(ns,{className:`w-3.5 h-3.5`}),(0,U.jsxs)(`span`,{children:[`Сигнал: `,a.toLocaleTimeString(`ru-RU`)]})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pt-2 border-t border-krona-border text-xs`,children:[(0,U.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-[11px] text-krona-tertiary`,children:[(0,U.jsx)(`span`,{children:`CPU`}),(0,U.jsxs)(`span`,{className:`font-bold font-mono ${o>80?`text-status-danger-text`:`text-krona-primary`}`,children:[o,`%`]})]}),(0,U.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full ${o>80?`bg-red-500`:`bg-emerald-500`}`,style:{width:`${o}%`}})})]}),(0,U.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-[11px] text-krona-tertiary`,children:[(0,U.jsx)(`span`,{children:`RAM`}),(0,U.jsxs)(`span`,{className:`font-bold font-mono ${s>80?`text-status-danger-text`:`text-krona-primary`}`,children:[s,`%`]})]}),(0,U.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full ${s>80?`bg-red-500`:`bg-emerald-500`}`,style:{width:`${s}%`}})})]}),(0,U.jsxs)(`div`,{className:`p-2 rounded-lg bg-krona-workspace border border-krona-border space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-[11px] text-krona-tertiary`,children:[(0,U.jsx)(`span`,{children:`Диск`}),(0,U.jsxs)(`span`,{className:`font-bold font-mono ${c>85?`text-status-danger-text`:`text-krona-primary`}`,children:[c,`%`]})]}),(0,U.jsx)(`div`,{className:`w-full bg-krona-surface h-1.5 rounded-full overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full ${c>85?`bg-red-500`:`bg-emerald-500`}`,style:{width:`${c}%`}})})]})]}),i&&(0,U.jsxs)(`div`,{className:`pt-2 border-t border-krona-border space-y-2.5 text-xs animate-in fade-in duration-150`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[11px] text-krona-secondary`,children:[(0,U.jsxs)(`div`,{children:[`Резервная копия:`,` `,(0,U.jsx)(`span`,{className:e.backup.state===`failed`?`text-status-danger-text font-bold`:`text-status-success-text font-semibold`,children:e.backup.state===`ok`?`В норме`:e.backup.state===`failed`?`Ошибка`:e.backup.state})]}),(0,U.jsxs)(`div`,{children:[`Срок mTLS-сертификата:`,` `,(0,U.jsxs)(`span`,{className:`font-mono text-krona-primary font-semibold`,children:[e.certificateDaysRemaining,` дней`]})]}),(0,U.jsxs)(`div`,{children:[`Активных модулей:`,` `,(0,U.jsx)(`span`,{className:`font-mono text-krona-primary font-semibold`,children:r.length})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[11px] text-krona-tertiary mb-1`,children:`История сигналов (Heartbeat):`}),(0,U.jsx)(_d,{status:e.status,count:24})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:t=>y(e,t),className:`min-h-[38px] px-3 py-1.5 rounded-lg border border-krona-border bg-krona-workspace text-krona-secondary hover:text-krona-primary text-xs font-medium`,children:`Диагностика`}),(e.status===`critical`||e.status===`offline`)&&(0,U.jsx)(`button`,{type:`button`,onClick:t=>v(e,t),className:`min-h-[38px] px-3 py-1.5 rounded-lg border border-status-danger-border bg-status-danger-soft text-status-danger-text text-xs font-bold`,children:`Открыть инцидент`})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between pt-1 gap-2 flex-wrap`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:t=>g(e.serverId,t),className:`min-h-[44px] px-2.5 text-xs text-krona-secondary hover:text-krona-primary flex items-center gap-1 font-medium`,"aria-expanded":i,children:i?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{children:`Скрыть детали`}),(0,U.jsx)(Wo,{className:`w-3.5 h-3.5`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{children:`Вторичные сведения`}),(0,U.jsx)(Bo,{className:`w-3.5 h-3.5`})]})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),h(e)},className:`min-h-[44px] px-3 flex items-center gap-1.5 text-xs font-semibold text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 hover:bg-emerald-500/20 rounded-lg border border-emerald-500/30 transition-colors`,"data-testid":`terminal-server-${e.serverId}`,title:`Открыть терминал сервера`,children:[(0,U.jsx)(il,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:`Терминал`})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),n(`server`,e.serverId)},className:`min-h-[44px] px-3 flex items-center gap-1.5 text-xs font-semibold text-krona-gold bg-krona-gold/10 hover:bg-krona-gold/20 rounded-lg border border-krona-gold/30 transition-colors`,"data-testid":`inspect-server-${e.serverId}`,children:[(0,U.jsx)(`span`,{children:`Подробности`}),(0,U.jsx)(H,{className:`w-4 h-4`})]})]})]})]},e.serverId)}),_.length===0&&(0,U.jsx)(`div`,{className:`col-span-full p-8 text-center text-krona-tertiary rounded-xl border border-krona-border bg-krona-surface text-xs`,children:`Серверные узлы не найдены по заданным критериям фильтрации`})]}),(0,U.jsx)(zd,{isOpen:f,onClose:()=>p(!1),onServerAdded:e=>n(`server`,e)}),(0,U.jsx)(yd,{server:m,isOpen:!!m,onClose:()=>h(null)})]})},{})},{path:`announcements`,element:(0,U.jsx)(()=>{let e=Y(e=>e.announcements),n=Y(e=>e.organizations),r=Y(e=>e.modules),i=Y(e=>e.createAnnouncement),a=Y(e=>e.openConfirmModal),{permissions:o}=nd(),[s,c]=(0,j.useState)(!1),[l,u]=(0,j.useState)(``),[d,f]=(0,j.useState)(``),[p,m]=(0,j.useState)(`normal`),[h,g]=(0,j.useState)(`module`),[_,v]=(0,j.useState)(`krona-omnichannel`),[y]=(0,j.useState)([n[0]?.tenantId||``,n[1]?.tenantId||``].filter(Boolean));return(0,U.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,U.jsx)(wo,{className:`w-5 h-5 text-amber-500 shrink-0`}),(0,U.jsx)(`span`,{children:`Оповещения и системные сообщения`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Таргетированные сервисные рассылки, уведомления об обновлениях модулей и плановом ТО`})]}),(0,U.jsxs)(`button`,{type:`button`,disabled:!o.canCreateAnnouncements,onClick:()=>c(!s),className:`min-h-[44px] px-4 py-2.5 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs flex items-center justify-center gap-2 transition-colors disabled:opacity-40 shadow-xs shrink-0`,children:[s?(0,U.jsx)(t,{className:`w-4 h-4`}):(0,U.jsx)(vc,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:s?`Закрыть редактор`:`Создать оповещение`})]})]}),s&&(0,U.jsxs)(`form`,{onSubmit:e=>{if(e.preventDefault(),!l.trim()||!d.trim())return;let t,r=!1;h===`all`?r=!0:h===`specific`?t=y:h===`module`&&(t=n.slice(0,4).map(e=>e.tenantId)),a({title:`Отправка оповещения: ${l}`,actionName:`announcement.publish_broadcast`,impactSummary:`Оповещение будет доставлено через In-App канал ${r?`всем организациям`:`${t?.length||0} выбранным организациям`}.`,targetType:`announcement`,targetId:`new-announcement`,targetName:l,onConfirm:async e=>{await i({title:l.trim(),body:d.trim(),priority:p,channels:[`in_app`,`comm_adapter`],status:`completed`,validFrom:new Date().toISOString(),validUntil:null,audience:{allTenants:r,tenantIds:t,requiredModuleId:h===`module`?_:void 0}},e),c(!1),u(``),f(``)}})},className:`rounded-xl border border-amber-500/40 bg-krona-surface p-4 md:p-5 space-y-4 shadow-lg animate-in fade-in slide-in-from-top-2`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-center border-b border-krona-border pb-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-bold text-krona-primary`,children:[(0,U.jsx)(Ac,{className:`w-4 h-4 text-amber-500`}),(0,U.jsx)(`span`,{children:`Конструктор операторского оповещения`})]}),(0,U.jsx)(`span`,{className:`text-[11px] text-amber-600 dark:text-amber-300 font-mono`,children:`ДЕМО: In-App доставка`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4 text-xs`,children:[(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:`Заголовок оповещения:`}),(0,U.jsx)(`input`,{type:`text`,required:!0,value:l,onChange:e=>u(e.target.value),placeholder:`Например: Доступно обновление платформы v3.0`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg px-3 py-2.5 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 min-h-[44px]`})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,U.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:`Приоритет доставки:`}),(0,U.jsxs)(`select`,{value:p,onChange:e=>m(e.target.value),className:`w-full bg-krona-workspace border border-krona-border rounded-lg px-3 py-2.5 text-xs text-krona-primary focus:outline-hidden min-h-[44px]`,children:[(0,U.jsx)(`option`,{value:`normal`,children:`Обычный (Информационный баннер)`}),(0,U.jsx)(`option`,{value:`important`,children:`Важный (Уведомление в шапке)`}),(0,U.jsx)(`option`,{value:`critical`,children:`Критический (Блокирующий диалог)`})]})]})]}),(0,U.jsxs)(`div`,{className:`space-y-2 text-xs`,children:[(0,U.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:`Целевая аудитория организаций:`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>g(`all`),className:`min-h-[44px] p-2.5 rounded-lg border text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${h===`all`?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/50 font-bold`:`bg-krona-workspace text-krona-secondary border-krona-border hover:text-krona-primary`}`,children:[(0,U.jsx)(vl,{className:`w-3.5 h-3.5`}),(0,U.jsxs)(`span`,{children:[`Все (`,n.length,`)`]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>g(`module`),className:`min-h-[44px] p-2.5 rounded-lg border text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${h===`module`?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/50 font-bold`:`bg-krona-workspace text-krona-secondary border-krona-border hover:text-krona-primary`}`,children:(0,U.jsx)(`span`,{children:`По модулю`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>g(`specific`),className:`min-h-[44px] p-2.5 rounded-lg border text-xs font-medium transition-colors flex items-center justify-center gap-1.5 ${h===`specific`?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/50 font-bold`:`bg-krona-workspace text-krona-secondary border-krona-border hover:text-krona-primary`}`,children:(0,U.jsxs)(`span`,{children:[`Выборочные (`,y.length,`)`]})})]}),h===`module`&&(0,U.jsxs)(`div`,{className:`pt-2 flex flex-col sm:flex-row sm:items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-krona-secondary text-xs`,children:`Выберите модуль:`}),(0,U.jsx)(`select`,{value:_,onChange:e=>v(e.target.value),className:`bg-krona-workspace border border-krona-border rounded-lg px-3 py-2 text-xs text-krona-primary min-h-[44px]`,children:r.map(e=>(0,U.jsx)(`option`,{value:e.moduleId,children:e.name},e.moduleId))})]})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,U.jsx)(`label`,{className:`font-semibold text-krona-primary`,children:`Текст сообщения:`}),(0,U.jsx)(`textarea`,{required:!0,rows:3,value:d,onChange:e=>f(e.target.value),placeholder:`Введите текст объявления для операторов и пользователей организаций...`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg p-3 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 resize-none`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col-reverse sm:flex-row justify-end gap-2 pt-2 border-t border-krona-border`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>c(!1),className:`min-h-[44px] px-4 py-2.5 rounded-lg border border-krona-border text-krona-secondary hover:text-krona-primary text-xs font-medium transition-colors`,children:`Отмена`}),(0,U.jsxs)(`button`,{type:`submit`,className:`min-h-[44px] px-5 py-2.5 rounded-lg bg-amber-500 hover:bg-amber-400 text-zinc-950 font-bold text-xs flex items-center justify-center gap-2 shadow-xs`,children:[(0,U.jsx)(Ac,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Опубликовать с подтверждением`})]})]})]}),(0,U.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>{let t=fd[e.priority]||e.priority,n=e.priority===`critical`,r=e.priority===`important`;return(0,U.jsxs)(`div`,{className:`rounded-xl border border-krona-border bg-krona-surface p-4 md:p-5 space-y-3 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-2 border-b border-krona-border pb-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 mb-1`,children:[(0,U.jsx)(`span`,{className:`font-bold text-sm text-krona-primary`,children:e.title}),(0,U.jsx)(hd,{status:e.status===`completed`?`healthy`:`warning`,size:`sm`,customLabel:e.status===`completed`?`Доставлено`:`Отправка`}),(0,U.jsx)(`span`,{className:`text-[10px] font-bold px-2 py-0.5 rounded-md border ${n?`bg-rose-500/15 text-rose-600 dark:text-rose-300 border-rose-500/40`:r?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/40`:`bg-krona-workspace text-krona-secondary border-krona-border`}`,children:t})]}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-secondary`,children:[`Автор: `,(0,U.jsx)(`span`,{className:`text-krona-primary font-medium`,children:e.author}),` • Опубликовано:`,` `,new Date(e.createdAt).toLocaleDateString(`ru-RU`)]})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-3 text-xs shrink-0 font-mono`,children:(0,U.jsxs)(`div`,{className:`text-left sm:text-right`,children:[(0,U.jsx)(`div`,{className:`text-[10px] text-krona-secondary`,children:`Доставлено`}),(0,U.jsxs)(`div`,{className:`font-bold text-emerald-600 dark:text-emerald-400 flex items-center gap-1`,children:[(0,U.jsx)(Xo,{className:`w-3 h-3 inline`}),(0,U.jsxs)(`span`,{children:[e.stats.delivered,` / `,e.stats.totalTargeted]})]})]})})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary leading-relaxed`,children:e.body})]},e.announcementId)})})]})},{})},{path:`incidents`,element:(0,U.jsx)(()=>{let e=Y(e=>e.incidents),t=Y(e=>e.openInspector),[n,r]=(0,j.useState)(`all`),[i,a]=(0,j.useState)(``),o=e.filter(e=>{let t=!i||e.incidentNumber.toLowerCase().includes(i.toLowerCase())||e.summary.toLowerCase().includes(i.toLowerCase())||e.description.toLowerCase().includes(i.toLowerCase()),r=n===`all`||e.status===n;return t&&r}),s=e.filter(e=>e.status!==`resolved`).length,c=e.filter(e=>e.status!==`resolved`&&(e.severity===`critical`||e.severity===`high`)).length;return(0,U.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,U.jsx)(fl,{className:`w-5 h-5 text-rose-500 shrink-0`}),(0,U.jsx)(`span`,{children:`Журнал инцидентов платформы`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Оперативное реагирование на сбои серверных узлов, деградацию модулей и инфраструктурные аварии`})]}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-krona-secondary`,children:[(0,U.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-krona-workspace border border-krona-border`,children:[`Всего: `,(0,U.jsx)(`strong`,{className:`text-krona-primary`,children:e.length})]}),(0,U.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-amber-500/10 border border-amber-500/30 text-amber-500 font-semibold`,children:[`В работе: `,(0,U.jsx)(`strong`,{children:s})]}),c>0&&(0,U.jsxs)(`span`,{className:`px-2.5 py-1 rounded-md bg-rose-500/10 border border-rose-500/30 text-rose-500 font-bold`,children:[`Критических: `,c]})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col md:flex-row gap-3 items-stretch md:items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1 max-w-md`,children:[(0,U.jsx)(Oc,{className:`w-4 h-4 text-krona-secondary absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none`}),(0,U.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Поиск по номеру, описанию или теме...`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg pl-9 pr-3 py-2.5 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 transition-colors min-h-[44px]`})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 text-xs -mx-1 px-1`,children:[{id:`all`,label:`Все инциденты`},{id:`open`,label:`Открытые`},{id:`mitigating`,label:`В процессе`},{id:`resolved`,label:`Устранённые`}].map(e=>(0,U.jsx)(`button`,{onClick:()=>r(e.id),className:`min-h-[44px] px-3.5 py-2 rounded-lg font-medium transition-colors whitespace-nowrap ${n===e.id?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border border-amber-500/40 font-bold shadow-xs`:`bg-krona-workspace text-krona-secondary border border-krona-border hover:text-krona-primary`}`,children:e.label},e.id))})]}),(0,U.jsxs)(`div`,{className:`space-y-3`,children:[o.map(e=>{let n=e.severity===`critical`,r=e.severity===`high`,i=id[e.severity]||{label:e.severity,short:e.severity},a=ad[e.status]||e.status;return(0,U.jsxs)(`div`,{onClick:()=>t(`incident`,e.incidentId),className:`p-4 md:p-5 rounded-xl border bg-krona-surface transition-all cursor-pointer space-y-3 shadow-xs hover:border-amber-500/50 group ${n?`border-rose-500/40 bg-rose-500/5`:r?`border-amber-500/30`:`border-krona-border`}`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-2 border-b border-krona-border pb-3`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`font-mono font-bold text-sm text-krona-primary group-hover:text-amber-500 transition-colors`,children:e.incidentNumber}),(0,U.jsx)(hd,{status:e.status,size:`sm`,customLabel:a}),(0,U.jsx)(`span`,{className:`text-[11px] font-bold px-2 py-0.5 rounded-md border font-mono ${n?`bg-rose-500/15 text-rose-600 dark:text-rose-300 border-rose-500/40`:r?`bg-amber-500/15 text-amber-600 dark:text-amber-300 border-amber-500/40`:`bg-sky-500/15 text-sky-600 dark:text-sky-300 border-sky-500/40`}`,children:i.short})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-krona-secondary`,children:[(0,U.jsxs)(`span`,{children:[`Ответственный: `,(0,U.jsx)(`strong`,{className:`text-krona-primary font-medium`,children:e.ownerName})]}),(0,U.jsx)(`span`,{children:`•`}),(0,U.jsx)(`span`,{children:new Date(e.openedAt).toLocaleDateString(`ru-RU`)})]})]}),(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(`h3`,{className:`font-bold text-sm text-krona-primary`,children:e.summary}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary leading-relaxed line-clamp-2 md:line-clamp-none`,children:e.description})]}),(0,U.jsxs)(`div`,{className:`pt-2 border-t border-krona-border flex flex-col sm:flex-row sm:items-center justify-between gap-3 text-xs text-krona-secondary`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 md:gap-5`,children:[(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(Ao,{className:`w-3.5 h-3.5 text-krona-secondary`}),`Организаций: `,(0,U.jsx)(`strong`,{className:`text-krona-primary font-medium`,children:e.affectedTenantIds.length})]}),(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(Mc,{className:`w-3.5 h-3.5 text-krona-secondary`}),`Узлов: `,(0,U.jsx)(`strong`,{className:`text-krona-primary font-medium`,children:e.affectedServerIds.length})]}),(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,U.jsx)(fc,{className:`w-3.5 h-3.5 text-krona-secondary`}),`Модулей: `,(0,U.jsx)(`strong`,{className:`text-krona-primary font-medium`,children:e.affectedModuleIds.length})]})]}),(0,U.jsxs)(`div`,{className:`inline-flex items-center gap-1 text-xs font-semibold text-amber-500 hover:text-amber-600 transition-colors min-h-[44px]`,children:[(0,U.jsx)(`span`,{children:`Детали расследования`}),(0,U.jsx)(H,{className:`w-4 h-4 group-hover:translate-x-0.5 transition-transform`})]})]})]},e.incidentId)}),o.length===0&&(0,U.jsxs)(`div`,{className:`p-8 rounded-xl border border-krona-border bg-krona-surface text-center space-y-2`,children:[(0,U.jsx)(Ic,{className:`w-8 h-8 text-krona-secondary mx-auto opacity-50`}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary`,children:`Инциденты не найдены по выбранным критериям фильтрации`})]})]})]})},{})},{path:`audit`,element:(0,U.jsx)(()=>{let e=Y(e=>e.auditLog),{permissions:n}=nd(),[r,i]=(0,j.useState)(``),[a,o]=(0,j.useState)(null),s=e.filter(e=>{let t=od[e.action]||``;return!r||e.operatorName.toLowerCase().includes(r.toLowerCase())||e.reason.toLowerCase().includes(r.toLowerCase())||e.action.toLowerCase().includes(r.toLowerCase())||t.toLowerCase().includes(r.toLowerCase())||e.correlationId.toLowerCase().includes(r.toLowerCase())}),c=e.find(e=>e.eventId===a);return(0,U.jsxs)(`div`,{className:`space-y-4 md:space-y-6`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 border-b border-krona-border pb-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h1`,{className:`text-lg md:text-xl font-bold text-krona-primary flex items-center gap-2`,children:[(0,U.jsx)(vs,{className:`w-5 h-5 text-amber-500 shrink-0`}),(0,U.jsx)(`span`,{children:`Неизменяемый журнал аудита действий`})]}),(0,U.jsx)(`p`,{className:`text-xs text-krona-secondary mt-0.5`,children:`Криптографическая цепочка событий (SHA-256 Hash Chain). Записи защищены от редактирования и удаления.`})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsxs)(`button`,{type:`button`,disabled:!n.canExportAudit,onClick:()=>{let t=`data:text/json;charset=utf-8,`+encodeURIComponent(JSON.stringify(e,null,2)),n=document.createElement(`a`);n.setAttribute(`href`,t),n.setAttribute(`download`,`kcc-immutable-audit-${Date.now()}.json`),document.body.appendChild(n),n.click(),n.remove()},className:`min-h-[44px] px-4 py-2.5 rounded-lg bg-krona-surface border border-krona-border hover:bg-krona-workspace text-krona-primary text-xs font-semibold flex items-center justify-center gap-2 transition-colors disabled:opacity-40 shadow-xs`,title:`Экспорт неизменяемого журнала для регулятора/аудитора`,children:[(0,U.jsx)(ms,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Экспорт JSON`})]})})]}),(0,U.jsxs)(`div`,{className:`rounded-xl border border-emerald-500/40 bg-emerald-500/10 p-3.5 flex flex-col sm:flex-row sm:items-center justify-between gap-2 text-xs text-emerald-600 dark:text-emerald-300`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(Rc,{className:`w-5 h-5 text-emerald-500 shrink-0`}),(0,U.jsxs)(`span`,{children:[`Целостность журнала подтверждена: `,(0,U.jsxs)(`strong`,{children:[e.length,` событий`]}),` в цепочке хешей.`]})]}),(0,U.jsx)(`span`,{className:`font-mono text-[11px] text-emerald-600/80 dark:text-emerald-400/80`,children:`WORM (Write Once, Read Many)`})]}),(0,U.jsxs)(`div`,{className:`relative max-w-md`,children:[(0,U.jsx)(Oc,{className:`w-4 h-4 text-krona-secondary absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none`}),(0,U.jsx)(`input`,{type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:`Поиск по оператору, действию или обоснованию...`,className:`w-full bg-krona-workspace border border-krona-border rounded-lg pl-9 pr-3 py-2.5 text-xs text-krona-primary placeholder:text-krona-secondary/60 focus:outline-hidden focus:border-amber-500 transition-colors min-h-[44px]`})]}),(0,U.jsxs)(`div`,{className:`block lg:hidden space-y-3`,children:[s.map(e=>{let t=od[e.action]||e.action,n=rd[e.operatorRole]?.shortLabel||e.operatorRole;return(0,U.jsxs)(`div`,{onClick:()=>o(e.eventId),className:`p-4 rounded-xl border border-krona-border bg-krona-surface space-y-3 cursor-pointer shadow-xs hover:border-amber-500/50 transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-start gap-2 border-b border-krona-border pb-2.5`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`font-bold text-sm text-krona-primary`,children:t}),(0,U.jsxs)(`div`,{className:`text-[11px] text-krona-secondary font-mono mt-0.5`,children:[e.operatorName,` • `,(0,U.jsx)(`span`,{className:`text-amber-500 font-semibold`,children:n})]})]}),(0,U.jsx)(`div`,{className:`text-right text-[11px] text-krona-secondary font-mono`,children:new Date(e.occurredAt).toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})})]}),(0,U.jsxs)(`div`,{className:`text-xs text-krona-secondary space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`text-krona-secondary/70`,children:`Объект:`}),(0,U.jsx)(`span`,{className:`font-medium text-krona-primary`,children:e.target.displayName||e.target.id})]}),(0,U.jsx)(`div`,{className:`line-clamp-2 text-krona-primary/90 bg-krona-workspace p-2 rounded-lg border border-krona-border`,children:e.reason})]}),(0,U.jsxs)(`div`,{className:`pt-2 border-t border-krona-border flex items-center justify-between text-[11px] text-krona-secondary`,children:[(0,U.jsxs)(`span`,{className:`font-mono text-xs text-krona-secondary flex items-center gap-1`,children:[(0,U.jsx)(Es,{className:`w-3 h-3 text-amber-500`}),e.hash.slice(0,8),`...`,e.hash.slice(-4)]}),(0,U.jsxs)(`span`,{className:`text-amber-500 font-medium inline-flex items-center gap-0.5`,children:[`Подробнее `,(0,U.jsx)(H,{className:`w-3.5 h-3.5`})]})]})]},e.eventId)}),s.length===0&&(0,U.jsx)(`div`,{className:`p-8 rounded-xl border border-krona-border bg-krona-surface text-center text-xs text-krona-secondary`,children:`Записи аудита не найдены`})]}),(0,U.jsx)(`div`,{className:`hidden lg:block rounded-xl border border-krona-border bg-krona-surface overflow-hidden shadow-xs`,children:(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`w-full text-left text-xs border-collapse`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`border-b border-krona-border bg-krona-workspace text-krona-secondary font-semibold uppercase tracking-wider text-[11px]`,children:[(0,U.jsx)(`th`,{className:`py-3 px-4`,children:`Время`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Оператор / Роль`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Действие`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Целевой объект`}),(0,U.jsx)(`th`,{className:`py-3 px-3`,children:`Обоснование`}),(0,U.jsx)(`th`,{className:`py-3 px-3 font-mono`,children:`Correlation ID`}),(0,U.jsx)(`th`,{className:`py-3 px-4 text-right font-mono`,children:`SHA-256 Hash`})]})}),(0,U.jsxs)(`tbody`,{className:`divide-y divide-krona-border/60`,children:[s.map(e=>{let t=od[e.action]||e.action,n=rd[e.operatorRole]?.label||e.operatorRole;return(0,U.jsxs)(`tr`,{onClick:()=>o(e.eventId),className:`hover:bg-krona-workspace/50 cursor-pointer transition-colors`,children:[(0,U.jsx)(`td`,{className:`py-3 px-4 font-mono text-krona-secondary text-[11px] whitespace-nowrap`,children:new Date(e.occurredAt).toLocaleString(`ru-RU`,{day:`2-digit`,month:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,U.jsxs)(`td`,{className:`py-3 px-3`,children:[(0,U.jsx)(`div`,{className:`font-bold text-krona-primary`,children:e.operatorName}),(0,U.jsx)(`div`,{className:`text-[10px] text-amber-500 font-medium`,children:n})]}),(0,U.jsxs)(`td`,{className:`py-3 px-3`,children:[(0,U.jsx)(`div`,{className:`font-semibold text-krona-primary text-xs`,children:t}),(0,U.jsx)(`div`,{className:`font-mono text-[10px] text-krona-secondary`,children:e.action})]}),(0,U.jsxs)(`td`,{className:`py-3 px-3 text-krona-secondary`,children:[(0,U.jsx)(`span`,{className:`font-semibold text-krona-primary`,children:e.target.displayName||e.target.id}),(0,U.jsxs)(`span`,{className:`text-[10px] text-krona-secondary block font-mono`,children:[`тип: `,e.target.type]})]}),(0,U.jsx)(`td`,{className:`py-3 px-3 text-krona-primary max-w-xs truncate`,title:e.reason,children:e.reason}),(0,U.jsx)(`td`,{className:`py-3 px-3 font-mono text-krona-secondary text-[11px]`,children:e.correlationId}),(0,U.jsxs)(`td`,{className:`py-3 px-4 text-right font-mono text-krona-secondary text-[10px]`,title:e.hash,children:[e.hash.slice(0,10),`...`,e.hash.slice(-6)]})]},e.eventId)}),s.length===0&&(0,U.jsx)(`tr`,{children:(0,U.jsx)(`td`,{colSpan:7,className:`py-8 text-center text-krona-secondary`,children:`Записи аудита не найдены`})})]})]})})}),c&&(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-xs p-4 animate-in fade-in`,role:`dialog`,"aria-modal":`true`,children:(0,U.jsxs)(`div`,{className:`w-full max-w-xl rounded-xl border border-krona-border bg-krona-surface p-5 md:p-6 text-krona-primary space-y-4 shadow-2xl`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between items-start border-b border-krona-border pb-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-xs font-mono text-amber-500`,children:c.eventId}),(0,U.jsx)(`h3`,{className:`text-base font-bold text-krona-primary`,children:od[c.action]||c.action})]}),(0,U.jsx)(`button`,{onClick:()=>o(null),className:`min-w-[44px] min-h-[44px] flex items-center justify-center text-krona-secondary hover:text-krona-primary rounded-lg hover:bg-krona-workspace transition-colors`,"aria-label":`Закрыть`,children:(0,U.jsx)(t,{className:`w-5 h-5`})})]}),(0,U.jsxs)(`div`,{className:`space-y-3 text-xs`,children:[(0,U.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-krona-workspace border border-krona-border space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-krona-secondary`,children:[(0,U.jsx)(`span`,{children:`Оператор:`}),(0,U.jsxs)(`span`,{className:`font-semibold text-krona-primary`,children:[c.operatorName,` (`,rd[c.operatorRole]?.label||c.operatorRole,`)`]})]}),(0,U.jsx)(`div`,{className:`text-krona-secondary`,children:`Обоснование действия:`}),(0,U.jsx)(`div`,{className:`font-medium text-krona-primary p-2 bg-krona-surface rounded-md border border-krona-border`,children:c.reason}),(0,U.jsxs)(`div`,{className:`text-krona-secondary text-[11px] pt-1 border-t border-krona-border`,children:[`Влияние: `,(0,U.jsx)(`span`,{className:`text-amber-500 font-medium`,children:c.impactSummary})]})]}),(0,U.jsxs)(`div`,{className:`p-3.5 rounded-lg bg-krona-workspace border border-krona-border space-y-1.5 font-mono text-[11px]`,children:[(0,U.jsx)(`div`,{className:`text-krona-secondary`,children:`Предыдущий хеш (Previous Hash N-1):`}),(0,U.jsx)(`div`,{className:`text-krona-secondary/80 break-all text-[10px]`,children:c.previousHash}),(0,U.jsx)(`div`,{className:`text-krona-secondary pt-1`,children:`Текущий хеш (SHA-256):`}),(0,U.jsx)(`div`,{className:`text-emerald-600 dark:text-emerald-400 break-all font-bold text-[10px]`,children:c.hash})]})]})]})})]})},{})},{path:`*`,element:(0,U.jsx)(Vu,{})}]},{path:`/`,element:(0,U.jsx)(ql,{}),errorElement:(0,U.jsx)(`div`,{className:`p-8`,children:(0,U.jsx)(zl,{scope:`Маршрутизатор приложения`,children:(0,U.jsx)(Vu,{})})}),children:[{index:!0,element:(0,U.jsx)(Zl,{})},{path:`operations/*`,element:(0,U.jsx)($l,{})},{path:`crm/*`,element:(0,U.jsx)(tu,{})},{path:`sales/*`,element:(0,U.jsx)(ru,{})},{path:`inventory/*`,element:(0,U.jsx)(au,{})},{path:`finance/*`,element:(0,U.jsx)(ou,{})},{path:`employees/*`,element:(0,U.jsx)(cu,{})},{path:`communications/*`,element:(0,U.jsx)(uu,{})},{path:`helpdesk/*`,element:(0,U.jsx)(fu,{})},{path:`tasks/*`,element:(0,U.jsx)(mu,{})},{path:`cms/*`,element:(0,U.jsx)(gu,{})},{path:`marketing/*`,element:(0,U.jsx)(vu,{})},{path:`analytics/*`,element:(0,U.jsx)(bu,{})},{path:`automation/*`,element:(0,U.jsx)(Su,{})},{path:`ai/*`,element:(0,U.jsx)(wu,{})},{path:`apps/*`,element:(0,U.jsx)(Eu,{})},{path:`settings/entities`,element:(0,U.jsx)(Au,{})},{path:`settings/entities/:entityCode/fields`,element:(0,U.jsx)(Mu,{})},{path:`settings/entities/:entityCode/forms`,element:(0,U.jsx)(Pu,{})},{path:`settings/entities/:entityCode/card`,element:(0,U.jsx)(Iu,{})},{path:`settings/entities/:entityCode/views`,element:(0,U.jsx)(Ru,{})},{path:`settings/*`,element:(0,U.jsx)(Ou,{})},{path:`entities/:entityCode`,element:(0,U.jsx)(Bu,{})},{path:`entities/:entityCode/:recordId`,element:(0,U.jsx)(Bu,{})},{path:`forbidden`,element:(0,U.jsx)(Jl,{})},{path:`403`,element:(0,U.jsx)(Jl,{})},{path:`*`,element:(0,U.jsx)(Vu,{})}]}]),Vd=[{id:`tenant_main`,name:`Основной бизнес (Main)`,description:`Главный тенант компании`},{id:`tenant_alpha`,name:`Филиал «Север» (Alpha)`,description:`Северное подразделение`},{id:`tenant_beta`,name:`Филиал «Юг» (Beta)`,description:`Южное подразделение`},{id:`tenant_demo`,name:`Песочница (Demo/Sandbox)`,description:`Тестовая изолированная среда`}],Hd=(0,j.createContext)(null),Ud=({children:e,initialTenantId:t})=>{let[n,r]=(0,j.useState)(()=>t||A()||`tenant_main`),i=(0,j.useCallback)(e=>{r(e),m(e)},[]);(0,j.useEffect)(()=>{m(n)},[n]);let a=(0,j.useMemo)(()=>Vd.find(e=>e.id===n)||{id:n,name:`Тенант ${n}`},[n]),o=(0,j.useMemo)(()=>h({tenantId:n}),[n]),s=(0,j.useCallback)(e=>h({tenantId:n,...e}),[n]),c=(0,j.useMemo)(()=>({currentTenantId:n,currentTenant:a,availableTenants:Vd,requestContext:o,switchTenant:i,createContextForCurrentTenant:s}),[n,a,o,i,s]);return(0,U.jsx)(Hd.Provider,{value:c,children:e})},Wd=({children:e})=>((0,j.useEffect)(()=>{so()},[]),(0,U.jsx)(zl,{scope:`Корневое приложение Krona`,children:(0,U.jsx)(Ud,{children:(0,U.jsx)(Pl,{children:e})})}));function Gd(){return(0,U.jsx)(Wd,{children:(0,U.jsx)(ba,{router:Bd})})}(0,ce.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(j.StrictMode,{children:(0,U.jsx)(Gd,{})}));export{go as $,Ws as A,ns as B,Sc as C,fc as D,gc as E,Ss as F,Bo as G,Xo as H,gs as I,Po as J,Ro as K,ms as L,Is as M,Ms as N,oc as O,Es as P,vo as Q,fs as R,wc as S,vc as T,Ko as U,es as V,H as W,So as X,Mo as Y,bo as Z,Hc as _,Ol as a,$a as at,Oc as b,ul as c,La as ct,il as d,Da as dt,mo as et,nl as f,xa as ft,Kc as g,ae as gt,Jc as h,Ur as ht,jl as i,eo as it,Hs as j,ic as k,cl as l,Ra as lt,Xc as m,zr as mt,Nl as n,lo as nt,vl as o,no as ot,Qc as p,Ir as pt,Io as q,Ml as r,co as rt,fl as s,to as st,Bl as t,fo as tt,ol as u,Oa as ut,Bc as v,bc as w,Ec as x,Ac as y,os as z};