const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Connections-BbZyMe5U.js","assets/Connections-CyW0Ot05.css"])))=>i.map(i=>d[i]); var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),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 l=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(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,D());else{var t=n(l);t!==null&&O(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&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&&O(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=ee,D=function(){ne.postMessage(null)}}else D=function(){_(ee,0)};function O(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||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,O(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),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}}}})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function te(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function O(e,t){return typeof e==`object`&&e&&e.key!=null?te(``+e.key):t.toString(36)}function k(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function A(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,A(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+O(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),A(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=d()})),p=o((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=u(),n=f(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1oe||(e.current=ae[oe],ae[oe]=null,oe--)}function I(e,t){oe++,ae[oe]=e.current,e.current=t}var se=P(null),ce=P(null),L=P(null),le=P(null);function ue(e,t){switch(I(L,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(se),I(se,e)}function R(){F(se),F(ce),F(L)}function de(e){e.memoizedState!==null&&I(le,e);var t=se.current,n=Hd(t,e.type);t!==n&&(I(ce,e),I(se,n))}function fe(e){ce.current===e&&(F(se),F(ce)),le.current===e&&(F(le),Qf._currentValue=N)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1)`:-1i||c[r]!==l[i]){var u=` `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(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&261888;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 Ge(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=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(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 Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(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 Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(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`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.textContent,a=i.length;for(e=0;e=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=null,Xn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=br(n)}}function Sr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(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=Nt(e.document)}return t}function wr(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 Tr=an&&`documentMode`in document&&11>=document.documentMode,Er=null,Dr=null,Or=null,kr=!1;function Ar(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kr||Er==null||Er!==Nt(r)||(r=Er,`selectionStart`in r&&wr(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}),Or&&yr(Or,r)||(Or=r,r=Td(Dr,`onSelect`),0>=o,i-=o,Si=1<<32-Le(t)+i|n<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),U&&wi(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),U&&wi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return U&&wi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),U&&wi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===D&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=li(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ci(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case v: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=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=fi(o,e.mode,c),c.return=e,e=c}return s(e);case D:return o=wa(o),b(e,r,o,c)}if(ie(o))return h(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(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=a(r,o),c.return=e,e=c):(n(e,r),c=ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(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 za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,q&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ti(e),ei(e,null,n),t}return Zr(e,r,t,n),ti(e)}function Va(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,$e(e,n)}}function Ha(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 Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!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?(X&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ia=!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),Wl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=j.T,s={};j.T=s,Ms(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),fu(e)):js(e,t,r,fu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,N,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:N,baseState:N,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:N},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:No,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},fu())}function Ts(){return Zi(Qf)}function Es(){return Oo().memoizedState}function Ds(){return Oo().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=za(n);var r=Ba(t,e,n);r!==null&&(mu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=Qr(e,t,n,r),n!==null&&(mu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,fu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(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,vr(s,o))return Zr(e,t,i,0),J===null&&Xr(),!1}catch{}if(n=Qr(e,t,i,r),n!==null)return mu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:ud(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=Qr(e,n,r,2),t!==null&&mu(t,e,2)}function Ns(e){var t=e.alternate;return e===W||t!==null&&t===W}function Ps(e,t){fo=uo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var Is={readContext:Zi,use:jo,useCallback:vo,useContext:vo,useEffect:vo,useImperativeHandle:vo,useLayoutEffect:vo,useInsertionEffect:vo,useMemo:vo,useReducer:vo,useRef:vo,useState:vo,useDebugValue:vo,useDeferredValue:vo,useTransition:vo,useSyncExternalStore:vo,useId:vo,useHostTransitionStatus:vo,useFormState:vo,useActionState:vo,useOptimistic:vo,useMemoCache:vo,useCacheRefresh:vo};Is.useEffectEvent=vo;var Ls={readContext:Zi,use:jo,useCallback:function(e,t){return Do().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Do();t=t===void 0?null:t;var r=e();if(po){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Do();if(n!==void 0){var i=n(t);if(po){Ie(!0);try{n(t)}finally{Ie(!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=ks.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Do();return e={current:e},t.memoizedState=e},useState:function(e){e=Uo(e);var t=e.queue,n=As.bind(null,W,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Do(),e,t)},useTransition:function(){var e=Uo(!1);return e=bs.bind(null,W,e.queue,!0,!1),Do().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=W,a=Do();if(U){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),J===null)throw Error(i(349));X&127||Ro(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Bo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},zo.bind(null,r,o,n,t),null),n},useId:function(){var e=Do(),t=J.identifierPrefix;if(U){var n=Ci,r=Si;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=mo++,0<\/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(a,{is:r.is}):s.createElement(a)}}o[at]=t,o[ot]=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(Pd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=L.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ki,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[at]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Pi(t,!0)}else e=Bd(e).createTextNode(r),e[at]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[at]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[at]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return R(),e===null&&xd(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(F(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Fc(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)si(n,e),n=n.sibling;return I(oo,oo.current&1|2),U&&wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>eu&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!U)return Ic(t),null}else 2*Te()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,Fc(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)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=oo.current,I(oo,a?n&1|2:n&1),U&&wi(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(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&&F(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Di(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),R(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(oo),null;case 4:return R(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&F(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Di(t),t.tag){case 3:Gi(ra),R();break;case 26:case 27:case 5:fe(t);break;case 4:R();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:F(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&F(ma);break;case 24:Gi(ra)}}function Bc(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 Vc(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 Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Q(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Wc(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: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 Gc(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 Kc(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 qc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[ot]=t}catch(t){Q(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(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&&Zd(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 Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[at]=e,t[ot]=n}catch(t){Q(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Rd=sp,e=Cr(e),wr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Pd(o,r,n),o[at]=e,_t(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=xr(s,h),v=xr(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;sn?32:n,j.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,q&6)throw Error(i(331));var c=q;if(q|=4,Nl(o.current),El(o,o.current,s,n),q=c,rd(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{M.p=a,j.T=r,Bu(e,t)}}function Uu(e,t,n){t=mi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Xe(e,2),nd(e))}function Q(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=mi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),Xe(r,2),nd(r));break}}t=t.return}}function Wu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;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)||(Vl=!0,i.add(n),e=Gu.bind(null,e,t,n),t.then(e,e))}function Gu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,J===e&&(X&n)===n&&(Ul===4||Ul===3&&(X&62914560)===X&&300>Te()-Ql?!(q&2)&&xu(e,0):Kl|=n,Jl===X&&(Jl=0)),nd(e)}function Ku(e,t){t===0&&(t=Je()),e=$r(e,t),e!==null&&(Xe(e,t),nd(e))}function qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ku(e,n)}function Ju(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ku(e,n)}function Yu(e,t){return xe(e,t)}var Xu=null,Zu=null,Qu=!1,$u=!1,ed=!1,td=0;function nd(e){e!==Zu&&e.next===null&&(Zu===null?Xu=Zu=e:Zu=Zu.next=e),$u=!0,Qu||(Qu=!0,ld())}function rd(e,t){if(!ed&&$u){ed=!0;do for(var n=!1,r=Xu;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-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,cd(r,a))}else a=X,a=Ge(r,r===J?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,cd(r,a))}r=r.next}while(n);ed=!1}}function id(){ad()}function ad(){$u=Qu=!1;var e=0;td!==0&&Gd()&&(e=td);for(var t=Te(),n=null,r=Xu;r!==null;){var i=r.next,a=od(r,t);a===0?(r.next=null,n===null?Xu=i:n.next=i,i===null&&(Zu=n)):(n=r,(e!==0||a&3)&&($u=!0)),r=i}ru!==0&&ru!==5||rd(e,!1),td!==0&&(td=0)}function od(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),_t(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),_t(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),_t(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=gt(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);_t(c),Pd(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,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=gt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),_t(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=gt(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),_t(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=L.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=gt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Af(n.href);var o=gt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=gt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Ft(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),_t(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Ft(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,_t(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),_t(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,_t(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),_t(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,_t(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),_t(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(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 title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(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=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,_t(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),_t(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(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=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{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=h()}))(),_=c(f(),1),v=Object.defineProperty,y=(e,t)=>v(e,`name`,{value:t,configurable:!0});function b(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}y(b,`setRef`);function x(...e){return t=>{let n=!1,r=e.map(e=>{let r=b(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;tC(e,`name`,{value:t,configurable:!0});function T(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];re(r)&&typeof N==`function`&&(r=N(r._payload)),_.Children.forEach(r,e=>{if(k(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;re(n)&&typeof N==`function`&&(n=N(n._payload)),a=te(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?O(a):void 0,l=S(n,c);if(!a){if(r||r===0)throw Error(o?M(e):j(e));return r}let u=ne(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}w(T,`createSlot`);var E=T(`Slot`),ee=Symbol.for(`radix.slottable`);function D(e){let t=w(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=ee,t}w(D,`createSlottable`);var te=w((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function ne(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}w(ne,`mergeProps`);function O(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}w(O,`getElementRef`);function k(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ee}w(k,`isSlottable`);var A=Symbol.for(`react.lazy`);function re(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===A&&`_payload`in e&&ie(e._payload)}w(re,`isLazyComponent`);function ie(e){return typeof e==`object`&&!!e&&`then`in e}w(ie,`isPromiseLike`);var j=w(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),M=w(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),N=_.use;function ae(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e==`boolean`?`${e}`:e===0?`0`:e,F=oe,I=(e,t)=>n=>{if(t?.variants==null)return F(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=P(t)||P(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return F(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},se=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),ce=o(((e,t)=>{t.exports=se()})),L=ce(),le=[`library`,`search`,`history`,`graph`,`updates`,`back`,`arrow`,`menu`,`close`,`copy`,`source`,`minus`,`plus`,`expand`,`chevron`,`document`],ue={home:`library`,code:`library`,plenum:`document`,bylaw:`document`,review:`document`,"federal-law":`document`,focus:`expand`,recent:`history`};function R({name:e,className:t=``}){let n=Math.max(0,le.indexOf(ue[e]||e));return(0,L.jsx)(`span`,{"aria-hidden":`true`,className:`p-icon ${t}`,style:{"--ix":`${n%4*100/3}%`,"--iy":`${Math.floor(n/4)*100/3}%`}})}var de=768;function fe(){let[e,t]=_.useState(void 0);return _.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidthe.removeEventListener(`change`,n)},[]),!!e}var pe=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),he=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ge=`-`,_e=[],ve=`arbitrary..`,ye=e=>{let t=Se(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return xe(e);let n=e.split(ge);return be(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?pe(i,t):t:i||_e}return n[e]||_e}}},be=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=be(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(ge):e.slice(t).join(ge),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?ve+r:void 0})(),Se=e=>{let{theme:t,classGroups:n}=e;return Ce(n,t)},Ce=(e,t)=>{let n=he();for(let r in e){let i=e[r];we(i,n,r,t)}return n},we=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){Ee(e,t,n);return}if(typeof e==`function`){De(e,t,n,r);return}Oe(e,t,n,r)},Ee=(e,t,n)=>{let r=e===``?t:ke(t,e);r.classGroupId=n},De=(e,t,n,r)=>{if(Ae(e)){we(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(me(n,e))},Oe=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(ge),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,je=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Me=`!`,Ne=`:`,Pe=[],Fe=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ie=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return Fe(t,l,c,u)};if(t){let e=t+Ne,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Fe(Pe,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Le=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Re=e=>({cache:je(e.cacheSize),parseClassName:Ie(e),sortModifiers:Le(e),postfixLookupClassGroupIds:ze(e),...ye(e)}),ze=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Be),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Me:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},He=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=Re(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Ve(e,n);return i(e,a),a};return a=o,(...e)=>a(He(...e))},Ge=[],Ke=e=>{let t=t=>t[e]||Ge;return t.isThemeGetter=!0,t},qe=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Je=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ye=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Xe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ze=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,et=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,tt=e=>Ye.test(e),z=e=>!!e&&!Number.isNaN(Number(e)),nt=e=>!!e&&Number.isInteger(Number(e)),rt=e=>e.endsWith(`%`)&&z(e.slice(0,-1)),it=e=>Xe.test(e),at=()=>!0,ot=e=>Ze.test(e)&&!Qe.test(e),st=()=>!1,ct=e=>$e.test(e),lt=e=>et.test(e),ut=e=>!B(e)&&!V(e),dt=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),ft=e=>Dt(e,jt,st),B=e=>qe.test(e),pt=e=>Dt(e,Mt,ot),mt=e=>Dt(e,Nt,z),ht=e=>Dt(e,Ft,at),gt=e=>Dt(e,Pt,st),_t=e=>Dt(e,kt,st),vt=e=>Dt(e,At,lt),yt=e=>Dt(e,It,ct),V=e=>Je.test(e),bt=e=>Ot(e,Mt),xt=e=>Ot(e,Pt),St=e=>Ot(e,kt),Ct=e=>Ot(e,jt),wt=e=>Ot(e,At),Tt=e=>Ot(e,It,!0),Et=e=>Ot(e,Ft,!0),Dt=(e,t,n)=>{let r=qe.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ot=(e,t,n=!1)=>{let r=Je.exec(e);return r?r[1]?t(r[1]):n:!1},kt=e=>e===`position`||e===`percentage`,At=e=>e===`image`||e===`url`,jt=e=>e===`length`||e===`size`||e===`bg-size`,Mt=e=>e===`length`,Nt=e=>e===`number`,Pt=e=>e===`family-name`,Ft=e=>e===`number`||e===`weight`,It=e=>e===`shadow`,Lt=We(()=>{let e=Ke(`color`),t=Ke(`font`),n=Ke(`text`),r=Ke(`font-weight`),i=Ke(`tracking`),a=Ke(`leading`),o=Ke(`breakpoint`),s=Ke(`container`),c=Ke(`spacing`),l=Ke(`radius`),u=Ke(`shadow`),d=Ke(`inset-shadow`),f=Ke(`text-shadow`),p=Ke(`drop-shadow`),m=Ke(`blur`),h=Ke(`perspective`),g=Ke(`aspect`),_=Ke(`ease`),v=Ke(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),V,B],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[V,B,c],T=()=>[tt,`full`,`auto`,...w()],E=()=>[nt,`none`,`subgrid`,V,B],ee=()=>[`auto`,{span:[`full`,nt,V,B]},nt,V,B],D=()=>[nt,`auto`,V,B],te=()=>[`auto`,`min`,`max`,`fr`,V,B],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],O=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],k=()=>[`auto`,...w()],A=()=>[tt,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],re=()=>[tt,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ie=()=>[tt,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],j=()=>[e,V,B],M=()=>[...b(),St,_t,{position:[V,B]}],N=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,Ct,ft,{size:[V,B]}],oe=()=>[rt,bt,pt],P=()=>[``,`none`,`full`,l,V,B],F=()=>[``,z,bt,pt],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ce=()=>[z,rt,St,_t],L=()=>[``,`none`,m,V,B],le=()=>[`none`,z,V,B],ue=()=>[`none`,z,V,B],R=()=>[z,V,B],de=()=>[tt,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[it],breakpoint:[it],color:[at],container:[it],"drop-shadow":[it],ease:[`in`,`out`,`in-out`],font:[ut],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[it],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[it],shadow:[it],spacing:[`px`,z],text:[it],"text-shadow":[it],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,tt,B,V,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,V,B]}],"container-named":[dt],columns:[{columns:[z,B,V,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[nt,`auto`,V,B]}],basis:[{basis:[tt,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[z,tt,`auto`,`initial`,`none`,B]}],grow:[{grow:[``,z,V,B]}],shrink:[{shrink:[``,z,V,B]}],order:[{order:[nt,`first`,`last`,`none`,V,B]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...O(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...O()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...O(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...O(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...O(),`baseline`]}],"place-self":[{"place-self":[`auto`,...O()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mbs:[{mbs:k()}],mbe:[{mbe:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:A()}],"inline-size":[{inline:[`auto`,...re()]}],"min-inline-size":[{"min-inline":[`auto`,...re()]}],"max-inline-size":[{"max-inline":[`none`,...re()]}],"block-size":[{block:[`auto`,...ie()]}],"min-block-size":[{"min-block":[`auto`,...ie()]}],"max-block-size":[{"max-block":[`none`,...ie()]}],w:[{w:[s,`screen`,...A()]}],"min-w":[{"min-w":[s,`screen`,`none`,...A()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...A()]}],h:[{h:[`screen`,`lh`,...A()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...A()]}],"max-h":[{"max-h":[`screen`,`lh`,...A()]}],"font-size":[{text:[`base`,n,bt,pt]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Et,ht]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,rt,B]}],"font-family":[{font:[xt,gt,t]}],"font-features":[{"font-features":[B]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,V,B]}],"line-clamp":[{"line-clamp":[z,`none`,V,mt]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,V,B]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,V,B]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[z,`from-font`,`auto`,V,pt]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[z,`auto`,V,B]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[nt,V,B]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,V,B]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,V,B]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:N()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},nt,V,B],radial:[``,V,B],conic:[nt,V,B]},wt,vt]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[z,V,B]}],"outline-w":[{outline:[``,z,bt,pt]}],"outline-color":[{outline:j()}],shadow:[{shadow:[``,`none`,u,Tt,yt]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":[`none`,d,Tt,yt]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[z,pt]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":[`none`,f,Tt,yt]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[z,V,B]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[z]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[V,B]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[z]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:N()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,V,B]}],filter:[{filter:[``,`none`,V,B]}],blur:[{blur:L()}],brightness:[{brightness:[z,V,B]}],contrast:[{contrast:[z,V,B]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Tt,yt]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:[``,z,V,B]}],"hue-rotate":[{"hue-rotate":[z,V,B]}],invert:[{invert:[``,z,V,B]}],saturate:[{saturate:[z,V,B]}],sepia:[{sepia:[``,z,V,B]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,V,B]}],"backdrop-blur":[{"backdrop-blur":L()}],"backdrop-brightness":[{"backdrop-brightness":[z,V,B]}],"backdrop-contrast":[{"backdrop-contrast":[z,V,B]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,z,V,B]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[z,V,B]}],"backdrop-invert":[{"backdrop-invert":[``,z,V,B]}],"backdrop-opacity":[{"backdrop-opacity":[z,V,B]}],"backdrop-saturate":[{"backdrop-saturate":[z,V,B]}],"backdrop-sepia":[{"backdrop-sepia":[``,z,V,B]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,V,B]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[z,`initial`,V,B]}],ease:[{ease:[`linear`,`initial`,_,V,B]}],delay:[{delay:[z,V,B]}],animate:[{animate:[`none`,v,V,B]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,V,B]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:le()}],"rotate-x":[{"rotate-x":le()}],"rotate-y":[{"rotate-y":le()}],"rotate-z":[{"rotate-z":le()}],scale:[{scale:ue()}],"scale-x":[{"scale-x":ue()}],"scale-y":[{"scale-y":ue()}],"scale-z":[{"scale-z":ue()}],"scale-3d":[`scale-3d`],skew:[{skew:R()}],"skew-x":[{"skew-x":R()}],"skew-y":[{"skew-y":R()}],transform:[{transform:[V,B,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:de()}],"translate-x":[{"translate-x":de()}],"translate-y":[{"translate-y":de()}],"translate-z":[{"translate-z":de()}],"translate-none":[`translate-none`],zoom:[{zoom:[nt,V,B]}],accent:[{accent:j()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,V,B]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,V,B]}],fill:[{fill:[`none`,...j()]}],"stroke-w":[{stroke:[z,bt,pt,mt]}],stroke:[{stroke:[`none`,...j()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function H(...e){return Lt(oe(e))}var Rt=I(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,outline:`border border-input bg-background hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),zt=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,L.jsx)(r?E:`button`,{className:H(Rt({variant:t,size:n,className:e})),ref:a,...i}));zt.displayName=`Button`;var Bt=_.forwardRef(({className:e,type:t,...n},r)=>(0,L.jsx)(`input`,{type:t,className:H(`flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));Bt.displayName=`Input`;var Vt=c(m(),1),Ht=Object.defineProperty,Ut=(e,t)=>Ht(e,`name`,{value:t,configurable:!0}),Wt=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=T(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gt(e,t){e&&Vt.flushSync(()=>e.dispatchEvent(t))}Ut(Gt,`dispatchDiscreteCustomEvent`);var Kt=Object.defineProperty,qt=(e,t)=>Kt(e,`name`,{value:t,configurable:!0}),Jt=`horizontal`,Yt=[`horizontal`,`vertical`],Xt=_.forwardRef(qt(function(e,t){let{decorative:n,orientation:r=Jt,...i}=e,a=Zt(r)?r:Jt,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,L.jsx)(Wt.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function Zt(e){return Yt.includes(e)}qt(Zt,`isValidOrientation`);var Qt=Xt,$t=_.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,L.jsx)(Qt,{ref:i,decorative:n,orientation:t,className:H(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));$t.displayName=Qt.displayName;var en=Object.defineProperty,tn=(e,t)=>en(e,`name`,{value:t,configurable:!0}),nn=!!(typeof window<`u`&&window.document&&window.document.createElement);function rn(e,t,{checkForDefaultPrevented:n=!0}={}){return tn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}tn(rn,`composeEventHandlers`);function an(e){if(!nn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}tn(an,`getOwnerWindow`);function on(e){if(!nn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}tn(on,`getOwnerDocument`);function sn(e,t=!1){let{activeElement:n}=on(e);if(!n?.nodeName)return null;if(cn(n)&&n.contentDocument)return sn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=on(n).getElementById(e);if(t)return t}}return n}tn(sn,`getActiveElement`);function cn(e){return e.tagName===`IFRAME`}tn(cn,`isFrame`);var ln=Object.defineProperty,un=(e,t)=>ln(e,`name`,{value:t,configurable:!0});function dn(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=un(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return un(i,`useContext`),[r,i]}un(dn,`createContext`);function fn(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=un(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return un(s,`useContext`),[o,s]}un(r,`createContext`);let i=un(()=>{let t=n.map(e=>_.createContext(e));return un(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,pn(i,...t)]}un(fn,`createContextScope`);function pn(...e){let t=e[0];if(e.length===1)return t;let n=un(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return un(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}un(pn,`composeContextScopes`);var mn=globalThis?.document?_.useLayoutEffect:()=>{},hn=Object.defineProperty,gn=(e,t)=>hn(e,`name`,{value:t,configurable:!0}),_n=_.useId||(()=>void 0),vn=0;function yn(e){let[t,n]=_.useState(_n());return mn(()=>{e||n(e=>e??String(vn++))},[e]),e||(t?`radix-${t}`:``)}gn(yn,`useId`);var bn=Object.defineProperty,xn=(e,t)=>bn(e,`name`,{value:t,configurable:!0}),Sn=_.useEffectEvent,Cn=_.useInsertionEffect;function wn(e){if(typeof Sn==`function`)return Sn(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Cn==`function`?Cn(()=>{t.current=e}):mn(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}xn(wn,`useEffectEvent`);var Tn=Object.defineProperty,En=(e,t)=>Tn(e,`name`,{value:t,configurable:!0}),Dn=_.useInsertionEffect||mn;function On({prop:e,defaultProp:t,onChange:n=En(()=>{},`onChange`),caller:r}){let[i,a,o]=kn({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=An(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}En(On,`useControllableState`);function kn({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Dn(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}En(kn,`useUncontrolledState`);function An(e){return typeof e==`function`}En(An,`isFunction`);var jn=Symbol(`RADIX:SYNC_STATE`);function Mn(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=wn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===jn)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:jn,state:i})},[i,d.state,c]),[h,f]}En(Mn,`useControllableStateReducer`);var Nn=Object.defineProperty,Pn=(e,t)=>Nn(e,`name`,{value:t,configurable:!0});function Fn(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Pn(Fn,`useCallbackRef`);var In=Object.defineProperty,Ln=(e,t)=>In(e,`name`,{value:t,configurable:!0}),Rn=`dismissableLayer.update`,zn=`dismissableLayer.pointerDownOutside`,Bn=`dismissableLayer.focusOutside`,Vn,Hn=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Un=_.forwardRef(Ln(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(Hn),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=S(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=b>=y,w=_.useRef(!1),T=Kn(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=qn(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),ee=d?b===g.length-1:!1,D=Fn(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(ee)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,ee,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Vn=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Jn(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Vn))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Jn())},[d,u]),_.useEffect(()=>{let e=Ln(()=>m({}),`handleUpdate`);return document.addEventListener(Rn,e),()=>document.removeEventListener(Rn,e)},[]),(0,L.jsx)(Wt.div,{...l,ref:h,style:{pointerEvents:x?C?`auto`:`none`:void 0,...e.style},onFocusCapture:rn(e.onFocusCapture,E.onFocusCapture),onBlurCapture:rn(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:rn(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`));function Wn(){let e=_.useContext(Hn),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Ln(Wn,`useDismissableLayerSurface`);var Gn=Ln(()=>!0,`IS_TRUE`);function Kn(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Gn}=t,s=Fn(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}Ln(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}Ln(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}Ln(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}Ln(p,`handleInteractionBubble`);let m=Ln(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Yn(zn,s,p,{discrete:!0})};if(Ln(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:Ln(()=>c.current=!0,`onPointerDownCapture`)}}Ln(Kn,`usePointerDownOutside`);function qn(e,t=globalThis?.document){let n=Fn(e),r=_.useRef(!1);return _.useEffect(()=>{let e=Ln(e=>{e.target&&!r.current&&Yn(Bn,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:Ln(()=>r.current=!0,`onFocusCapture`),onBlurCapture:Ln(()=>r.current=!1,`onBlurCapture`)}}Ln(qn,`useFocusOutside`);function Jn(){let e=new CustomEvent(Rn);document.dispatchEvent(e)}Ln(Jn,`dispatchUpdate`);function Yn(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Gt(i,a):i.dispatchEvent(a)}Ln(Yn,`handleAndDispatchCustomEvent`);var Xn=Object.defineProperty,Zn=(e,t)=>Xn(e,`name`,{value:t,configurable:!0}),Qn=`focusScope.autoFocusOnMount`,$n=`focusScope.autoFocusOnUnmount`,er={bubbles:!1,cancelable:!0},tr=_.forwardRef(Zn(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Fn(i),u=Fn(a),d=_.useRef(null),f=S(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:cr(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||cr(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&cr(s)};Zn(e,`handleFocusIn`),Zn(t,`handleFocusOut`),Zn(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),_.useEffect(()=>{if(s){lr.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Qn,er);s.addEventListener(Qn,l),s.dispatchEvent(t),t.defaultPrevented||(nr(fr(ir(s)),{select:!0}),document.activeElement===e&&cr(s))}return()=>{s.removeEventListener(Qn,l),setTimeout(()=>{let t=new CustomEvent($n,er);s.addEventListener($n,u),s.dispatchEvent(t),t.defaultPrevented||cr(e??document.body,{select:!0}),s.removeEventListener($n,u),lr.remove(p)},0)}}},[s,l,u,p]);let m=_.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=rr(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&cr(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&cr(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(Wt.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function nr(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(cr(r,{select:t}),document.activeElement!==n)return}Zn(nr,`focusFirst`);function rr(e){let t=ir(e);return[ar(t,e),ar(t.reverse(),e)]}Zn(rr,`getTabbableEdges`);function ir(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Zn(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Zn(ir,`getTabbableCandidates`);function ar(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):or(r,{upTo:t})))return r}Zn(ar,`findVisible`);function or(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Zn(or,`isHidden`);function sr(e){return e instanceof HTMLInputElement&&`select`in e}Zn(sr,`isSelectableInput`);function cr(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&sr(e)&&t&&e.select()}}Zn(cr,`focus`);var lr=ur();function ur(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=dr(e,t),e.unshift(t)},remove(t){e=dr(e,t),e[0]?.resume()}}}Zn(ur,`createFocusScopesStack`);function dr(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Zn(dr,`arrayRemove`);function fr(e){return e.filter(e=>e.tagName!==`A`)}Zn(fr,`removeLinks`);var pr=Object.defineProperty,mr=_.forwardRef(((e,t)=>pr(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);mn(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Vt.createPortal((0,L.jsx)(Wt.div,{...r,ref:t}),o):null},`Portal`)),hr=Object.defineProperty,gr=(e,t)=>hr(e,`name`,{value:t,configurable:!0});function _r(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}gr(_r,`useStateMachine`);var vr=gr(e=>{let{present:t,children:n}=e,r=yr(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=xr(r.ref,Cr(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function yr(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=_r(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??Sr(r.current),o.current=void 0):a.current=`none`},[s]),mn(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Sr(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),mn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=gr(a=>{let o=Sr(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=gr(e=>{e.target===t&&(a.current=Sr(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Sr(t)}else r.current=null;n(e)},[])}}gr(yr,`usePresence`);function br(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}gr(br,`setRef`);function xr(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=br(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;ewr(e,`name`,{value:t,configurable:!0}),Er=0,Dr=null;function Or(e){return kr(),e.children}Tr(Or,`FocusGuards`);function kr(){_.useEffect(()=>{Dr||={start:Ar(),end:Ar()};let{start:e,end:t}=Dr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Er++,()=>{Er===1&&(Dr?.start.remove(),Dr?.end.remove(),Dr=null),Er=Math.max(0,Er-1)}},[])}Tr(kr,`useFocusGuards`);function Ar(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Tr(Ar,`createFocusGuard`);var jr=function(){return jr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n`u`)return ii;var t=oi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ci=ri(),li=`data-scroll-locked`,ui=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` .${Ir} { overflow: hidden ${r}; padding-right: ${s}px ${r}; } body[${li}] { overflow: hidden ${r}; overscroll-behavior: contain; ${[t&&`position: relative ${r};`,n===`margin`&&` padding-left: ${i}px; padding-top: ${a}px; padding-right: ${o}px; margin-left:0; margin-top:0; margin-right: ${s}px ${r}; `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)} } .${Pr} { right: ${s}px ${r}; } .${Fr} { margin-right: ${s}px ${r}; } .${Pr} .${Pr} { right: 0 ${r}; } .${Fr} .${Fr} { margin-right: 0 ${r}; } body[${li}] { ${Lr}: ${s}px; } `},di=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},fi=function(){_.useEffect(function(){return document.body.setAttribute(li,(di()+1).toString()),function(){var e=di()-1;e<=0?document.body.removeAttribute(li):document.body.setAttribute(li,e.toString())}},[])},pi=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;fi();var a=_.useMemo(function(){return si(i)},[i]);return _.createElement(ci,{styles:ui(a,!t,i,n?``:`!important`)})},mi=!1;if(typeof window<`u`)try{var hi=Object.defineProperty({},"passive",{get:function(){return mi=!0,!0}});window.addEventListener(`test`,hi,hi),window.removeEventListener(`test`,hi,hi)}catch{mi=!1}var gi=mi?{passive:!1}:!1,_i=function(e){return e.tagName===`TEXTAREA`},vi=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!_i(e)&&n[t]===`visible`)},yi=function(e){return vi(e,`overflowY`)},bi=function(e){return vi(e,`overflowX`)},xi=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),wi(e,r)){var i=Ti(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Si=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ci=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},wi=function(e,t){return e===`v`?yi(t):bi(t)},Ti=function(e,t){return e===`v`?Si(t):Ci(t)},Ei=function(e,t){return e===`h`&&t===`rtl`?-1:1},Di=function(e,t,n,r,i){var a=Ei(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Ti(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&wi(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Oi=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ki=function(e){return[e.deltaX,e.deltaY]},Ai=function(e){return e&&`current`in e?e.current:e},U=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ji=function(e){return` .block-interactivity-${e} {pointer-events: none;} .allow-interactivity-${e} {pointer-events: all;} `},Mi=0,Ni=[];function Pi(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Mi++)[0],a=_.useState(ri)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Nr([e.lockRef.current],(e.shards||[]).map(Ai),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Oi(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=xi(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=xi(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Di(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(Ni.length&&Ni[Ni.length-1]===a){var r=`deltaY`in n?ki(n):Oi(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&U(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Ai).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Fi(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Oi(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,ki(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Oi(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Ni.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,gi),document.addEventListener(`touchmove`,c,gi),document.addEventListener(`touchstart`,u,gi),function(){Ni=Ni.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,gi),document.removeEventListener(`touchmove`,c,gi),document.removeEventListener(`touchstart`,u,gi)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:ji(i)}):null,p?_.createElement(pi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Fi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ii=qr(Jr,Pi),Li=_.forwardRef(function(e,t){return _.createElement(Xr,jr({},e,{ref:t,sideCar:Ii}))});Li.classNames=Xr.classNames;var Ri=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},zi=new WeakMap,Bi=new WeakMap,Vi={},Hi=0,Ui=function(e){return e&&(e.host||Ui(e.parentNode))},Wi=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ui(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Gi=function(e,t,n,r){var i=Wi(t,Array.isArray(e)?e:[e]);Vi[n]||(Vi[n]=new WeakMap);var a=Vi[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(zi.get(e)||0)+1,l=(a.get(e)||0)+1;zi.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Bi.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Hi++,function(){o.forEach(function(e){var t=zi.get(e)-1,i=a.get(e)-1;zi.set(e,t),a.set(e,i),t||(Bi.has(e)||e.removeAttribute(r),Bi.delete(e)),i||e.removeAttribute(n)}),Hi--,Hi||(zi=new WeakMap,zi=new WeakMap,Bi=new WeakMap,Vi={})}},Ki=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Ri(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Gi(r,i,n,`aria-hidden`)):function(){return null}},qi=Object.defineProperty,Ji=(e,t)=>qi(e,`name`,{value:t,configurable:!0}),Yi=`Dialog`,[Xi,Zi]=fn(Yi),[Qi,$i]=Xi(Yi),ea=Ji(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=On({prop:r,defaultProp:i??!1,onChange:a,caller:Yi}),[d,f]=_.useState(0),[p,m]=_.useState(0);return(0,L.jsx)(Qi,{scope:t,triggerRef:s,contentRef:c,contentId:yn(),titleId:yn(),descriptionId:yn(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),ta=`DialogPortal`,[na,ra]=Xi(ta,{forceMount:void 0}),ia=Ji(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=$i(ta,t);return(0,L.jsx)(na,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,L.jsx)(vr,{present:n||a.open,children:(0,L.jsx)(mr,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),aa=`DialogOverlay`,oa=_.forwardRef(Ji(function(e,t){let n=ra(aa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$i(aa,e.__scopeDialog);return a.modal?(0,L.jsx)(vr,{present:r||a.open,children:(0,L.jsx)(ca,{...i,ref:t})}):null},`DialogOverlay`)),sa=T(`DialogOverlay.RemoveScroll`),ca=_.forwardRef(Ji(function(e,t){let{__scopeDialog:n,...r}=e,i=$i(aa,n),a=S(t,Wn());return(0,L.jsx)(Li,{as:sa,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(Wt.div,{"data-state":ba(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),la=`DialogContent`,ua=_.forwardRef(Ji(function(e,t){let n=ra(la,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=$i(la,e.__scopeDialog);return(0,L.jsx)(vr,{present:r||a.open,children:a.modal?(0,L.jsx)(da,{...i,ref:t}):(0,L.jsx)(fa,{...i,ref:t})})},`DialogContent`)),da=_.forwardRef(Ji(function(e,t){let n=$i(la,e.__scopeDialog),r=_.useRef(null),i=S(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Ki(e)},[]),(0,L.jsx)(pa,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:rn(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:rn(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:rn(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),fa=_.forwardRef(Ji(function(e,t){let n=$i(la,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,L.jsx)(pa,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),pa=_.forwardRef(Ji(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=$i(la,n);return kr(),(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(tr,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Un,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":ba(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),ma=`DialogTitle`,ha=_.forwardRef(Ji(function(e,t){let{__scopeDialog:n,...r}=e,i=$i(ma,n),{setTitleCount:a}=i;return mn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(Wt.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),ga=`DialogDescription`,_a=_.forwardRef(Ji(function(e,t){let{__scopeDialog:n,...r}=e,i=$i(ga,n),{setDescriptionCount:a}=i;return mn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(Wt.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),va=`DialogClose`,ya=_.forwardRef(Ji(function(e,t){let{__scopeDialog:n,...r}=e,i=$i(va,n);return(0,L.jsx)(Wt.button,{type:`button`,...r,ref:t,onClick:rn(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function ba(e){return e?`open`:`closed`}Ji(ba,`getState`);var xa=ea,Sa=ia,Ca=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(oa,{className:H(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));Ca.displayName=oa.displayName;var wa=I(`fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-150 data-[state=open]:duration-200`,{variants:{side:{top:`inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,bottom:`inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,left:`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,right:`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`}},defaultVariants:{side:`right`}}),Ta=_.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,L.jsxs)(Sa,{children:[(0,L.jsx)(Ca,{}),(0,L.jsxs)(ua,{ref:i,className:H(wa({side:e}),t),...r,children:[n,(0,L.jsxs)(ya,{className:`absolute right-3 top-3 flex size-11 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,L.jsx)(R,{name:`close`,className:`h-4 w-4`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Закрыть`})]})]})]}));Ta.displayName=ua.displayName;var Ea=({className:e,...t})=>(0,L.jsx)(`div`,{className:H(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Ea.displayName=`SheetHeader`;var Da=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(ha,{ref:n,className:H(`text-lg font-semibold text-foreground`,e),...t}));Da.displayName=ha.displayName;var Oa=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(_a,{ref:n,className:H(`text-sm text-muted-foreground`,e),...t}));Oa.displayName=_a.displayName;function ka({className:e,...t}){return(0,L.jsx)(`div`,{className:H(`animate-pulse rounded-md bg-muted`,e),...t})}var Aa=[`top`,`right`,`bottom`,`left`],ja=Math.min,Ma=Math.max,Na=Math.round,Pa=Math.floor,Fa=e=>({x:e,y:e}),Ia={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function La(e,t,n){return Ma(e,ja(t,n))}function Ra(e,t){return typeof e==`function`?e(t):e}function za(e){return e.split(`-`)[0]}function Ba(e){return e.split(`-`)[1]}function Va(e){return e===`x`?`y`:`x`}function Ha(e){return e===`y`?`height`:`width`}function Ua(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Wa(e){return Va(Ua(e))}function Ga(e,t,n){n===void 0&&(n=!1);let r=Ba(e),i=Wa(e),a=Ha(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=eo(o)),[o,eo(o)]}function Ka(e){let t=eo(e);return[qa(e),t,qa(t)]}function qa(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ja=[`left`,`right`],Ya=[`right`,`left`],Xa=[`top`,`bottom`],Za=[`bottom`,`top`];function Qa(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ya:Ja:t?Ja:Ya;case`left`:case`right`:return t?Xa:Za;default:return[]}}function $a(e,t,n,r){let i=Ba(e),a=Qa(za(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(qa)))),a}function eo(e){let t=za(e);return Ia[t]+e.slice(t.length)}function to(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function no(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:to(e)}function ro(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function io(e,t,n){let{reference:r,floating:i}=e,a=Ua(t),o=Wa(t),s=Ha(o),c=za(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ba(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ao(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ra(t,e),p=no(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ro(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ro(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var oo=50,so=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ao},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=io(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ra(e,t)||{};if(l==null)return{};let d=no(u),f={x:n,y:r},p=Wa(i),m=Ha(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=ja(d[_],T),ee=ja(d[v],T),D=C-h[m]-ee,te=C/2-h[m]/2+w,ne=La(E,te,D),O=!c.arrow&&Ba(i)!=null&&te!==ne&&a.reference[m]/2-(tee<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===Ua(t)||T.every(e=>Ua(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Ua(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function G(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function lo(e){return Aa.some(t=>e[t]>=0)}var uo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ra(e,t);switch(i){case`referenceHidden`:{let e=G(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:lo(e)}}}case`escaped`:{let e=G(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:lo(e)}}}default:return{}}}}},fo=new Set([`left`,`top`]);async function po(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=za(n),s=Ba(n),c=Ua(n)===`y`,l=fo.has(o)?-1:1,u=a&&c?-1:1,d=Ra(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var mo=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await po(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ho=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ra(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Ua(i),p=Va(f),m=u[p],h=u[f],g=(e,t)=>La(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},go=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ra(e,t),u={x:n,y:r},d=Ua(i),f=Va(d),p=u[f],m=u[d],h=Ra(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=fo.has(za(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},_o=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=Ra(e,t),c=await i.detectOverflow(t,s),l=za(n),u=Ba(n),d=Ua(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ja(p-c[m],g),y=ja(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Ma(c.left,c.right):S=p-2*Ma(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function vo(){return typeof window<`u`}function yo(e){return So(e)?(e.nodeName||``).toLowerCase():`#document`}function bo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xo(e){return((So(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function So(e){return vo()?e instanceof Node||e instanceof bo(e).Node:!1}function Co(e){return vo()?e instanceof Element||e instanceof bo(e).Element:!1}function wo(e){return vo()?e instanceof HTMLElement||e instanceof bo(e).HTMLElement:!1}function To(e){return!vo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof bo(e).ShadowRoot}function Eo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Lo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Do(e){return/^(table|td|th)$/.test(yo(e))}function Oo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ko=/transform|translate|scale|rotate|perspective|filter/,Ao=/paint|layout|strict|content/,jo=e=>!!e&&e!==`none`,Mo;function No(e){let t=Co(e)?Lo(e):e;return jo(t.transform)||jo(t.translate)||jo(t.scale)||jo(t.rotate)||jo(t.perspective)||!Fo()&&(jo(t.backdropFilter)||jo(t.filter))||ko.test(t.willChange||``)||Ao.test(t.contain||``)}function Po(e){let t=zo(e);for(;wo(t)&&!Io(t);){if(No(t))return t;if(Oo(t))return null;t=zo(t)}return null}function Fo(){return Mo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Mo}function Io(e){return/^(html|body|#document)$/.test(yo(e))}function Lo(e){return bo(e).getComputedStyle(e)}function Ro(e){return Co(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zo(e){if(yo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||To(e)&&e.host||xo(e);return To(t)?t.host:t}function Bo(e){let t=zo(e);return Io(t)?(e.ownerDocument||e).body:wo(t)&&Eo(t)?t:Bo(t)}function Vo(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Bo(e),i=r===e.ownerDocument?.body,a=bo(r);if(i){let e=Ho(a);return t.concat(a,a.visualViewport||[],Eo(r)?r:[],e&&n?Vo(e):[])}return t.concat(r,Vo(r,[],n))}function Ho(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Uo(e){let t=Lo(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=wo(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Na(n)!==a||Na(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Wo(e){return Co(e)?e:e.contextElement}function Go(e){let t=Wo(e);if(!wo(t))return Fa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Uo(t),o=(a?Na(n.width):n.width)/r,s=(a?Na(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ko=Fa(0);function qo(e){let t=bo(e);return!Fo()||!t.visualViewport?Ko:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Jo(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===bo(e)}function Yo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Wo(e),o=Fa(1);t&&(r?Co(r)&&(o=Go(r)):o=Go(e));let s=Jo(a,n,r)?qo(a):Fa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=bo(a),t=Co(r)?bo(r):r,n=e,i=Ho(n);for(;i&&t!==n;){let e=Go(i),t=i.getBoundingClientRect(),r=Lo(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=bo(i),i=Ho(n)}}return ro({width:u,height:d,x:c,y:l})}function Xo(e,t){let n=Ro(e).scrollLeft;return t?t.left+n:Yo(xo(e)).left+n}function Zo(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Xo(e,n),y:n.top+t.scrollTop}}function Qo(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=xo(r),s=t?Oo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Fa(1),u=Fa(0),d=wo(r);if((d||!a)&&((yo(r)!==`body`||Eo(o))&&(c=Ro(r)),d)){let e=Yo(r);l=Go(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Zo(o,c):Fa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function $o(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function es(e){let t=Ro(e),n=e.ownerDocument.body,r=Ma(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ma(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Xo(e),o=-t.scrollTop;return Lo(n).direction===`rtl`&&(a+=Ma(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ts=25;function ns(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=bo(e),a=xo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Fo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Xo(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ts&&(s-=o)}return{width:s,height:c,x:l,y:u}}function rs(e,t){let n=Yo(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Go(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function is(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ns(e,n,t);else if(t===`document`)r=es(xo(e));else if(Co(t))r=rs(t,n);else{let n=qo(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ro(r)}function as(e,t){let n=t.get(e);if(n)return n;let r=Vo(e,[],!1).filter(e=>Co(e)&&yo(e)!==`body`),i=null,a=Lo(e).position===`fixed`,o=a?zo(e):e;for(;Co(o)&&!Io(o);){let e=Lo(o),t=No(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=zo(o)}return t.set(e,r),r}function os(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Oo(t)?[]:as(t,this._c):[].concat(n),r],o=is(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=bo(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function _s(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Wo(e),u=i||a?[...l?Vo(l):[],...t?Vo(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?gs(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Yo(e):null;c&&g();function g(){let t=Yo(e);h&&!hs(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var vs=mo,ys=ho,bs=W,xs=_o,Ss=uo,Cs=co,ws=go,Ts=(e,t,n)=>{let r=new Map,i=n??{},a={...ms,...i.platform,_c:r};return so(e,t,{...i,platform:a})},Es=typeof document<`u`?_.useLayoutEffect:function(){};function Ds(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ds(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ds(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Os(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ks(e,t){let n=Os(e);return Math.round(t*n)/n}function As(e){let t=_.useRef(e);return Es(()=>{t.current=e}),t}function js(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Ds(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,ee=As(c),D=As(i),te=As(l),ne=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ts(C.current,w.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};O.current&&!Ds(T.current,t)&&(T.current=t,Vt.flushSync(()=>{d(t)}))})},[f,t,n,D,te]);Es(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let O=_.useRef(!1);Es(()=>(O.current=!0,()=>{O.current=!1}),[]),Es(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(ee.current)return ee.current(x,S,ne);ne()}},[x,S,ne,ee,E]);let k=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),A=_.useMemo(()=>({reference:x,floating:S}),[x,S]),re=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=ks(A.floating,u.x),r=ks(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Os(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:ne,refs:k,elements:A,floatingStyles:re}),[u,ne,k,A,re])}var Ms=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Cs({element:r.current,padding:i}).fn(n):r?Cs({element:r,padding:i}).fn(n):{}}}},Ns=(e,t)=>{let n=vs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ps=(e,t)=>{let n=ys(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fs=(e,t)=>({fn:ws(e).fn,options:[e,t]}),Is=(e,t)=>{let n=bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ls=(e,t)=>{let n=xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rs=(e,t)=>{let n=Ss(e);return{name:n.name,fn:n.fn,options:[e,t]}},zs=(e,t)=>{let n=Ms(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bs=Object.defineProperty,Vs=(e,t)=>Bs(e,`name`,{value:t,configurable:!0});function Hs(e){let[t,n]=_.useState(void 0);return mn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}Vs(Hs,`useSize`);var Us=Object.defineProperty,Ws=(e,t)=>Us(e,`name`,{value:t,configurable:!0}),Gs=`Popper`,[Ks,qs]=fn(Gs),[Js,Ys]=Ks(Gs),Xs=Ws(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,L.jsx)(Js,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Zs=`PopperAnchor`,Qs=_.forwardRef(Ws(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Ys(Zs,n),o=_.useRef(null),s=a.onAnchorChange,c=S(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ac(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(Wt.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),$s=`PopperContent`,[ec,tc]=Ks($s),nc=_.forwardRef(Ws(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Ys($s,n),[v,y]=_.useState(null),b=S(t,y),[x,C]=_.useState(null),w=Hs(x),T=w?.width??0,E=w?.height??0,ee=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},te=Array.isArray(l)?l:[l],ne=te.length>0,O={padding:D,boundary:te.filter(rc),altBoundary:ne},{refs:k,floatingStyles:A,placement:re,isPositioned:ie,middlewareData:j}=js({strategy:`fixed`,placement:ee,whileElementsMounted:Ws((...e)=>_s(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Ns({mainAxis:i+E,alignmentAxis:o}),c&&Ps({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Fs():void 0,...O}),c&&Is({...O}),Ls({...O,apply:Ws(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&zs({element:x,padding:s}),ic({arrowWidth:T,arrowHeight:E}),f&&Rs({strategy:`referenceHidden`,...O,boundary:ne?O.boundary:void 0})]}),M=g.setPlacementState;mn(()=>(M(re),()=>{M(void 0)}),[re,M]);let[N,ae]=ac(re),oe=Fn(m);mn(()=>{ie&&oe?.()},[ie,oe]);let P=j.arrow?.x,F=j.arrow?.y,I=j.arrow?.centerOffset!==0,[se,ce]=_.useState();return mn(()=>{v&&ce(window.getComputedStyle(v).zIndex)},[v]),(0,L.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...A,transform:ie?A.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(` `),...j.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(ec,{scope:n,placedSide:N,placedAlign:ae,onArrowChange:C,arrowX:P,arrowY:F,shouldHideArrow:I,children:(0,L.jsx)(Wt.div,{"data-side":N,"data-align":ae,...h,ref:b,style:{...h.style,animation:ie?h.style?.animation:`none`}})})})},`PopperContent`));function rc(e){return e!==null}Ws(rc,`isNotNull`);var ic=Ws(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ac(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ac(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ws(ac,`getSideAndAlignFromPlacement`);var oc=Xs,sc=Qs,cc=nc,lc=Object.defineProperty,uc=(e,t)=>lc(e,`name`,{value:t,configurable:!0}),dc=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),fc=_.forwardRef(uc(function(e,t){return(0,L.jsx)(Wt.span,{...e,ref:t,style:{...dc,...e.style}})},`VisuallyHidden`)),pc=Object.defineProperty,mc=(e,t)=>pc(e,`name`,{value:t,configurable:!0}),[hc,gc]=fn(`Tooltip`,[qs]),_c=qs(),vc=`TooltipProvider`,yc=700,bc=`tooltip.open`,[xc,Sc]=hc(vc),Cc=mc(e=>{let{__scopeTooltip:t,delayDuration:n=yc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(xc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),wc=`Tooltip`,[Tc,Ec]=hc(wc),Dc=mc(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Sc(wc,e.__scopeTooltip),l=_c(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=yn(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=On({prop:r,defaultProp:i??!1,onChange:mc(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(bc))):c.onClose(),a?.(e)},`onChange`),caller:wc}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,L.jsx)(oc,{...l,children:(0,L.jsx)(Tc,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Oc=`TooltipTrigger`,kc=_.forwardRef(mc(function(e,t){let{__scopeTooltip:n,...r}=e,i=Ec(Oc,n),a=Sc(Oc,n),o=_c(n),s=S(t,_.useRef(null),i.onTriggerChange),c=_.useRef(!1),l=_.useRef(!1),u=_.useCallback(()=>c.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(sc,{asChild:!0,...o,children:(0,L.jsx)(Wt.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:rn(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:rn(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:rn(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:rn(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:rn(e.onBlur,i.onClose),onClick:rn(e.onClick,i.onClose)})})},`TooltipTrigger`)),[Ac,jc]=hc(`TooltipPortal`,{forceMount:void 0}),Mc=`TooltipContent`,Nc=_.forwardRef(mc(function(e,t){let n=jc(Mc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Ec(Mc,e.__scopeTooltip);return(0,L.jsx)(vr,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(Ic,{side:i,...a,ref:t}):(0,L.jsx)(Pc,{side:i,...a,ref:t})})},`TooltipContent`)),Pc=_.forwardRef(mc(function(e,t){let n=Ec(Mc,e.__scopeTooltip),r=Sc(Mc,e.__scopeTooltip),i=_.useRef(null),a=S(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Rc(r,Lc(r,n.getBoundingClientRect())),a=zc(t.getBoundingClientRect()),o=Vc([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=mc(e=>p(e,u),`handleTriggerLeave`),t=mc(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=mc(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Bc(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(Ic,{...e,ref:a})},`TooltipContentHoverable`)),Fc=D(`TooltipContent`),Ic=_.forwardRef(mc(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Ec(Mc,n),u=_c(n),{onClose:d}=l;_.useEffect(()=>(document.addEventListener(bc,d),()=>document.removeEventListener(bc,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=mc(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return mn(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,L.jsx)(Un,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,L.jsxs)(cc,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,L.jsx)(Fc,{children:r}),i?(0,L.jsx)(fc,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Lc(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}mc(Lc,`getExitSideFromRect`);function Rc(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}mc(Rc,`getPaddedExitPoints`);function zc(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}mc(zc,`getPointsFromRect`);function Bc(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;er!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}mc(Bc,`isPointInPolygon`);function Vc(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y)),Hc(t)}mc(Vc,`getHull`);function Hc(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}mc(Hc,`getHullPresorted`);var Uc=Cc,Wc=Dc,Gc=kc,Kc=Nc,qc=Uc,Jc=Wc,Yc=Gc,Xc=_.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,L.jsx)(Kc,{ref:r,sideOffset:t,className:H(`z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[var(--radix-tooltip-content-transform-origin)]`,e),...n}));Xc.displayName=Kc.displayName;var Zc=`16rem`,Qc=`18rem`,$c=`3rem`,el=`b`,tl=_.createContext(null);function nl(){let e=_.useContext(tl);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var rl=_.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let c=fe(),[l,u]=_.useState(!1),[d,f]=_.useState(e),p=t??d,m=_.useCallback(e=>{let t=typeof e==`function`?e(p):e;n?n(t):f(t)},[n,p]),h=_.useCallback(()=>c?u(e=>!e):m(e=>!e),[c,m,u]);_.useEffect(()=>{let e=e=>{e.key===el&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),h())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let g=p?`expanded`:`collapsed`,v=_.useMemo(()=>({state:g,open:p,setOpen:m,isMobile:c,openMobile:l,setOpenMobile:u,toggleSidebar:h}),[g,p,m,c,l,u,h]);return(0,L.jsx)(tl.Provider,{value:v,children:(0,L.jsx)(qc,{delayDuration:0,children:(0,L.jsx)(`div`,{style:{"--sidebar-width":Zc,"--sidebar-width-icon":$c,...i},className:H(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,r),ref:s,...o,children:a})})})});rl.displayName=`SidebarProvider`;var il=_.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},o)=>{let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=nl();return n===`none`?(0,L.jsx)(`div`,{className:H(`flex h-full w-[var(--sidebar-width)] flex-col bg-sidebar text-sidebar-foreground`,r),ref:o,...a,children:i}):s?(0,L.jsx)(xa,{open:l,onOpenChange:u,...a,children:(0,L.jsxs)(Ta,{"data-sidebar":`sidebar`,"data-mobile":`true`,onCloseAutoFocus:e=>{e.preventDefault(),document.getElementById(`menu-toggle`)?.focus()},className:H(`w-[var(--sidebar-width)] bg-sidebar p-0 text-sidebar-foreground`,r),style:{"--sidebar-width":Qc},side:e,children:[(0,L.jsxs)(Ea,{className:`sr-only`,children:[(0,L.jsx)(Da,{children:`Навигация`}),(0,L.jsx)(Oa,{children:`Основная навигация по библиотеке.`})]}),(0,L.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,L.jsxs)(`div`,{ref:o,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,children:[(0,L.jsx)(`div`,{className:H(`relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem)]`:`group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]`)}),(0,L.jsx)(`div`,{className:H(`fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_1rem_+_2px)]`:`group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,L.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:i})})]})});il.displayName=`Sidebar`;var al=_.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=nl();return(0,L.jsxs)(zt,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:H(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,L.jsx)(R,{name:`menu`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Переключить боковую панель`})]})});al.displayName=`SidebarTrigger`;var ol=_.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=nl();return(0,L.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Переключить боковую панель`,tabIndex:-1,onClick:r,title:`Переключить боковую панель`,className:H(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});ol.displayName=`SidebarRail`;var sl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`main`,{ref:n,className:H(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,e),...t}));sl.displayName=`SidebarInset`;var cl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Bt,{ref:n,"data-sidebar":`input`,className:H(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));cl.displayName=`SidebarInput`;var ll=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:H(`flex flex-col gap-2 p-2`,e),...t}));ll.displayName=`SidebarHeader`;var ul=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:H(`flex flex-col gap-2 p-2`,e),...t}));ul.displayName=`SidebarFooter`;var dl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)($t,{ref:n,"data-sidebar":`separator`,className:H(`mx-2 w-auto bg-sidebar-border`,e),...t}));dl.displayName=`SidebarSeparator`;var fl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:H(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));fl.displayName=`SidebarContent`;var pl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:H(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));pl.displayName=`SidebarGroup`;var ml=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,L.jsx)(t?E:`div`,{ref:r,"data-sidebar":`group-label`,className:H(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...n}));ml.displayName=`SidebarGroupLabel`;var hl=_.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,L.jsx)(t?E:`button`,{ref:r,"data-sidebar":`group-action`,className:H(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n}));hl.displayName=`SidebarGroupAction`;var gl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:H(`w-full text-sm`,e),...t}));gl.displayName=`SidebarGroupContent`;var _l=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:H(`flex w-full min-w-0 flex-col gap-1`,e),...t}));_l.displayName=`SidebarMenu`;var vl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:H(`group/menu-item relative`,e),...t}));vl.displayName=`SidebarMenuItem`;var yl=I(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:!p-0`}},defaultVariants:{variant:`default`,size:`default`}}),bl=_.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let c=e?E:`button`,{isMobile:l,state:u}=nl(),d=(0,L.jsx)(c,{ref:s,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:H(yl({variant:n,size:r}),a),...o});return!i||l||u!==`collapsed`?d:(typeof i==`string`&&(i={children:i}),(0,L.jsxs)(Jc,{children:[(0,L.jsx)(Yc,{asChild:!0,children:d}),(0,L.jsx)(Xc,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...i})]}))});bl.displayName=`SidebarMenuButton`;var xl=_.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,L.jsx)(t?E:`button`,{ref:i,"data-sidebar":`menu-action`,className:H(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));xl.displayName=`SidebarMenuAction`;var Sl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:H(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));Sl.displayName=`SidebarMenuBadge`;var Cl=_.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=_.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,L.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:H(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,L.jsx)(ka,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,L.jsx)(ka,{className:`h-4 max-w-[var(--skeleton-width)] flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});Cl.displayName=`SidebarMenuSkeleton`;var wl=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:H(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));wl.displayName=`SidebarMenuSub`;var Tl=_.forwardRef(({...e},t)=>(0,L.jsx)(`li`,{ref:t,...e}));Tl.displayName=`SidebarMenuSubItem`;var El=_.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,L.jsx)(e?E:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:H(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i}));El.displayName=`SidebarMenuSubButton`;var Dl={code:[`Кодексы`,`Основные отрасли права`],"federal-law":[`Федеральные законы`,`Законы по отдельным вопросам`],bylaw:[`Подзаконные акты`,`Постановления, приказы и правила`],plenum:[`Пленумы`,`Разъяснения по применению права`],review:[`Обзоры практики`,`Правовые позиции и выводы судов`]},Ol=(e=``)=>e.toLocaleLowerCase(`ru`).replaceAll(`ё`,`е`);function K(e){return`#`+new URLSearchParams(Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,t])=>[e,String(t)])).toString()}var kl=(e,t)=>K({doc:e,fragment:t}),Al=e=>{if(!e)return`не указана`;if(/^\d{2}\.\d{2}\.\d{4}$/.test(e))return e;let t=new Date(e);return Number.isNaN(+t)?e:t.toLocaleDateString(`ru-RU`)};async function jl(e,t={}){let n=await fetch(`/api`+e,{...t,headers:{Accept:`application/json`,...t.headers}}),r=await n.json();if(!n.ok)throw Error(r.error||`Не удалось получить данные. Попробуйте снова.`);return r}function Ml(e){let[t,n]=(0,_.useState)({data:null,error:``,loading:!0});return(0,_.useEffect)(()=>{if(!e){n({data:null,error:``,loading:!1});return}let t=new AbortController,r=!0;return n({data:null,error:``,loading:!0}),jl(e,{signal:t.signal}).then(e=>{r&&n({data:e,error:``,loading:!1})}).catch(e=>{r&&e.name!==`AbortError`&&n({data:null,error:e.message,loading:!1})}),()=>{r=!1,t.abort()}},[e]),t}function Nl(e,t){let[n,r]=(0,_.useState)({data:null,error:``}),[i,a]=(0,_.useState)(0);return(0,_.useEffect)(()=>{let n=new AbortController,i=0,a=async()=>{if(!document.hidden)try{let t=await jl(e,{signal:n.signal});r({data:t,error:``})}catch(e){e.name!==`AbortError`&&r(t=>({...t,error:e.message}))}n.signal.aborted||(i=window.setTimeout(a,t))};return a(),()=>{n.abort(),clearTimeout(i)}},[e,t,i]),{...n,reload:()=>a(e=>e+1)}}function Pl(e){try{let t=new URL(e||``);return[`https:`,`http:`].includes(t.protocol)?t.href:`#`}catch{return`#`}}var Fl=1,Il=.9,Ll=.8,q=.17,J=.1,Y=.999,X=.9999,Z=.99,Rl=/[\\\/_+.#"@\[\(\{&]/,zl=/[\\\/_+.#"@\[\(\{&]/g,Bl=/[\s-]/,Vl=/[\s-]/g;function Hl(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Fl:Z;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Hl(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Fl:Rl.test(e.charAt(l-1))?(d*=Ll,p=e.slice(i,l-1).match(zl),p&&i>0&&(d*=Y**+p.length)):Bl.test(e.charAt(l-1))?(d*=Il,m=e.slice(i,l-1).match(Vl),m&&i>0&&(d*=Y**+m.length)):(d*=q,i>0&&(d*=Y**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=X)),(dd&&(d=f*J)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Ul(e){return e.toLowerCase().replace(Vl,` `)}function Wl(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Hl(e,t,Ul(e),Ul(t),0,0,{})}var Gl=`[cmdk-group=""]`,Kl=`[cmdk-group-items=""]`,ql=`[cmdk-group-heading=""]`,Jl=`[cmdk-item=""]`,Yl=`${Jl}:not([aria-disabled="true"])`,Xl=`cmdk-item-select`,Zl=`data-value`,Ql=(e,t,n)=>Wl(e,t,n),$l=_.createContext(void 0),eu=()=>_.useContext($l),tu=_.createContext(void 0),nu=()=>_.useContext(tu),ru=_.createContext(void 0),iu=_.forwardRef((e,t)=>{let n=vu(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=vu(()=>new Set),i=vu(()=>new Map),a=vu(()=>new Map),o=vu(()=>new Set),s=gu(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,...v}=e,y=yn(),b=yn(),x=yn(),S=_.useRef(null),C=xu();_u(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),_u(()=>{C(6,ne)},[]);let w=_.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)te(),ee(),C(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=O()?.id,w.emit()}),r||C(5,ne),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=_.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{ee(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{te(),ee(),n.current.value||D(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=O();C(4,()=>{te(),t?.getAttribute(`id`)===e&&D(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??Ql;return e?r(e,n.current.search,t):0}function ee(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;k().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Kl);t?t.appendChild(e.parentElement===t?e:e.closest(`${Kl} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Kl} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${Gl}[${Zl}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=k().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(Zl);w.setState(`value`,e||void 0)}function te(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ne(){var e;let t=O();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Gl)?.querySelector(ql))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function O(){return S.current?.querySelector(`${Jl}[aria-selected="true"]`)}function k(){return Array.from(S.current?.querySelectorAll(Yl)||[])}function A(e){let t=k()[e];t&&w.setState(`value`,t.getAttribute(Zl))}function re(e){var t;let n=O(),r=k(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(Zl))}function ie(e){let t=O()?.closest(Gl),n;for(;t&&!n;)t=e>0?mu(t,Gl):hu(t,Gl),n=t?.querySelector(Yl);n?w.setState(`value`,n.getAttribute(Zl)):re(e)}let j=()=>A(k().length-1),M=e=>{e.preventDefault(),e.metaKey?j():e.altKey?ie(1):re(1)},N=e=>{e.preventDefault(),e.metaKey?A(0):e.altKey?ie(-1):re(-1)};return _.createElement(Wt.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&M(e);break;case`ArrowDown`:M(e);break;case`p`:case`k`:g&&e.ctrlKey&&N(e);break;case`ArrowUp`:N(e);break;case`Home`:e.preventDefault(),A(0);break;case`End`:e.preventDefault(),j();break;case`Enter`:{e.preventDefault();let t=O();if(t){let e=new Event(Xl);t.dispatchEvent(e)}}}}},_.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:wu},c),Cu(e,e=>_.createElement(tu.Provider,{value:w},_.createElement($l.Provider,{value:T},e))))}),au=_.forwardRef((e,t)=>{let n=yn(),r=_.useRef(null),i=_.useContext(ru),a=eu(),o=gu(e),s=o.current?.forceMount??i?.forceMount;_u(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=bu(n,r,[e.value,e.children,r],e.keywords),l=nu(),u=yu(e=>e.value&&e.value===c.current),d=yu(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);_.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(Xl,f),()=>t.removeEventListener(Xl,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:v,keywords:y,...b}=e;return _.createElement(Wt.div,{ref:x(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),ou=_.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=yn(),s=_.useRef(null),c=_.useRef(null),l=yn(),u=eu(),d=yu(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));_u(()=>u.group(o),[]),bu(o,s,[e.value,e.heading,c]);let f=_.useMemo(()=>({id:o,forceMount:i}),[i]);return _.createElement(Wt.div,{ref:x(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&_.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Cu(e,e=>_.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},_.createElement(ru.Provider,{value:f},e))))}),su=_.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=_.useRef(null),a=yu(e=>!e.search);return!n&&!a?null:_.createElement(Wt.div,{ref:x(i,t),...r,"cmdk-separator":``,role:`separator`})}),cu=_.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=nu(),o=yu(e=>e.search),s=yu(e=>e.selectedItemId),c=eu();return _.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),_.createElement(Wt.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),lu=_.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=_.useRef(null),o=_.useRef(null),s=yu(e=>e.selectedItemId),c=eu();return _.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),_.createElement(Wt.div,{ref:x(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Cu(e,e=>_.createElement(`div`,{ref:x(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),uu=_.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return _.createElement(ea,{open:n,onOpenChange:r},_.createElement(ia,{container:o},_.createElement(oa,{"cmdk-overlay":``,className:i}),_.createElement(ua,{"aria-label":e.label,"cmdk-dialog":``,className:a},_.createElement(iu,{ref:t,...s}))))}),du=_.forwardRef((e,t)=>yu(e=>e.filtered.count===0)?_.createElement(Wt.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),fu=_.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return _.createElement(Wt.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Cu(e,e=>_.createElement(`div`,{"aria-hidden":!0},e)))}),pu=Object.assign(iu,{List:lu,Item:au,Input:cu,Group:ou,Separator:su,Dialog:uu,Empty:du,Loading:fu});function mu(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function hu(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function gu(e){let t=_.useRef(e);return _u(()=>{t.current=e}),t}var _u=typeof window>`u`?_.useEffect:_.useLayoutEffect;function vu(e){let t=_.useRef();return t.current===void 0&&(t.current=e()),t}function yu(e){let t=nu(),n=()=>e(t.snapshot());return _.useSyncExternalStore(t.subscribe,n,n)}function bu(e,t,n,r=[]){let i=_.useRef(),a=eu();return _u(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(Zl,s),i.current=s}),i}var xu=()=>{let[e,t]=_.useState(),n=vu(()=>new Map);return _u(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Su(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Cu({asChild:e,children:t},n){return e&&_.isValidElement(t)?_.cloneElement(Su(t),{ref:t.ref},n(t.props.children)):n(t)}var wu={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Tu=ia,Eu=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(oa,{ref:n,className:H(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));Eu.displayName=oa.displayName;var Du=_.forwardRef(({className:e,children:t,title:n=`Диалог`,description:r=`Диалоговое окно`,...i},a)=>(0,L.jsxs)(Tu,{children:[(0,L.jsx)(Eu,{}),(0,L.jsxs)(ua,{ref:a,className:H(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...i,children:[(0,L.jsx)(Ou,{className:`sr-only`,children:n}),(0,L.jsx)(ku,{className:`sr-only`,children:r}),t,(0,L.jsxs)(ya,{className:`absolute right-3 top-3 flex size-11 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,L.jsx)(R,{name:`close`,className:`h-4 w-4`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Закрыть`})]})]})]}));Du.displayName=ua.displayName;var Ou=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(ha,{ref:n,className:H(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Ou.displayName=ha.displayName;var ku=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(_a,{ref:n,className:H(`text-sm text-muted-foreground`,e),...t}));ku.displayName=_a.displayName;var Au=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(pu,{ref:n,className:H(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));Au.displayName=pu.displayName;var ju=_.forwardRef(({className:e,...t},n)=>(0,L.jsxs)(`div`,{className:`flex items-center border-b px-3`,"cmdk-input-wrapper":``,children:[(0,L.jsx)(R,{name:`search`,className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,L.jsx)(pu.Input,{ref:n,className:H(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));ju.displayName=pu.Input.displayName;var Mu=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(pu.List,{ref:n,className:H(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));Mu.displayName=pu.List.displayName;var Nu=_.forwardRef((e,t)=>(0,L.jsx)(pu.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));Nu.displayName=pu.Empty.displayName;var Pu=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(pu.Group,{ref:n,className:H(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));Pu.displayName=pu.Group.displayName;var Fu=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(pu.Separator,{ref:n,className:H(`-mx-1 h-px bg-border`,e),...t}));Fu.displayName=pu.Separator.displayName;var Iu=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(pu.Item,{ref:n,className:H(`relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,e),...t}));Iu.displayName=pu.Item.displayName;function Lu({large:e=!1,initialQuery:t=``}){let[n,r]=(0,_.useState)(t),[i,a]=(0,_.useState)(!1),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),f=(0,_.useRef)(null),p=(0,_.useRef)(null),m=(0,_.useRef)(!1),h=(0,_.useRef)(``),g=i&&n.trim().length>0;(0,_.useEffect)(()=>{r(t),a(!1),m.current=!1},[t]);let v=e=>{a(!1),p.current?.blur(),location.hash=e.slice(1)},y=()=>{n.trim()&&v(K({view:`search`,q:n.trim()}))};return(0,_.useEffect)(()=>{let e=e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),p.current?.focus(),a(!0))},t=e=>{f.current?.contains(e.target)||a(!1)};return document.addEventListener(`keydown`,e),document.addEventListener(`pointerdown`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`pointerdown`,t)}},[]),(0,_.useEffect)(()=>{if(!n.trim()){s(null),l(!1),d(``);return}let e=new AbortController;l(!0),d(``);let t=setTimeout(()=>{jl(`/search?`+new URLSearchParams({q:n}),{signal:e.signal}).then(t=>{e.signal.aborted||s(t)}).catch(t=>{e.signal.aborted||d(t.message)}).finally(()=>{e.signal.aborted||l(!1)})},200);return()=>{e.abort(),clearTimeout(t)}},[n]),(0,_.useLayoutEffect)(()=>{let e=p.current;e&&(h.current||=e.getAttribute(`aria-controls`)||``,e.setAttribute(`aria-expanded`,String(g)),g?e.setAttribute(`aria-controls`,h.current):e.removeAttribute(`aria-controls`))},[g]),(0,L.jsx)(`div`,{className:`p-search ${e?`p-search-large`:``}`,ref:f,children:(0,L.jsxs)(Au,{shouldFilter:!1,label:`Поиск по библиотеке`,children:[(0,L.jsxs)(`div`,{className:`p-search-field`,children:[(0,L.jsx)(R,{name:`search`}),(0,L.jsx)(pu.Input,{ref:p,value:n,"aria-label":`Поиск по библиотеке`,enterKeyHint:`search`,placeholder:e?`Статья, номер документа или вопрос права`:`Поиск по библиотеке`,onValueChange:e=>{r(e),a(!0),m.current=!1},onFocus:()=>a(!0),onKeyDown:e=>{e.key===`Escape`&&(a(!1),e.stopPropagation()),(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(m.current=!0),e.key===`Enter`&&!m.current&&(e.preventDefault(),e.stopPropagation(),y())}}),n&&(0,L.jsx)(`button`,{className:`p-search-clear`,"aria-label":`Очистить поиск`,onClick:()=>{r(``),p.current?.focus()},children:(0,L.jsx)(R,{name:`close`})}),e?(0,L.jsxs)(`button`,{className:`p-button p-primary`,onClick:y,children:[`Найти `,(0,L.jsx)(R,{name:`arrow`})]}):(0,L.jsx)(`kbd`,{"aria-label":`Command или Control K`,children:`⌘ K`})]}),g&&(0,L.jsxs)(Mu,{className:`p-suggestions`,children:[(0,L.jsxs)(Iu,{value:`all-results`,onSelect:y,children:[(0,L.jsx)(R,{name:`search`}),(0,L.jsxs)(`span`,{children:[`Все результаты по запросу «`,n,`»`]}),(0,L.jsx)(`kbd`,{children:`↵`})]}),c?(0,L.jsx)(`p`,{className:`p-search-note`,role:`status`,children:`Ищем в текстах…`}):u?(0,L.jsx)(`p`,{className:`p-search-note`,role:`alert`,children:u}):o?.results.length?o.results.slice(0,5).map(e=>(0,L.jsxs)(Iu,{value:e.id,onSelect:()=>v(kl(e.resource_id,e.id)),children:[(0,L.jsx)(R,{name:`document`}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{children:e.label}),(0,L.jsx)(`small`,{children:e.document||e.title})]}),(0,L.jsx)(R,{name:`arrow`})]},e.id)):(0,L.jsx)(`p`,{className:`p-search-note`,children:`Совпадений нет. Уточните название или номер статьи.`})]})]})})}var Ru=[`code`,`federal-law`,`bylaw`,`plenum`,`review`],zu=[[`Гражданское право`,/гражданск|договор|недвижим|потребител/i],[`Гражданский процесс`,/гражданск.{0,30}(процесс|судопроизвод)|исков|судебн.{0,20}расход/i],[`Уголовное право`,/уголовн|преступлен|наказан/i],[`Уголовный процесс`,/уголовн.{0,30}(процесс|судопроизвод)|следствен|доказательств/i],[`Экономические споры`,/арбитраж|экономичес|банкрот|предприним/i],[`Административные дела`,/административн|публичн|правонаруш/i],[`Трудовые споры`,/трудов|работник|работодател/i],[`Семейные споры`,/семейн|брак|алименты/i]],Bu={"gk-rf":`Гражданский кодекс`,"gpk-rf":`Гражданский процессуальный кодекс`,"apk-rf":`Арбитражный процессуальный кодекс`,"uk-rf":`Уголовный кодекс`,"upk-rf":`Уголовно-процессуальный кодекс`,"kas-rf":`Кодекс административного судопроизводства`,"koap-rf":`Кодекс об административных правонарушениях`,"tk-rf":`Трудовой кодекс`,"sk-rf":`Семейный кодекс`,"zhk-rf":`Жилищный кодекс`,"zk-rf":`Земельный кодекс`,"nk-rf-gosposhlina":`Налоговый кодекс`};function Vu(e){return e.split(`:`).pop()||e}function Hu(e){return Bu[Vu(e.id)]||e.subject||e.title}function Uu(e){return`${e} ${e%10==1&&e%100!=11?`материал`:e%10>=2&&e%10<=4&&!(e%100>=12&&e%100<=14)?`материала`:`материалов`}`}function Q({documents:e,route:t,search:n,aside:r,hero:i=!1}){let a=t.kind||`code`,o=e.filter(e=>e.kind===a);return(0,L.jsxs)(`section`,{className:`p-catalog`,"aria-labelledby":`catalog-title`,children:[i&&(0,L.jsxs)(`div`,{className:`p-hero`,children:[(0,L.jsxs)(`div`,{className:`p-hero-copy`,children:[(0,L.jsx)(`p`,{className:`p-eyebrow`,children:`Локальная правовая библиотека`}),(0,L.jsxs)(`h1`,{children:[`Найти норму.`,(0,L.jsx)(`br`,{}),`Понять контекст.`]}),(0,L.jsx)(`p`,{children:`Тексты актов, редакции и проверяемые связи в одном рабочем месте.`}),n]}),(0,L.jsx)(`div`,{className:`p-hero-figure`,children:(0,L.jsx)(`img`,{src:`/assets/pantheon/eunomia-marble.webp`,alt:`Эвномия`,onError:e=>{e.currentTarget.hidden=!0}})})]}),r,(0,L.jsxs)(`div`,{className:`p-catalog-head`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`p-eyebrow`,children:`Библиотека`}),(0,L.jsx)(`h2`,{id:`catalog-title`,children:`Корпус документов`})]}),(0,L.jsx)(`span`,{className:`p-catalog-total`,children:Uu(e.length)})]}),(0,L.jsx)(`nav`,{className:`p-tabs`,"aria-label":`Тип материала`,children:Ru.map(t=>(0,L.jsxs)(`a`,{href:K({view:`category`,kind:t}),"aria-current":a===t?`page`:void 0,children:[Dl[t][0],` `,(0,L.jsx)(`span`,{children:e.filter(e=>e.kind===t).length})]},t))}),a===`code`?(0,L.jsx)(Gu,{documents:o}):a===`plenum`?(0,L.jsx)(qu,{documents:o,route:t}):(0,L.jsx)(Ju,{documents:o,route:t})]})}function Wu(e){return e.available?e.warnings?.length?`Есть предупреждения корпуса`:`Текст доступен`:`Текст недоступен`}function Gu({documents:e}){return(0,L.jsx)(`div`,{className:`p-stone-grid`,children:e.map(e=>{let t=Vu(e.id)===`gk-rf`;return(0,L.jsxs)(`a`,{className:`p-stone`,href:t?K({view:`contents`,id:e.id}):kl(e.id),children:[(0,L.jsx)(`div`,{className:`p-stone-image`,children:(0,L.jsx)(`img`,{src:`/assets/pantheon/${Vu(e.id)}.webp`,alt:``,loading:`lazy`,decoding:`async`,width:`1536`,height:`1024`})}),(0,L.jsxs)(`div`,{className:`p-stone-face`,children:[(0,L.jsx)(`strong`,{children:Hu(e)}),(0,L.jsx)(`span`,{children:e.number||(t?`Четыре части кодекса`:`Кодекс Российской Федерации`)}),(0,L.jsx)(`small`,{children:t?`Редакции указаны в каждой части`:e.revision?`Редакция ${Al(e.revision)}`:`Редакция не указана`}),(0,L.jsx)(`small`,{children:Wu(e)})]})]},e.id)})})}function Ku(e,t){let n=Number(e.page);return Number.isInteger(n)&&n>=1&&n<=t?n:1}function qu({documents:e,route:t}){let n=e=>/^\d{2}\.\d{2}\.\d{4}$/.test(e||``)?(e||``).split(`.`).reverse().join(`-`):e||``,r=[...new Set(e.map(e=>n(e.act_date).slice(0,4)).filter(Boolean))].sort().reverse(),i=t.sort===`old`?`old`:`new`,a=t.year&&r.includes(t.year)?t.year:``,o=t.topic&&zu.some(([e])=>e===t.topic)?t.topic:``,s=zu.find(([e])=>e===o)?.[1],c=e.filter(e=>{let t=`${e.subject||``} ${e.title}`;return(!a||(e.act_date||``).includes(a))&&(!s||s.test(t))}).sort((e,t)=>i===`new`?n(t.act_date).localeCompare(n(e.act_date)):n(e.act_date).localeCompare(n(t.act_date))),l=Math.max(1,Math.ceil(c.length/12)),u=Ku(t,l),d=e=>{location.hash=K({...t,...e,page:void 0})};return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`p-topic-grid`,"aria-label":`Тематика пленумов`,children:zu.map(([t,n])=>{let r=e.filter(e=>n.test(`${e.subject||``} ${e.title}`)).length;return r?(0,L.jsxs)(`button`,{className:`p-topic${o===t?` is-active`:``}`,type:`button`,"aria-pressed":o===t,onClick:()=>d({topic:o===t?void 0:t}),children:[(0,L.jsx)(`strong`,{children:t}),(0,L.jsx)(`span`,{children:r})]},t):null})}),(0,L.jsxs)(`div`,{className:`p-filterbar`,children:[(0,L.jsxs)(`label`,{children:[`Сортировка`,(0,L.jsxs)(`select`,{value:i,onChange:e=>d({sort:e.target.value===`new`?void 0:e.target.value}),children:[(0,L.jsx)(`option`,{value:`new`,children:`Сначала новые`}),(0,L.jsx)(`option`,{value:`old`,children:`Сначала ранние`})]})]}),(0,L.jsxs)(`label`,{children:[`Год`,(0,L.jsxs)(`select`,{value:a,onChange:e=>d({year:e.target.value}),children:[(0,L.jsx)(`option`,{value:``,children:`Все годы`}),r.map(e=>(0,L.jsx)(`option`,{children:e},e))]})]})]}),(0,L.jsx)(Xu,{documents:c.slice((u-1)*12,u*12)}),(0,L.jsx)(Yu,{page:u,pageCount:l,total:c.length,onChange:e=>location.hash=K({...t,page:e})})]})}function Ju({documents:e,route:t}){let n=Math.max(1,Math.ceil(e.length/12)),r=Ku(t,n);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Xu,{documents:e.slice((r-1)*12,r*12),route:t}),(0,L.jsx)(Yu,{page:r,pageCount:n,total:e.length,onChange:e=>location.hash=K({...t,page:e})})]})}function Yu({page:e,pageCount:t,total:n,onChange:r}){return(0,L.jsxs)(`div`,{className:`p-pagination`,"aria-label":`Страницы`,children:[(0,L.jsxs)(`span`,{children:[n,` документов · страница `,e,` из `,t]}),(0,L.jsxs)(`div`,{className:`p-pagination-actions`,children:[(0,L.jsx)(`button`,{type:`button`,disabled:e<=1,onClick:()=>r(e-1),children:`Предыдущая`}),(0,L.jsx)(`button`,{type:`button`,disabled:e>=t,onClick:()=>r(e+1),children:`Следующая`})]})]})}function Xu({documents:e,route:t}){return(0,L.jsxs)(`div`,{className:`p-document-list`,children:[e.map(e=>(0,L.jsxs)(`a`,{className:`p-document-row`,href:kl(e.id),children:[(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{children:e.subject||e.title}),(0,L.jsxs)(`small`,{children:[e.number||`Документ`,` · `,Al(e.act_date)]})]}),(0,L.jsx)(`span`,{className:`p-row-meta`,children:e.warnings?.length?`Требует сверки`:e.available?`Текст доступен`:`Нет текста`})]},e.id)),!e.length&&(0,L.jsx)(`p`,{className:`p-empty`,children:`Для этого типа пока нет материалов.`})]})}function Zu({documents:e,route:t}){let n=t.doc||t.id||e[0]?.id||null,{data:r,loading:i,error:a}=Ml(n?`/reader?${new URLSearchParams({id:n,fragment:t.fragment||``})}`:null),o=n||``,s=(0,_.useMemo)(()=>{let e=r?.toc||[];return o.endsWith(`gk-rf`)?e.filter(e=>/^Часть\s+/i.test(e.label)):e},[r,o]);return i?(0,L.jsx)(`section`,{className:`p-contents`,children:(0,L.jsx)(`p`,{children:`Загружаем оглавление…`})}):a||!r?(0,L.jsx)(`section`,{className:`p-contents`,children:(0,L.jsx)(`p`,{className:`p-empty`,children:`Оглавление пока недоступно.`})}):(0,L.jsxs)(`section`,{className:`p-contents`,"aria-labelledby":`contents-title`,children:[(0,L.jsx)(`p`,{className:`p-eyebrow`,children:`Оглавление`}),(0,L.jsx)(`h1`,{id:`contents-title`,children:r.document.subject||r.document.title}),(0,L.jsx)(`div`,{className:`p-contents-list`,children:s.map((e,t)=>(0,L.jsxs)(`a`,{href:kl(r.document.id,e.id),children:[(0,L.jsx)(`span`,{children:String(t+1).padStart(2,`0`)}),(0,L.jsx)(`strong`,{children:e.label})]},e.id))})]})}var Qu=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],$u=[`q`,`area`,`month`,`kind`,`category`,`court`,`code`,`article`,`sort`],ed={Гражданское:`Гражданские`,Административное:`Административные`,Уголовное:`Уголовные`},td=(e,t,n,r)=>e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&!(e%100>=12&&e%100<=14)?n:r,nd=e=>`${e.toLocaleString(`ru-RU`)} ${td(e,`акт`,`акта`,`актов`)}`,rd=e=>{let[t,n]=e.split(`-`);return`${Qu[Number(n)-1]||e} ${t}`},id=e=>{let t=new Date(e||``);return e&&!Number.isNaN(+t)?t.toLocaleString(`ru-RU`,{dateStyle:`long`,timeStyle:`short`}):`не указано`},ad=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);function od(e,t){let n=t.filter(e=>e.length>1).map(ad);if(!n.length)return e;let r=RegExp(`(?t%2?(0,L.jsx)(`mark`,{children:e},t):e)}function sd({label:e,value:t=``,options:n=[],all:r,onChange:i}){return(0,L.jsxs)(`label`,{children:[(0,L.jsx)(`span`,{children:e}),(0,L.jsxs)(`select`,{value:t,onChange:e=>i(e.target.value||void 0),children:[(0,L.jsx)(`option`,{value:``,children:r}),n.map(([e,t])=>(0,L.jsx)(`option`,{value:e,children:t},e)),t&&!n.some(([e])=>e===t)&&(0,L.jsx)(`option`,{value:t,children:t})]})]})}function cd({item:e,terms:t}){let n=e.excerpt||e.subject||``;return(0,L.jsxs)(`article`,{className:`p-result p-practice-row`,children:[(0,L.jsx)(`div`,{className:`p-result-kind`,children:e.category||`Судебный акт`}),(0,L.jsx)(`h2`,{children:(0,L.jsxs)(`a`,{href:K({view:`act`,act:e.doc}),children:[e.kind,e.number?` № ${e.number}`:``,(0,L.jsx)(R,{name:`arrow`})]})}),(0,L.jsx)(`p`,{className:`p-result-document`,children:[Al(e.act_date),e.court].filter(Boolean).join(` · `)}),n&&(0,L.jsx)(`p`,{className:`p-result-excerpt`,children:od(n,t)})]})}function ld(e,t=16){if(e.length<=t)return[e];let n=[...e.matchAll(/ /g)].map(e=>e.index||0),r=n.reduce((t,n)=>Math.abs(n-e.length/2)(t.area||``).split(`,`).some(t=>t===e.id||e.children.some(e=>e.id===t)));return(0,L.jsxs)(`nav`,{className:`p-practice-divisions`,"aria-label":`Деление практики`,children:[(0,L.jsxs)(`div`,{className:`p-division-row`,children:[(0,L.jsx)(`span`,{className:`p-division-label`,children:`Производство`}),(0,L.jsxs)(`a`,{href:n({category:void 0}),"aria-current":t.category?void 0:`true`,children:[`Все`,(0,L.jsx)(`span`,{children:r.toLocaleString(`ru-RU`)})]}),e.productions.map(e=>(0,L.jsxs)(`a`,{href:n({category:e.value}),"aria-current":t.category===e.value?`true`:void 0,children:[ed[e.value]||e.value,(0,L.jsx)(`span`,{children:e.count.toLocaleString(`ru-RU`)})]},e.value))]}),(0,L.jsxs)(`div`,{className:`p-division-row`,children:[(0,L.jsx)(`span`,{className:`p-division-label`,children:`Отрасли`}),(0,L.jsx)(`a`,{href:n({area:void 0}),"aria-current":t.area?void 0:`true`,children:`Все отрасли`}),e.areas.map(e=>(0,L.jsxs)(`a`,{href:n({area:e.id}),"aria-current":i?.id===e.id?`true`:void 0,children:[e.title,(0,L.jsx)(`span`,{children:e.count.toLocaleString(`ru-RU`)})]},e.id))]})]})}function dd({data:e,selected:t,link:n}){let r=Math.max(1,...e.children.map(e=>e.count)),i=Math.max(1,...e.intersections.map(e=>e.count)),a=new Map(e.children.map((t,n)=>{let i=-Math.PI/2+n*2*Math.PI/e.children.length;return[t.id,{x:410+230*Math.cos(i),y:235+150*Math.sin(i),cos:Math.cos(i),sin:Math.sin(i),r:20+18*Math.sqrt(t.count/r)}]}));return(0,L.jsxs)(`svg`,{className:`p-area-graph`,viewBox:`0 0 820 470`,"aria-hidden":`true`,focusable:`false`,children:[e.children.map(e=>{let t=a.get(e.id);return(0,L.jsx)(`line`,{className:`p-area-spoke`,x1:410,y1:235,x2:t.x,y2:t.y},e.id)}),e.intersections.map(e=>{let r=a.get(e.a),o=a.get(e.b);if(!r||!o)return null;let s=(r.x+o.x)/2,c=(r.y+o.y)/2,l=Math.hypot(s-410,c-235)>80,u=l?(s-410)/Math.hypot(s-410,c-235):(r.y-o.y)/Math.hypot(o.x-r.x,o.y-r.y),d=l?(c-235)/Math.hypot(s-410,c-235):(o.x-r.x)/Math.hypot(o.x-r.x,o.y-r.y),f=s+u*(l?60:150),p=c+d*(l?60:150),m=t.includes(e.a)&&t.includes(e.b);return(0,L.jsxs)(`a`,{href:n({area:`${e.a},${e.b}`}),tabIndex:-1,children:[(0,L.jsx)(`path`,{className:`p-area-cross-edge${m?` is-on`:``}`,d:`M${r.x},${r.y} Q${f},${p} ${o.x},${o.y}`,strokeWidth:1.5+4*e.count/i}),(0,L.jsx)(`circle`,{className:`p-area-badge`,cx:(r.x+2*f+o.x)/4,cy:(r.y+2*p+o.y)/4,r:`12`}),(0,L.jsx)(`text`,{className:`p-area-badge-text`,x:(r.x+2*f+o.x)/4,y:(r.y+2*p+o.y)/4+4,children:e.count})]},e.a+e.b)}),(0,L.jsxs)(`a`,{href:n({area:e.area.id}),tabIndex:-1,children:[(0,L.jsx)(`circle`,{className:`p-area-hub${t.includes(e.area.id)?` is-on`:``}`,cx:410,cy:235,r:`62`}),ld(e.area.title,10).map((e,t,n)=>(0,L.jsx)(`text`,{className:`p-area-hub-text`,x:410,y:227-(n.length-1)*9+t*18,children:e},e)),(0,L.jsx)(`text`,{className:`p-area-hub-count`,x:410,y:259,children:e.area.count})]}),e.children.map(e=>{let r=a.get(e.id),i=Math.abs(r.cos)>.3,o=ld(e.title),s=i?r.cos>0?`start`:`end`:`middle`,c=i?r.x+(r.r+12)*Math.sign(r.cos):r.x,l=i?r.y-(o.length-1)*8+5:r.sin<0?r.y-r.r-12-(o.length-1)*16:r.y+r.r+22;return(0,L.jsxs)(`a`,{href:n({area:e.id}),tabIndex:-1,children:[(0,L.jsx)(`circle`,{className:`p-area-node${t.includes(e.id)?` is-on`:``}`,cx:r.x,cy:r.y,r:r.r}),(0,L.jsx)(`text`,{className:`p-area-node-count`,x:r.x,y:r.y+5,children:e.count}),o.map((e,t)=>(0,L.jsx)(`text`,{className:`p-area-node-text`,textAnchor:s,x:c,y:l+t*16,children:e},e))]},e.id)})]})}function fd({hub:e,route:t,link:n}){let{data:r}=Ml(`/practice/area?`+new URLSearchParams({id:e}));if(!r?.ready)return null;let i=(t.area||``).split(`,`),a=e=>r.children.find(t=>t.id===e)?.title||e,o=r.articles.filter(e=>i.includes(e.node)||i.includes(r.area.id));return(0,L.jsxs)(`section`,{className:`p-area`,"aria-labelledby":`area-title`,children:[(0,L.jsxs)(`div`,{className:`p-area-head`,children:[(0,L.jsx)(`h2`,{id:`area-title`,children:r.area.title}),(0,L.jsxs)(`p`,{children:[nd(r.area.count),r.productions.length?` · `+r.productions.map(e=>`${ed[e.value]||e.value} ${e.count}`).join(` · `):``]})]}),(0,L.jsx)(dd,{data:r,selected:i,link:n}),(0,L.jsxs)(`nav`,{className:`p-area-children`,"aria-label":`Подкатегории`,children:[(0,L.jsxs)(`a`,{href:n({area:r.area.id}),"aria-current":t.area===r.area.id?`true`:void 0,children:[`Все `,r.area.title.toLocaleLowerCase(`ru`),(0,L.jsx)(`span`,{children:r.area.count})]}),r.children.map(e=>(0,L.jsxs)(`a`,{href:n({area:e.id}),"aria-current":t.area===e.id?`true`:void 0,children:[e.title,(0,L.jsx)(`span`,{children:e.count})]},e.id))]}),!!r.intersections.length&&(0,L.jsxs)(`div`,{className:`p-area-cross`,children:[(0,L.jsx)(`h3`,{children:`Пересечения подкатегорий`}),r.intersections.map(e=>(0,L.jsxs)(`a`,{href:n({area:`${e.a},${e.b}`}),"aria-current":t.area===`${e.a},${e.b}`?`true`:void 0,children:[a(e.a),` и `,a(e.b),(0,L.jsx)(`span`,{children:nd(e.count)})]},e.a+e.b))]}),!!o.length&&(0,L.jsxs)(`div`,{className:`p-area-cross`,children:[(0,L.jsx)(`h3`,{children:`Чаще всего цитируют`}),o.map(e=>(0,L.jsxs)(`a`,{href:n({area:e.node,code:e.code,article:e.article}),children:[e.label,(0,L.jsx)(`small`,{children:a(e.node)}),(0,L.jsx)(`span`,{children:e.count})]},e.node+e.article))]}),(0,L.jsx)(`p`,{className:`p-area-note`,children:`Акты отнесены машиной, без модели: по предмету требования в начале акта или по нескольким статьям главы СК. Причина видна в каждом акте.`})]})}function pd(){return(0,L.jsx)(`p`,{className:`p-practice-note`,children:`Практика еще не загружена. Задача обновления каждый час забирает акты из Lynceuz и строит связи со статьями. Ее состояние — на странице «Состояние базы».`})}function md({route:e}){let t=Ml(`/practice?`+new URLSearchParams([...$u.flatMap(t=>e[t]?[[t,e[t]]]:[]),...e.page?[[`page`,e.page]]:[]])),n=Ml(`/practice/facets`),[r,i]=(0,_.useState)(e.q||``);(0,_.useEffect)(()=>i(e.q||``),[e.q]);let a=Ml(`/practice/tree`),o=t=>K({view:`practice`,...Object.fromEntries($u.map(t=>[t,e[t]])),...t,page:t.page}),s=e=>{location.hash=o(e)},c=a.data?.areas.find(t=>(e.area||``).split(`,`).some(e=>e===t.id||t.children.some(t=>t.id===e))),l=e.area&&!e.area.includes(`,`)?[c,...c?.children||[]].find(t=>t?.id===e.area):void 0,u=e=>{e.preventDefault(),s({q:r.trim()||void 0})},d=t.data,f=e.code&&e.article?d?.articles.find(t=>t.code===e.code&&t.article===e.article):void 0,p=e=>n.data?.[e].map(({value:t,count:n})=>[t,`${e===`months`?rd(t):t} · ${n}`]);return(0,L.jsxs)(`section`,{className:`p-research p-practice`,"aria-labelledby":`practice-title`,children:[(0,L.jsxs)(`div`,{className:`p-page-head`,children:[(0,L.jsx)(`p`,{className:`p-eyebrow`,children:`Судебная практика · СудАкт`}),(0,L.jsx)(`h1`,{id:`practice-title`,children:f?`Практика по ${f.label}`:e.q?`«${e.q}»`:l?.title||`Судебная практика`}),(0,L.jsx)(`p`,{children:`Акты судов 2026 года с полным текстом. Ищите словами или статьей: «неустойка», «ст. 333 ГК».`})]}),a.data?.ready&&(0,L.jsx)(ud,{tree:a.data,route:e,link:o}),c&&(0,L.jsx)(fd,{hub:c.id,route:e,link:o},c.id),(0,L.jsxs)(`form`,{className:`p-practice-search`,role:`search`,"aria-label":`Поиск по практике`,onSubmit:u,children:[(0,L.jsxs)(`label`,{className:`p-field`,children:[(0,L.jsx)(`span`,{children:`Слова или статья`}),(0,L.jsx)(`input`,{type:`search`,value:r,maxLength:300,onChange:e=>i(e.target.value),placeholder:`неустойка, ст. 333 ГК`})]}),(0,L.jsxs)(`button`,{className:`p-button p-primary`,type:`submit`,children:[(0,L.jsx)(R,{name:`search`}),`Найти`]})]}),(0,L.jsxs)(`div`,{className:`p-filterbar p-practice-filters`,children:[(0,L.jsx)(sd,{label:`Месяц`,value:e.month,options:p(`months`),all:`Все месяцы`,onChange:e=>s({month:e})}),(0,L.jsx)(sd,{label:`Вид акта`,value:e.kind,options:p(`kinds`),all:`Все виды`,onChange:e=>s({kind:e})}),(0,L.jsx)(sd,{label:`Суд`,value:e.court,options:p(`courts`),all:`Все суды`,onChange:e=>s({court:e})}),(0,L.jsx)(sd,{label:`Порядок`,value:e.sort,options:[[`old`,`Сначала ранние`]],all:`Сначала новые`,onChange:e=>s({sort:e})})]}),!!d?.articles.length&&(0,L.jsxs)(`div`,{className:`p-practice-articles`,"aria-label":`Статьи в запросе`,children:[d.articles.map(e=>(0,L.jsxs)(`span`,{className:`p-chip`,children:[e.label,e.reader&&(0,L.jsx)(`a`,{href:kl(e.reader.id,e.reader.fragment),children:`текст статьи`})]},e.code+e.article)),e.code&&(0,L.jsx)(`a`,{className:`p-practice-reset`,href:K({view:`practice`}),children:`Сбросить статью`})]}),(0,L.jsx)(`div`,{className:`p-results-tools`,children:(0,L.jsx)(`span`,{role:`status`,children:t.loading?`Ищем…`:d?.ready?nd(d.total):``})}),t.error?(0,L.jsx)(`p`,{role:`alert`,className:`p-notice`,children:t.error}):d?d.ready?d.items.length?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`p-results`,children:d.items.map(e=>(0,L.jsx)(cd,{item:e,terms:d.terms},e.doc))}),(0,L.jsxs)(`div`,{className:`p-pagination`,"aria-label":`Страницы`,children:[(0,L.jsxs)(`span`,{children:[`Страница `,d.page,` из `,d.pages]}),(0,L.jsxs)(`div`,{className:`p-pagination-actions`,children:[(0,L.jsx)(`button`,{type:`button`,disabled:d.page<=1,onClick:()=>s({page:String(d.page-1)}),children:`Предыдущая`}),(0,L.jsx)(`button`,{type:`button`,disabled:d.page>=d.pages,onClick:()=>s({page:String(d.page+1)}),children:`Следующая`})]})]})]}):(0,L.jsx)(`p`,{className:`p-empty`,children:`Актов по запросу нет. Уберите фильтр или измените слова.`}):(0,L.jsx)(pd,{}):(0,L.jsx)(`p`,{className:`p-loading`,role:`status`,children:`Открываем практику…`})]})}function hd(e,t,n){let r=new Map(n.map(e=>[`${e.code}:${e.article}`,e])),i=[],a=0;for(let n of e.split(` `)){let o=a,s=a+n.length;if(a=s+1,!n.trim())continue;let c=[],l=o;for(let n of t){let t=Math.max(n.start,l),i=Math.min(n.end,s);if(t>=i)continue;t>l&&c.push(e.slice(l,t));let a=r.get(`${n.code}:${n.article}`);c.push(a?.reader?(0,L.jsx)(`a`,{href:kl(a.reader.id,a.reader.fragment),title:`Открыть ${a.label}`,children:e.slice(t,i)},t):(0,L.jsx)(`span`,{className:`p-act-cite`,title:a?.label,children:e.slice(t,i)},t)),l=i}c.push(e.slice(l,s)),i.push((0,L.jsx)(`p`,{children:c},o))}return i}function gd({route:e}){let{data:t,error:n,loading:r}=Ml(e.act?`/practice/act?`+new URLSearchParams({id:e.act}):null);if(r)return(0,L.jsx)(`section`,{className:`p-practice-act`,children:(0,L.jsx)(`p`,{className:`p-loading`,role:`status`,children:`Открываем акт…`})});if(n||!t)return(0,L.jsx)(`section`,{className:`p-practice-act`,children:(0,L.jsx)(`p`,{className:`p-notice`,role:`alert`,children:n||`Акт не найден.`})});let{act:i}=t;return(0,L.jsxs)(`article`,{className:`p-practice-act`,"aria-labelledby":`act-title`,children:[(0,L.jsx)(`header`,{className:`p-document-header`,children:(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`a`,{className:`p-practice-back`,href:K({view:`practice`}),children:[(0,L.jsx)(R,{name:`back`}),`Судебная практика`]}),(0,L.jsx)(`span`,{className:`p-kicker`,children:[i.category,i.kind].filter(Boolean).join(` · `)}),(0,L.jsx)(`h1`,{id:`act-title`,children:t.heading||i.title}),(0,L.jsx)(`p`,{className:`p-practice-court`,children:[i.court,i.area&&`(${i.area})`].filter(Boolean).join(` `)})]})}),i.removed_at&&(0,L.jsxs)(`p`,{className:`p-notice`,role:`status`,children:[`Источник удалил акт `,Al(i.removed_at),i.removed_code?` (${i.removed_code})`:``,`. Показана копия, сохраненная до удаления.`]}),(0,L.jsxs)(`div`,{className:`p-act-layout`,children:[(0,L.jsx)(`div`,{className:`p-act-main`,children:t.text===null?(0,L.jsx)(`p`,{className:`p-notice`,role:`alert`,children:`Сохраненный текст не прошел сверку SHA-256 и не показан. Повторите импорт практики.`}):(0,L.jsx)(`div`,{className:`p-reading p-act-text`,children:hd(t.text,t.links,t.articles)})}),(0,L.jsxs)(`aside`,{className:`p-act-aside`,"aria-label":`Источник и статьи акта`,children:[(0,L.jsxs)(`section`,{className:`p-act-card`,"aria-labelledby":`act-source`,children:[(0,L.jsx)(`h2`,{id:`act-source`,children:`Источник`}),(0,L.jsxs)(`dl`,{children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:`Адрес`}),(0,L.jsx)(`dd`,{children:(0,L.jsx)(`a`,{href:Pl(i.url),target:`_blank`,rel:`noreferrer`,children:i.url.replace(`https://`,``).replace(/\/$/,``)})})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:`Загружено`}),(0,L.jsx)(`dd`,{children:id(i.fetched_at)})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:`SHA-256`}),(0,L.jsxs)(`dd`,{children:[(0,L.jsx)(`code`,{className:`p-hash`,children:i.sha256}),(0,L.jsx)(`span`,{className:i.verified?`p-chip`:`p-chip p-chip-bad`,children:i.verified?`Хеш совпал`:`Хеш не совпал`})]})]})]})]}),!!t.areas.length&&(0,L.jsxs)(`section`,{className:`p-act-card`,"aria-labelledby":`act-areas`,children:[(0,L.jsx)(`h2`,{id:`act-areas`,children:`Отрасль`}),(0,L.jsx)(`ul`,{className:`p-act-areas`,children:t.areas.map(e=>(0,L.jsxs)(`li`,{children:[(0,L.jsxs)(`a`,{href:K({view:`practice`,area:e.id}),children:[e.parent_title?`${e.parent_title} → `:``,e.title]}),(0,L.jsx)(`small`,{children:e.reason})]},e.id))})]}),(0,L.jsxs)(`section`,{className:`p-act-card`,"aria-labelledby":`act-articles`,children:[(0,L.jsxs)(`h2`,{id:`act-articles`,children:[`Статьи в акте · `,t.articles.length]}),t.articles.length?(0,L.jsx)(`ul`,{children:t.articles.map(e=>(0,L.jsxs)(`li`,{children:[e.reader?(0,L.jsx)(`a`,{href:kl(e.reader.id,e.reader.fragment),children:e.label}):(0,L.jsx)(`span`,{children:e.label}),(0,L.jsxs)(`a`,{className:`p-act-more`,href:K({view:`practice`,code:e.code,article:e.article}),children:[nd(e.total||0),` по статье`]})]},e.code+e.article))}):(0,L.jsx)(`p`,{children:`Ссылок на статьи кодексов не найдено.`})]})]})]})]})}function _d({documentId:e,fragmentId:t}){let{data:n}=Ml(e.includes(`:code:`)&&t.includes(`_article_`)?`/practice/norm?`+new URLSearchParams({id:e,fragment:t}):null);return!n?.total||!n.code||!n.article?null:(0,L.jsxs)(`a`,{className:`p-norm-practice`,href:K({view:`practice`,code:n.code,article:n.article}),children:[(0,L.jsx)(R,{name:`document`}),(0,L.jsxs)(`span`,{className:`p-norm-practice-text`,children:[(0,L.jsxs)(`strong`,{children:[`Судебная практика по `,n.label]}),(0,L.jsxs)(`small`,{children:[nd(n.total),` 2026 года цитируют статью`]})]}),(0,L.jsx)(R,{name:`arrow`})]})}function vd({status:e}){let t=e?.acts||0;return(0,L.jsxs)(`section`,{className:`p-practice-teaser`,"aria-labelledby":`practice-teaser-title`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`p-eyebrow`,children:`Судебная практика`}),(0,L.jsx)(`h2`,{id:`practice-teaser-title`,children:`Акты судов 2026 года`}),(0,L.jsx)(`p`,{children:e?.ready&&t?`${nd(t)} с полным текстом, источником и ссылками на статьи кодексов. Новые акты приходят сами.`:`Акты появятся после первого импорта из Lynceuz.`})]}),(0,L.jsxs)(`a`,{className:`p-button p-primary`,href:K({view:`practice`}),children:[`Открыть практику`,(0,L.jsx)(R,{name:`arrow`})]})]})}function $(e,t=[],n=``){let r=n.trim()?RegExp(`(${n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)})`,`ig`):null,i=t.slice().sort((e,t)=>e.offset-t.offset),a=[],o=0,s=(e,t)=>{if(e){if(!r){a.push((0,L.jsx)(`span`,{children:e},t));return}a.push(...e.split(r).map((e,r)=>e.toLocaleLowerCase(`ru`)===n.toLocaleLowerCase(`ru`)?(0,L.jsx)(`mark`,{children:e},`${t}-mark-${r}`):(0,L.jsx)(`span`,{children:e},`${t}-${r}`)))}};return i.forEach((t,n)=>{let r=Math.max(o,Math.min(e.length,t.offset));s(e.slice(o,r),`text-${n}`),a.push((0,L.jsx)(`span`,{className:`p-anchor`,id:t.id,"aria-hidden":`true`},`anchor-${t.id}`)),o=r}),s(e.slice(o),`text-tail`),a}function yd(e,t){let n=String(e.text||``),r=n.split(/\r?\n/,1)[0].replace(/^\s*#+\s*/,``).trim();if(!r||Ol(r)!==Ol(e.label))return $(n,e.anchors,t);let i=n.match(/\r?\n/);if(!i||i.index===void 0)return null;let a=i.index+i[0].length,o=a+(n.slice(a).match(/^[\r\n]+/)?.[0].length||0),s=(e.anchors||[]).filter(e=>e.offset>=o).map(e=>({...e,offset:e.offset-o}));return $(n.slice(o),s,t)}function bd(e){return e.replace(/\s*\(?Российской Федерации\)?\s*/gi,` `).replace(/\s+РФ\s*$/i,``).trim()||e}function xd({items:e,activeId:t,documentId:n,filter:r,onFilter:i,onSelect:a}){let o=(0,_.useRef)(null);(0,_.useEffect)(()=>{let e=o.current,t=e?.querySelector(`.is-active`);e&&t&&(e.scrollTop+=t.getBoundingClientRect().top-e.getBoundingClientRect().top-64)},[t,r,e]);let s=(0,_.useMemo)(()=>e.filter(e=>!r||Ol(`${e.label} ${e.text||``}`).includes(Ol(r))),[e,r]),c=s.filter(e=>![`article`,`point`,`paragraph`].includes(e.kind)),l=(0,_.useMemo)(()=>c.map((t,n)=>{let r=e.indexOf(t),i=n+1n.id!==t.id&&!c.some(e=>e.id===n.id)&&e.indexOf(n)>r&&e.indexOf(n)i(e.target.value),placeholder:`Например, 395`})]}),(0,L.jsxs)(`div`,{className:`p-toc-list`,ref:o,children:[l.map(({chapter:e,children:i})=>(0,L.jsxs)(`details`,{open:!!r||t===e.id||i.some(e=>e.id===t),children:[(0,L.jsx)(`summary`,{children:e.label}),(0,L.jsx)(`a`,{className:t===e.id?`p-toc-link is-active`:`p-toc-link`,"aria-label":`Читать раздел ${e.label}`,href:kl(n,e.id),onClick:()=>a(e.id),children:`Читать раздел`}),i.map(e=>(0,L.jsx)(`a`,{className:t===e.id?`p-toc-link is-active`:`p-toc-link`,href:kl(n,e.id),onClick:()=>a(e.id),children:e.label},e.id))]},e.id)),!c.length&&s.map(e=>(0,L.jsx)(`a`,{className:t===e.id?`p-toc-link is-active`:`p-toc-link`,href:kl(n,e.id),onClick:()=>a(e.id),children:e.label},e.id))]})]})}var Sd=e=>e?`${e} ${e%10==1&&e%100!=11?`связь`:e%10>=2&&e%10<=4&&!(e%100>=12&&e%100<=14)?`связи`:`связей`}`:`Связей нет`;function Cd({data:e,documentId:t,fragmentId:n}){let r=e.node_id;return(0,L.jsxs)(`aside`,{className:`p-context`,"aria-label":`Контекст и связи`,children:[(0,L.jsxs)(`div`,{className:`p-panel-title`,children:[(0,L.jsx)(`h2`,{children:`Контекст`}),(0,L.jsx)(`span`,{children:Sd(e.related?.length||0)})]}),(0,L.jsx)(`p`,{className:`p-context-intro`,children:`Основания связи с выбранным фрагментом. Проверяйте каждый переход по источнику.`}),(0,L.jsx)(`div`,{className:`p-related-list`,children:(e.related||[]).map((e,n)=>{let i=e.source_node,a=e.target_node,o=r&&i?.id===r?a:r&&a?.id===r?i:i?.resource_id===t?a:i;return o?(0,L.jsxs)(`details`,{className:`p-relation`,children:[(0,L.jsx)(`summary`,{children:o.label||`Связанный фрагмент`}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{className:`p-chip`,children:e.relation===`references`?`Прямая ссылка`:e.relation===`thematic`?`Тематическая связь`:`Связь из графа`}),e.evidence?.excerpt?(0,L.jsxs)(`p`,{children:[`«`,e.evidence.excerpt,`»`]}):(0,L.jsx)(`p`,{className:`p-muted`,children:`Доказательный фрагмент не сохранен.`}),e.evidence?.revision&&(0,L.jsxs)(`p`,{className:`p-muted`,children:[`Редакция: `,Al(e.evidence.revision)]}),e.evidence?.source_url&&(0,L.jsx)(`a`,{href:Pl(e.evidence.source_url),target:`_blank`,rel:`noopener noreferrer`,children:`Источник связи ↗`}),(0,L.jsxs)(`a`,{className:`p-button p-button-quiet`,href:kl(o.resource_id,o.reader_id),children:[o.reader_id?`Открыть фрагмент`:`Открыть документ`,` `,(0,L.jsx)(R,{name:`arrow`})]})]})]},`${e.source}-${e.target}-${n}`):null})}),(0,L.jsx)(`a`,{className:`p-context-graph`,href:K({view:`graph`,level:`atoms`,node_id:r||void 0,resource_id:t,fragment:r?void 0:n}),children:`Граф выбранной нормы →`})]})}function wd({route:e,onNotify:t,onRecent:n}){let r=e.doc||e.id||``,i=e.fragment||``,a=Ml(r?`/reader?${new URLSearchParams({id:r,...i?{fragment:i}:{}})}`:null),[o,s]=(0,_.useState)([]),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(``),[y,b]=(0,_.useState)(20),[x,S]=(0,_.useState)(!1),[C,w]=(0,_.useState)(``),[T,E]=(0,_.useState)(null),[ee,D]=(0,_.useState)({related:[]}),[te,ne]=(0,_.useState)(!1),[O,k]=(0,_.useState)(-1),[A,re]=(0,_.useState)(0),ie=(0,_.useRef)(null),j=(0,_.useRef)(null),M=(0,_.useRef)(0),N=a.data?.document,ae=a.data?.toc||[],oe=o.length?o:a.data?.fragment?[a.data.fragment]:[],P=a.data?.selected_id||i||oe[0]?.id||``,F=g?o:oe;(0,_.useEffect)(()=>{s([]),v(``),p(``),d(``),l(!1),M.current+=1,j.current?.abort(),window.scrollTo(0,0)},[r,i]),(0,_.useEffect)(()=>{a.data?.document&&P&&n?.(r,P)},[a.data?.document.id,P,r,n]),(0,_.useEffect)(()=>{m&&ie.current?.focus()},[m]),(0,_.useEffect)(()=>(document.body.classList.toggle(`p-reading-focus`,x),()=>document.body.classList.remove(`p-reading-focus`)),[x]),(0,_.useEffect)(()=>{let e=e=>{e.key===`Escape`&&x&&S(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x]),(0,_.useEffect)(()=>()=>{M.current+=1,j.current?.abort()},[]);let I=(0,_.useCallback)(async()=>{if(!r||o.length||c)return o;j.current?.abort();let e=new AbortController;j.current=e;let n=++M.current;l(!0),d(``);try{let t=await jl(`/document?${new URLSearchParams({id:r})}`,{signal:e.signal});if(e.signal.aborted||n!==M.current)return[];let i=t.fragments||(t.body?[{id:r,label:`Документ`,kind:`document`,text:t.body}]:[]);return s(i),i}catch(r){if(e.signal.aborted||n!==M.current)return[];let i=r instanceof Error?r.message:`Полный текст недоступен.`;return d(i),t(i),[]}finally{n===M.current&&(l(!1),j.current=null)}},[o,r,t,c]);(0,_.useEffect)(()=>{if(!f.trim()){v(``);return}let e=window.setTimeout(()=>{o.length?(v(f.trim()),k(-1)):!c&&!u&&I()},260);return()=>window.clearTimeout(e)},[f,o,c,u,I]),(0,_.useEffect)(()=>{if(!r)return;let e=new AbortController,t,n=0,i=!0;ne(!0);let a=async()=>{try{let o=await jl(`/related?${new URLSearchParams({id:r,...P?{fragment:P}:{}})}`,{signal:e.signal});if(!i||e.signal.aborted)return;D(o),ne(!!o.loading),o.loading&&n++<4&&(t=window.setTimeout(a,1500))}catch(e){i&&!(e instanceof Error&&e.name===`AbortError`)&&D({related:[]})}};return a(),()=>{i=!1,e.abort(),t!==void 0&&window.clearTimeout(t)}},[r,P]),(0,_.useEffect)(()=>{let e=window.requestAnimationFrame(()=>{if(re(document.querySelectorAll(`.p-reading mark`).length),!g&&!o.length&&P===a.data?.fragment?.id)return;let e=P?document.getElementById(P):null;e&&window.scrollTo({top:Math.max(0,e.getBoundingClientRect().top+window.scrollY-110),behavior:`auto`})});return()=>window.cancelAnimationFrame(e)},[P,g,o,a.data]);let se=e=>{window.location.hash=kl(r,e).slice(1),n?.(r,e)},ce=ae.filter(e=>e.kind===`article`),le=ce.findIndex(e=>e.id===a.data?.fragment?.id),ue=e=>{let t=ce[le+e];t&&se(t.id)},de=e=>{let t=Array.from(document.querySelectorAll(`.p-reading mark`));if(!t.length)return;let n=(O+e+t.length)%t.length;k(n),t[n].scrollIntoView({block:`center`,behavior:`auto`})},fe=async()=>{try{await navigator.clipboard.writeText(`${location.origin}${location.pathname}${kl(r,P)}`),t(`Ссылка скопирована`)}catch{t(`Копирование недоступно в этом браузере.`)}};if(a.loading&&!N)return(0,L.jsx)(`div`,{className:`p-document`,children:(0,L.jsx)(`p`,{className:`p-status`,children:`Открываем документ…`})});if(a.error||!N)return(0,L.jsx)(`div`,{className:`p-document`,children:(0,L.jsx)(`p`,{className:`p-warning`,children:a.error||`Документ не найден.`})});let pe=N.subject||N.title,me=(N.revision?.length||0)>35;return(0,L.jsxs)(`div`,{className:`p-document`,children:[(0,L.jsxs)(`header`,{className:`p-document-header`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{className:`p-kicker`,children:Dl[N.kind]?.[0]||`Документ`}),(0,L.jsx)(`h1`,{children:bd(pe)}),(0,L.jsxs)(`details`,{children:[(0,L.jsx)(`summary`,{children:`Название, редакция и реквизиты`}),(0,L.jsx)(`p`,{children:N.title}),(0,L.jsxs)(`dl`,{children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:`Номер`}),(0,L.jsx)(`dd`,{children:N.number||`не указан`})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dt`,{children:`Дата акта`}),(0,L.jsx)(`dd`,{children:Al(N.act_date)})]})]}),(0,L.jsxs)(`p`,{children:[`Редакция: `,Al(N.revision)]}),(0,L.jsxs)(`p`,{children:[`Получено: `,Al(N.retrieved_at),` · Проверено: `,Al(N.last_checked)]}),(0,L.jsx)(`p`,{children:N.integrity?`Целостность сохраненного текста подтверждена`:`Целостность текста не подтверждена`})]})]}),(0,L.jsxs)(`div`,{className:`p-header-actions`,children:[(0,L.jsxs)(`a`,{className:`p-button`,href:K({view:`history`,id:r}),children:[(0,L.jsx)(R,{name:`history`}),`Редакции`]}),Pl(N.source_url)!==`#`&&(0,L.jsxs)(`a`,{className:`p-button`,href:Pl(N.source_url),target:`_blank`,rel:`noopener noreferrer`,children:[`Источник`,(0,L.jsx)(R,{name:`source`})]})]})]}),(0,L.jsxs)(`div`,{className:`p-document-meta`,children:[(0,L.jsx)(`span`,{children:me?`Редакции четырех частей — в реквизитах`:`Редакция: ${Al(N.revision)}`}),!!N.warnings?.length&&(0,L.jsxs)(`details`,{className:`p-reader-warning`,children:[(0,L.jsxs)(`summary`,{children:[`Требует сверки · `,N.warnings.length]}),N.warnings.map((e,t)=>(0,L.jsx)(`p`,{children:e},t))]})]}),(0,L.jsxs)(`div`,{className:`p-mobile-actions`,children:[(0,L.jsxs)(`button`,{className:`p-button p-toc-trigger`,onClick:()=>E(`toc`),children:[(0,L.jsx)(R,{name:`menu`}),`Оглавление`]}),(0,L.jsxs)(`button`,{className:`p-button`,onClick:()=>E(`context`),children:[(0,L.jsx)(R,{name:`graph`}),`Контекст`]})]}),(0,L.jsxs)(`div`,{className:`p-layout`,children:[(0,L.jsx)(`div`,{className:`p-side`,children:(0,L.jsx)(xd,{items:ae,activeId:a.data?.fragment?.id||P,documentId:r,filter:C,onFilter:w,onSelect:se})}),(0,L.jsxs)(`div`,{className:`p-reader-main`,children:[(0,L.jsxs)(`div`,{className:`p-reader-tools`,children:[(0,L.jsxs)(`div`,{className:`p-toolbar`,role:`toolbar`,"aria-label":`Инструменты чтения`,children:[(0,L.jsxs)(`button`,{className:`p-button`,onClick:()=>h(e=>!e),"aria-expanded":m,children:[(0,L.jsx)(R,{name:`search`}),`Найти`]}),(0,L.jsx)(`span`,{className:`p-tool-divider`}),(0,L.jsx)(`button`,{className:`p-icon-button`,"aria-label":`Уменьшить шрифт`,title:`Уменьшить шрифт`,disabled:y<=16,onClick:()=>b(e=>e-1),children:`A−`}),(0,L.jsx)(`button`,{className:`p-icon-button`,"aria-label":`Увеличить шрифт`,title:`Увеличить шрифт`,disabled:y>=30,onClick:()=>b(e=>e+1),children:`A+`}),(0,L.jsx)(`button`,{className:`p-icon-button`,"aria-label":`Копировать ссылку`,title:`Копировать ссылку`,onClick:()=>void fe(),children:(0,L.jsx)(R,{name:`copy`})}),(0,L.jsx)(`button`,{className:`p-icon-button`,"aria-label":x?`Выйти из режима чтения`:`Режим чтения`,title:`Режим чтения · Escape для выхода`,"aria-pressed":x,onClick:()=>S(e=>!e),children:(0,L.jsx)(R,{name:`expand`})})]}),m&&(0,L.jsxs)(`div`,{className:`p-find-row`,children:[(0,L.jsxs)(`label`,{className:`p-field p-find`,children:[(0,L.jsx)(`span`,{className:`sr-only`,children:`Найти в тексте`}),(0,L.jsx)(`input`,{ref:ie,"aria-label":`Найти в тексте`,type:`search`,value:f,onChange:e=>p(e.target.value),placeholder:`Слово или фраза`})]}),(0,L.jsx)(`span`,{className:`p-counter`,role:`status`,children:c?`Загрузка…`:g?`${O>=0?O+1:0} / ${A}`:``}),(0,L.jsx)(`button`,{className:`p-icon-button`,disabled:!A,"aria-label":`Предыдущее совпадение`,onClick:()=>de(-1),children:`↑`}),(0,L.jsx)(`button`,{className:`p-icon-button`,disabled:!A,"aria-label":`Следующее совпадение`,onClick:()=>de(1),children:`↓`})]})]}),u&&(0,L.jsx)(`p`,{className:`p-warning`,role:`alert`,children:u}),!g&&(0,L.jsx)(_d,{documentId:r,fragmentId:a.data?.fragment?.id||P}),(0,L.jsx)(`div`,{className:`p-reading`,style:{fontSize:y},children:F.length?F.map(e=>(0,L.jsxs)(`section`,{className:`p-fragment`,id:e.id,children:[(0,L.jsx)(`h2`,{children:e.label}),(0,L.jsxs)(`a`,{className:`p-fragment-graph`,href:K({view:`graph`,level:`atoms`,resource_id:r,fragment:e.id}),children:[(0,L.jsx)(R,{name:`graph`}),`Граф этой нормы`]}),(0,L.jsx)(`div`,{children:yd(e,g)})]},e.id)):(0,L.jsx)(`p`,{className:`p-muted`,children:`Текст пока не загружен.`})}),le>=0&&(0,L.jsxs)(`div`,{className:`p-adjacent`,children:[(0,L.jsx)(`button`,{className:`p-button`,disabled:le<=0,onClick:()=>ue(-1),children:`← Предыдущая статья`}),(0,L.jsx)(`button`,{className:`p-button`,disabled:le>=ce.length-1,onClick:()=>ue(1),children:`Следующая статья →`})]}),!o.length&&(0,L.jsx)(`button`,{className:`p-button p-whole-text`,disabled:c,onClick:()=>void I(),children:c?`Загружаем…`:`Открыть весь документ`})]}),(0,L.jsx)(`div`,{className:`p-side`,children:(0,L.jsx)(Cd,{data:{...ee,loading:te},documentId:r,fragmentId:P})})]}),(0,L.jsx)(xa,{open:T!==null,onOpenChange:e=>{e||E(null)},children:(0,L.jsxs)(Ta,{side:T===`toc`?`left`:`right`,className:`p-sheet`,children:[(0,L.jsx)(Da,{children:T===`toc`?`Оглавление`:`Контекст`}),(0,L.jsx)(Oa,{className:`sr-only`,children:`Навигация и проверяемые связи документа`}),T===`toc`?(0,L.jsx)(xd,{items:ae,activeId:a.data?.fragment?.id||P,documentId:r,filter:C,onFilter:w,onSelect:e=>{se(e),E(null)}}):(0,L.jsx)(Cd,{data:{...ee,loading:te},documentId:r,fragmentId:P})]})})]})}var Td=5e3,Ed=18e4,Dd=5,Od=e=>e.toLocaleString(`ru-RU`),kd=(e,t,n)=>e%10==1&&e%100!=11?t:n,Ad=e=>e<60?`${e} мин`:`${Math.floor(e/60)} ч ${e%60} мин`,jd=e=>new Date(e).toLocaleString(`ru-RU`,{day:`numeric`,month:`long`,hour:`2-digit`,minute:`2-digit`}),Md=e=>`${e.per_min>=1?`${Od(Math.round(e.per_min))} в минуту`:`${Od(Math.round(e.per_min*60))} в час`}, осталось около ${Ad(e.eta_min??0)}`,Nd=[[`current`,`без изменений`],[`updated`,`обновлены`],[`deferred`,`повтор позже`],[`blocked`,`источник недоступен`],[`failed`,`ошибка`]];function Pd({ok:e,label:t,missing:n}){let r=(n?.length??0)-Dd;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:e?`p-load-mark`:`p-load-mark p-load-incomplete`,children:t}),!!n?.length&&(0,L.jsxs)(`ul`,{className:`p-load-missing`,"aria-label":`Что не готово`,children:[n.slice(0,Dd).map(e=>(0,L.jsxs)(`li`,{children:[e.title,` — `,e.reason]},e.id)),r>0&&(0,L.jsxs)(`li`,{children:[`И еще `,Od(r)]})]})]})}function Fd({id:e,title:t,label:n,load:r,count:i,mark:a,children:o}){let s=r?.total?Math.min(r.done/r.total,1):0;return(0,L.jsxs)(`section`,{className:`p-service-card p-load`,"aria-labelledby":e,children:[(0,L.jsx)(`h2`,{id:e,className:`p-load-title`,children:t}),a,(0,L.jsx)(`p`,{className:`p-load-pct`,children:r?`${(s*100).toLocaleString(`ru-RU`,{minimumFractionDigits:1,maximumFractionDigits:1})} %`:`—`}),(0,L.jsx)(`progress`,{max:100,value:s*100,"aria-label":n}),(0,L.jsx)(`p`,{className:`p-load-count`,children:i}),o]})}function Id({at:e,next:t}){if(!e)return null;let n=new Date(e);return Date.now()-+n>=Ed?(0,L.jsxs)(`p`,{className:`p-load-meta p-load-stale`,children:[`Нет свежих данных. Последнее обновление: `,jd(e)]}):(0,L.jsxs)(`p`,{className:`p-load-meta`,children:[`Обновлено в `,n.toLocaleTimeString(`ru-RU`,{hour:`2-digit`,minute:`2-digit`}),t?` · следующий обход ${jd(t)}`:``]})}function Ld({idle:e,label:t,onRun:n}){return(0,L.jsxs)(`button`,{type:`button`,className:e?`p-button p-primary`:`p-button p-load-wait`,"aria-disabled":!e,onClick:e?n:void 0,children:[(0,L.jsx)(R,{name:`updates`}),t]})}function Rd(e,t,n){let[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(``);return{busy:r,error:a,run:async()=>{i(!0),o(``);try{await e(t),n()}catch(e){o(e.message)}finally{i(!1)}}}}function zd({onAction:e}){let t=Nl(`/practice/progress`,Td),{busy:n,error:r,run:i}=Rd(e,`refresh`,t.reload),a=t.data,o=a?.walk,s=o?.requested_at&&!o.running?Date.now()-+new Date(o.requested_at):null,c=o?.found,l=a?a.error?a.error:s===null?a.per_min>0&&a.done0?`Идет обход СудАкта, новые акты скачиваются`:`Идет обход СудАкта, новых актов пока нет`:a.total&&a.done>=a.total?c?`Последний обход: ${Od(c)} ${td(c,`новый акт`,`новых акта`,`новых актов`)}`:c===0?`Последний обход: новых актов нет`:`Загрузка завершена`:`Сейчас загрузка стоит`:ss[e]).map(([e,t])=>`${t}: ${Od(s[e])}`).join(` · `),l=a?a.total?o?a.running?a.per_min>0?Md(a):`Проверка идет`:`Очередь стоит 10 минут: обработчик не берет задания. Кнопка запустит проверку снова.`:`Очередь пройдена`:`Очередь пуста. Кнопка поставит в нее все документы библиотеки.`:t.error||`Считаем очередь…`;return(0,L.jsxs)(Fd,{id:`load-law`,title:`Законодательство`,label:`Законодательство: готово, процентов`,load:a,mark:a?.freshness&&(0,L.jsx)(Pd,{ok:a.freshness.full,label:a.freshness.label,missing:a.freshness.missing}),count:a?`Готово ${Od(a.done)} из ${Od(a.total)} ${kd(a.total,`документа`,`документов`)}`:`Загружаем данные`,children:[(0,L.jsx)(`p`,{className:`p-load-pace`,children:l}),c&&(0,L.jsx)(`p`,{className:`p-load-meta`,children:c.charAt(0).toUpperCase()+c.slice(1)}),r&&(0,L.jsx)(`p`,{className:`p-notice`,role:`alert`,children:r}),(0,L.jsx)(Id,{at:a?.updated_at}),(0,L.jsx)(`div`,{className:`p-load-actions`,children:(0,L.jsx)(Ld,{idle:!!a&&!n&&!a.running,label:n?`Ставим в очередь…`:a?.running?`Идет обновление…`:`Обновить законодательство`,onRun:i})})]})}function Vd(e){return(e||`Редакции документа`).replace(/\s*\(?Российской Федерации\)?\s*/gi,` `).replace(/\s+РФ\s*$/i,``).replace(/\s+/g,` `).trim()}function Hd(e){return Al(e.observed_at||e.retrieved_at||e.revision)}function Ud(e,t){return`Копия ${t+1} · ${Hd(e)}${e.current?` · текущая`:``}`}function Wd({documents:e,route:t}){let[n,r]=(0,_.useState)(``),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),[c,l]=(0,_.useState)(null),u=t.id||t.doc||``,d=e.find(e=>e.id===u),f=Ml(u?`/history?${new URLSearchParams({id:u})}`:null),p=Ml(c),m=f.data?.versions||[],h=(0,_.useMemo)(()=>e.filter(e=>Ol(`${e.title} ${e.subject||``} ${e.number||``}`).includes(Ol(n))).slice(0,16),[e,n]);return(0,_.useEffect)(()=>{l(null),m.length>=2?(a(m[0].id),s(m[m.length-1].id)):(a(``),s(``))},[u,f.data]),u?(0,L.jsxs)(`div`,{className:`p-editions`,children:[(0,L.jsxs)(`header`,{className:`p-editions-head`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{className:`p-kicker`,children:`ИСТОРИЯ ТЕКСТА`}),(0,L.jsx)(`h1`,{children:Vd(d?.subject||d?.title)}),(0,L.jsx)(`p`,{className:`p-editions-full-title`,children:d?.title||`Сохраненные копии документа`})]}),(0,L.jsxs)(`a`,{className:`p-button p-button-quiet`,href:K({doc:u}),children:[(0,L.jsx)(R,{name:`back`}),` К тексту`]})]}),f.loading&&(0,L.jsx)(`p`,{className:`p-status`,children:`Загружаем сохраненные копии…`}),f.error&&(0,L.jsx)(`p`,{className:`p-warning`,children:f.error}),f.data&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`p-edition-note`,children:f.data.note}),(0,L.jsxs)(`div`,{className:`p-edition-list`,children:[(0,L.jsx)(`h2`,{children:`Доступные копии`}),m.map((e,t)=>(0,L.jsxs)(`div`,{className:`p-edition-row`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`strong`,{children:[`Копия `,t+1]}),(0,L.jsxs)(`span`,{children:[`Наблюдалась: `,Hd(e)]}),(0,L.jsxs)(`span`,{className:`p-edition-detail`,children:[`Редакция: `,Al(e.revision)]}),e.effective_date&&(0,L.jsxs)(`span`,{className:`p-edition-detail`,children:[`Вступила в силу: `,Al(e.effective_date)]})]}),e.current&&(0,L.jsx)(`span`,{className:`p-chip`,children:`Текущая копия`})]},e.id)),!m.length&&(0,L.jsx)(`p`,{className:`p-muted`,children:`Сохраненных копий пока нет.`})]}),m.length>=2?(0,L.jsxs)(`form`,{className:`p-compare`,onSubmit:e=>{e.preventDefault(),u&&i&&o&&i!==o&&l(`/diff?${new URLSearchParams({id:u,before:i,after:o})}`)},children:[(0,L.jsx)(`h2`,{children:`Сравнить копии`}),(0,L.jsx)(`p`,{children:`Дата наблюдения показывает, когда Эвномия получила копию. Она не подтверждает дату вступления изменений в силу.`}),(0,L.jsxs)(`div`,{className:`p-compare-fields`,children:[(0,L.jsxs)(`label`,{className:`p-field`,children:[(0,L.jsx)(`span`,{children:`Исходная`}),(0,L.jsx)(`select`,{value:i,onChange:e=>a(e.target.value),children:m.map((e,t)=>(0,L.jsx)(`option`,{value:e.id,children:Ud(e,t)},e.id))})]}),(0,L.jsxs)(`label`,{className:`p-field`,children:[(0,L.jsx)(`span`,{children:`Сравниваемая`}),(0,L.jsx)(`select`,{value:o,onChange:e=>s(e.target.value),children:m.map((e,t)=>(0,L.jsx)(`option`,{value:e.id,children:Ud(e,t)},e.id))})]}),(0,L.jsx)(`button`,{className:`p-button p-button-primary`,disabled:i===o,children:`Сравнить`})]})]}):(0,L.jsx)(`p`,{className:`p-empty`,children:`Для сравнения нужна еще одна сохраненная копия.`}),c&&(0,L.jsx)(Gd,{state:p})]})]}):(0,L.jsxs)(`div`,{className:`p-editions`,children:[(0,L.jsxs)(`header`,{className:`p-editions-head`,children:[(0,L.jsx)(`span`,{className:`p-kicker`,children:`ИСТОРИЯ ТЕКСТА`}),(0,L.jsx)(`h1`,{children:`Редакции документов`}),(0,L.jsx)(`p`,{children:`Выберите документ, чтобы увидеть только сохраненные копии и сравнить их.`})]}),(0,L.jsxs)(`label`,{className:`p-field`,children:[(0,L.jsx)(`span`,{children:`Найти документ`}),(0,L.jsx)(`input`,{type:`search`,value:n,onChange:e=>r(e.target.value),placeholder:`Название или номер`})]}),(0,L.jsxs)(`div`,{className:`p-edition-picker`,children:[h.map(e=>(0,L.jsxs)(`a`,{className:`p-edition-choice`,href:K({view:`history`,id:e.id}),children:[(0,L.jsx)(`strong`,{children:e.subject||e.title}),(0,L.jsx)(`span`,{children:e.number||`Номер не указан`})]},e.id)),!h.length&&(0,L.jsx)(`p`,{className:`p-muted`,children:`Документы не найдены.`})]})]})}function Gd({state:e}){if(e.loading)return(0,L.jsx)(`p`,{className:`p-status`,children:`Сравниваем тексты…`});if(e.error)return(0,L.jsx)(`p`,{className:`p-warning`,children:e.error});let t=e.data;return t?(0,L.jsxs)(`section`,{className:`p-diff`,children:[(0,L.jsx)(`h2`,{children:`Результат сравнения`}),(0,L.jsx)(`p`,{className:`p-edition-note`,children:t.note}),t.changes.length?t.changes.map(e=>(0,L.jsxs)(`article`,{className:`p-diff-change`,children:[(0,L.jsx)(`h3`,{children:e.label}),(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h4`,{children:`Исходная копия`}),(0,L.jsx)(`pre`,{children:e.before||`Фрагмент отсутствовал`})]}),(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h4`,{children:`Сравниваемая копия`}),(0,L.jsx)(`pre`,{children:e.after||`Фрагмент отсутствовал`})]})]})]},e.id)):(0,L.jsx)(`p`,{className:`p-empty`,children:t.formatting_only?`Изменилось только оформление текста.`:`Тексты совпадают.`})]}):null}function Kd({title:e,children:t}){return(0,L.jsxs)(`div`,{className:`p-empty-scene`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{children:e}),(0,L.jsx)(`p`,{children:t}),(0,L.jsxs)(`a`,{className:`p-button`,href:K({view:`home`}),children:[`Открыть библиотеку `,(0,L.jsx)(R,{name:`arrow`})]})]}),(0,L.jsx)(`img`,{src:`/assets/pantheon/eunomia-marble.webp`,alt:``,onError:e=>{e.currentTarget.hidden=!0}})]})}function qd({route:e}){let{data:t,error:n,loading:r}=Ml(e.q?`/search?`+new URLSearchParams({q:e.q,kind:e.kind||``}):null),i=t?.results||[],a=Math.max(1,Math.ceil(i.length/12)),o=Math.min(a,Math.max(1,Number(e.page)||1)),s=(e.q||``).trim().split(/\s+/).filter(e=>e.length>1).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)),c=s.length?RegExp(`(`+s.join(`|`)+`)`,`gi`):null;return(0,L.jsxs)(`section`,{className:`p-research`,children:[(0,L.jsxs)(`div`,{className:`p-page-head`,children:[(0,L.jsx)(`p`,{className:`p-eyebrow`,children:`Поиск по текстам`}),(0,L.jsx)(`h1`,{children:e.q?`«${e.q}»`:`Что найти в библиотеке?`}),(0,L.jsx)(`p`,{children:e.q?`Статьи и фрагменты из сохраненных документов.`:`Введите номер статьи, название или фразу в строке поиска.`})]}),(0,L.jsxs)(`div`,{className:`p-results-tools`,children:[(0,L.jsx)(`span`,{role:`status`,children:r?`Ищем…`:`${t?.total||0} фрагментов`}),(0,L.jsxs)(`label`,{className:`p-field`,children:[(0,L.jsx)(`span`,{children:`Тип документа`}),(0,L.jsxs)(`select`,{value:e.kind||``,onChange:t=>{location.hash=K({...e,kind:t.target.value,page:1})},children:[(0,L.jsx)(`option`,{value:``,children:`Все документы`}),Object.entries(Dl).map(([e,[t]])=>(0,L.jsx)(`option`,{value:e,children:t},e))]})]})]}),n?(0,L.jsx)(`p`,{role:`alert`,className:`p-notice`,children:n}):r?(0,L.jsx)(`p`,{role:`status`,className:`p-loading`,children:`Открываем результаты…`}):i.length?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`p-results`,children:i.slice((o-1)*12,o*12).map(e=>(0,L.jsxs)(`article`,{className:`p-result`,children:[(0,L.jsx)(`div`,{className:`p-result-kind`,children:Dl[e.kind]?.[0]||`Документ`}),(0,L.jsx)(`h2`,{children:(0,L.jsxs)(`a`,{href:kl(e.resource_id,e.id),children:[e.label||e.title,(0,L.jsx)(R,{name:`arrow`})]})}),(0,L.jsx)(`p`,{className:`p-result-document`,children:e.document||e.title}),(0,L.jsx)(`p`,{className:`p-result-excerpt`,children:c?e.snippet.split(c).map((e,t)=>t%2?(0,L.jsx)(`mark`,{children:e},t):e):e.snippet}),(0,L.jsxs)(`div`,{className:`p-result-meta`,children:[(0,L.jsxs)(`span`,{children:[`Редакция: `,Al(e.revision)]}),!!e.warnings?.length&&(0,L.jsx)(`span`,{className:`p-chip p-warning`,children:`Требует сверки`})]})]},e.id))}),t&&t.total>i.length&&(0,L.jsxs)(`p`,{className:`p-muted`,children:[`Показаны первые `,i.length,` совпадений. Уточните запрос, чтобы сузить результаты.`]}),a>1&&(0,L.jsxs)(`nav`,{className:`p-pager`,"aria-label":`Страницы результатов`,children:[(0,L.jsx)(`a`,{className:`p-button`,"aria-disabled":o===1,href:o>1?K({...e,page:o-1}):void 0,children:`Назад`}),(0,L.jsxs)(`span`,{children:[o,` / `,a]}),(0,L.jsx)(`a`,{className:`p-button`,"aria-disabled":o===a,href:o{let n=e.find(e=>e.id===t.id);return n?[{...t,doc:n}]:[]});return(0,L.jsxs)(`section`,{className:`p-research`,children:[(0,L.jsxs)(`div`,{className:`p-page-head p-head-action`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`p-eyebrow`,children:`Продолжить работу`}),(0,L.jsx)(`h1`,{children:`Недавнее`}),(0,L.jsx)(`p`,{children:`Последние открытые документы. История хранится в этом браузере.`})]}),t.length>0&&(0,L.jsx)(`button`,{className:`p-button`,onClick:n,children:`Очистить историю`})]}),r.length?(0,L.jsx)(`div`,{className:`p-recent-list`,children:r.map(e=>(0,L.jsxs)(`a`,{href:kl(e.id,e.fragment),children:[(0,L.jsx)(R,{name:`document`}),(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`strong`,{children:e.doc.subject||e.doc.title}),(0,L.jsx)(`small`,{children:e.fragment?`Вернуться к открытому фрагменту`:`Открыть документ`})]}),(0,L.jsx)(`time`,{dateTime:new Date(e.at).toISOString(),children:Al(new Date(e.at).toISOString())}),(0,L.jsx)(R,{name:`arrow`})]},e.id))}):(0,L.jsx)(Kd,{title:`Здесь продолжится ваша работа`,children:`Откройте документ из библиотеки или поиска — он появится здесь вместе с последним прочитанным фрагментом.`})]})}var Yd={queued:`В очереди`,running:`Обновляется`,current:`Проверен`,updated:`Обновлен`,deferred:`Повтор позже`,blocked:`Источник недоступен`,failed:`Ошибка обновления`,error:`Ошибка обновления`},Xd=e=>e.replace(/\/(?:Users|home)\/[^/\s'"]+/g,`~`),Zd=e=>{let t=e.detail||``;if(/Errno 2|No such file or directory/.test(t))return`Обновление остановилось: пропал рабочий файл задания. Сохранённый текст на месте. Нажмите «Обновить законодательство», чтобы начать заново.`;if(/fetch failed|timed out|timeout|URLError|ConnectionError|HTTP Error|getaddrinfo/i.test(t))return`Источник не отдал страницу. Сохранённый текст на месте. Проверка повторится сама, а запустить её сейчас можно кнопкой «Обновить законодательство».`;if(/source check failed|refresh not activated/.test(t))return`Источник не прошёл проверку, текст не заменён. Сохранённая редакция на месте, проверка повторится по расписанию.`;if(/body too short|content container absent/.test(t))return`Источник прислал пустую страницу, текст не заменён. Проверка повторится по расписанию. Если ошибка держится, у документа мог смениться адрес.`;if(/candidate failed|ValueError/.test(t))return`Новую редакцию не удалось разобрать, текст не заменён. Проверка повторится по расписанию.`;if(/не запустился|превысил/.test(t))return`Задание не уложилось во время и отложено. Проверка повторится сама, а запустить её сейчас можно кнопкой «Обновить законодательство».`;if(/parser_not_verified/.test(t))return`Разбор этого источника ещё не проверен, поэтому обновление приостановлено. Сохранённый текст доступен.`;if(e.state===`current`)return`Источник проверен, текст в библиотеке актуален.`;if(e.state===`updated`){let e=/source date (\d{2}\.\d{2}\.\d{4})/.exec(t);return`Текст обновлён по источнику`+(e?` от `+e[1]:``)+`.`}return e.state===`queued`?`Задание ждёт своей очереди.`:e.state===`running`?`Задание выполняется.`:`Задание остановилось с ошибкой, текст не заменён. Нажмите «Обновить законодательство», чтобы повторить.`};function Qd({data:e,onAction:t}){let[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(`attention`),[c,l]=(0,_.useState)(1),u=Nl(`/status`,15e3),d=u.data||e.status,f=async()=>{r(!0),a(``);try{await t(`graph`),u.reload()}catch(e){a(e.message)}finally{r(!1)}},p=e.documents.filter(e=>!e.available||e.warnings?.length),m=d.jobs||[],h=e=>[`deferred`,`blocked`,`failed`,`error`].includes(e),g=e=>m.filter(t=>e(t.state)).length,v=o===`attention`?m.filter(e=>h(e.state)):o===`failed`?m.filter(e=>e.state===`failed`||e.state===`error`):o===`all`?m:m.filter(e=>e.state===o),y=Math.max(1,Math.ceil(v.length/20)),b=Math.min(Math.max(1,c),y),x=v.slice((b-1)*20,b*20);return(0,L.jsxs)(`section`,{className:`p-research`,children:[(0,L.jsxs)(`div`,{className:`p-page-head`,children:[(0,L.jsx)(`p`,{className:`p-eyebrow`,children:`Состояние базы`}),(0,L.jsx)(`h1`,{children:`Библиотека под контролем`}),(0,L.jsx)(`p`,{children:`Сохраненные тексты доступны, пока проверяются источники.`})]}),(i||u.error)&&(0,L.jsx)(`p`,{className:`p-notice`,role:`alert`,children:i||u.error}),(0,L.jsxs)(`div`,{className:`p-service-grid`,children:[(0,L.jsx)(zd,{onAction:t}),(0,L.jsx)(Bd,{onAction:t}),(0,L.jsxs)(`section`,{className:`p-service-card`,children:[(0,L.jsx)(`h2`,{children:`Связи документов`}),(0,L.jsx)(`p`,{children:d.graph?.available?`Сборка от ${Al(d.graph.built_at)}`:`Сохраненная карта пока недоступна.`}),(0,L.jsx)(`p`,{children:`Пересоберите карту после изменения текстов, чтобы обновить перекрестные ссылки.`}),(0,L.jsxs)(`button`,{className:`p-button`,disabled:n,onClick:f,children:[n?`Запускаем…`:`Пересобрать связи`,(0,L.jsx)(R,{name:`graph`})]})]})]}),(0,L.jsxs)(`section`,{className:`p-jobs`,children:[(0,L.jsxs)(`div`,{className:`p-results-tools`,children:[(0,L.jsx)(`h2`,{children:`Очередь заданий`}),(0,L.jsxs)(`label`,{className:`p-field`,children:[(0,L.jsx)(`span`,{children:`Показать`}),(0,L.jsxs)(`select`,{value:o,onChange:e=>{s(e.target.value),l(1)},children:[(0,L.jsxs)(`option`,{value:`attention`,children:[`Требуют внимания · `,g(h)]}),[`deferred`,`blocked`,`failed`,`queued`,`running`,`current`,`updated`].map(e=>(0,L.jsxs)(`option`,{value:e,children:[Yd[e],` · `,g(e===`failed`?e=>e===`failed`||e===`error`:t=>t===e)]},e)),(0,L.jsxs)(`option`,{value:`all`,children:[`Все задания · `,m.length]})]})]})]}),m.length?x.length?x.map((t,n)=>(0,L.jsxs)(`div`,{className:`p-job`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`strong`,{children:e.documents.find(e=>e.id===t.id)?.title||`Каталог источников`}),t.detail&&(0,L.jsxs)(`details`,{children:[(0,L.jsx)(`summary`,{children:`Подробности`}),(0,L.jsx)(`p`,{children:Zd(t)}),(0,L.jsxs)(`details`,{children:[(0,L.jsx)(`summary`,{children:`Техническая подробность`}),(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-all`,children:(0,L.jsx)(`code`,{children:Xd(t.detail)})})]})]})]}),(0,L.jsx)(`span`,{className:`p-chip`,children:Yd[t.state]||t.state})]},t.id+n)):(0,L.jsx)(`p`,{className:`p-muted`,children:o===`attention`?`Заданий, требующих внимания, нет. Выберите «Все задания», чтобы увидеть всю очередь.`:`Заданий в этом состоянии нет.`}):(0,L.jsx)(`p`,{className:`p-muted`,children:`Очередь пуста. Задания появятся после запроса обновления.`}),y>1&&(0,L.jsxs)(`nav`,{className:`p-pager`,"aria-label":`Страницы очереди`,children:[(0,L.jsx)(`button`,{type:`button`,className:`p-button`,disabled:b<=1,onClick:()=>l(b-1),children:`Назад`}),(0,L.jsxs)(`span`,{children:[b,` / `,y]}),(0,L.jsx)(`button`,{type:`button`,className:`p-button`,disabled:b>=y,onClick:()=>l(b+1),children:`Далее`})]})]}),p.length>0&&(0,L.jsxs)(`details`,{className:`p-source-warnings`,children:[(0,L.jsxs)(`summary`,{children:[`Документы, требующие сверки · `,p.length]}),p.map(e=>(0,L.jsxs)(`a`,{href:kl(e.id),children:[e.subject||e.title,(0,L.jsx)(R,{name:`arrow`})]},e.id))]})]})}var $d=`eunomia:recent:v1`;function ef(){try{let e=JSON.parse(localStorage.getItem($d)||`[]`);return Array.isArray(e)?e.filter(e=>e&&typeof e.id==`string`&&typeof e.at==`number`&&(!e.fragment||typeof e.fragment==`string`)).slice(0,12):[]}catch{return[]}}function tf(e,t){let n=[{id:e,fragment:t,at:Date.now()},...ef().filter(t=>t.id!==e)].slice(0,12);try{localStorage.setItem($d,JSON.stringify(n))}catch{}return n}function nf(){try{localStorage.removeItem($d)}catch{}}var rf=`modulepreload`,af=function(e){return`/`+e},of={},sf=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=af(t,n),t=s(t),t in of)return;of[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`:rf,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)})},cf=(0,_.lazy)(()=>sf(()=>import(`./Connections-BbZyMe5U.js`).then(e=>({default:e.Connections})),__vite__mapDeps([0,1])));function lf(){let e=Object.fromEntries(new URLSearchParams(location.hash.slice(1)));return{...e,view:e.doc?`reader`:e.view||`home`}}var uf=[{view:`home`,title:`Библиотека`,icon:`library`},{view:`practice`,title:`Судебная практика`,icon:`document`},{view:`recent`,title:`Недавнее`,icon:`history`},{view:`graph`,title:`Граф знаний`,icon:`graph`}];function df({route:e}){let{setOpenMobile:t,state:n,toggleSidebar:r}=nl(),i=(n,r,i)=>(0,L.jsx)(vl,{children:(0,L.jsx)(bl,{asChild:!0,isActive:n===`home`?[`home`,`category`,`contents`].includes(e.view):n===`practice`?[`practice`,`act`].includes(e.view):n===e.view,tooltip:r,children:(0,L.jsxs)(`a`,{href:K({view:n}),onClick:()=>t(!1),"aria-current":e.view===n?`page`:void 0,children:[(0,L.jsx)(R,{name:i}),(0,L.jsx)(`span`,{children:r})]})})},n);return(0,L.jsxs)(il,{collapsible:`icon`,className:`p-sidebar`,role:`navigation`,"aria-label":`Меню библиотеки`,children:[(0,L.jsx)(ll,{children:(0,L.jsxs)(`a`,{href:K({view:`home`}),className:`p-brand`,"aria-label":`Эвномия — главная`,onClick:()=>t(!1),children:[(0,L.jsx)(`span`,{className:`p-monogram`,"aria-hidden":`true`,children:`Э`}),(0,L.jsxs)(`span`,{className:`p-brand-name`,children:[(0,L.jsx)(`strong`,{children:`Эвномия`}),(0,L.jsx)(`small`,{children:`ПАНТЕОН · THEMIZ`})]})]})}),(0,L.jsx)(fl,{children:(0,L.jsx)(_l,{children:uf.map(e=>i(e.view,e.title,e.icon))})}),(0,L.jsxs)(ul,{children:[(0,L.jsxs)(_l,{children:[i(`updates`,`Состояние базы`,`updates`),(0,L.jsx)(vl,{children:(0,L.jsxs)(bl,{onClick:r,tooltip:n===`expanded`?`Свернуть меню`:`Развернуть меню`,"aria-label":n===`expanded`?`Свернуть меню`:`Развернуть меню`,children:[(0,L.jsx)(R,{name:`menu`}),(0,L.jsx)(`span`,{children:`Свернуть меню`})]})})]}),(0,L.jsxs)(`div`,{className:`p-sidebar-note`,children:[(0,L.jsx)(`span`,{}),`Локальная библиотека`]})]})]})}function ff({data:e,route:t,onNotify:n,refresh:r}){let{toggleSidebar:i,openMobile:a,state:o,isMobile:s}=nl(),[c,l]=(0,_.useState)(ef),u=(0,_.useCallback)((e,t)=>{l(tf(e,t))},[]),d=t.view===`home`,f={home:`Библиотека`,category:`Библиотека`,contents:`Оглавление`,reader:`Чтение`,search:`Результаты поиска`,recent:`Недавнее`,graph:`Граф знаний`,history:`Редакции`,updates:`Состояние базы`,practice:`Судебная практика`,act:`Судебный акт`}[t.view]||`Библиотека`;return(0,_.useEffect)(()=>{document.title=`${f} · Эвномия`,t.view!==`reader`&&window.scrollTo({top:0,behavior:`instant`})},[t,f]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`a`,{className:`p-skip`,href:`#p-main`,onClick:e=>{e.preventDefault(),document.getElementById(`p-main`)?.focus()},children:`К содержанию`}),(0,L.jsx)(df,{route:t}),(0,L.jsxs)(`div`,{className:`p-surface`,children:[(0,L.jsxs)(`header`,{className:`p-topbar`,children:[(0,L.jsx)(`button`,{className:`p-icon-button`,id:`menu-toggle`,onClick:i,"aria-label":s?`Открыть меню`:o===`expanded`?`Свернуть меню`:`Развернуть меню`,"aria-expanded":s?a:o===`expanded`,children:(0,L.jsx)(R,{name:`menu`})}),(0,L.jsxs)(`nav`,{"aria-label":`Путь`,className:`p-breadcrumb`,children:[(0,L.jsx)(`a`,{href:K({view:`home`}),children:`Эвномия`}),(0,L.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,L.jsx)(`span`,{children:f})]}),!d&&(0,L.jsx)(Lu,{initialQuery:t.view===`search`?t.q:``}),d&&(0,L.jsxs)(`span`,{className:`p-local-note`,children:[(0,L.jsx)(`span`,{}),`Документы на вашем компьютере`]})]}),(0,L.jsx)(`main`,{id:`p-main`,tabIndex:-1,className:`p-main ${t.view===`reader`?`p-main-reading`:t.view===`graph`?`p-main-graph`:``}`,children:t.doc?(0,L.jsx)(wd,{route:t,onNotify:n,onRecent:u},t.doc):t.view===`contents`?(0,L.jsx)(Zu,{documents:e.documents,route:t}):t.view===`search`?(0,L.jsx)(qd,{route:t}):t.view===`practice`?(0,L.jsx)(md,{route:t}):t.view===`act`?(0,L.jsx)(gd,{route:t},t.act):t.view===`graph`?(0,L.jsx)(_.Suspense,{fallback:(0,L.jsx)(`p`,{role:`status`,children:`Загружаем граф знаний…`}),children:(0,L.jsx)(cf,{route:t})}):t.view===`history`?(0,L.jsx)(Wd,{documents:e.documents,route:t}):t.view===`updates`?(0,L.jsx)(Qd,{data:e,onAction:async t=>{n((await jl({update:`/update`,graph:`/graph/rebuild`,refresh:`/practice/refresh`}[t],{method:`POST`,headers:{"Content-Type":`application/json`,"X-Eunomia-CSRF":e.csrf},body:`{}`})).detail),t!==`refresh`&&await r()}}):t.view===`recent`?(0,L.jsx)(Jd,{documents:e.documents,recent:c,onClear:()=>{nf(),l([])}}):(0,L.jsx)(Q,{documents:e.documents,route:t,hero:d,search:d?(0,L.jsx)(Lu,{large:!0}):void 0,aside:d?(0,L.jsx)(vd,{status:e.status.practice}):void 0})})]})]})}function pf(){let[e,t]=(0,_.useState)(lf),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(``),[o,s]=(0,_.useState)(``),c=(0,_.useCallback)(async()=>{try{r(await jl(`/bootstrap`)),a(``)}catch(e){a(e.message)}},[]);return(0,_.useEffect)(()=>{c()},[c]),(0,_.useEffect)(()=>{let e=()=>t(lf());return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,_.useEffect)(()=>{if(!n?.status.index?.indexing||n.documents.length)return;let e=setTimeout(c,1500);return()=>clearTimeout(e)},[n,c]),(0,_.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>s(``),5e3);return()=>clearTimeout(e)},[o]),(0,L.jsxs)(qc,{delayDuration:300,children:[(0,L.jsx)(rl,{className:`p-app`,style:{"--sidebar-width":`224px`,"--sidebar-width-icon":`72px`},children:n&&(n.documents.length||!n.status.index?.indexing)?(0,L.jsx)(ff,{data:n,route:e,onNotify:s,refresh:c}):(0,L.jsxs)(`div`,{className:`p-start-state`,children:[(0,L.jsx)(`span`,{className:`p-monogram`,children:`Э`}),(0,L.jsx)(`h1`,{children:i?`Библиотека недоступна`:`Открываем библиотеку`}),(0,L.jsx)(`p`,{children:i||`Подготавливаем сохраненные тексты.`}),i&&(0,L.jsx)(`button`,{className:`p-button p-primary`,onClick:c,children:`Повторить`})]})}),(0,L.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`p-toast ${o?`is-visible`:``}`,children:o})]})}(0,g.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(pf,{}));export{Dl as a,R as c,o as d,c as f,K as i,ce as l,jl as n,Pl as o,kl as r,Al as s,sf as t,f as u};