@neuroverseos/nv-sim 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +346 -68
- package/dist/adapters/mirofish.js +461 -0
- package/dist/adapters/scienceclaw.js +750 -0
- package/dist/assets/index-B64NuIXu.css +1 -0
- package/dist/assets/index-DbzSnYxr.js +532 -0
- package/dist/assets/{reportEngine-BfteK4MN.js → reportEngine-DKWTrP6-.js} +1 -1
- package/dist/components/ConstraintsPanel.js +11 -0
- package/dist/components/StakeholderBuilder.js +32 -0
- package/dist/components/ui/badge.js +24 -0
- package/dist/components/ui/button.js +70 -0
- package/dist/components/ui/card.js +57 -0
- package/dist/components/ui/input.js +44 -0
- package/dist/components/ui/label.js +45 -0
- package/dist/components/ui/select.js +70 -0
- package/dist/engine/aiProvider.js +427 -2
- package/dist/engine/auditTrace.js +352 -0
- package/dist/engine/behavioralAnalysis.js +605 -0
- package/dist/engine/cli.js +1087 -13
- package/dist/engine/dynamicsGovernance.js +588 -0
- package/dist/engine/fullGovernedLoop.js +367 -0
- package/dist/engine/governedSimulation.js +77 -6
- package/dist/engine/index.js +41 -1
- package/dist/engine/liveVisualizer.js +2787 -360
- package/dist/engine/metrics/science.metrics.js +335 -0
- package/dist/engine/narrativeInjection.js +55 -0
- package/dist/engine/policyEnforcement.js +1611 -0
- package/dist/engine/policyEngine.js +799 -0
- package/dist/engine/primeRadiant.js +540 -0
- package/dist/engine/scenarioCapsule.js +56 -0
- package/dist/engine/scenarioComparison.js +463 -0
- package/dist/engine/scenarioLibrary.js +17 -0
- package/dist/engine/swarmSimulation.js +54 -1
- package/dist/engine/worldComparison.js +164 -0
- package/dist/engine/worldStorage.js +232 -0
- package/dist/index.html +2 -2
- package/dist/lib/reasoningEngine.js +290 -0
- package/dist/lib/simulationAdapter.js +686 -0
- package/dist/lib/swarmParser.js +291 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/runtime/govern.js +473 -0
- package/dist/runtime/index.js +75 -0
- package/dist/runtime/types.js +11 -0
- package/package.json +5 -2
- package/dist/assets/index-DHKd4rcV.js +0 -338
- package/dist/assets/index-SyyA3z3U.css +0 -1
- package/dist/assets/swarmSimulation-DHDqjfMa.js +0 -1
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
var o1=Object.defineProperty;var Om=e=>{throw TypeError(e)};var a1=(e,t,n)=>t in e?o1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Gt=(e,t,n)=>a1(e,typeof t!="symbol"?t+"":t,n),yc=(e,t,n)=>t.has(e)||Om("Cannot "+n);var M=(e,t,n)=>(yc(e,t,"read from private field"),n?n.call(e):t.get(e)),ue=(e,t,n)=>t.has(e)?Om("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ne=(e,t,n,r)=>(yc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ze=(e,t,n)=>(yc(e,t,"access private method"),n);var Uo=(e,t,n,r)=>({set _(s){ne(e,t,s,n)},get _(){return M(e,t,r)}});function l1(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Sg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ng={exports:{}},wl={},kg={exports:{}},ae={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Co=Symbol.for("react.element"),c1=Symbol.for("react.portal"),d1=Symbol.for("react.fragment"),u1=Symbol.for("react.strict_mode"),f1=Symbol.for("react.profiler"),m1=Symbol.for("react.provider"),p1=Symbol.for("react.context"),h1=Symbol.for("react.forward_ref"),g1=Symbol.for("react.suspense"),v1=Symbol.for("react.memo"),x1=Symbol.for("react.lazy"),Lm=Symbol.iterator;function y1(e){return e===null||typeof e!="object"?null:(e=Lm&&e[Lm]||e["@@iterator"],typeof e=="function"?e:null)}var jg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cg=Object.assign,Eg={};function mi(e,t,n){this.props=e,this.context=t,this.refs=Eg,this.updater=n||jg}mi.prototype.isReactComponent={};mi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};mi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function _g(){}_g.prototype=mi.prototype;function Uu(e,t,n){this.props=e,this.context=t,this.refs=Eg,this.updater=n||jg}var Wu=Uu.prototype=new _g;Wu.constructor=Uu;Cg(Wu,mi.prototype);Wu.isPureReactComponent=!0;var $m=Array.isArray,Rg=Object.prototype.hasOwnProperty,Hu={current:null},Pg={key:!0,ref:!0,__self:!0,__source:!0};function Tg(e,t,n){var r,s={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Rg.call(t,r)&&!Pg.hasOwnProperty(r)&&(s[r]=t[r]);var l=arguments.length-2;if(l===1)s.children=n;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];s.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)s[r]===void 0&&(s[r]=l[r]);return{$$typeof:Co,type:e,key:i,ref:a,props:s,_owner:Hu.current}}function b1(e,t){return{$$typeof:Co,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Gu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Co}function w1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Dm=/\/+/g;function bc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?w1(""+e.key):t.toString(36)}function va(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Co:case c1:a=!0}}if(a)return a=e,s=s(a),e=r===""?"."+bc(a,0):r,$m(s)?(n="",e!=null&&(n=e.replace(Dm,"$&/")+"/"),va(s,t,n,"",function(d){return d})):s!=null&&(Gu(s)&&(s=b1(s,n+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(Dm,"$&/")+"/")+e)),t.push(s)),1;if(a=0,r=r===""?".":r+":",$m(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+bc(i,l);a+=va(i,t,n,c,s)}else if(c=y1(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+bc(i,l++),a+=va(i,t,n,c,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Wo(e,t,n){if(e==null)return e;var r=[],s=0;return va(e,r,"","",function(i){return t.call(n,i,s++)}),r}function S1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var dt={current:null},xa={transition:null},N1={ReactCurrentDispatcher:dt,ReactCurrentBatchConfig:xa,ReactCurrentOwner:Hu};function Ag(){throw Error("act(...) is not supported in production builds of React.")}ae.Children={map:Wo,forEach:function(e,t,n){Wo(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Wo(e,function(){t++}),t},toArray:function(e){return Wo(e,function(t){return t})||[]},only:function(e){if(!Gu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ae.Component=mi;ae.Fragment=d1;ae.Profiler=f1;ae.PureComponent=Uu;ae.StrictMode=u1;ae.Suspense=g1;ae.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N1;ae.act=Ag;ae.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Cg({},e.props),s=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=Hu.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Rg.call(t,c)&&!Pg.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];r.children=l}return{$$typeof:Co,type:e.type,key:s,ref:i,props:r,_owner:a}};ae.createContext=function(e){return e={$$typeof:p1,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:m1,_context:e},e.Consumer=e};ae.createElement=Tg;ae.createFactory=function(e){var t=Tg.bind(null,e);return t.type=e,t};ae.createRef=function(){return{current:null}};ae.forwardRef=function(e){return{$$typeof:h1,render:e}};ae.isValidElement=Gu;ae.lazy=function(e){return{$$typeof:x1,_payload:{_status:-1,_result:e},_init:S1}};ae.memo=function(e,t){return{$$typeof:v1,type:e,compare:t===void 0?null:t}};ae.startTransition=function(e){var t=xa.transition;xa.transition={};try{e()}finally{xa.transition=t}};ae.unstable_act=Ag;ae.useCallback=function(e,t){return dt.current.useCallback(e,t)};ae.useContext=function(e){return dt.current.useContext(e)};ae.useDebugValue=function(){};ae.useDeferredValue=function(e){return dt.current.useDeferredValue(e)};ae.useEffect=function(e,t){return dt.current.useEffect(e,t)};ae.useId=function(){return dt.current.useId()};ae.useImperativeHandle=function(e,t,n){return dt.current.useImperativeHandle(e,t,n)};ae.useInsertionEffect=function(e,t){return dt.current.useInsertionEffect(e,t)};ae.useLayoutEffect=function(e,t){return dt.current.useLayoutEffect(e,t)};ae.useMemo=function(e,t){return dt.current.useMemo(e,t)};ae.useReducer=function(e,t,n){return dt.current.useReducer(e,t,n)};ae.useRef=function(e){return dt.current.useRef(e)};ae.useState=function(e){return dt.current.useState(e)};ae.useSyncExternalStore=function(e,t,n){return dt.current.useSyncExternalStore(e,t,n)};ae.useTransition=function(){return dt.current.useTransition()};ae.version="18.3.1";kg.exports=ae;var h=kg.exports;const U=Sg(h),Ku=l1({__proto__:null,default:U},[h]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var k1=h,j1=Symbol.for("react.element"),C1=Symbol.for("react.fragment"),E1=Object.prototype.hasOwnProperty,_1=k1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,R1={key:!0,ref:!0,__self:!0,__source:!0};function Ig(e,t,n){var r,s={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)E1.call(t,r)&&!R1.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:j1,type:e,key:i,ref:a,props:s,_owner:_1.current}}wl.Fragment=C1;wl.jsx=Ig;wl.jsxs=Ig;Ng.exports=wl;var o=Ng.exports,Mg={exports:{}},Rt={},Og={exports:{}},Lg={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(_,A){var D=_.length;_.push(A);e:for(;0<D;){var Y=D-1>>>1,G=_[Y];if(0<s(G,A))_[Y]=A,_[D]=G,D=Y;else break e}}function n(_){return _.length===0?null:_[0]}function r(_){if(_.length===0)return null;var A=_[0],D=_.pop();if(D!==A){_[0]=D;e:for(var Y=0,G=_.length,J=G>>>1;Y<J;){var Z=2*(Y+1)-1,me=_[Z],be=Z+1,W=_[be];if(0>s(me,D))be<G&&0>s(W,me)?(_[Y]=W,_[be]=D,Y=be):(_[Y]=me,_[Z]=D,Y=Z);else if(be<G&&0>s(W,D))_[Y]=W,_[be]=D,Y=be;else break e}}return A}function s(_,A){var D=_.sortIndex-A.sortIndex;return D!==0?D:_.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],d=[],u=1,f=null,p=3,m=!1,y=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var A=n(d);A!==null;){if(A.callback===null)r(d);else if(A.startTime<=_)r(d),A.sortIndex=A.expirationTime,t(c,A);else break;A=n(d)}}function S(_){if(g=!1,w(_),!y)if(n(c)!==null)y=!0,O(N);else{var A=n(d);A!==null&&V(S,A.startTime-_)}}function N(_,A){y=!1,g&&(g=!1,x(C),C=-1),m=!0;var D=p;try{for(w(A),f=n(c);f!==null&&(!(f.expirationTime>A)||_&&!P());){var Y=f.callback;if(typeof Y=="function"){f.callback=null,p=f.priorityLevel;var G=Y(f.expirationTime<=A);A=e.unstable_now(),typeof G=="function"?f.callback=G:f===n(c)&&r(c),w(A)}else r(c);f=n(c)}if(f!==null)var J=!0;else{var Z=n(d);Z!==null&&V(S,Z.startTime-A),J=!1}return J}finally{f=null,p=D,m=!1}}var k=!1,j=null,C=-1,E=5,R=-1;function P(){return!(e.unstable_now()-R<E)}function T(){if(j!==null){var _=e.unstable_now();R=_;var A=!0;try{A=j(!0,_)}finally{A?L():(k=!1,j=null)}}else k=!1}var L;if(typeof v=="function")L=function(){v(T)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,F=I.port2;I.port1.onmessage=T,L=function(){F.postMessage(null)}}else L=function(){b(T,0)};function O(_){j=_,k||(k=!0,L())}function V(_,A){C=b(function(){_(e.unstable_now())},A)}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(_){_.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,O(N))},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var A=3;break;default:A=p}var D=p;p=A;try{return _()}finally{p=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,A){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var D=p;p=_;try{return A()}finally{p=D}},e.unstable_scheduleCallback=function(_,A,D){var Y=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?Y+D:Y):D=Y,_){case 1:var G=-1;break;case 2:G=250;break;case 5:G=1073741823;break;case 4:G=1e4;break;default:G=5e3}return G=D+G,_={id:u++,callback:A,priorityLevel:_,startTime:D,expirationTime:G,sortIndex:-1},D>Y?(_.sortIndex=D,t(d,_),n(c)===null&&_===n(d)&&(g?(x(C),C=-1):g=!0,V(S,D-Y))):(_.sortIndex=G,t(c,_),y||m||(y=!0,O(N))),_},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(_){var A=p;return function(){var D=p;p=A;try{return _.apply(this,arguments)}finally{p=D}}}})(Lg);Og.exports=Lg;var P1=Og.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var T1=h,_t=P1;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var $g=new Set,Ji={};function ds(e,t){ti(e,t),ti(e+"Capture",t)}function ti(e,t){for(Ji[e]=t,e=0;e<t.length;e++)$g.add(t[e])}var zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gd=Object.prototype.hasOwnProperty,A1=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Fm={},zm={};function I1(e){return gd.call(zm,e)?!0:gd.call(Fm,e)?!1:A1.test(e)?zm[e]=!0:(Fm[e]=!0,!1)}function M1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O1(e,t,n,r){if(t===null||typeof t>"u"||M1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ut(e,t,n,r,s,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qe[e]=new ut(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qe[t]=new ut(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qe[e]=new ut(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qe[e]=new ut(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Qe[e]=new ut(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qe[e]=new ut(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qe[e]=new ut(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qe[e]=new ut(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qe[e]=new ut(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yu=/[\-:]([a-z])/g;function qu(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Yu,qu);Qe[t]=new ut(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Yu,qu);Qe[t]=new ut(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Yu,qu);Qe[t]=new ut(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qe[e]=new ut(e,1,!1,e.toLowerCase(),null,!1,!1)});Qe.xlinkHref=new ut("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qe[e]=new ut(e,1,!1,e.toLowerCase(),null,!0,!0)});function Qu(e,t,n,r){var s=Qe.hasOwnProperty(t)?Qe[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(O1(t,n,s,r)&&(n=null),r||s===null?I1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Kn=T1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ho=Symbol.for("react.element"),Ss=Symbol.for("react.portal"),Ns=Symbol.for("react.fragment"),Xu=Symbol.for("react.strict_mode"),vd=Symbol.for("react.profiler"),Dg=Symbol.for("react.provider"),Fg=Symbol.for("react.context"),Ju=Symbol.for("react.forward_ref"),xd=Symbol.for("react.suspense"),yd=Symbol.for("react.suspense_list"),Zu=Symbol.for("react.memo"),rr=Symbol.for("react.lazy"),zg=Symbol.for("react.offscreen"),Bm=Symbol.iterator;function wi(e){return e===null||typeof e!="object"?null:(e=Bm&&e[Bm]||e["@@iterator"],typeof e=="function"?e:null)}var Me=Object.assign,wc;function Ii(e){if(wc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);wc=t&&t[1]||""}return`
|
|
34
|
+
`+wc+e}var Sc=!1;function Nc(e,t){if(!e||Sc)return"";Sc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var s=d.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),a=s.length-1,l=i.length-1;1<=a&&0<=l&&s[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(s[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||s[a]!==i[l]){var c=`
|
|
37
|
+
`+s[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Sc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ii(e):""}function L1(e){switch(e.tag){case 5:return Ii(e.type);case 16:return Ii("Lazy");case 13:return Ii("Suspense");case 19:return Ii("SuspenseList");case 0:case 2:case 15:return e=Nc(e.type,!1),e;case 11:return e=Nc(e.type.render,!1),e;case 1:return e=Nc(e.type,!0),e;default:return""}}function bd(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ns:return"Fragment";case Ss:return"Portal";case vd:return"Profiler";case Xu:return"StrictMode";case xd:return"Suspense";case yd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Fg:return(e.displayName||"Context")+".Consumer";case Dg:return(e._context.displayName||"Context")+".Provider";case Ju:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Zu:return t=e.displayName||null,t!==null?t:bd(e.type)||"Memo";case rr:t=e._payload,e=e._init;try{return bd(e(t))}catch{}}return null}function $1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bd(t);case 8:return t===Xu?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Nr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function D1(e){var t=Bg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Go(e){e._valueTracker||(e._valueTracker=D1(e))}function Vg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Bg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function La(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function wd(e,t){var n=t.checked;return Me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Vm(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Nr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ug(e,t){t=t.checked,t!=null&&Qu(e,"checked",t,!1)}function Sd(e,t){Ug(e,t);var n=Nr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Nd(e,t.type,n):t.hasOwnProperty("defaultValue")&&Nd(e,t.type,Nr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Um(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Nd(e,t,n){(t!=="number"||La(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Mi=Array.isArray;function Ms(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Nr(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function kd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return Me({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Wm(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(Mi(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Nr(n)}}function Wg(e,t){var n=Nr(t.value),r=Nr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Hm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Hg(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Hg(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ko,Gg=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ko=Ko||document.createElement("div"),Ko.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ko.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Fi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},F1=["Webkit","ms","Moz","O"];Object.keys(Fi).forEach(function(e){F1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Fi[t]=Fi[e]})});function Kg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Fi.hasOwnProperty(e)&&Fi[e]?(""+t).trim():t+"px"}function Yg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Kg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var z1=Me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Cd(e,t){if(t){if(z1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function Ed(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _d=null;function ef(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rd=null,Os=null,Ls=null;function Gm(e){if(e=Ro(e)){if(typeof Rd!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Cl(t),Rd(e.stateNode,e.type,t))}}function qg(e){Os?Ls?Ls.push(e):Ls=[e]:Os=e}function Qg(){if(Os){var e=Os,t=Ls;if(Ls=Os=null,Gm(e),t)for(e=0;e<t.length;e++)Gm(t[e])}}function Xg(e,t){return e(t)}function Jg(){}var kc=!1;function Zg(e,t,n){if(kc)return e(t,n);kc=!0;try{return Xg(e,t,n)}finally{kc=!1,(Os!==null||Ls!==null)&&(Jg(),Qg())}}function eo(e,t){var n=e.stateNode;if(n===null)return null;var r=Cl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var Pd=!1;if(zn)try{var Si={};Object.defineProperty(Si,"passive",{get:function(){Pd=!0}}),window.addEventListener("test",Si,Si),window.removeEventListener("test",Si,Si)}catch{Pd=!1}function B1(e,t,n,r,s,i,a,l,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(u){this.onError(u)}}var zi=!1,$a=null,Da=!1,Td=null,V1={onError:function(e){zi=!0,$a=e}};function U1(e,t,n,r,s,i,a,l,c){zi=!1,$a=null,B1.apply(V1,arguments)}function W1(e,t,n,r,s,i,a,l,c){if(U1.apply(this,arguments),zi){if(zi){var d=$a;zi=!1,$a=null}else throw Error(B(198));Da||(Da=!0,Td=d)}}function us(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function ev(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Km(e){if(us(e)!==e)throw Error(B(188))}function H1(e){var t=e.alternate;if(!t){if(t=us(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Km(s),e;if(i===r)return Km(s),t;i=i.sibling}throw Error(B(188))}if(n.return!==r.return)n=s,r=i;else{for(var a=!1,l=s.child;l;){if(l===n){a=!0,n=s,r=i;break}if(l===r){a=!0,r=s,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,r=s;break}if(l===r){a=!0,r=i,n=s;break}l=l.sibling}if(!a)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function tv(e){return e=H1(e),e!==null?nv(e):null}function nv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=nv(e);if(t!==null)return t;e=e.sibling}return null}var rv=_t.unstable_scheduleCallback,Ym=_t.unstable_cancelCallback,G1=_t.unstable_shouldYield,K1=_t.unstable_requestPaint,$e=_t.unstable_now,Y1=_t.unstable_getCurrentPriorityLevel,tf=_t.unstable_ImmediatePriority,sv=_t.unstable_UserBlockingPriority,Fa=_t.unstable_NormalPriority,q1=_t.unstable_LowPriority,iv=_t.unstable_IdlePriority,Sl=null,Nn=null;function Q1(e){if(Nn&&typeof Nn.onCommitFiberRoot=="function")try{Nn.onCommitFiberRoot(Sl,e,void 0,(e.current.flags&128)===128)}catch{}}var rn=Math.clz32?Math.clz32:Z1,X1=Math.log,J1=Math.LN2;function Z1(e){return e>>>=0,e===0?32:31-(X1(e)/J1|0)|0}var Yo=64,qo=4194304;function Oi(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function za(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~s;l!==0?r=Oi(l):(i&=a,i!==0&&(r=Oi(i)))}else a=n&~s,a!==0?r=Oi(a):i!==0&&(r=Oi(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-rn(t),s=1<<n,r|=e[n],t&=~s;return r}function eS(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-rn(i),l=1<<a,c=s[a];c===-1?(!(l&n)||l&r)&&(s[a]=eS(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Ad(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function ov(){var e=Yo;return Yo<<=1,!(Yo&4194240)&&(Yo=64),e}function jc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Eo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-rn(t),e[t]=n}function nS(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-rn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function nf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var pe=0;function av(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var lv,rf,cv,dv,uv,Id=!1,Qo=[],hr=null,gr=null,vr=null,to=new Map,no=new Map,ir=[],rS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function qm(e,t){switch(e){case"focusin":case"focusout":hr=null;break;case"dragenter":case"dragleave":gr=null;break;case"mouseover":case"mouseout":vr=null;break;case"pointerover":case"pointerout":to.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":no.delete(t.pointerId)}}function Ni(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ro(t),t!==null&&rf(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function sS(e,t,n,r,s){switch(t){case"focusin":return hr=Ni(hr,e,t,n,r,s),!0;case"dragenter":return gr=Ni(gr,e,t,n,r,s),!0;case"mouseover":return vr=Ni(vr,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return to.set(i,Ni(to.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,no.set(i,Ni(no.get(i)||null,e,t,n,r,s)),!0}return!1}function fv(e){var t=Fr(e.target);if(t!==null){var n=us(t);if(n!==null){if(t=n.tag,t===13){if(t=ev(n),t!==null){e.blockedOn=t,uv(e.priority,function(){cv(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ya(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Md(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_d=r,n.target.dispatchEvent(r),_d=null}else return t=Ro(n),t!==null&&rf(t),e.blockedOn=n,!1;t.shift()}return!0}function Qm(e,t,n){ya(e)&&n.delete(t)}function iS(){Id=!1,hr!==null&&ya(hr)&&(hr=null),gr!==null&&ya(gr)&&(gr=null),vr!==null&&ya(vr)&&(vr=null),to.forEach(Qm),no.forEach(Qm)}function ki(e,t){e.blockedOn===t&&(e.blockedOn=null,Id||(Id=!0,_t.unstable_scheduleCallback(_t.unstable_NormalPriority,iS)))}function ro(e){function t(s){return ki(s,e)}if(0<Qo.length){ki(Qo[0],e);for(var n=1;n<Qo.length;n++){var r=Qo[n];r.blockedOn===e&&(r.blockedOn=null)}}for(hr!==null&&ki(hr,e),gr!==null&&ki(gr,e),vr!==null&&ki(vr,e),to.forEach(t),no.forEach(t),n=0;n<ir.length;n++)r=ir[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ir.length&&(n=ir[0],n.blockedOn===null);)fv(n),n.blockedOn===null&&ir.shift()}var $s=Kn.ReactCurrentBatchConfig,Ba=!0;function oS(e,t,n,r){var s=pe,i=$s.transition;$s.transition=null;try{pe=1,sf(e,t,n,r)}finally{pe=s,$s.transition=i}}function aS(e,t,n,r){var s=pe,i=$s.transition;$s.transition=null;try{pe=4,sf(e,t,n,r)}finally{pe=s,$s.transition=i}}function sf(e,t,n,r){if(Ba){var s=Md(e,t,n,r);if(s===null)Oc(e,t,r,Va,n),qm(e,r);else if(sS(s,e,t,n,r))r.stopPropagation();else if(qm(e,r),t&4&&-1<rS.indexOf(e)){for(;s!==null;){var i=Ro(s);if(i!==null&&lv(i),i=Md(e,t,n,r),i===null&&Oc(e,t,r,Va,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Oc(e,t,r,null,n)}}var Va=null;function Md(e,t,n,r){if(Va=null,e=ef(r),e=Fr(e),e!==null)if(t=us(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ev(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Va=e,null}function mv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Y1()){case tf:return 1;case sv:return 4;case Fa:case q1:return 16;case iv:return 536870912;default:return 16}default:return 16}}var fr=null,of=null,ba=null;function pv(){if(ba)return ba;var e,t=of,n=t.length,r,s="value"in fr?fr.value:fr.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===s[i-r];r++);return ba=s.slice(e,1<r?1-r:void 0)}function wa(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Xo(){return!0}function Xm(){return!1}function Pt(e){function t(n,r,s,i,a){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Xo:Xm,this.isPropagationStopped=Xm,this}return Me(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),t}var pi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},af=Pt(pi),_o=Me({},pi,{view:0,detail:0}),lS=Pt(_o),Cc,Ec,ji,Nl=Me({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lf,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ji&&(ji&&e.type==="mousemove"?(Cc=e.screenX-ji.screenX,Ec=e.screenY-ji.screenY):Ec=Cc=0,ji=e),Cc)},movementY:function(e){return"movementY"in e?e.movementY:Ec}}),Jm=Pt(Nl),cS=Me({},Nl,{dataTransfer:0}),dS=Pt(cS),uS=Me({},_o,{relatedTarget:0}),_c=Pt(uS),fS=Me({},pi,{animationName:0,elapsedTime:0,pseudoElement:0}),mS=Pt(fS),pS=Me({},pi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hS=Pt(pS),gS=Me({},pi,{data:0}),Zm=Pt(gS),vS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yS[e])?!!t[e]:!1}function lf(){return bS}var wS=Me({},_o,{key:function(e){if(e.key){var t=vS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=wa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lf,charCode:function(e){return e.type==="keypress"?wa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?wa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),SS=Pt(wS),NS=Me({},Nl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ep=Pt(NS),kS=Me({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lf}),jS=Pt(kS),CS=Me({},pi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ES=Pt(CS),_S=Me({},Nl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),RS=Pt(_S),PS=[9,13,27,32],cf=zn&&"CompositionEvent"in window,Bi=null;zn&&"documentMode"in document&&(Bi=document.documentMode);var TS=zn&&"TextEvent"in window&&!Bi,hv=zn&&(!cf||Bi&&8<Bi&&11>=Bi),tp=" ",np=!1;function gv(e,t){switch(e){case"keyup":return PS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ks=!1;function AS(e,t){switch(e){case"compositionend":return vv(t);case"keypress":return t.which!==32?null:(np=!0,tp);case"textInput":return e=t.data,e===tp&&np?null:e;default:return null}}function IS(e,t){if(ks)return e==="compositionend"||!cf&&gv(e,t)?(e=pv(),ba=of=fr=null,ks=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return hv&&t.locale!=="ko"?null:t.data;default:return null}}var MS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function rp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MS[e.type]:t==="textarea"}function xv(e,t,n,r){qg(r),t=Ua(t,"onChange"),0<t.length&&(n=new af("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vi=null,so=null;function OS(e){Rv(e,0)}function kl(e){var t=Es(e);if(Vg(t))return e}function LS(e,t){if(e==="change")return t}var yv=!1;if(zn){var Rc;if(zn){var Pc="oninput"in document;if(!Pc){var sp=document.createElement("div");sp.setAttribute("oninput","return;"),Pc=typeof sp.oninput=="function"}Rc=Pc}else Rc=!1;yv=Rc&&(!document.documentMode||9<document.documentMode)}function ip(){Vi&&(Vi.detachEvent("onpropertychange",bv),so=Vi=null)}function bv(e){if(e.propertyName==="value"&&kl(so)){var t=[];xv(t,so,e,ef(e)),Zg(OS,t)}}function $S(e,t,n){e==="focusin"?(ip(),Vi=t,so=n,Vi.attachEvent("onpropertychange",bv)):e==="focusout"&&ip()}function DS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kl(so)}function FS(e,t){if(e==="click")return kl(t)}function zS(e,t){if(e==="input"||e==="change")return kl(t)}function BS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var on=typeof Object.is=="function"?Object.is:BS;function io(e,t){if(on(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!gd.call(t,s)||!on(e[s],t[s]))return!1}return!0}function op(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ap(e,t){var n=op(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=op(n)}}function wv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sv(){for(var e=window,t=La();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=La(e.document)}return t}function df(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function VS(e){var t=Sv(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&wv(n.ownerDocument.documentElement,n)){if(r!==null&&df(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=ap(n,i);var a=ap(n,r);s&&a&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var US=zn&&"documentMode"in document&&11>=document.documentMode,js=null,Od=null,Ui=null,Ld=!1;function lp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ld||js==null||js!==La(r)||(r=js,"selectionStart"in r&&df(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}),Ui&&io(Ui,r)||(Ui=r,r=Ua(Od,"onSelect"),0<r.length&&(t=new af("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=js)))}function Jo(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Cs={animationend:Jo("Animation","AnimationEnd"),animationiteration:Jo("Animation","AnimationIteration"),animationstart:Jo("Animation","AnimationStart"),transitionend:Jo("Transition","TransitionEnd")},Tc={},Nv={};zn&&(Nv=document.createElement("div").style,"AnimationEvent"in window||(delete Cs.animationend.animation,delete Cs.animationiteration.animation,delete Cs.animationstart.animation),"TransitionEvent"in window||delete Cs.transitionend.transition);function jl(e){if(Tc[e])return Tc[e];if(!Cs[e])return e;var t=Cs[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nv)return Tc[e]=t[n];return e}var kv=jl("animationend"),jv=jl("animationiteration"),Cv=jl("animationstart"),Ev=jl("transitionend"),_v=new Map,cp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function _r(e,t){_v.set(e,t),ds(t,[e])}for(var Ac=0;Ac<cp.length;Ac++){var Ic=cp[Ac],WS=Ic.toLowerCase(),HS=Ic[0].toUpperCase()+Ic.slice(1);_r(WS,"on"+HS)}_r(kv,"onAnimationEnd");_r(jv,"onAnimationIteration");_r(Cv,"onAnimationStart");_r("dblclick","onDoubleClick");_r("focusin","onFocus");_r("focusout","onBlur");_r(Ev,"onTransitionEnd");ti("onMouseEnter",["mouseout","mouseover"]);ti("onMouseLeave",["mouseout","mouseover"]);ti("onPointerEnter",["pointerout","pointerover"]);ti("onPointerLeave",["pointerout","pointerover"]);ds("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ds("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ds("onBeforeInput",["compositionend","keypress","textInput","paste"]);ds("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ds("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ds("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Li="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),GS=new Set("cancel close invalid load scroll toggle".split(" ").concat(Li));function dp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,W1(r,t,void 0,e),e.currentTarget=null}function Rv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&s.isPropagationStopped())break e;dp(s,l,d),i=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&s.isPropagationStopped())break e;dp(s,l,d),i=c}}}if(Da)throw e=Td,Da=!1,Td=null,e}function je(e,t){var n=t[Bd];n===void 0&&(n=t[Bd]=new Set);var r=e+"__bubble";n.has(r)||(Pv(t,e,2,!1),n.add(r))}function Mc(e,t,n){var r=0;t&&(r|=4),Pv(n,e,r,t)}var Zo="_reactListening"+Math.random().toString(36).slice(2);function oo(e){if(!e[Zo]){e[Zo]=!0,$g.forEach(function(n){n!=="selectionchange"&&(GS.has(n)||Mc(n,!1,e),Mc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zo]||(t[Zo]=!0,Mc("selectionchange",!1,t))}}function Pv(e,t,n,r){switch(mv(t)){case 1:var s=oS;break;case 4:s=aS;break;default:s=sf}n=s.bind(null,t,n,e),s=void 0,!Pd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Oc(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;a=a.return}for(;l!==null;){if(a=Fr(l),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}l=l.parentNode}}r=r.return}Zg(function(){var d=i,u=ef(n),f=[];e:{var p=_v.get(e);if(p!==void 0){var m=af,y=e;switch(e){case"keypress":if(wa(n)===0)break e;case"keydown":case"keyup":m=SS;break;case"focusin":y="focus",m=_c;break;case"focusout":y="blur",m=_c;break;case"beforeblur":case"afterblur":m=_c;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=Jm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=dS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=jS;break;case kv:case jv:case Cv:m=mS;break;case Ev:m=ES;break;case"scroll":m=lS;break;case"wheel":m=RS;break;case"copy":case"cut":case"paste":m=hS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=ep}var g=(t&4)!==0,b=!g&&e==="scroll",x=g?p!==null?p+"Capture":null:p;g=[];for(var v=d,w;v!==null;){w=v;var S=w.stateNode;if(w.tag===5&&S!==null&&(w=S,x!==null&&(S=eo(v,x),S!=null&&g.push(ao(v,S,w)))),b)break;v=v.return}0<g.length&&(p=new m(p,y,null,n,u),f.push({event:p,listeners:g}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",p&&n!==_d&&(y=n.relatedTarget||n.fromElement)&&(Fr(y)||y[Bn]))break e;if((m||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,m?(y=n.relatedTarget||n.toElement,m=d,y=y?Fr(y):null,y!==null&&(b=us(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=d),m!==y)){if(g=Jm,S="onMouseLeave",x="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(g=ep,S="onPointerLeave",x="onPointerEnter",v="pointer"),b=m==null?p:Es(m),w=y==null?p:Es(y),p=new g(S,v+"leave",m,n,u),p.target=b,p.relatedTarget=w,S=null,Fr(u)===d&&(g=new g(x,v+"enter",y,n,u),g.target=w,g.relatedTarget=b,S=g),b=S,m&&y)t:{for(g=m,x=y,v=0,w=g;w;w=vs(w))v++;for(w=0,S=x;S;S=vs(S))w++;for(;0<v-w;)g=vs(g),v--;for(;0<w-v;)x=vs(x),w--;for(;v--;){if(g===x||x!==null&&g===x.alternate)break t;g=vs(g),x=vs(x)}g=null}else g=null;m!==null&&up(f,p,m,g,!1),y!==null&&b!==null&&up(f,b,y,g,!0)}}e:{if(p=d?Es(d):window,m=p.nodeName&&p.nodeName.toLowerCase(),m==="select"||m==="input"&&p.type==="file")var N=LS;else if(rp(p))if(yv)N=zS;else{N=DS;var k=$S}else(m=p.nodeName)&&m.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(N=FS);if(N&&(N=N(e,d))){xv(f,N,n,u);break e}k&&k(e,p,d),e==="focusout"&&(k=p._wrapperState)&&k.controlled&&p.type==="number"&&Nd(p,"number",p.value)}switch(k=d?Es(d):window,e){case"focusin":(rp(k)||k.contentEditable==="true")&&(js=k,Od=d,Ui=null);break;case"focusout":Ui=Od=js=null;break;case"mousedown":Ld=!0;break;case"contextmenu":case"mouseup":case"dragend":Ld=!1,lp(f,n,u);break;case"selectionchange":if(US)break;case"keydown":case"keyup":lp(f,n,u)}var j;if(cf)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else ks?gv(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&(hv&&n.locale!=="ko"&&(ks||C!=="onCompositionStart"?C==="onCompositionEnd"&&ks&&(j=pv()):(fr=u,of="value"in fr?fr.value:fr.textContent,ks=!0)),k=Ua(d,C),0<k.length&&(C=new Zm(C,e,null,n,u),f.push({event:C,listeners:k}),j?C.data=j:(j=vv(n),j!==null&&(C.data=j)))),(j=TS?AS(e,n):IS(e,n))&&(d=Ua(d,"onBeforeInput"),0<d.length&&(u=new Zm("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:d}),u.data=j))}Rv(f,t)})}function ao(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ua(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=eo(e,n),i!=null&&r.unshift(ao(e,i,s)),i=eo(e,t),i!=null&&r.push(ao(e,i,s))),e=e.return}return r}function vs(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function up(e,t,n,r,s){for(var i=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,d=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&d!==null&&(l=d,s?(c=eo(n,i),c!=null&&a.unshift(ao(n,c,l))):s||(c=eo(n,i),c!=null&&a.push(ao(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var KS=/\r\n?/g,YS=/\u0000|\uFFFD/g;function fp(e){return(typeof e=="string"?e:""+e).replace(KS,`
|
|
38
|
+
`).replace(YS,"")}function ea(e,t,n){if(t=fp(t),fp(e)!==t&&n)throw Error(B(425))}function Wa(){}var $d=null,Dd=null;function Fd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var zd=typeof setTimeout=="function"?setTimeout:void 0,qS=typeof clearTimeout=="function"?clearTimeout:void 0,mp=typeof Promise=="function"?Promise:void 0,QS=typeof queueMicrotask=="function"?queueMicrotask:typeof mp<"u"?function(e){return mp.resolve(null).then(e).catch(XS)}:zd;function XS(e){setTimeout(function(){throw e})}function Lc(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),ro(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);ro(t)}function xr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function pp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var hi=Math.random().toString(36).slice(2),vn="__reactFiber$"+hi,lo="__reactProps$"+hi,Bn="__reactContainer$"+hi,Bd="__reactEvents$"+hi,JS="__reactListeners$"+hi,ZS="__reactHandles$"+hi;function Fr(e){var t=e[vn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bn]||n[vn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pp(e);e!==null;){if(n=e[vn])return n;e=pp(e)}return t}e=n,n=e.parentNode}return null}function Ro(e){return e=e[vn]||e[Bn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Es(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function Cl(e){return e[lo]||null}var Vd=[],_s=-1;function Rr(e){return{current:e}}function Ce(e){0>_s||(e.current=Vd[_s],Vd[_s]=null,_s--)}function Se(e,t){_s++,Vd[_s]=e.current,e.current=t}var kr={},it=Rr(kr),vt=Rr(!1),Jr=kr;function ni(e,t){var n=e.type.contextTypes;if(!n)return kr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function xt(e){return e=e.childContextTypes,e!=null}function Ha(){Ce(vt),Ce(it)}function hp(e,t,n){if(it.current!==kr)throw Error(B(168));Se(it,t),Se(vt,n)}function Tv(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(B(108,$1(e)||"Unknown",s));return Me({},n,r)}function Ga(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kr,Jr=it.current,Se(it,e),Se(vt,vt.current),!0}function gp(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Tv(e,t,Jr),r.__reactInternalMemoizedMergedChildContext=e,Ce(vt),Ce(it),Se(it,e)):Ce(vt),Se(vt,n)}var Mn=null,El=!1,$c=!1;function Av(e){Mn===null?Mn=[e]:Mn.push(e)}function eN(e){El=!0,Av(e)}function Pr(){if(!$c&&Mn!==null){$c=!0;var e=0,t=pe;try{var n=Mn;for(pe=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Mn=null,El=!1}catch(s){throw Mn!==null&&(Mn=Mn.slice(e+1)),rv(tf,Pr),s}finally{pe=t,$c=!1}}return null}var Rs=[],Ps=0,Ka=null,Ya=0,Mt=[],Ot=0,Zr=null,Ln=1,$n="";function $r(e,t){Rs[Ps++]=Ya,Rs[Ps++]=Ka,Ka=e,Ya=t}function Iv(e,t,n){Mt[Ot++]=Ln,Mt[Ot++]=$n,Mt[Ot++]=Zr,Zr=e;var r=Ln;e=$n;var s=32-rn(r)-1;r&=~(1<<s),n+=1;var i=32-rn(t)+s;if(30<i){var a=s-s%5;i=(r&(1<<a)-1).toString(32),r>>=a,s-=a,Ln=1<<32-rn(t)+s|n<<s|r,$n=i+e}else Ln=1<<i|n<<s|r,$n=e}function uf(e){e.return!==null&&($r(e,1),Iv(e,1,0))}function ff(e){for(;e===Ka;)Ka=Rs[--Ps],Rs[Ps]=null,Ya=Rs[--Ps],Rs[Ps]=null;for(;e===Zr;)Zr=Mt[--Ot],Mt[Ot]=null,$n=Mt[--Ot],Mt[Ot]=null,Ln=Mt[--Ot],Mt[Ot]=null}var Ct=null,kt=null,_e=!1,nn=null;function Mv(e,t){var n=Lt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function vp(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ct=e,kt=xr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ct=e,kt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zr!==null?{id:Ln,overflow:$n}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Lt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ct=e,kt=null,!0):!1;default:return!1}}function Ud(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Wd(e){if(_e){var t=kt;if(t){var n=t;if(!vp(e,t)){if(Ud(e))throw Error(B(418));t=xr(n.nextSibling);var r=Ct;t&&vp(e,t)?Mv(r,n):(e.flags=e.flags&-4097|2,_e=!1,Ct=e)}}else{if(Ud(e))throw Error(B(418));e.flags=e.flags&-4097|2,_e=!1,Ct=e}}}function xp(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ct=e}function ta(e){if(e!==Ct)return!1;if(!_e)return xp(e),_e=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fd(e.type,e.memoizedProps)),t&&(t=kt)){if(Ud(e))throw Ov(),Error(B(418));for(;t;)Mv(e,t),t=xr(t.nextSibling)}if(xp(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){kt=xr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}kt=null}}else kt=Ct?xr(e.stateNode.nextSibling):null;return!0}function Ov(){for(var e=kt;e;)e=xr(e.nextSibling)}function ri(){kt=Ct=null,_e=!1}function mf(e){nn===null?nn=[e]:nn.push(e)}var tN=Kn.ReactCurrentBatchConfig;function Ci(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=s.refs;a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function na(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function yp(e){var t=e._init;return t(e._payload)}function Lv(e){function t(x,v){if(e){var w=x.deletions;w===null?(x.deletions=[v],x.flags|=16):w.push(v)}}function n(x,v){if(!e)return null;for(;v!==null;)t(x,v),v=v.sibling;return null}function r(x,v){for(x=new Map;v!==null;)v.key!==null?x.set(v.key,v):x.set(v.index,v),v=v.sibling;return x}function s(x,v){return x=Sr(x,v),x.index=0,x.sibling=null,x}function i(x,v,w){return x.index=w,e?(w=x.alternate,w!==null?(w=w.index,w<v?(x.flags|=2,v):w):(x.flags|=2,v)):(x.flags|=1048576,v)}function a(x){return e&&x.alternate===null&&(x.flags|=2),x}function l(x,v,w,S){return v===null||v.tag!==6?(v=Wc(w,x.mode,S),v.return=x,v):(v=s(v,w),v.return=x,v)}function c(x,v,w,S){var N=w.type;return N===Ns?u(x,v,w.props.children,S,w.key):v!==null&&(v.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===rr&&yp(N)===v.type)?(S=s(v,w.props),S.ref=Ci(x,v,w),S.return=x,S):(S=_a(w.type,w.key,w.props,null,x.mode,S),S.ref=Ci(x,v,w),S.return=x,S)}function d(x,v,w,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Hc(w,x.mode,S),v.return=x,v):(v=s(v,w.children||[]),v.return=x,v)}function u(x,v,w,S,N){return v===null||v.tag!==7?(v=Qr(w,x.mode,S,N),v.return=x,v):(v=s(v,w),v.return=x,v)}function f(x,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Wc(""+v,x.mode,w),v.return=x,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Ho:return w=_a(v.type,v.key,v.props,null,x.mode,w),w.ref=Ci(x,null,v),w.return=x,w;case Ss:return v=Hc(v,x.mode,w),v.return=x,v;case rr:var S=v._init;return f(x,S(v._payload),w)}if(Mi(v)||wi(v))return v=Qr(v,x.mode,w,null),v.return=x,v;na(x,v)}return null}function p(x,v,w,S){var N=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return N!==null?null:l(x,v,""+w,S);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ho:return w.key===N?c(x,v,w,S):null;case Ss:return w.key===N?d(x,v,w,S):null;case rr:return N=w._init,p(x,v,N(w._payload),S)}if(Mi(w)||wi(w))return N!==null?null:u(x,v,w,S,null);na(x,w)}return null}function m(x,v,w,S,N){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(w)||null,l(v,x,""+S,N);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ho:return x=x.get(S.key===null?w:S.key)||null,c(v,x,S,N);case Ss:return x=x.get(S.key===null?w:S.key)||null,d(v,x,S,N);case rr:var k=S._init;return m(x,v,w,k(S._payload),N)}if(Mi(S)||wi(S))return x=x.get(w)||null,u(v,x,S,N,null);na(v,S)}return null}function y(x,v,w,S){for(var N=null,k=null,j=v,C=v=0,E=null;j!==null&&C<w.length;C++){j.index>C?(E=j,j=null):E=j.sibling;var R=p(x,j,w[C],S);if(R===null){j===null&&(j=E);break}e&&j&&R.alternate===null&&t(x,j),v=i(R,v,C),k===null?N=R:k.sibling=R,k=R,j=E}if(C===w.length)return n(x,j),_e&&$r(x,C),N;if(j===null){for(;C<w.length;C++)j=f(x,w[C],S),j!==null&&(v=i(j,v,C),k===null?N=j:k.sibling=j,k=j);return _e&&$r(x,C),N}for(j=r(x,j);C<w.length;C++)E=m(j,x,C,w[C],S),E!==null&&(e&&E.alternate!==null&&j.delete(E.key===null?C:E.key),v=i(E,v,C),k===null?N=E:k.sibling=E,k=E);return e&&j.forEach(function(P){return t(x,P)}),_e&&$r(x,C),N}function g(x,v,w,S){var N=wi(w);if(typeof N!="function")throw Error(B(150));if(w=N.call(w),w==null)throw Error(B(151));for(var k=N=null,j=v,C=v=0,E=null,R=w.next();j!==null&&!R.done;C++,R=w.next()){j.index>C?(E=j,j=null):E=j.sibling;var P=p(x,j,R.value,S);if(P===null){j===null&&(j=E);break}e&&j&&P.alternate===null&&t(x,j),v=i(P,v,C),k===null?N=P:k.sibling=P,k=P,j=E}if(R.done)return n(x,j),_e&&$r(x,C),N;if(j===null){for(;!R.done;C++,R=w.next())R=f(x,R.value,S),R!==null&&(v=i(R,v,C),k===null?N=R:k.sibling=R,k=R);return _e&&$r(x,C),N}for(j=r(x,j);!R.done;C++,R=w.next())R=m(j,x,C,R.value,S),R!==null&&(e&&R.alternate!==null&&j.delete(R.key===null?C:R.key),v=i(R,v,C),k===null?N=R:k.sibling=R,k=R);return e&&j.forEach(function(T){return t(x,T)}),_e&&$r(x,C),N}function b(x,v,w,S){if(typeof w=="object"&&w!==null&&w.type===Ns&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Ho:e:{for(var N=w.key,k=v;k!==null;){if(k.key===N){if(N=w.type,N===Ns){if(k.tag===7){n(x,k.sibling),v=s(k,w.props.children),v.return=x,x=v;break e}}else if(k.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===rr&&yp(N)===k.type){n(x,k.sibling),v=s(k,w.props),v.ref=Ci(x,k,w),v.return=x,x=v;break e}n(x,k);break}else t(x,k);k=k.sibling}w.type===Ns?(v=Qr(w.props.children,x.mode,S,w.key),v.return=x,x=v):(S=_a(w.type,w.key,w.props,null,x.mode,S),S.ref=Ci(x,v,w),S.return=x,x=S)}return a(x);case Ss:e:{for(k=w.key;v!==null;){if(v.key===k)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(x,v.sibling),v=s(v,w.children||[]),v.return=x,x=v;break e}else{n(x,v);break}else t(x,v);v=v.sibling}v=Hc(w,x.mode,S),v.return=x,x=v}return a(x);case rr:return k=w._init,b(x,v,k(w._payload),S)}if(Mi(w))return y(x,v,w,S);if(wi(w))return g(x,v,w,S);na(x,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(x,v.sibling),v=s(v,w),v.return=x,x=v):(n(x,v),v=Wc(w,x.mode,S),v.return=x,x=v),a(x)):n(x,v)}return b}var si=Lv(!0),$v=Lv(!1),qa=Rr(null),Qa=null,Ts=null,pf=null;function hf(){pf=Ts=Qa=null}function gf(e){var t=qa.current;Ce(qa),e._currentValue=t}function Hd(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ds(e,t){Qa=e,pf=Ts=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ht=!0),e.firstContext=null)}function Dt(e){var t=e._currentValue;if(pf!==e)if(e={context:e,memoizedValue:t,next:null},Ts===null){if(Qa===null)throw Error(B(308));Ts=e,Qa.dependencies={lanes:0,firstContext:e}}else Ts=Ts.next=e;return t}var zr=null;function vf(e){zr===null?zr=[e]:zr.push(e)}function Dv(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,vf(t)):(n.next=s.next,s.next=n),t.interleaved=n,Vn(e,r)}function Vn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var sr=!1;function xf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function yr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,de&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Vn(e,n)}return s=r.interleaved,s===null?(t.next=t,vf(r)):(t.next=s.next,s.next=t),r.interleaved=t,Vn(e,n)}function Sa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nf(e,n)}}function bp(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xa(e,t,n,r){var s=e.updateQueue;sr=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,d=c.next;c.next=null,a===null?i=d:a.next=d,a=c;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==a&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var f=s.baseState;a=0,u=d=c=null,l=i;do{var p=l.lane,m=l.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,g=l;switch(p=t,m=n,g.tag){case 1:if(y=g.payload,typeof y=="function"){f=y.call(m,f,p);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,p=typeof y=="function"?y.call(m,f,p):y,p==null)break e;f=Me({},f,p);break e;case 2:sr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[l]:p.push(l))}else m={eventTime:m,lane:p,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=m,c=f):u=u.next=m,a|=p;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;p=l,l=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(u===null&&(c=f),s.baseState=c,s.firstBaseUpdate=d,s.lastBaseUpdate=u,t=s.shared.interleaved,t!==null){s=t;do a|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);ts|=a,e.lanes=a,e.memoizedState=f}}function wp(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(B(191,s));s.call(r)}}}var Po={},kn=Rr(Po),co=Rr(Po),uo=Rr(Po);function Br(e){if(e===Po)throw Error(B(174));return e}function yf(e,t){switch(Se(uo,t),Se(co,e),Se(kn,Po),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:jd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=jd(t,e)}Ce(kn),Se(kn,t)}function ii(){Ce(kn),Ce(co),Ce(uo)}function zv(e){Br(uo.current);var t=Br(kn.current),n=jd(t,e.type);t!==n&&(Se(co,e),Se(kn,n))}function bf(e){co.current===e&&(Ce(kn),Ce(co))}var Pe=Rr(0);function Ja(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Dc=[];function wf(){for(var e=0;e<Dc.length;e++)Dc[e]._workInProgressVersionPrimary=null;Dc.length=0}var Na=Kn.ReactCurrentDispatcher,Fc=Kn.ReactCurrentBatchConfig,es=0,Ie=null,Fe=null,Ge=null,Za=!1,Wi=!1,fo=0,nN=0;function et(){throw Error(B(321))}function Sf(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!on(e[n],t[n]))return!1;return!0}function Nf(e,t,n,r,s,i){if(es=i,Ie=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Na.current=e===null||e.memoizedState===null?oN:aN,e=n(r,s),Wi){i=0;do{if(Wi=!1,fo=0,25<=i)throw Error(B(301));i+=1,Ge=Fe=null,t.updateQueue=null,Na.current=lN,e=n(r,s)}while(Wi)}if(Na.current=el,t=Fe!==null&&Fe.next!==null,es=0,Ge=Fe=Ie=null,Za=!1,t)throw Error(B(300));return e}function kf(){var e=fo!==0;return fo=0,e}function fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ge===null?Ie.memoizedState=Ge=e:Ge=Ge.next=e,Ge}function Ft(){if(Fe===null){var e=Ie.alternate;e=e!==null?e.memoizedState:null}else e=Fe.next;var t=Ge===null?Ie.memoizedState:Ge.next;if(t!==null)Ge=t,Fe=e;else{if(e===null)throw Error(B(310));Fe=e,e={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},Ge===null?Ie.memoizedState=Ge=e:Ge=Ge.next=e}return Ge}function mo(e,t){return typeof t=="function"?t(e):t}function zc(e){var t=Ft(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Fe,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var a=s.next;s.next=i.next,i.next=a}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var l=a=null,c=null,d=i;do{var u=d.lane;if((es&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var f={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=f,a=r):c=c.next=f,Ie.lanes|=u,ts|=u}d=d.next}while(d!==null&&d!==i);c===null?a=r:c.next=l,on(r,t.memoizedState)||(ht=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,Ie.lanes|=i,ts|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Bc(e){var t=Ft(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var a=s=s.next;do i=e(i,a.action),a=a.next;while(a!==s);on(i,t.memoizedState)||(ht=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Bv(){}function Vv(e,t){var n=Ie,r=Ft(),s=t(),i=!on(r.memoizedState,s);if(i&&(r.memoizedState=s,ht=!0),r=r.queue,jf(Hv.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Ge!==null&&Ge.memoizedState.tag&1){if(n.flags|=2048,po(9,Wv.bind(null,n,r,s,t),void 0,null),Ke===null)throw Error(B(349));es&30||Uv(n,t,s)}return s}function Uv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wv(e,t,n,r){t.value=n,t.getSnapshot=r,Gv(t)&&Kv(e)}function Hv(e,t,n){return n(function(){Gv(t)&&Kv(e)})}function Gv(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!on(e,n)}catch{return!0}}function Kv(e){var t=Vn(e,1);t!==null&&sn(t,e,1,-1)}function Sp(e){var t=fn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mo,lastRenderedState:e},t.queue=e,e=e.dispatch=iN.bind(null,Ie,e),[t.memoizedState,e]}function po(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ie.updateQueue,t===null?(t={lastEffect:null,stores:null},Ie.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Yv(){return Ft().memoizedState}function ka(e,t,n,r){var s=fn();Ie.flags|=e,s.memoizedState=po(1|t,n,void 0,r===void 0?null:r)}function _l(e,t,n,r){var s=Ft();r=r===void 0?null:r;var i=void 0;if(Fe!==null){var a=Fe.memoizedState;if(i=a.destroy,r!==null&&Sf(r,a.deps)){s.memoizedState=po(t,n,i,r);return}}Ie.flags|=e,s.memoizedState=po(1|t,n,i,r)}function Np(e,t){return ka(8390656,8,e,t)}function jf(e,t){return _l(2048,8,e,t)}function qv(e,t){return _l(4,2,e,t)}function Qv(e,t){return _l(4,4,e,t)}function Xv(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jv(e,t,n){return n=n!=null?n.concat([e]):null,_l(4,4,Xv.bind(null,t,e),n)}function Cf(){}function Zv(e,t){var n=Ft();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Sf(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ex(e,t){var n=Ft();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Sf(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function tx(e,t,n){return es&21?(on(n,t)||(n=ov(),Ie.lanes|=n,ts|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ht=!0),e.memoizedState=n)}function rN(e,t){var n=pe;pe=n!==0&&4>n?n:4,e(!0);var r=Fc.transition;Fc.transition={};try{e(!1),t()}finally{pe=n,Fc.transition=r}}function nx(){return Ft().memoizedState}function sN(e,t,n){var r=wr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},rx(e))sx(t,n);else if(n=Dv(e,t,n,r),n!==null){var s=ct();sn(n,e,r,s),ix(n,t,r)}}function iN(e,t,n){var r=wr(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(rx(e))sx(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(s.hasEagerState=!0,s.eagerState=l,on(l,a)){var c=t.interleaved;c===null?(s.next=s,vf(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}n=Dv(e,t,s,r),n!==null&&(s=ct(),sn(n,e,r,s),ix(n,t,r))}}function rx(e){var t=e.alternate;return e===Ie||t!==null&&t===Ie}function sx(e,t){Wi=Za=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ix(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,nf(e,n)}}var el={readContext:Dt,useCallback:et,useContext:et,useEffect:et,useImperativeHandle:et,useInsertionEffect:et,useLayoutEffect:et,useMemo:et,useReducer:et,useRef:et,useState:et,useDebugValue:et,useDeferredValue:et,useTransition:et,useMutableSource:et,useSyncExternalStore:et,useId:et,unstable_isNewReconciler:!1},oN={readContext:Dt,useCallback:function(e,t){return fn().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Np,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ka(4194308,4,Xv.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ka(4194308,4,e,t)},useInsertionEffect:function(e,t){return ka(4,2,e,t)},useMemo:function(e,t){var n=fn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=sN.bind(null,Ie,e),[r.memoizedState,e]},useRef:function(e){var t=fn();return e={current:e},t.memoizedState=e},useState:Sp,useDebugValue:Cf,useDeferredValue:function(e){return fn().memoizedState=e},useTransition:function(){var e=Sp(!1),t=e[0];return e=rN.bind(null,e[1]),fn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ie,s=fn();if(_e){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Ke===null)throw Error(B(349));es&30||Uv(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Np(Hv.bind(null,r,i,e),[e]),r.flags|=2048,po(9,Wv.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=fn(),t=Ke.identifierPrefix;if(_e){var n=$n,r=Ln;n=(r&~(1<<32-rn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=fo++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=nN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},aN={readContext:Dt,useCallback:Zv,useContext:Dt,useEffect:jf,useImperativeHandle:Jv,useInsertionEffect:qv,useLayoutEffect:Qv,useMemo:ex,useReducer:zc,useRef:Yv,useState:function(){return zc(mo)},useDebugValue:Cf,useDeferredValue:function(e){var t=Ft();return tx(t,Fe.memoizedState,e)},useTransition:function(){var e=zc(mo)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:Bv,useSyncExternalStore:Vv,useId:nx,unstable_isNewReconciler:!1},lN={readContext:Dt,useCallback:Zv,useContext:Dt,useEffect:jf,useImperativeHandle:Jv,useInsertionEffect:qv,useLayoutEffect:Qv,useMemo:ex,useReducer:Bc,useRef:Yv,useState:function(){return Bc(mo)},useDebugValue:Cf,useDeferredValue:function(e){var t=Ft();return Fe===null?t.memoizedState=e:tx(t,Fe.memoizedState,e)},useTransition:function(){var e=Bc(mo)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:Bv,useSyncExternalStore:Vv,useId:nx,unstable_isNewReconciler:!1};function Qt(e,t){if(e&&e.defaultProps){t=Me({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Gd(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Me({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rl={isMounted:function(e){return(e=e._reactInternals)?us(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ct(),s=wr(e),i=Fn(r,s);i.payload=t,n!=null&&(i.callback=n),t=yr(e,i,s),t!==null&&(sn(t,e,s,r),Sa(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ct(),s=wr(e),i=Fn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=yr(e,i,s),t!==null&&(sn(t,e,s,r),Sa(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ct(),r=wr(e),s=Fn(n,r);s.tag=2,t!=null&&(s.callback=t),t=yr(e,s,r),t!==null&&(sn(t,e,r,n),Sa(t,e,r))}};function kp(e,t,n,r,s,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!io(n,r)||!io(s,i):!0}function ox(e,t,n){var r=!1,s=kr,i=t.contextType;return typeof i=="object"&&i!==null?i=Dt(i):(s=xt(t)?Jr:it.current,r=t.contextTypes,i=(r=r!=null)?ni(e,s):kr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Rl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function jp(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Rl.enqueueReplaceState(t,t.state,null)}function Kd(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},xf(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=Dt(i):(i=xt(t)?Jr:it.current,s.context=ni(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Gd(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Rl.enqueueReplaceState(s,s.state,null),Xa(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function oi(e,t){try{var n="",r=t;do n+=L1(r),r=r.return;while(r);var s=n}catch(i){s=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:s,digest:null}}function Vc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Yd(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var cN=typeof WeakMap=="function"?WeakMap:Map;function ax(e,t,n){n=Fn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){nl||(nl=!0,su=r),Yd(e,t)},n}function lx(e,t,n){n=Fn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Yd(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Yd(e,t),typeof r!="function"&&(br===null?br=new Set([this]):br.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function Cp(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new cN;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=NN.bind(null,e,t,n),t.then(e,e))}function Ep(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function _p(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Fn(-1,1),t.tag=2,yr(n,t,1))),n.lanes|=1),e)}var dN=Kn.ReactCurrentOwner,ht=!1;function at(e,t,n,r){t.child=e===null?$v(t,null,n,r):si(t,e.child,n,r)}function Rp(e,t,n,r,s){n=n.render;var i=t.ref;return Ds(t,s),r=Nf(e,t,n,r,i,s),n=kf(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Un(e,t,s)):(_e&&n&&uf(t),t.flags|=1,at(e,t,r,s),t.child)}function Pp(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Mf(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,cx(e,t,i,r,s)):(e=_a(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:io,n(a,r)&&e.ref===t.ref)return Un(e,t,s)}return t.flags|=1,e=Sr(i,r),e.ref=t.ref,e.return=t,t.child=e}function cx(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(io(i,r)&&e.ref===t.ref)if(ht=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(ht=!0);else return t.lanes=e.lanes,Un(e,t,s)}return qd(e,t,n,r,s)}function dx(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Se(Is,St),St|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Se(Is,St),St|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Se(Is,St),St|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Se(Is,St),St|=r;return at(e,t,s,n),t.child}function ux(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function qd(e,t,n,r,s){var i=xt(n)?Jr:it.current;return i=ni(t,i),Ds(t,s),n=Nf(e,t,n,r,i,s),r=kf(),e!==null&&!ht?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Un(e,t,s)):(_e&&r&&uf(t),t.flags|=1,at(e,t,n,s),t.child)}function Tp(e,t,n,r,s){if(xt(n)){var i=!0;Ga(t)}else i=!1;if(Ds(t,s),t.stateNode===null)ja(e,t),ox(t,n,r),Kd(t,n,r,s),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,d=n.contextType;typeof d=="object"&&d!==null?d=Dt(d):(d=xt(n)?Jr:it.current,d=ni(t,d));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==d)&&jp(t,a,r,d),sr=!1;var p=t.memoizedState;a.state=p,Xa(t,r,a,s),c=t.memoizedState,l!==r||p!==c||vt.current||sr?(typeof u=="function"&&(Gd(t,n,u,r),c=t.memoizedState),(l=sr||kp(t,n,l,r,p,c,d))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=d,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Fv(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:Qt(t.type,l),a.props=d,f=t.pendingProps,p=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Dt(c):(c=xt(n)?Jr:it.current,c=ni(t,c));var m=n.getDerivedStateFromProps;(u=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||p!==c)&&jp(t,a,r,c),sr=!1,p=t.memoizedState,a.state=p,Xa(t,r,a,s);var y=t.memoizedState;l!==f||p!==y||vt.current||sr?(typeof m=="function"&&(Gd(t,n,m,r),y=t.memoizedState),(d=sr||kp(t,n,d,r,p,y,c)||!1)?(u||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,y,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,y,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),a.props=r,a.state=y,a.context=c,r=d):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Qd(e,t,n,r,i,s)}function Qd(e,t,n,r,s,i){ux(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return s&&gp(t,n,!1),Un(e,t,i);r=t.stateNode,dN.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=si(t,e.child,null,i),t.child=si(t,null,l,i)):at(e,t,l,i),t.memoizedState=r.state,s&&gp(t,n,!0),t.child}function fx(e){var t=e.stateNode;t.pendingContext?hp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&hp(e,t.context,!1),yf(e,t.containerInfo)}function Ap(e,t,n,r,s){return ri(),mf(s),t.flags|=256,at(e,t,n,r),t.child}var Xd={dehydrated:null,treeContext:null,retryLane:0};function Jd(e){return{baseLanes:e,cachePool:null,transitions:null}}function mx(e,t,n){var r=t.pendingProps,s=Pe.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(s&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Se(Pe,s&1),e===null)return Wd(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Al(a,r,0,null),e=Qr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Jd(n),t.memoizedState=Xd,e):Ef(t,a));if(s=e.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return uN(e,t,a,r,l,s,n);if(i){i=r.fallback,a=t.mode,s=e.child,l=s.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Sr(s,c),r.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=Sr(l,i):(i=Qr(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?Jd(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Xd,r}return i=e.child,e=i.sibling,r=Sr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ef(e,t){return t=Al({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ra(e,t,n,r){return r!==null&&mf(r),si(t,e.child,null,n),e=Ef(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uN(e,t,n,r,s,i,a){if(n)return t.flags&256?(t.flags&=-257,r=Vc(Error(B(422))),ra(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Al({mode:"visible",children:r.children},s,0,null),i=Qr(i,s,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&si(t,e.child,null,a),t.child.memoizedState=Jd(a),t.memoizedState=Xd,i);if(!(t.mode&1))return ra(e,t,a,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(B(419)),r=Vc(i,r,void 0),ra(e,t,a,r)}if(l=(a&e.childLanes)!==0,ht||l){if(r=Ke,r!==null){switch(a&-a){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Vn(e,s),sn(r,e,s,-1))}return If(),r=Vc(Error(B(421))),ra(e,t,a,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=kN.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,kt=xr(s.nextSibling),Ct=t,_e=!0,nn=null,e!==null&&(Mt[Ot++]=Ln,Mt[Ot++]=$n,Mt[Ot++]=Zr,Ln=e.id,$n=e.overflow,Zr=t),t=Ef(t,r.children),t.flags|=4096,t)}function Ip(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hd(e.return,t,n)}function Uc(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function px(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(at(e,t,r.children,n),r=Pe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ip(e,n,t);else if(e.tag===19)Ip(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Se(Pe,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Ja(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Uc(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Ja(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Uc(t,!0,n,null,i);break;case"together":Uc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ja(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Un(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ts|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=Sr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Sr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fN(e,t,n){switch(t.tag){case 3:fx(t),ri();break;case 5:zv(t);break;case 1:xt(t.type)&&Ga(t);break;case 4:yf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Se(qa,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Se(Pe,Pe.current&1),t.flags|=128,null):n&t.child.childLanes?mx(e,t,n):(Se(Pe,Pe.current&1),e=Un(e,t,n),e!==null?e.sibling:null);Se(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return px(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Se(Pe,Pe.current),r)break;return null;case 22:case 23:return t.lanes=0,dx(e,t,n)}return Un(e,t,n)}var hx,Zd,gx,vx;hx=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Zd=function(){};gx=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Br(kn.current);var i=null;switch(n){case"input":s=wd(e,s),r=wd(e,r),i=[];break;case"select":s=Me({},s,{value:void 0}),r=Me({},r,{value:void 0}),i=[];break;case"textarea":s=kd(e,s),r=kd(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Wa)}Cd(n,r);var a;n=null;for(d in s)if(!r.hasOwnProperty(d)&&s.hasOwnProperty(d)&&s[d]!=null)if(d==="style"){var l=s[d];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(Ji.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in r){var c=r[d];if(l=s!=null?s[d]:void 0,r.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(Ji.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&je("scroll",e),i||l===c||(i=[])):(i=i||[]).push(d,c))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};vx=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ei(e,t){if(!_e)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function mN(e,t,n){var r=t.pendingProps;switch(ff(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return xt(t.type)&&Ha(),tt(t),null;case 3:return r=t.stateNode,ii(),Ce(vt),Ce(it),wf(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ta(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,nn!==null&&(au(nn),nn=null))),Zd(e,t),tt(t),null;case 5:bf(t);var s=Br(uo.current);if(n=t.type,e!==null&&t.stateNode!=null)gx(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return tt(t),null}if(e=Br(kn.current),ta(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[vn]=t,r[lo]=i,e=(t.mode&1)!==0,n){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(s=0;s<Li.length;s++)je(Li[s],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":Vm(r,i),je("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},je("invalid",r);break;case"textarea":Wm(r,i),je("invalid",r)}Cd(n,i),s=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&ea(r.textContent,l,e),s=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&ea(r.textContent,l,e),s=["children",""+l]):Ji.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&je("scroll",r)}switch(n){case"input":Go(r),Um(r,i,!0);break;case"textarea":Go(r),Hm(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Wa)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Hg(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[vn]=t,e[lo]=r,hx(e,t,!1,!1),t.stateNode=e;e:{switch(a=Ed(n,r),n){case"dialog":je("cancel",e),je("close",e),s=r;break;case"iframe":case"object":case"embed":je("load",e),s=r;break;case"video":case"audio":for(s=0;s<Li.length;s++)je(Li[s],e);s=r;break;case"source":je("error",e),s=r;break;case"img":case"image":case"link":je("error",e),je("load",e),s=r;break;case"details":je("toggle",e),s=r;break;case"input":Vm(e,r),s=wd(e,r),je("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=Me({},r,{value:void 0}),je("invalid",e);break;case"textarea":Wm(e,r),s=kd(e,r),je("invalid",e);break;default:s=r}Cd(n,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Yg(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Gg(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Zi(e,c):typeof c=="number"&&Zi(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ji.hasOwnProperty(i)?c!=null&&i==="onScroll"&&je("scroll",e):c!=null&&Qu(e,i,c,a))}switch(n){case"input":Go(e),Um(e,r,!1);break;case"textarea":Go(e),Hm(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Nr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Ms(e,!!r.multiple,i,!1):r.defaultValue!=null&&Ms(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Wa)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return tt(t),null;case 6:if(e&&t.stateNode!=null)vx(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Br(uo.current),Br(kn.current),ta(t)){if(r=t.stateNode,n=t.memoizedProps,r[vn]=t,(i=r.nodeValue!==n)&&(e=Ct,e!==null))switch(e.tag){case 3:ea(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ea(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vn]=t,t.stateNode=r}return tt(t),null;case 13:if(Ce(Pe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(_e&&kt!==null&&t.mode&1&&!(t.flags&128))Ov(),ri(),t.flags|=98560,i=!1;else if(i=ta(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[vn]=t}else ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;tt(t),i=!1}else nn!==null&&(au(nn),nn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Pe.current&1?Be===0&&(Be=3):If())),t.updateQueue!==null&&(t.flags|=4),tt(t),null);case 4:return ii(),Zd(e,t),e===null&&oo(t.stateNode.containerInfo),tt(t),null;case 10:return gf(t.type._context),tt(t),null;case 17:return xt(t.type)&&Ha(),tt(t),null;case 19:if(Ce(Pe),i=t.memoizedState,i===null)return tt(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Ei(i,!1);else{if(Be!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ja(e),a!==null){for(t.flags|=128,Ei(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Se(Pe,Pe.current&1|2),t.child}e=e.sibling}i.tail!==null&&$e()>ai&&(t.flags|=128,r=!0,Ei(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ja(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ei(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!_e)return tt(t),null}else 2*$e()-i.renderingStartTime>ai&&n!==1073741824&&(t.flags|=128,r=!0,Ei(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$e(),t.sibling=null,n=Pe.current,Se(Pe,r?n&1|2:n&1),t):(tt(t),null);case 22:case 23:return Af(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?St&1073741824&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function pN(e,t){switch(ff(t),t.tag){case 1:return xt(t.type)&&Ha(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ii(),Ce(vt),Ce(it),wf(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bf(t),null;case 13:if(Ce(Pe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ce(Pe),null;case 4:return ii(),null;case 10:return gf(t.type._context),null;case 22:case 23:return Af(),null;case 24:return null;default:return null}}var sa=!1,rt=!1,hN=typeof WeakSet=="function"?WeakSet:Set,H=null;function As(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Le(e,t,r)}else n.current=null}function eu(e,t,n){try{n()}catch(r){Le(e,t,r)}}var Mp=!1;function gN(e,t){if($d=Ba,e=Sv(),df(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,d=0,u=0,f=e,p=null;t:for(;;){for(var m;f!==n||s!==0&&f.nodeType!==3||(l=a+s),f!==i||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++d===s&&(l=a),p===i&&++u===r&&(c=a),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Dd={focusedElem:e,selectionRange:n},Ba=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,b=y.memoizedState,x=t.stateNode,v=x.getSnapshotBeforeUpdate(t.elementType===t.type?g:Qt(t.type,g),b);x.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(S){Le(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return y=Mp,Mp=!1,y}function Hi(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&eu(t,n,i)}s=s.next}while(s!==r)}}function Pl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function tu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function xx(e){var t=e.alternate;t!==null&&(e.alternate=null,xx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vn],delete t[lo],delete t[Bd],delete t[JS],delete t[ZS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function yx(e){return e.tag===5||e.tag===3||e.tag===4}function Op(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yx(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function nu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wa));else if(r!==4&&(e=e.child,e!==null))for(nu(e,t,n),e=e.sibling;e!==null;)nu(e,t,n),e=e.sibling}function ru(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(ru(e,t,n),e=e.sibling;e!==null;)ru(e,t,n),e=e.sibling}var Ye=null,tn=!1;function Jn(e,t,n){for(n=n.child;n!==null;)bx(e,t,n),n=n.sibling}function bx(e,t,n){if(Nn&&typeof Nn.onCommitFiberUnmount=="function")try{Nn.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:rt||As(n,t);case 6:var r=Ye,s=tn;Ye=null,Jn(e,t,n),Ye=r,tn=s,Ye!==null&&(tn?(e=Ye,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ye.removeChild(n.stateNode));break;case 18:Ye!==null&&(tn?(e=Ye,n=n.stateNode,e.nodeType===8?Lc(e.parentNode,n):e.nodeType===1&&Lc(e,n),ro(e)):Lc(Ye,n.stateNode));break;case 4:r=Ye,s=tn,Ye=n.stateNode.containerInfo,tn=!0,Jn(e,t,n),Ye=r,tn=s;break;case 0:case 11:case 14:case 15:if(!rt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&eu(n,t,a),s=s.next}while(s!==r)}Jn(e,t,n);break;case 1:if(!rt&&(As(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Le(n,t,l)}Jn(e,t,n);break;case 21:Jn(e,t,n);break;case 22:n.mode&1?(rt=(r=rt)||n.memoizedState!==null,Jn(e,t,n),rt=r):Jn(e,t,n);break;default:Jn(e,t,n)}}function Lp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hN),t.forEach(function(r){var s=jN.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Kt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:Ye=l.stateNode,tn=!1;break e;case 3:Ye=l.stateNode.containerInfo,tn=!0;break e;case 4:Ye=l.stateNode.containerInfo,tn=!0;break e}l=l.return}if(Ye===null)throw Error(B(160));bx(i,a,s),Ye=null,tn=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(d){Le(s,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)wx(t,e),t=t.sibling}function wx(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Kt(t,e),un(e),r&4){try{Hi(3,e,e.return),Pl(3,e)}catch(g){Le(e,e.return,g)}try{Hi(5,e,e.return)}catch(g){Le(e,e.return,g)}}break;case 1:Kt(t,e),un(e),r&512&&n!==null&&As(n,n.return);break;case 5:if(Kt(t,e),un(e),r&512&&n!==null&&As(n,n.return),e.flags&32){var s=e.stateNode;try{Zi(s,"")}catch(g){Le(e,e.return,g)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Ug(s,i),Ed(l,a);var d=Ed(l,i);for(a=0;a<c.length;a+=2){var u=c[a],f=c[a+1];u==="style"?Yg(s,f):u==="dangerouslySetInnerHTML"?Gg(s,f):u==="children"?Zi(s,f):Qu(s,u,f,d)}switch(l){case"input":Sd(s,i);break;case"textarea":Wg(s,i);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Ms(s,!!i.multiple,m,!1):p!==!!i.multiple&&(i.defaultValue!=null?Ms(s,!!i.multiple,i.defaultValue,!0):Ms(s,!!i.multiple,i.multiple?[]:"",!1))}s[lo]=i}catch(g){Le(e,e.return,g)}}break;case 6:if(Kt(t,e),un(e),r&4){if(e.stateNode===null)throw Error(B(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){Le(e,e.return,g)}}break;case 3:if(Kt(t,e),un(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ro(t.containerInfo)}catch(g){Le(e,e.return,g)}break;case 4:Kt(t,e),un(e);break;case 13:Kt(t,e),un(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Pf=$e())),r&4&&Lp(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(rt=(d=rt)||u,Kt(t,e),rt=d):Kt(t,e),un(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!u&&e.mode&1)for(H=e,u=e.child;u!==null;){for(f=H=u;H!==null;){switch(p=H,m=p.child,p.tag){case 0:case 11:case 14:case 15:Hi(4,p,p.return);break;case 1:As(p,p.return);var y=p.stateNode;if(typeof y.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(g){Le(r,n,g)}}break;case 5:As(p,p.return);break;case 22:if(p.memoizedState!==null){Dp(f);continue}}m!==null?(m.return=p,H=m):Dp(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{s=f.stateNode,d?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Kg("display",a))}catch(g){Le(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(g){Le(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Kt(t,e),un(e),r&4&&Lp(e);break;case 21:break;default:Kt(t,e),un(e)}}function un(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(yx(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(Zi(s,""),r.flags&=-33);var i=Op(e);ru(e,i,s);break;case 3:case 4:var a=r.stateNode.containerInfo,l=Op(e);nu(e,l,a);break;default:throw Error(B(161))}}catch(c){Le(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vN(e,t,n){H=e,Sx(e)}function Sx(e,t,n){for(var r=(e.mode&1)!==0;H!==null;){var s=H,i=s.child;if(s.tag===22&&r){var a=s.memoizedState!==null||sa;if(!a){var l=s.alternate,c=l!==null&&l.memoizedState!==null||rt;l=sa;var d=rt;if(sa=a,(rt=c)&&!d)for(H=s;H!==null;)a=H,c=a.child,a.tag===22&&a.memoizedState!==null?Fp(s):c!==null?(c.return=a,H=c):Fp(s);for(;i!==null;)H=i,Sx(i),i=i.sibling;H=s,sa=l,rt=d}$p(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,H=i):$p(e)}}function $p(e){for(;H!==null;){var t=H;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:rt||Pl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!rt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Qt(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&wp(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}wp(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&ro(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}rt||t.flags&512&&tu(t)}catch(p){Le(t,t.return,p)}}if(t===e){H=null;break}if(n=t.sibling,n!==null){n.return=t.return,H=n;break}H=t.return}}function Dp(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var n=t.sibling;if(n!==null){n.return=t.return,H=n;break}H=t.return}}function Fp(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Pl(4,t)}catch(c){Le(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(c){Le(t,s,c)}}var i=t.return;try{tu(t)}catch(c){Le(t,i,c)}break;case 5:var a=t.return;try{tu(t)}catch(c){Le(t,a,c)}}}catch(c){Le(t,t.return,c)}if(t===e){H=null;break}var l=t.sibling;if(l!==null){l.return=t.return,H=l;break}H=t.return}}var xN=Math.ceil,tl=Kn.ReactCurrentDispatcher,_f=Kn.ReactCurrentOwner,$t=Kn.ReactCurrentBatchConfig,de=0,Ke=null,De=null,qe=0,St=0,Is=Rr(0),Be=0,ho=null,ts=0,Tl=0,Rf=0,Gi=null,pt=null,Pf=0,ai=1/0,In=null,nl=!1,su=null,br=null,ia=!1,mr=null,rl=0,Ki=0,iu=null,Ca=-1,Ea=0;function ct(){return de&6?$e():Ca!==-1?Ca:Ca=$e()}function wr(e){return e.mode&1?de&2&&qe!==0?qe&-qe:tN.transition!==null?(Ea===0&&(Ea=ov()),Ea):(e=pe,e!==0||(e=window.event,e=e===void 0?16:mv(e.type)),e):1}function sn(e,t,n,r){if(50<Ki)throw Ki=0,iu=null,Error(B(185));Eo(e,n,r),(!(de&2)||e!==Ke)&&(e===Ke&&(!(de&2)&&(Tl|=n),Be===4&&or(e,qe)),yt(e,r),n===1&&de===0&&!(t.mode&1)&&(ai=$e()+500,El&&Pr()))}function yt(e,t){var n=e.callbackNode;tS(e,t);var r=za(e,e===Ke?qe:0);if(r===0)n!==null&&Ym(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ym(n),t===1)e.tag===0?eN(zp.bind(null,e)):Av(zp.bind(null,e)),QS(function(){!(de&6)&&Pr()}),n=null;else{switch(av(r)){case 1:n=tf;break;case 4:n=sv;break;case 16:n=Fa;break;case 536870912:n=iv;break;default:n=Fa}n=Px(n,Nx.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Nx(e,t){if(Ca=-1,Ea=0,de&6)throw Error(B(327));var n=e.callbackNode;if(Fs()&&e.callbackNode!==n)return null;var r=za(e,e===Ke?qe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=sl(e,r);else{t=r;var s=de;de|=2;var i=jx();(Ke!==e||qe!==t)&&(In=null,ai=$e()+500,qr(e,t));do try{wN();break}catch(l){kx(e,l)}while(!0);hf(),tl.current=i,de=s,De!==null?t=0:(Ke=null,qe=0,t=Be)}if(t!==0){if(t===2&&(s=Ad(e),s!==0&&(r=s,t=ou(e,s))),t===1)throw n=ho,qr(e,0),or(e,r),yt(e,$e()),n;if(t===6)or(e,r);else{if(s=e.current.alternate,!(r&30)&&!yN(s)&&(t=sl(e,r),t===2&&(i=Ad(e),i!==0&&(r=i,t=ou(e,i))),t===1))throw n=ho,qr(e,0),or(e,r),yt(e,$e()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Dr(e,pt,In);break;case 3:if(or(e,r),(r&130023424)===r&&(t=Pf+500-$e(),10<t)){if(za(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){ct(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=zd(Dr.bind(null,e,pt,In),t);break}Dr(e,pt,In);break;case 4:if(or(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var a=31-rn(r);i=1<<a,a=t[a],a>s&&(s=a),r&=~i}if(r=s,r=$e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*xN(r/1960))-r,10<r){e.timeoutHandle=zd(Dr.bind(null,e,pt,In),r);break}Dr(e,pt,In);break;case 5:Dr(e,pt,In);break;default:throw Error(B(329))}}}return yt(e,$e()),e.callbackNode===n?Nx.bind(null,e):null}function ou(e,t){var n=Gi;return e.current.memoizedState.isDehydrated&&(qr(e,t).flags|=256),e=sl(e,t),e!==2&&(t=pt,pt=n,t!==null&&au(t)),e}function au(e){pt===null?pt=e:pt.push.apply(pt,e)}function yN(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!on(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function or(e,t){for(t&=~Rf,t&=~Tl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rn(t),r=1<<n;e[n]=-1,t&=~r}}function zp(e){if(de&6)throw Error(B(327));Fs();var t=za(e,0);if(!(t&1))return yt(e,$e()),null;var n=sl(e,t);if(e.tag!==0&&n===2){var r=Ad(e);r!==0&&(t=r,n=ou(e,r))}if(n===1)throw n=ho,qr(e,0),or(e,t),yt(e,$e()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Dr(e,pt,In),yt(e,$e()),null}function Tf(e,t){var n=de;de|=1;try{return e(t)}finally{de=n,de===0&&(ai=$e()+500,El&&Pr())}}function ns(e){mr!==null&&mr.tag===0&&!(de&6)&&Fs();var t=de;de|=1;var n=$t.transition,r=pe;try{if($t.transition=null,pe=1,e)return e()}finally{pe=r,$t.transition=n,de=t,!(de&6)&&Pr()}}function Af(){St=Is.current,Ce(Is)}function qr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,qS(n)),De!==null)for(n=De.return;n!==null;){var r=n;switch(ff(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ha();break;case 3:ii(),Ce(vt),Ce(it),wf();break;case 5:bf(r);break;case 4:ii();break;case 13:Ce(Pe);break;case 19:Ce(Pe);break;case 10:gf(r.type._context);break;case 22:case 23:Af()}n=n.return}if(Ke=e,De=e=Sr(e.current,null),qe=St=t,Be=0,ho=null,Rf=Tl=ts=0,pt=Gi=null,zr!==null){for(t=0;t<zr.length;t++)if(n=zr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=s,r.next=a}n.pending=r}zr=null}return e}function kx(e,t){do{var n=De;try{if(hf(),Na.current=el,Za){for(var r=Ie.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Za=!1}if(es=0,Ge=Fe=Ie=null,Wi=!1,fo=0,_f.current=null,n===null||n.return===null){Be=1,ho=t,De=null;break}e:{var i=e,a=n.return,l=n,c=t;if(t=qe,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var m=Ep(a);if(m!==null){m.flags&=-257,_p(m,a,l,i,t),m.mode&1&&Cp(i,d,t),t=m,c=d;var y=t.updateQueue;if(y===null){var g=new Set;g.add(c),t.updateQueue=g}else y.add(c);break e}else{if(!(t&1)){Cp(i,d,t),If();break e}c=Error(B(426))}}else if(_e&&l.mode&1){var b=Ep(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),_p(b,a,l,i,t),mf(oi(c,l));break e}}i=c=oi(c,l),Be!==4&&(Be=2),Gi===null?Gi=[i]:Gi.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=ax(i,c,t);bp(i,x);break e;case 1:l=c;var v=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(br===null||!br.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=lx(i,l,t);bp(i,S);break e}}i=i.return}while(i!==null)}Ex(n)}catch(N){t=N,De===n&&n!==null&&(De=n=n.return);continue}break}while(!0)}function jx(){var e=tl.current;return tl.current=el,e===null?el:e}function If(){(Be===0||Be===3||Be===2)&&(Be=4),Ke===null||!(ts&268435455)&&!(Tl&268435455)||or(Ke,qe)}function sl(e,t){var n=de;de|=2;var r=jx();(Ke!==e||qe!==t)&&(In=null,qr(e,t));do try{bN();break}catch(s){kx(e,s)}while(!0);if(hf(),de=n,tl.current=r,De!==null)throw Error(B(261));return Ke=null,qe=0,Be}function bN(){for(;De!==null;)Cx(De)}function wN(){for(;De!==null&&!G1();)Cx(De)}function Cx(e){var t=Rx(e.alternate,e,St);e.memoizedProps=e.pendingProps,t===null?Ex(e):De=t,_f.current=null}function Ex(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=pN(n,t),n!==null){n.flags&=32767,De=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Be=6,De=null;return}}else if(n=mN(n,t,St),n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Be===0&&(Be=5)}function Dr(e,t,n){var r=pe,s=$t.transition;try{$t.transition=null,pe=1,SN(e,t,n,r)}finally{$t.transition=s,pe=r}return null}function SN(e,t,n,r){do Fs();while(mr!==null);if(de&6)throw Error(B(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(nS(e,i),e===Ke&&(De=Ke=null,qe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ia||(ia=!0,Px(Fa,function(){return Fs(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=$t.transition,$t.transition=null;var a=pe;pe=1;var l=de;de|=4,_f.current=null,gN(e,n),wx(n,e),VS(Dd),Ba=!!$d,Dd=$d=null,e.current=n,vN(n),K1(),de=l,pe=a,$t.transition=i}else e.current=n;if(ia&&(ia=!1,mr=e,rl=s),i=e.pendingLanes,i===0&&(br=null),Q1(n.stateNode),yt(e,$e()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(nl)throw nl=!1,e=su,su=null,e;return rl&1&&e.tag!==0&&Fs(),i=e.pendingLanes,i&1?e===iu?Ki++:(Ki=0,iu=e):Ki=0,Pr(),null}function Fs(){if(mr!==null){var e=av(rl),t=$t.transition,n=pe;try{if($t.transition=null,pe=16>e?16:e,mr===null)var r=!1;else{if(e=mr,mr=null,rl=0,de&6)throw Error(B(331));var s=de;for(de|=4,H=e.current;H!==null;){var i=H,a=i.child;if(H.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(H=d;H!==null;){var u=H;switch(u.tag){case 0:case 11:case 15:Hi(8,u,i)}var f=u.child;if(f!==null)f.return=u,H=f;else for(;H!==null;){u=H;var p=u.sibling,m=u.return;if(xx(u),u===d){H=null;break}if(p!==null){p.return=m,H=p;break}H=m}}}var y=i.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}H=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,H=a;else e:for(;H!==null;){if(i=H,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Hi(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,H=x;break e}H=i.return}}var v=e.current;for(H=v;H!==null;){a=H;var w=a.child;if(a.subtreeFlags&2064&&w!==null)w.return=a,H=w;else e:for(a=v;H!==null;){if(l=H,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Pl(9,l)}}catch(N){Le(l,l.return,N)}if(l===a){H=null;break e}var S=l.sibling;if(S!==null){S.return=l.return,H=S;break e}H=l.return}}if(de=s,Pr(),Nn&&typeof Nn.onPostCommitFiberRoot=="function")try{Nn.onPostCommitFiberRoot(Sl,e)}catch{}r=!0}return r}finally{pe=n,$t.transition=t}}return!1}function Bp(e,t,n){t=oi(n,t),t=ax(e,t,1),e=yr(e,t,1),t=ct(),e!==null&&(Eo(e,1,t),yt(e,t))}function Le(e,t,n){if(e.tag===3)Bp(e,e,n);else for(;t!==null;){if(t.tag===3){Bp(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(br===null||!br.has(r))){e=oi(n,e),e=lx(t,e,1),t=yr(t,e,1),e=ct(),t!==null&&(Eo(t,1,e),yt(t,e));break}}t=t.return}}function NN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ct(),e.pingedLanes|=e.suspendedLanes&n,Ke===e&&(qe&n)===n&&(Be===4||Be===3&&(qe&130023424)===qe&&500>$e()-Pf?qr(e,0):Rf|=n),yt(e,t)}function _x(e,t){t===0&&(e.mode&1?(t=qo,qo<<=1,!(qo&130023424)&&(qo=4194304)):t=1);var n=ct();e=Vn(e,t),e!==null&&(Eo(e,t,n),yt(e,n))}function kN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),_x(e,n)}function jN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),_x(e,n)}var Rx;Rx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||vt.current)ht=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ht=!1,fN(e,t,n);ht=!!(e.flags&131072)}else ht=!1,_e&&t.flags&1048576&&Iv(t,Ya,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ja(e,t),e=t.pendingProps;var s=ni(t,it.current);Ds(t,n),s=Nf(null,t,r,e,s,n);var i=kf();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,xt(r)?(i=!0,Ga(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,xf(t),s.updater=Rl,t.stateNode=s,s._reactInternals=t,Kd(t,r,e,n),t=Qd(null,t,r,!0,i,n)):(t.tag=0,_e&&i&&uf(t),at(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ja(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=EN(r),e=Qt(r,e),s){case 0:t=qd(null,t,r,e,n);break e;case 1:t=Tp(null,t,r,e,n);break e;case 11:t=Rp(null,t,r,e,n);break e;case 14:t=Pp(null,t,r,Qt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Qt(r,s),qd(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Qt(r,s),Tp(e,t,r,s,n);case 3:e:{if(fx(t),e===null)throw Error(B(387));r=t.pendingProps,i=t.memoizedState,s=i.element,Fv(e,t),Xa(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=oi(Error(B(423)),t),t=Ap(e,t,r,n,s);break e}else if(r!==s){s=oi(Error(B(424)),t),t=Ap(e,t,r,n,s);break e}else for(kt=xr(t.stateNode.containerInfo.firstChild),Ct=t,_e=!0,nn=null,n=$v(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ri(),r===s){t=Un(e,t,n);break e}at(e,t,r,n)}t=t.child}return t;case 5:return zv(t),e===null&&Wd(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,a=s.children,Fd(r,s)?a=null:i!==null&&Fd(r,i)&&(t.flags|=32),ux(e,t),at(e,t,a,n),t.child;case 6:return e===null&&Wd(t),null;case 13:return mx(e,t,n);case 4:return yf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=si(t,null,r,n):at(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Qt(r,s),Rp(e,t,r,s,n);case 7:return at(e,t,t.pendingProps,n),t.child;case 8:return at(e,t,t.pendingProps.children,n),t.child;case 12:return at(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,a=s.value,Se(qa,r._currentValue),r._currentValue=a,i!==null)if(on(i.value,a)){if(i.children===s.children&&!vt.current){t=Un(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Fn(-1,n&-n),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Hd(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(B(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Hd(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}at(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Ds(t,n),s=Dt(s),r=r(s),t.flags|=1,at(e,t,r,n),t.child;case 14:return r=t.type,s=Qt(r,t.pendingProps),s=Qt(r.type,s),Pp(e,t,r,s,n);case 15:return cx(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Qt(r,s),ja(e,t),t.tag=1,xt(r)?(e=!0,Ga(t)):e=!1,Ds(t,n),ox(t,r,s),Kd(t,r,s,n),Qd(null,t,r,!0,e,n);case 19:return px(e,t,n);case 22:return dx(e,t,n)}throw Error(B(156,t.tag))};function Px(e,t){return rv(e,t)}function CN(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lt(e,t,n,r){return new CN(e,t,n,r)}function Mf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function EN(e){if(typeof e=="function")return Mf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ju)return 11;if(e===Zu)return 14}return 2}function Sr(e,t){var n=e.alternate;return n===null?(n=Lt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function _a(e,t,n,r,s,i){var a=2;if(r=e,typeof e=="function")Mf(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Ns:return Qr(n.children,s,i,t);case Xu:a=8,s|=8;break;case vd:return e=Lt(12,n,t,s|2),e.elementType=vd,e.lanes=i,e;case xd:return e=Lt(13,n,t,s),e.elementType=xd,e.lanes=i,e;case yd:return e=Lt(19,n,t,s),e.elementType=yd,e.lanes=i,e;case zg:return Al(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Dg:a=10;break e;case Fg:a=9;break e;case Ju:a=11;break e;case Zu:a=14;break e;case rr:a=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=Lt(a,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Qr(e,t,n,r){return e=Lt(7,e,r,t),e.lanes=n,e}function Al(e,t,n,r){return e=Lt(22,e,r,t),e.elementType=zg,e.lanes=n,e.stateNode={isHidden:!1},e}function Wc(e,t,n){return e=Lt(6,e,null,t),e.lanes=n,e}function Hc(e,t,n){return t=Lt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _N(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jc(0),this.expirationTimes=jc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jc(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Of(e,t,n,r,s,i,a,l,c){return e=new _N(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Lt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xf(i),e}function RN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ss,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Tx(e){if(!e)return kr;e=e._reactInternals;e:{if(us(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(xt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(xt(n))return Tv(e,n,t)}return t}function Ax(e,t,n,r,s,i,a,l,c){return e=Of(n,r,!0,e,s,i,a,l,c),e.context=Tx(null),n=e.current,r=ct(),s=wr(n),i=Fn(r,s),i.callback=t??null,yr(n,i,s),e.current.lanes=s,Eo(e,s,r),yt(e,r),e}function Il(e,t,n,r){var s=t.current,i=ct(),a=wr(s);return n=Tx(n),t.context===null?t.context=n:t.pendingContext=n,t=Fn(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=yr(s,t,a),e!==null&&(sn(e,s,a,i),Sa(e,s,a)),a}function il(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Vp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Lf(e,t){Vp(e,t),(e=e.alternate)&&Vp(e,t)}function PN(){return null}var Ix=typeof reportError=="function"?reportError:function(e){console.error(e)};function $f(e){this._internalRoot=e}Ml.prototype.render=$f.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Il(e,t,null,null)};Ml.prototype.unmount=$f.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ns(function(){Il(null,e,null,null)}),t[Bn]=null}};function Ml(e){this._internalRoot=e}Ml.prototype.unstable_scheduleHydration=function(e){if(e){var t=dv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ir.length&&t!==0&&t<ir[n].priority;n++);ir.splice(n,0,e),n===0&&fv(e)}};function Df(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ol(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Up(){}function TN(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var d=il(a);i.call(d)}}var a=Ax(t,r,e,0,null,!1,!1,"",Up);return e._reactRootContainer=a,e[Bn]=a.current,oo(e.nodeType===8?e.parentNode:e),ns(),a}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var l=r;r=function(){var d=il(c);l.call(d)}}var c=Of(e,0,!1,null,null,!1,!1,"",Up);return e._reactRootContainer=c,e[Bn]=c.current,oo(e.nodeType===8?e.parentNode:e),ns(function(){Il(t,c,n,r)}),c}function Ll(e,t,n,r,s){var i=n._reactRootContainer;if(i){var a=i;if(typeof s=="function"){var l=s;s=function(){var c=il(a);l.call(c)}}Il(t,a,e,s)}else a=TN(n,t,e,s,r);return il(a)}lv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Oi(t.pendingLanes);n!==0&&(nf(t,n|1),yt(t,$e()),!(de&6)&&(ai=$e()+500,Pr()))}break;case 13:ns(function(){var r=Vn(e,1);if(r!==null){var s=ct();sn(r,e,1,s)}}),Lf(e,1)}};rf=function(e){if(e.tag===13){var t=Vn(e,134217728);if(t!==null){var n=ct();sn(t,e,134217728,n)}Lf(e,134217728)}};cv=function(e){if(e.tag===13){var t=wr(e),n=Vn(e,t);if(n!==null){var r=ct();sn(n,e,t,r)}Lf(e,t)}};dv=function(){return pe};uv=function(e,t){var n=pe;try{return pe=e,t()}finally{pe=n}};Rd=function(e,t,n){switch(t){case"input":if(Sd(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Cl(r);if(!s)throw Error(B(90));Vg(r),Sd(r,s)}}}break;case"textarea":Wg(e,n);break;case"select":t=n.value,t!=null&&Ms(e,!!n.multiple,t,!1)}};Xg=Tf;Jg=ns;var AN={usingClientEntryPoint:!1,Events:[Ro,Es,Cl,qg,Qg,Tf]},_i={findFiberByHostInstance:Fr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},IN={bundleType:_i.bundleType,version:_i.version,rendererPackageName:_i.rendererPackageName,rendererConfig:_i.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Kn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=tv(e),e===null?null:e.stateNode},findFiberByHostInstance:_i.findFiberByHostInstance||PN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oa.isDisabled&&oa.supportsFiber)try{Sl=oa.inject(IN),Nn=oa}catch{}}Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=AN;Rt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Df(t))throw Error(B(200));return RN(e,t,null,n)};Rt.createRoot=function(e,t){if(!Df(e))throw Error(B(299));var n=!1,r="",s=Ix;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Of(e,1,!1,null,null,n,!1,r,s),e[Bn]=t.current,oo(e.nodeType===8?e.parentNode:e),new $f(t)};Rt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=tv(t),e=e===null?null:e.stateNode,e};Rt.flushSync=function(e){return ns(e)};Rt.hydrate=function(e,t,n){if(!Ol(t))throw Error(B(200));return Ll(null,e,t,!0,n)};Rt.hydrateRoot=function(e,t,n){if(!Df(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",a=Ix;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Ax(t,null,e,1,n??null,s,!1,i,a),e[Bn]=t.current,oo(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Ml(t)};Rt.render=function(e,t,n){if(!Ol(t))throw Error(B(200));return Ll(null,e,t,!1,n)};Rt.unmountComponentAtNode=function(e){if(!Ol(e))throw Error(B(40));return e._reactRootContainer?(ns(function(){Ll(null,null,e,!1,function(){e._reactRootContainer=null,e[Bn]=null})}),!0):!1};Rt.unstable_batchedUpdates=Tf;Rt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ol(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return Ll(e,t,n,!1,r)};Rt.version="18.3.1-next-f1338f8080-20240426";function Mx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mx)}catch(e){console.error(e)}}Mx(),Mg.exports=Rt;var fs=Mg.exports;const Ox=Sg(fs);var Lx,Wp=fs;Lx=Wp.createRoot,Wp.hydrateRoot;var $l=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Dl=typeof window>"u"||"Deno"in globalThis;function Xt(){}function MN(e,t){return typeof e=="function"?e(t):e}function ON(e){return typeof e=="number"&&e>=0&&e!==1/0}function LN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function lu(e,t){return typeof e=="function"?e(t):e}function $N(e,t){return typeof e=="function"?e(t):e}function Hp(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==Ff(a,t.options))return!1}else if(!vo(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||s&&s!==t.state.fetchStatus||i&&!i(t))}function Gp(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(go(t.options.mutationKey)!==go(i))return!1}else if(!vo(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Ff(e,t){return((t==null?void 0:t.queryKeyHashFn)||go)(e)}function go(e){return JSON.stringify(e,(t,n)=>cu(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function vo(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>vo(e[n],t[n])):!1}function $x(e,t){if(e===t)return e;const n=Kp(e)&&Kp(t);if(n||cu(e)&&cu(t)){const r=n?e:Object.keys(e),s=r.length,i=n?t:Object.keys(t),a=i.length,l=n?[]:{},c=new Set(r);let d=0;for(let u=0;u<a;u++){const f=n?u:i[u];(!n&&c.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,d++):(l[f]=$x(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&d++)}return s===a&&d===s?e:l}return t}function Kp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cu(e){if(!Yp(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Yp(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Yp(e){return Object.prototype.toString.call(e)==="[object Object]"}function DN(e){return new Promise(t=>{setTimeout(t,e)})}function FN(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?$x(e,t):t}function zN(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function BN(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zf=Symbol();function Dx(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===zf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Ur,ar,Ks,pg,VN=(pg=class extends $l{constructor(){super();ue(this,Ur);ue(this,ar);ue(this,Ks);ne(this,Ks,t=>{if(!Dl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){M(this,ar)||this.setEventListener(M(this,Ks))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,ar))==null||t.call(this),ne(this,ar,void 0))}setEventListener(t){var n;ne(this,Ks,t),(n=M(this,ar))==null||n.call(this),ne(this,ar,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){M(this,Ur)!==t&&(ne(this,Ur,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof M(this,Ur)=="boolean"?M(this,Ur):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ur=new WeakMap,ar=new WeakMap,Ks=new WeakMap,pg),Fx=new VN,Ys,lr,qs,hg,UN=(hg=class extends $l{constructor(){super();ue(this,Ys,!0);ue(this,lr);ue(this,qs);ne(this,qs,t=>{if(!Dl&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){M(this,lr)||this.setEventListener(M(this,qs))}onUnsubscribe(){var t;this.hasListeners()||((t=M(this,lr))==null||t.call(this),ne(this,lr,void 0))}setEventListener(t){var n;ne(this,qs,t),(n=M(this,lr))==null||n.call(this),ne(this,lr,t(this.setOnline.bind(this)))}setOnline(t){M(this,Ys)!==t&&(ne(this,Ys,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return M(this,Ys)}},Ys=new WeakMap,lr=new WeakMap,qs=new WeakMap,hg),ol=new UN;function WN(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function HN(e){return Math.min(1e3*2**e,3e4)}function zx(e){return(e??"online")==="online"?ol.isOnline():!0}var Bx=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Gc(e){return e instanceof Bx}function Vx(e){let t=!1,n=0,r=!1,s;const i=WN(),a=g=>{var b;r||(p(new Bx(g)),(b=e.abort)==null||b.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>Fx.isFocused()&&(e.networkMode==="always"||ol.isOnline())&&e.canRun(),u=()=>zx(e.networkMode)&&e.canRun(),f=g=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,g),s==null||s(),i.resolve(g))},p=g=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,g),s==null||s(),i.reject(g))},m=()=>new Promise(g=>{var b;s=x=>{(r||d())&&g(x)},(b=e.onPause)==null||b.call(e)}).then(()=>{var g;s=void 0,r||(g=e.onContinue)==null||g.call(e)}),y=()=>{if(r)return;let g;const b=n===0?e.initialPromise:void 0;try{g=b??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{var k;if(r)return;const v=e.retry??(Dl?0:3),w=e.retryDelay??HN,S=typeof w=="function"?w(n,x):w,N=v===!0||typeof v=="number"&&n<v||typeof v=="function"&&v(n,x);if(t||!N){p(x);return}n++,(k=e.onFail)==null||k.call(e,n,x),DN(S).then(()=>d()?void 0:m()).then(()=>{t?p(x):y()})})};return{promise:i,cancel:a,continue:()=>(s==null||s(),i),cancelRetry:l,continueRetry:c,canStart:u,start:()=>(u()?y():m().then(y),i)}}var GN=e=>setTimeout(e,0);function KN(){let e=[],t=0,n=l=>{l()},r=l=>{l()},s=GN;const i=l=>{t?e.push(l):s(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&s(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{s=l}}}var lt=KN(),Wr,gg,Ux=(gg=class{constructor(){ue(this,Wr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ON(this.gcTime)&&ne(this,Wr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Dl?1/0:5*60*1e3))}clearGcTimeout(){M(this,Wr)&&(clearTimeout(M(this,Wr)),ne(this,Wr,void 0))}},Wr=new WeakMap,gg),Qs,Hr,It,Gr,nt,ko,Kr,Zt,An,vg,YN=(vg=class extends Ux{constructor(t){super();ue(this,Zt);ue(this,Qs);ue(this,Hr);ue(this,It);ue(this,Gr);ue(this,nt);ue(this,ko);ue(this,Kr);ne(this,Kr,!1),ne(this,ko,t.defaultOptions),this.setOptions(t.options),this.observers=[],ne(this,Gr,t.client),ne(this,It,M(this,Gr).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ne(this,Qs,QN(this.options)),this.state=t.state??M(this,Qs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=M(this,nt))==null?void 0:t.promise}setOptions(t){this.options={...M(this,ko),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&M(this,It).remove(this)}setData(t,n){const r=FN(this.state.data,t,this.options);return Ze(this,Zt,An).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ze(this,Zt,An).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=M(this,nt))==null?void 0:r.promise;return(s=M(this,nt))==null||s.cancel(t),n?n.then(Xt).catch(Xt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(M(this,Qs))}isActive(){return this.observers.some(t=>$N(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>lu(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!LN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,nt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=M(this,nt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),M(this,It).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(M(this,nt)&&(M(this,Kr)?M(this,nt).cancel({revert:!0}):M(this,nt).cancelRetry()),this.scheduleGc()),M(this,It).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ze(this,Zt,An).call(this,{type:"invalidate"})}fetch(t,n){var d,u,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(M(this,nt))return M(this,nt).continueRetry(),M(this,nt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(m=>m.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(ne(this,Kr,!0),r.signal)})},i=()=>{const p=Dx(this.options,n),y=(()=>{const g={client:M(this,Gr),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return ne(this,Kr,!1),this.options.persister?this.options.persister(p,y,this):p(y)},l=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:M(this,Gr),state:this.state,fetchFn:i};return s(p),p})();(d=this.options.behavior)==null||d.onFetch(l,this),ne(this,Hr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=l.fetchOptions)==null?void 0:u.meta))&&Ze(this,Zt,An).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=p=>{var m,y,g,b;Gc(p)&&p.silent||Ze(this,Zt,An).call(this,{type:"error",error:p}),Gc(p)||((y=(m=M(this,It).config).onError)==null||y.call(m,p,this),(b=(g=M(this,It).config).onSettled)==null||b.call(g,this.state.data,p,this)),this.scheduleGc()};return ne(this,nt,Vx({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var m,y,g,b;if(p===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(x){c(x);return}(y=(m=M(this,It).config).onSuccess)==null||y.call(m,p,this),(b=(g=M(this,It).config).onSettled)==null||b.call(g,p,this.state.error,this),this.scheduleGc()},onError:c,onFail:(p,m)=>{Ze(this,Zt,An).call(this,{type:"failed",failureCount:p,error:m})},onPause:()=>{Ze(this,Zt,An).call(this,{type:"pause"})},onContinue:()=>{Ze(this,Zt,An).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),M(this,nt).start()}},Qs=new WeakMap,Hr=new WeakMap,It=new WeakMap,Gr=new WeakMap,nt=new WeakMap,ko=new WeakMap,Kr=new WeakMap,Zt=new WeakSet,An=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...qN(r.data,this.options),fetchMeta:t.meta??null};case"success":return ne(this,Hr,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Gc(s)&&s.revert&&M(this,Hr)?{...M(this,Hr),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),lt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),M(this,It).notify({query:this,type:"updated",action:t})})},vg);function qN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:zx(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function QN(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var mn,xg,XN=(xg=class extends $l{constructor(t={}){super();ue(this,mn);this.config=t,ne(this,mn,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??Ff(s,n);let a=this.get(i);return a||(a=new YN({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(a)),a}add(t){M(this,mn).has(t.queryHash)||(M(this,mn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=M(this,mn).get(t.queryHash);n&&(t.destroy(),n===t&&M(this,mn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){lt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return M(this,mn).get(t)}getAll(){return[...M(this,mn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Hp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Hp(t,r)):n}notify(t){lt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},mn=new WeakMap,xg),pn,ot,Yr,hn,tr,yg,JN=(yg=class extends Ux{constructor(t){super();ue(this,hn);ue(this,pn);ue(this,ot);ue(this,Yr);this.mutationId=t.mutationId,ne(this,ot,t.mutationCache),ne(this,pn,[]),this.state=t.state||ZN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){M(this,pn).includes(t)||(M(this,pn).push(t),this.clearGcTimeout(),M(this,ot).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ne(this,pn,M(this,pn).filter(n=>n!==t)),this.scheduleGc(),M(this,ot).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){M(this,pn).length||(this.state.status==="pending"?this.scheduleGc():M(this,ot).remove(this))}continue(){var t;return((t=M(this,Yr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,a,l,c,d,u,f,p,m,y,g,b,x,v,w,S,N,k,j,C;const n=()=>{Ze(this,hn,tr).call(this,{type:"continue"})};ne(this,Yr,Vx({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,R)=>{Ze(this,hn,tr).call(this,{type:"failed",failureCount:E,error:R})},onPause:()=>{Ze(this,hn,tr).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>M(this,ot).canRun(this)}));const r=this.state.status==="pending",s=!M(this,Yr).canStart();try{if(r)n();else{Ze(this,hn,tr).call(this,{type:"pending",variables:t,isPaused:s}),await((a=(i=M(this,ot).config).onMutate)==null?void 0:a.call(i,t,this));const R=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));R!==this.state.context&&Ze(this,hn,tr).call(this,{type:"pending",context:R,variables:t,isPaused:s})}const E=await M(this,Yr).start();return await((u=(d=M(this,ot).config).onSuccess)==null?void 0:u.call(d,E,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,E,t,this.state.context)),await((y=(m=M(this,ot).config).onSettled)==null?void 0:y.call(m,E,null,this.state.variables,this.state.context,this)),await((b=(g=this.options).onSettled)==null?void 0:b.call(g,E,null,t,this.state.context)),Ze(this,hn,tr).call(this,{type:"success",data:E}),E}catch(E){try{throw await((v=(x=M(this,ot).config).onError)==null?void 0:v.call(x,E,t,this.state.context,this)),await((S=(w=this.options).onError)==null?void 0:S.call(w,E,t,this.state.context)),await((k=(N=M(this,ot).config).onSettled)==null?void 0:k.call(N,void 0,E,this.state.variables,this.state.context,this)),await((C=(j=this.options).onSettled)==null?void 0:C.call(j,void 0,E,t,this.state.context)),E}finally{Ze(this,hn,tr).call(this,{type:"error",error:E})}}finally{M(this,ot).runNext(this)}}},pn=new WeakMap,ot=new WeakMap,Yr=new WeakMap,hn=new WeakSet,tr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),lt.batch(()=>{M(this,pn).forEach(r=>{r.onMutationUpdate(t)}),M(this,ot).notify({mutation:this,type:"updated",action:t})})},yg);function ZN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var On,en,jo,bg,ek=(bg=class extends $l{constructor(t={}){super();ue(this,On);ue(this,en);ue(this,jo);this.config=t,ne(this,On,new Set),ne(this,en,new Map),ne(this,jo,0)}build(t,n,r){const s=new JN({mutationCache:this,mutationId:++Uo(this,jo)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){M(this,On).add(t);const n=aa(t);if(typeof n=="string"){const r=M(this,en).get(n);r?r.push(t):M(this,en).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(M(this,On).delete(t)){const n=aa(t);if(typeof n=="string"){const r=M(this,en).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&M(this,en).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=aa(t);if(typeof n=="string"){const r=M(this,en).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=aa(t);if(typeof n=="string"){const s=(r=M(this,en).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){lt.batch(()=>{M(this,On).forEach(t=>{this.notify({type:"removed",mutation:t})}),M(this,On).clear(),M(this,en).clear()})}getAll(){return Array.from(M(this,On))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Gp(n,r))}findAll(t={}){return this.getAll().filter(n=>Gp(t,n))}notify(t){lt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return lt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Xt))))}},On=new WeakMap,en=new WeakMap,jo=new WeakMap,bg);function aa(e){var t;return(t=e.options.scope)==null?void 0:t.id}function qp(e){return{onFetch:(t,n)=>{var u,f,p,m,y;const r=t.options,s=(p=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((m=t.state.data)==null?void 0:m.pages)||[],a=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},x=Dx(t.options,t.fetchOptions),v=async(w,S,N)=>{if(g)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const j=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:S,direction:N?"backward":"forward",meta:t.options.meta};return b(P),P})(),C=await x(j),{maxPages:E}=t.options,R=N?BN:zN;return{pages:R(w.pages,C,E),pageParams:R(w.pageParams,S,E)}};if(s&&i.length){const w=s==="backward",S=w?tk:Qp,N={pages:i,pageParams:a},k=S(r,N);l=await v(N,k,w)}else{const w=e??i.length;do{const S=c===0?a[0]??r.initialPageParam:Qp(r,l);if(c>0&&S==null)break;l=await v(l,S),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function Qp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function tk(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Oe,cr,dr,Xs,Js,ur,Zs,ei,wg,nk=(wg=class{constructor(e={}){ue(this,Oe);ue(this,cr);ue(this,dr);ue(this,Xs);ue(this,Js);ue(this,ur);ue(this,Zs);ue(this,ei);ne(this,Oe,e.queryCache||new XN),ne(this,cr,e.mutationCache||new ek),ne(this,dr,e.defaultOptions||{}),ne(this,Xs,new Map),ne(this,Js,new Map),ne(this,ur,0)}mount(){Uo(this,ur)._++,M(this,ur)===1&&(ne(this,Zs,Fx.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Oe).onFocus())})),ne(this,ei,ol.subscribe(async e=>{e&&(await this.resumePausedMutations(),M(this,Oe).onOnline())})))}unmount(){var e,t;Uo(this,ur)._--,M(this,ur)===0&&((e=M(this,Zs))==null||e.call(this),ne(this,Zs,void 0),(t=M(this,ei))==null||t.call(this),ne(this,ei,void 0))}isFetching(e){return M(this,Oe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return M(this,cr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Oe).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=M(this,Oe).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(lu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return M(this,Oe).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=M(this,Oe).get(r.queryHash),i=s==null?void 0:s.state.data,a=MN(t,i);if(a!==void 0)return M(this,Oe).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return lt.batch(()=>M(this,Oe).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=M(this,Oe).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=M(this,Oe);lt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=M(this,Oe);return lt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=lt.batch(()=>M(this,Oe).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Xt).catch(Xt)}invalidateQueries(e,t={}){return lt.batch(()=>(M(this,Oe).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=lt.batch(()=>M(this,Oe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Xt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Xt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=M(this,Oe).build(this,t);return n.isStaleByTime(lu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Xt).catch(Xt)}fetchInfiniteQuery(e){return e.behavior=qp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Xt).catch(Xt)}ensureInfiniteQueryData(e){return e.behavior=qp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ol.isOnline()?M(this,cr).resumePausedMutations():Promise.resolve()}getQueryCache(){return M(this,Oe)}getMutationCache(){return M(this,cr)}getDefaultOptions(){return M(this,dr)}setDefaultOptions(e){ne(this,dr,e)}setQueryDefaults(e,t){M(this,Xs).set(go(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...M(this,Xs).values()],n={};return t.forEach(r=>{vo(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){M(this,Js).set(go(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...M(this,Js).values()],n={};return t.forEach(r=>{vo(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...M(this,dr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ff(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zf&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...M(this,dr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){M(this,Oe).clear(),M(this,cr).clear()}},Oe=new WeakMap,cr=new WeakMap,dr=new WeakMap,Xs=new WeakMap,Js=new WeakMap,ur=new WeakMap,Zs=new WeakMap,ei=new WeakMap,wg),rk=h.createContext(void 0),sk=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),o.jsx(rk.Provider,{value:e,children:t}));/**
|
|
41
|
+
* @remix-run/router v1.23.0
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) Remix Software Inc.
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the MIT license found in the
|
|
46
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
47
|
+
*
|
|
48
|
+
* @license MIT
|
|
49
|
+
*/function al(){return al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},al.apply(this,arguments)}var pr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(pr||(pr={}));const Xp="popstate";function ik(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:a,hash:l}=r.location;return du("",{pathname:i,search:a,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Hx(s)}return ak(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Wx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function ok(){return Math.random().toString(36).substr(2,8)}function Jp(e,t){return{usr:e.state,key:e.key,idx:t}}function du(e,t,n,r){return n===void 0&&(n=null),al({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Fl(t):t,{state:n,key:t&&t.key||r||ok()})}function Hx(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Fl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ak(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,a=s.history,l=pr.Pop,c=null,d=u();d==null&&(d=0,a.replaceState(al({},a.state,{idx:d}),""));function u(){return(a.state||{idx:null}).idx}function f(){l=pr.Pop;let b=u(),x=b==null?null:b-d;d=b,c&&c({action:l,location:g.location,delta:x})}function p(b,x){l=pr.Push;let v=du(g.location,b,x);d=u()+1;let w=Jp(v,d),S=g.createHref(v);try{a.pushState(w,"",S)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(S)}i&&c&&c({action:l,location:g.location,delta:1})}function m(b,x){l=pr.Replace;let v=du(g.location,b,x);d=u();let w=Jp(v,d),S=g.createHref(v);a.replaceState(w,"",S),i&&c&&c({action:l,location:g.location,delta:0})}function y(b){let x=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof b=="string"?b:Hx(b);return v=v.replace(/ $/,"%20"),bt(x,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,x)}let g={get action(){return l},get location(){return e(s,a)},listen(b){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(Xp,f),c=b,()=>{s.removeEventListener(Xp,f),c=null}},createHref(b){return t(s,b)},createURL:y,encodeLocation(b){let x=y(b);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:m,go(b){return a.go(b)}};return g}var Zp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Zp||(Zp={}));function lk(e,t,n){return n===void 0&&(n="/"),ck(e,t,n,!1)}function ck(e,t,n,r){let s=typeof t=="string"?Fl(t):t,i=Yx(s.pathname||"/",n);if(i==null)return null;let a=Gx(e);dk(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let d=wk(i);l=yk(a[c],d,r)}return l}function Gx(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(bt(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=zs([r,c.relativePath]),u=n.concat(c);i.children&&i.children.length>0&&(bt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),Gx(i.children,t,u,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:vk(d,i.index),routesMeta:u})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,a);else for(let c of Kx(i.path))s(i,a,c)}),t}function Kx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let a=Kx(r.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function dk(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:xk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uk=/^:[\w-]+$/,fk=3,mk=2,pk=1,hk=10,gk=-2,eh=e=>e==="*";function vk(e,t){let n=e.split("/"),r=n.length;return n.some(eh)&&(r+=gk),t&&(r+=mk),n.filter(s=>!eh(s)).reduce((s,i)=>s+(uk.test(i)?fk:i===""?pk:hk),r)}function xk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function yk(e,t,n){let{routesMeta:r}=e,s={},i="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],d=l===r.length-1,u=i==="/"?t:t.slice(i.length)||"/",f=th({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),p=c.route;if(!f&&d&&n&&!r[r.length-1].route.index&&(f=th({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},u)),!f)return null;Object.assign(s,f.params),a.push({params:s,pathname:zs([i,f.pathname]),pathnameBase:Sk(zs([i,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(i=zs([i,f.pathnameBase]))}return a}function th(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=bk(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],a=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:r.reduce((d,u,f)=>{let{paramName:p,isOptional:m}=u;if(p==="*"){let g=l[f]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const y=l[f];return m&&!y?d[p]=void 0:d[p]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:a,pattern:e}}function bk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Wx(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function wk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Wx(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Yx(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const zs=e=>e.join("/").replace(/\/\/+/g,"/"),Sk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");function Nk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qx=["post","put","patch","delete"];new Set(qx);const kk=["get",...qx];new Set(kk);/**
|
|
50
|
+
* React Router v6.30.1
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/function ll(){return ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ll.apply(this,arguments)}const jk=h.createContext(null),Ck=h.createContext(null),Qx=h.createContext(null),zl=h.createContext(null),Bl=h.createContext({outlet:null,matches:[],isDataRoute:!1}),Xx=h.createContext(null);function Bf(){return h.useContext(zl)!=null}function Jx(){return Bf()||bt(!1),h.useContext(zl).location}function Ek(e,t){return _k(e,t)}function _k(e,t,n,r){Bf()||bt(!1);let{navigator:s}=h.useContext(Qx),{matches:i}=h.useContext(Bl),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=Jx(),u;if(t){var f;let b=typeof t=="string"?Fl(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||bt(!1),u=b}else u=d;let p=u.pathname||"/",m=p;if(c!=="/"){let b=c.replace(/^\//,"").split("/");m="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let y=lk(e,{pathname:m}),g=Ik(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:zs([c,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:zs([c,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,n,r);return t&&g?h.createElement(zl.Provider,{value:{location:ll({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:pr.Pop}},g):g}function Rk(){let e=$k(),t=Nk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:s},n):null,null)}const Pk=h.createElement(Rk,null);class Tk extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(Bl.Provider,{value:this.props.routeContext},h.createElement(Xx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ak(e){let{routeContext:t,match:n,children:r}=e,s=h.useContext(jk);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(Bl.Provider,{value:t},r)}function Ik(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(s=n)==null?void 0:s.errors;if(l!=null){let u=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);u>=0||bt(!1),a=a.slice(0,Math.min(a.length,u+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<a.length;u++){let f=a[u];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(d=u),f.route.id){let{loaderData:p,errors:m}=n,y=f.route.loader&&p[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||y){c=!0,d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((u,f,p)=>{let m,y=!1,g=null,b=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||Pk,c&&(d<0&&p===0?(y=!0,b=null):d===p&&(y=!0,b=f.route.hydrateFallbackElement||null)));let x=t.concat(a.slice(0,p+1)),v=()=>{let w;return m?w=g:y?w=b:f.route.Component?w=h.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=u,h.createElement(Ak,{match:f,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?h.createElement(Tk,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:v(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):v()},null)}var uu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(uu||{});function Mk(e){let t=h.useContext(Ck);return t||bt(!1),t}function Ok(e){let t=h.useContext(Bl);return t||bt(!1),t}function Lk(e){let t=Ok(),n=t.matches[t.matches.length-1];return n.route.id||bt(!1),n.route.id}function $k(){var e;let t=h.useContext(Xx),n=Mk(uu.UseRouteError),r=Lk(uu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Dk(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ra(e){bt(!1)}function Fk(e){let{basename:t="/",children:n=null,location:r,navigationType:s=pr.Pop,navigator:i,static:a=!1,future:l}=e;Bf()&&bt(!1);let c=t.replace(/^\/*/,"/"),d=h.useMemo(()=>({basename:c,navigator:i,static:a,future:ll({v7_relativeSplatPath:!1},l)}),[c,l,i,a]);typeof r=="string"&&(r=Fl(r));let{pathname:u="/",search:f="",hash:p="",state:m=null,key:y="default"}=r,g=h.useMemo(()=>{let b=Yx(u,c);return b==null?null:{location:{pathname:b,search:f,hash:p,state:m,key:y},navigationType:s}},[c,u,f,p,m,y,s]);return g==null?null:h.createElement(Qx.Provider,{value:d},h.createElement(zl.Provider,{children:n,value:g}))}function zk(e){let{children:t,location:n}=e;return Ek(fu(t),n)}new Promise(()=>{});function fu(e,t){t===void 0&&(t=[]);let n=[];return h.Children.forEach(e,(r,s)=>{if(!h.isValidElement(r))return;let i=[...t,s];if(r.type===h.Fragment){n.push.apply(n,fu(r.props.children,i));return}r.type!==Ra&&bt(!1),!r.props.index||!r.props.children||bt(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=fu(r.props.children,i)),n.push(a)}),n}/**
|
|
59
|
+
* React Router DOM v6.30.1
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) Remix Software Inc.
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the MIT license found in the
|
|
64
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
65
|
+
*
|
|
66
|
+
* @license MIT
|
|
67
|
+
*/const Bk="6";try{window.__reactRouterVersion=Bk}catch{}const Vk="startTransition",nh=Ku[Vk];function Uk(e){let{basename:t,children:n,future:r,window:s}=e,i=h.useRef();i.current==null&&(i.current=ik({window:s,v5Compat:!0}));let a=i.current,[l,c]=h.useState({action:a.action,location:a.location}),{v7_startTransition:d}=r||{},u=h.useCallback(f=>{d&&nh?nh(()=>c(f)):c(f)},[c,d]);return h.useLayoutEffect(()=>a.listen(u),[a,u]),h.useEffect(()=>Dk(r),[r]),h.createElement(Fk,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:a,future:r})}var rh;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(rh||(rh={}));var sh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(sh||(sh={}));var ih=["light","dark"],Wk="(prefers-color-scheme: dark)",Hk=h.createContext(void 0),Gk={setTheme:e=>{},themes:[]},Kk=()=>{var e;return(e=h.useContext(Hk))!=null?e:Gk};h.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:a,attrs:l,nonce:c})=>{let d=i==="system",u=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?ih.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(y,g=!1,b=!0)=>{let x=a?a[y]:y,v=g?y+"|| ''":`'${x}'`,w="";return s&&b&&!g&&ih.includes(y)&&(w+=`d.style.colorScheme = '${y}';`),n==="class"?g||x?w+=`c.add(${v})`:w+="null":x&&(w+=`d[s](n,${v})`),w},m=e?`!function(){${u}${p(e)}}()`:r?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${d})){var t='${Wk}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${d?"":"else{"+p(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${f}}catch(t){}}();`;return h.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var Yk=e=>{switch(e){case"success":return Xk;case"info":return Zk;case"warning":return Jk;case"error":return ej;default:return null}},qk=Array(12).fill(0),Qk=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},qk.map((n,r)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Xk=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Jk=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Zk=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),ej=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),tj=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),nj=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},mu=1,rj=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:mu++,i=this.toasts.find(l=>l.id===s),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(l=>l.id===s?(this.publish({...l,...e,id:s,title:n}),{...l,...e,id:s,dismissible:a,title:n}):l):this.addToast({title:n,...r,dismissible:a,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,i,a=r.then(async c=>{if(i=["resolve",c],U.isValidElement(c))s=!1,this.create({id:n,type:"default",message:c});else if(ij(c)&&!c.ok){s=!1;let d=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:d,description:u})}else if(t.success!==void 0){s=!1;let d=typeof t.success=="function"?await t.success(c):t.success,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:d,description:u})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){s=!1;let d=typeof t.error=="function"?await t.error(c):t.error,u=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:d,description:u})}}).finally(()=>{var c;s&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,d)=>a.then(()=>i[0]==="reject"?d(i[1]):c(i[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||mu++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},mt=new rj,sj=(e,t)=>{let n=(t==null?void 0:t.id)||mu++;return mt.addToast({title:e,...t,id:n}),n},ij=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",oj=sj,aj=()=>mt.toasts,lj=()=>mt.getActiveToasts();Object.assign(oj,{success:mt.success,info:mt.info,warning:mt.warning,error:mt.error,custom:mt.custom,message:mt.message,promise:mt.promise,dismiss:mt.dismiss,loading:mt.loading},{getHistory:aj,getToasts:lj});function cj(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}cj(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
|
|
68
|
+
`);function la(e){return e.label!==void 0}var dj=3,uj="32px",fj="16px",oh=4e3,mj=356,pj=14,hj=20,gj=200;function Yt(...e){return e.filter(Boolean).join(" ")}function vj(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var xj=e=>{var t,n,r,s,i,a,l,c,d,u,f;let{invert:p,toast:m,unstyled:y,interacting:g,setHeights:b,visibleToasts:x,heights:v,index:w,toasts:S,expanded:N,removeToast:k,defaultRichColors:j,closeButton:C,style:E,cancelButtonStyle:R,actionButtonStyle:P,className:T="",descriptionClassName:L="",duration:I,position:F,gap:O,loadingIcon:V,expandByDefault:_,classNames:A,icons:D,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:G}=e,[J,Z]=U.useState(null),[me,be]=U.useState(null),[W,ce]=U.useState(!1),[xe,le]=U.useState(!1),[z,X]=U.useState(!1),[he,oe]=U.useState(!1),[ft,Ue]=U.useState(!1),[We,Vt]=U.useState(0),[wt,zo]=U.useState(0),He=U.useRef(m.duration||I||oh),Bo=U.useRef(null),ee=U.useRef(null),Ne=w===0,fe=w+1<=x,ge=m.type,Tt=m.dismissible!==!1,At=m.className||"",we=m.descriptionClassName||"",ps=U.useMemo(()=>v.findIndex(te=>te.toastId===m.id)||0,[v,m.id]),Vo=U.useMemo(()=>{var te;return(te=m.closeButton)!=null?te:C},[m.closeButton,C]),dn=U.useMemo(()=>m.duration||I||oh,[m.duration,I]),vc=U.useRef(0),hs=U.useRef(0),Am=U.useRef(0),gs=U.useRef(null),[n1,r1]=F.split("-"),Im=U.useMemo(()=>v.reduce((te,ve,Ee)=>Ee>=ps?te:te+ve.height,0),[v,ps]),Mm=nj(),s1=m.invert||p,xc=ge==="loading";hs.current=U.useMemo(()=>ps*O+Im,[ps,Im]),U.useEffect(()=>{He.current=dn},[dn]),U.useEffect(()=>{ce(!0)},[]),U.useEffect(()=>{let te=ee.current;if(te){let ve=te.getBoundingClientRect().height;return zo(ve),b(Ee=>[{toastId:m.id,height:ve,position:m.position},...Ee]),()=>b(Ee=>Ee.filter(Ut=>Ut.toastId!==m.id))}},[b,m.id]),U.useLayoutEffect(()=>{if(!W)return;let te=ee.current,ve=te.style.height;te.style.height="auto";let Ee=te.getBoundingClientRect().height;te.style.height=ve,zo(Ee),b(Ut=>Ut.find(Wt=>Wt.toastId===m.id)?Ut.map(Wt=>Wt.toastId===m.id?{...Wt,height:Ee}:Wt):[{toastId:m.id,height:Ee,position:m.position},...Ut])},[W,m.title,m.description,b,m.id]);let qn=U.useCallback(()=>{le(!0),Vt(hs.current),b(te=>te.filter(ve=>ve.toastId!==m.id)),setTimeout(()=>{k(m)},gj)},[m,k,b,hs]);U.useEffect(()=>{if(m.promise&&ge==="loading"||m.duration===1/0||m.type==="loading")return;let te;return N||g||G&&Mm?(()=>{if(Am.current<vc.current){let ve=new Date().getTime()-vc.current;He.current=He.current-ve}Am.current=new Date().getTime()})():He.current!==1/0&&(vc.current=new Date().getTime(),te=setTimeout(()=>{var ve;(ve=m.onAutoClose)==null||ve.call(m,m),qn()},He.current)),()=>clearTimeout(te)},[N,g,m,ge,G,Mm,qn]),U.useEffect(()=>{m.delete&&qn()},[qn,m.delete]);function i1(){var te,ve,Ee;return D!=null&&D.loading?U.createElement("div",{className:Yt(A==null?void 0:A.loader,(te=m==null?void 0:m.classNames)==null?void 0:te.loader,"sonner-loader"),"data-visible":ge==="loading"},D.loading):V?U.createElement("div",{className:Yt(A==null?void 0:A.loader,(ve=m==null?void 0:m.classNames)==null?void 0:ve.loader,"sonner-loader"),"data-visible":ge==="loading"},V):U.createElement(Qk,{className:Yt(A==null?void 0:A.loader,(Ee=m==null?void 0:m.classNames)==null?void 0:Ee.loader),visible:ge==="loading"})}return U.createElement("li",{tabIndex:0,ref:ee,className:Yt(T,At,A==null?void 0:A.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,A==null?void 0:A.default,A==null?void 0:A[ge],(n=m==null?void 0:m.classNames)==null?void 0:n[ge]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:j,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":W,"data-promise":!!m.promise,"data-swiped":ft,"data-removed":xe,"data-visible":fe,"data-y-position":n1,"data-x-position":r1,"data-index":w,"data-front":Ne,"data-swiping":z,"data-dismissible":Tt,"data-type":ge,"data-invert":s1,"data-swipe-out":he,"data-swipe-direction":me,"data-expanded":!!(N||_&&W),style:{"--index":w,"--toasts-before":w,"--z-index":S.length-w,"--offset":`${xe?We:hs.current}px`,"--initial-height":_?"auto":`${wt}px`,...E,...m.style},onDragEnd:()=>{X(!1),Z(null),gs.current=null},onPointerDown:te=>{xc||!Tt||(Bo.current=new Date,Vt(hs.current),te.target.setPointerCapture(te.pointerId),te.target.tagName!=="BUTTON"&&(X(!0),gs.current={x:te.clientX,y:te.clientY}))},onPointerUp:()=>{var te,ve,Ee,Ut;if(he||!Tt)return;gs.current=null;let Wt=Number(((te=ee.current)==null?void 0:te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Qn=Number(((ve=ee.current)==null?void 0:ve.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Mr=new Date().getTime()-((Ee=Bo.current)==null?void 0:Ee.getTime()),Ht=J==="x"?Wt:Qn,Xn=Math.abs(Ht)/Mr;if(Math.abs(Ht)>=hj||Xn>.11){Vt(hs.current),(Ut=m.onDismiss)==null||Ut.call(m,m),be(J==="x"?Wt>0?"right":"left":Qn>0?"down":"up"),qn(),oe(!0),Ue(!1);return}X(!1),Z(null)},onPointerMove:te=>{var ve,Ee,Ut,Wt;if(!gs.current||!Tt||((ve=window.getSelection())==null?void 0:ve.toString().length)>0)return;let Qn=te.clientY-gs.current.y,Mr=te.clientX-gs.current.x,Ht=(Ee=e.swipeDirections)!=null?Ee:vj(F);!J&&(Math.abs(Mr)>1||Math.abs(Qn)>1)&&Z(Math.abs(Mr)>Math.abs(Qn)?"x":"y");let Xn={x:0,y:0};J==="y"?(Ht.includes("top")||Ht.includes("bottom"))&&(Ht.includes("top")&&Qn<0||Ht.includes("bottom")&&Qn>0)&&(Xn.y=Qn):J==="x"&&(Ht.includes("left")||Ht.includes("right"))&&(Ht.includes("left")&&Mr<0||Ht.includes("right")&&Mr>0)&&(Xn.x=Mr),(Math.abs(Xn.x)>0||Math.abs(Xn.y)>0)&&Ue(!0),(Ut=ee.current)==null||Ut.style.setProperty("--swipe-amount-x",`${Xn.x}px`),(Wt=ee.current)==null||Wt.style.setProperty("--swipe-amount-y",`${Xn.y}px`)}},Vo&&!m.jsx?U.createElement("button",{"aria-label":Y,"data-disabled":xc,"data-close-button":!0,onClick:xc||!Tt?()=>{}:()=>{var te;qn(),(te=m.onDismiss)==null||te.call(m,m)},className:Yt(A==null?void 0:A.closeButton,(s=m==null?void 0:m.classNames)==null?void 0:s.closeButton)},(i=D==null?void 0:D.close)!=null?i:tj):null,m.jsx||h.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:U.createElement(U.Fragment,null,ge||m.icon||m.promise?U.createElement("div",{"data-icon":"",className:Yt(A==null?void 0:A.icon,(a=m==null?void 0:m.classNames)==null?void 0:a.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||i1():null,m.type!=="loading"?m.icon||(D==null?void 0:D[ge])||Yk(ge):null):null,U.createElement("div",{"data-content":"",className:Yt(A==null?void 0:A.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},U.createElement("div",{"data-title":"",className:Yt(A==null?void 0:A.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?U.createElement("div",{"data-description":"",className:Yt(L,we,A==null?void 0:A.description,(d=m==null?void 0:m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),h.isValidElement(m.cancel)?m.cancel:m.cancel&&la(m.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:te=>{var ve,Ee;la(m.cancel)&&Tt&&((Ee=(ve=m.cancel).onClick)==null||Ee.call(ve,te),qn())},className:Yt(A==null?void 0:A.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,h.isValidElement(m.action)?m.action:m.action&&la(m.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||P,onClick:te=>{var ve,Ee;la(m.action)&&((Ee=(ve=m.action).onClick)==null||Ee.call(ve,te),!te.defaultPrevented&&qn())},className:Yt(A==null?void 0:A.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function ah(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function yj(e,t){let n={};return[e,t].forEach((r,s)=>{let i=s===1,a=i?"--mobile-offset":"--offset",l=i?fj:uj;function c(d){["top","right","bottom","left"].forEach(u=>{n[`${a}-${u}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${a}-${d}`]=l:n[`${a}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):c(l)}),n}var bj=h.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:a,className:l,offset:c,mobileOffset:d,theme:u="light",richColors:f,duration:p,style:m,visibleToasts:y=dj,toastOptions:g,dir:b=ah(),gap:x=pj,loadingIcon:v,icons:w,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:N}=e,[k,j]=U.useState([]),C=U.useMemo(()=>Array.from(new Set([r].concat(k.filter(G=>G.position).map(G=>G.position)))),[k,r]),[E,R]=U.useState([]),[P,T]=U.useState(!1),[L,I]=U.useState(!1),[F,O]=U.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),V=U.useRef(null),_=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=U.useRef(null),D=U.useRef(!1),Y=U.useCallback(G=>{j(J=>{var Z;return(Z=J.find(me=>me.id===G.id))!=null&&Z.delete||mt.dismiss(G.id),J.filter(({id:me})=>me!==G.id)})},[]);return U.useEffect(()=>mt.subscribe(G=>{if(G.dismiss){j(J=>J.map(Z=>Z.id===G.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{Ox.flushSync(()=>{j(J=>{let Z=J.findIndex(me=>me.id===G.id);return Z!==-1?[...J.slice(0,Z),{...J[Z],...G},...J.slice(Z+1)]:[G,...J]})})})}),[]),U.useEffect(()=>{if(u!=="system"){O(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?O("dark"):O("light")),typeof window>"u")return;let G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:J})=>{O(J?"dark":"light")})}catch{G.addListener(({matches:Z})=>{try{O(Z?"dark":"light")}catch(me){console.error(me)}})}},[u]),U.useEffect(()=>{k.length<=1&&T(!1)},[k]),U.useEffect(()=>{let G=J=>{var Z,me;s.every(be=>J[be]||J.code===be)&&(T(!0),(Z=V.current)==null||Z.focus()),J.code==="Escape"&&(document.activeElement===V.current||(me=V.current)!=null&&me.contains(document.activeElement))&&T(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[s]),U.useEffect(()=>{if(V.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,D.current=!1)}},[V.current]),U.createElement("section",{ref:t,"aria-label":`${S} ${_}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},C.map((G,J)=>{var Z;let[me,be]=G.split("-");return k.length?U.createElement("ol",{key:G,dir:b==="auto"?ah():b,tabIndex:-1,ref:V,className:l,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":me,"data-lifted":P&&k.length>1&&!i,"data-x-position":be,style:{"--front-toast-height":`${((Z=E[0])==null?void 0:Z.height)||0}px`,"--width":`${mj}px`,"--gap":`${x}px`,...m,...yj(c,d)},onBlur:W=>{D.current&&!W.currentTarget.contains(W.relatedTarget)&&(D.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||D.current||(D.current=!0,A.current=W.relatedTarget)},onMouseEnter:()=>T(!0),onMouseMove:()=>T(!0),onMouseLeave:()=>{L||T(!1)},onDragEnd:()=>T(!1),onPointerDown:W=>{W.target instanceof HTMLElement&&W.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},k.filter(W=>!W.position&&J===0||W.position===G).map((W,ce)=>{var xe,le;return U.createElement(xj,{key:W.id,icons:w,index:ce,toast:W,defaultRichColors:f,duration:(xe=g==null?void 0:g.duration)!=null?xe:p,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:y,closeButton:(le=g==null?void 0:g.closeButton)!=null?le:a,interacting:L,position:G,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:Y,toasts:k.filter(z=>z.position==W.position),heights:E.filter(z=>z.position==W.position),setHeights:R,expandByDefault:i,gap:x,loadingIcon:v,expanded:P,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const wj=({...e})=>{const{theme:t="system"}=Kk();return o.jsx(bj,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},Sj=1,Nj=1e6;let Kc=0;function kj(){return Kc=(Kc+1)%Number.MAX_SAFE_INTEGER,Kc.toString()}const Yc=new Map,lh=e=>{if(Yc.has(e))return;const t=setTimeout(()=>{Yc.delete(e),Yi({type:"REMOVE_TOAST",toastId:e})},Nj);Yc.set(e,t)},jj=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Sj)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?lh(n):e.toasts.forEach(r=>{lh(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Pa=[];let Ta={toasts:[]};function Yi(e){Ta=jj(Ta,e),Pa.forEach(t=>{t(Ta)})}function Cj({...e}){const t=kj(),n=s=>Yi({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Yi({type:"DISMISS_TOAST",toastId:t});return Yi({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Ej(){const[e,t]=h.useState(Ta);return h.useEffect(()=>(Pa.push(t),()=>{const n=Pa.indexOf(t);n>-1&&Pa.splice(n,1)}),[e]),{...e,toast:Cj,dismiss:n=>Yi({type:"DISMISS_TOAST",toastId:n})}}function K(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function ch(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Zx(...e){return t=>{let n=!1;const r=e.map(s=>{const i=ch(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():ch(e[s],null)}}}}function ie(...e){return h.useCallback(Zx(...e),e)}function zt(e,t=[]){let n=[];function r(i,a){const l=h.createContext(a),c=n.length;n=[...n,a];const d=f=>{var x;const{scope:p,children:m,...y}=f,g=((x=p==null?void 0:p[e])==null?void 0:x[c])||l,b=h.useMemo(()=>y,Object.values(y));return o.jsx(g.Provider,{value:b,children:m})};d.displayName=i+"Provider";function u(f,p){var g;const m=((g=p==null?void 0:p[e])==null?void 0:g[c])||l,y=h.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[d,u]}const s=()=>{const i=n.map(a=>h.createContext(a));return function(l){const c=(l==null?void 0:l[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return s.scopeName=e,[r,_j(s,...t)]}function _j(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const a=r.reduce((l,{useScope:c,scopeName:d})=>{const f=c(i)[`__scope${d}`];return{...l,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function xo(e){const t=Pj(e),n=h.forwardRef((r,s)=>{const{children:i,...a}=r,l=h.Children.toArray(i),c=l.find(Aj);if(c){const d=c.props.children,u=l.map(f=>f===c?h.Children.count(d)>1?h.Children.only(null):h.isValidElement(d)?d.props.children:null:f);return o.jsx(t,{...a,ref:s,children:h.isValidElement(d)?h.cloneElement(d,void 0,u):null})}return o.jsx(t,{...a,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var Rj=xo("Slot");function Pj(e){const t=h.forwardRef((n,r)=>{const{children:s,...i}=n;if(h.isValidElement(s)){const a=Mj(s),l=Ij(i,s.props);return s.type!==h.Fragment&&(l.ref=r?Zx(r,a):a),h.cloneElement(s,l)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e0=Symbol("radix.slottable");function Tj(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=e0,t}function Aj(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e0}function Ij(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...l)=>{const c=i(...l);return s(...l),c}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function Mj(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Vl(e){const t=e+"CollectionProvider",[n,r]=zt(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=g=>{const{scope:b,children:x}=g,v=U.useRef(null),w=U.useRef(new Map).current;return o.jsx(s,{scope:b,itemMap:w,collectionRef:v,children:x})};a.displayName=t;const l=e+"CollectionSlot",c=xo(l),d=U.forwardRef((g,b)=>{const{scope:x,children:v}=g,w=i(l,x),S=ie(b,w.collectionRef);return o.jsx(c,{ref:S,children:v})});d.displayName=l;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=xo(u),m=U.forwardRef((g,b)=>{const{scope:x,children:v,...w}=g,S=U.useRef(null),N=ie(b,S),k=i(u,x);return U.useEffect(()=>(k.itemMap.set(S,{ref:S,...w}),()=>void k.itemMap.delete(S))),o.jsx(p,{[f]:"",ref:N,children:v})});m.displayName=u;function y(g){const b=i(e+"CollectionConsumer",g);return U.useCallback(()=>{const v=b.collectionRef.current;if(!v)return[];const w=Array.from(v.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((k,j)=>w.indexOf(k.ref.current)-w.indexOf(j.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:a,Slot:d,ItemSlot:m},y,r]}var Oj=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Q=Oj.reduce((e,t)=>{const n=xo(`Primitive.${t}`),r=h.forwardRef((s,i)=>{const{asChild:a,...l}=s,c=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function t0(e,t){e&&fs.flushSync(()=>e.dispatchEvent(t))}function ze(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Lj(e,t=globalThis==null?void 0:globalThis.document){const n=ze(e);h.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var $j="DismissableLayer",pu="dismissableLayer.update",Dj="dismissableLayer.pointerDownOutside",Fj="dismissableLayer.focusOutside",dh,n0=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ul=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,d=h.useContext(n0),[u,f]=h.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),y=ie(t,j=>f(j)),g=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=g.indexOf(b),v=u?g.indexOf(u):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=v>=x,N=Bj(j=>{const C=j.target,E=[...d.branches].some(R=>R.contains(C));!S||E||(s==null||s(j),a==null||a(j),j.defaultPrevented||l==null||l())},p),k=Vj(j=>{const C=j.target;[...d.branches].some(R=>R.contains(C))||(i==null||i(j),a==null||a(j),j.defaultPrevented||l==null||l())},p);return Lj(j=>{v===d.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},p),h.useEffect(()=>{if(u)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(dh=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(u)),d.layers.add(u),uh(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=dh)}},[u,p,n,d]),h.useEffect(()=>()=>{u&&(d.layers.delete(u),d.layersWithOutsidePointerEventsDisabled.delete(u),uh())},[u,d]),h.useEffect(()=>{const j=()=>m({});return document.addEventListener(pu,j),()=>document.removeEventListener(pu,j)},[]),o.jsx(Q.div,{...c,ref:y,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:K(e.onFocusCapture,k.onFocusCapture),onBlurCapture:K(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,N.onPointerDownCapture)})});Ul.displayName=$j;var zj="DismissableLayerBranch",r0=h.forwardRef((e,t)=>{const n=h.useContext(n0),r=h.useRef(null),s=ie(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),o.jsx(Q.div,{...e,ref:s})});r0.displayName=zj;function Bj(e,t=globalThis==null?void 0:globalThis.document){const n=ze(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){s0(Dj,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Vj(e,t=globalThis==null?void 0:globalThis.document){const n=ze(e),r=h.useRef(!1);return h.useEffect(()=>{const s=i=>{i.target&&!r.current&&s0(Fj,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function uh(){const e=new CustomEvent(pu);document.dispatchEvent(e)}function s0(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?t0(s,i):s.dispatchEvent(i)}var Uj=Ul,Wj=r0,Ve=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Hj="Portal",Vf=h.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[s,i]=h.useState(!1);Ve(()=>i(!0),[]);const a=n||s&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?Ox.createPortal(o.jsx(Q.div,{...r,ref:t}),a):null});Vf.displayName=Hj;function Gj(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Yn=e=>{const{present:t,children:n}=e,r=Kj(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=ie(r.ref,Yj(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:i}):null};Yn.displayName="Presence";function Kj(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),i=h.useRef("none"),a=e?"mounted":"unmounted",[l,c]=Gj(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const d=ca(r.current);i.current=l==="mounted"?d:"none"},[l]),Ve(()=>{const d=r.current,u=s.current;if(u!==e){const p=i.current,m=ca(d);e?c("MOUNT"):m==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(u&&p!==m?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,c]),Ve(()=>{if(t){let d;const u=t.ownerDocument.defaultView??window,f=m=>{const g=ca(r.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},p=m=>{m.target===t&&(i.current=ca(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(d),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:h.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function ca(e){return(e==null?void 0:e.animationName)||"none"}function Yj(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qj=Ku[" useInsertionEffect ".trim().toString()]||Ve;function Wn({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,a]=Qj({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:s;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const f=u.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=l},[l,r])}const d=h.useCallback(u=>{var f;if(l){const p=Xj(u)?u(e):u;p!==e&&((f=a.current)==null||f.call(a,p))}else i(u)},[l,e,i,a]);return[c,d]}function Qj({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),i=h.useRef(t);return qj(()=>{i.current=t},[t]),h.useEffect(()=>{var a;s.current!==n&&((a=i.current)==null||a.call(i,n),s.current=n)},[n,s]),[n,r,i]}function Xj(e){return typeof e=="function"}var i0=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"}),Jj="VisuallyHidden",Wl=h.forwardRef((e,t)=>o.jsx(Q.span,{...e,ref:t,style:{...i0,...e.style}}));Wl.displayName=Jj;var Zj=Wl,Uf="ToastProvider",[Wf,eC,tC]=Vl("Toast"),[o0,J3]=zt("Toast",[tC]),[nC,Hl]=o0(Uf),a0=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:a}=e,[l,c]=h.useState(null),[d,u]=h.useState(0),f=h.useRef(!1),p=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Uf}\`. Expected non-empty \`string\`.`),o.jsx(Wf.Provider,{scope:t,children:o.jsx(nC,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:d,viewport:l,onViewportChange:c,onToastAdd:h.useCallback(()=>u(m=>m+1),[]),onToastRemove:h.useCallback(()=>u(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:a})})};a0.displayName=Uf;var l0="ToastViewport",rC=["F8"],hu="toast.viewportPause",gu="toast.viewportResume",c0=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=rC,label:s="Notifications ({hotkey})",...i}=e,a=Hl(l0,n),l=eC(n),c=h.useRef(null),d=h.useRef(null),u=h.useRef(null),f=h.useRef(null),p=ie(t,f,a.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;h.useEffect(()=>{const b=x=>{var w;r.length!==0&&r.every(S=>x[S]||x.code===S)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),h.useEffect(()=>{const b=c.current,x=f.current;if(y&&b&&x){const v=()=>{if(!a.isClosePausedRef.current){const k=new CustomEvent(hu);x.dispatchEvent(k),a.isClosePausedRef.current=!0}},w=()=>{if(a.isClosePausedRef.current){const k=new CustomEvent(gu);x.dispatchEvent(k),a.isClosePausedRef.current=!1}},S=k=>{!b.contains(k.relatedTarget)&&w()},N=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",v),b.addEventListener("focusout",S),b.addEventListener("pointermove",v),b.addEventListener("pointerleave",N),window.addEventListener("blur",v),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",v),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",v),b.removeEventListener("pointerleave",N),window.removeEventListener("blur",v),window.removeEventListener("focus",w)}}},[y,a.isClosePausedRef]);const g=h.useCallback(({tabbingDirection:b})=>{const v=l().map(w=>{const S=w.ref.current,N=[S,...gC(S)];return b==="forwards"?N:N.reverse()});return(b==="forwards"?v.reverse():v).flat()},[l]);return h.useEffect(()=>{const b=f.current;if(b){const x=v=>{var N,k,j;const w=v.altKey||v.ctrlKey||v.metaKey;if(v.key==="Tab"&&!w){const C=document.activeElement,E=v.shiftKey;if(v.target===b&&E){(N=d.current)==null||N.focus();return}const T=g({tabbingDirection:E?"backwards":"forwards"}),L=T.findIndex(I=>I===C);qc(T.slice(L+1))?v.preventDefault():E?(k=d.current)==null||k.focus():(j=u.current)==null||j.focus()}};return b.addEventListener("keydown",x),()=>b.removeEventListener("keydown",x)}},[l,g]),o.jsxs(Wj,{ref:c,role:"region","aria-label":s.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&o.jsx(vu,{ref:d,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"forwards"});qc(b)}}),o.jsx(Wf.Slot,{scope:n,children:o.jsx(Q.ol,{tabIndex:-1,...i,ref:p})}),y&&o.jsx(vu,{ref:u,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"backwards"});qc(b)}})]})});c0.displayName=l0;var d0="ToastFocusProxy",vu=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=Hl(d0,n);return o.jsx(Wl,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:a=>{var d;const l=a.relatedTarget;!((d=i.viewport)!=null&&d.contains(l))&&r()}})});vu.displayName=d0;var To="Toast",sC="toast.swipeStart",iC="toast.swipeMove",oC="toast.swipeCancel",aC="toast.swipeEnd",u0=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...a}=e,[l,c]=Wn({prop:r,defaultProp:s??!0,onChange:i,caller:To});return o.jsx(Yn,{present:n||l,children:o.jsx(dC,{open:l,...a,ref:t,onClose:()=>c(!1),onPause:ze(e.onPause),onResume:ze(e.onResume),onSwipeStart:K(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:K(e.onSwipeMove,d=>{const{x:u,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:K(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:K(e.onSwipeEnd,d=>{const{x:u,y:f}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});u0.displayName=To;var[lC,cC]=o0(To,{onClose(){}}),dC=h.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:d,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...y}=e,g=Hl(To,n),[b,x]=h.useState(null),v=ie(t,I=>x(I)),w=h.useRef(null),S=h.useRef(null),N=s||g.duration,k=h.useRef(0),j=h.useRef(N),C=h.useRef(0),{onToastAdd:E,onToastRemove:R}=g,P=ze(()=>{var F;(b==null?void 0:b.contains(document.activeElement))&&((F=g.viewport)==null||F.focus()),a()}),T=h.useCallback(I=>{!I||I===1/0||(window.clearTimeout(C.current),k.current=new Date().getTime(),C.current=window.setTimeout(P,I))},[P]);h.useEffect(()=>{const I=g.viewport;if(I){const F=()=>{T(j.current),d==null||d()},O=()=>{const V=new Date().getTime()-k.current;j.current=j.current-V,window.clearTimeout(C.current),c==null||c()};return I.addEventListener(hu,O),I.addEventListener(gu,F),()=>{I.removeEventListener(hu,O),I.removeEventListener(gu,F)}}},[g.viewport,N,c,d,T]),h.useEffect(()=>{i&&!g.isClosePausedRef.current&&T(N)},[i,N,g.isClosePausedRef,T]),h.useEffect(()=>(E(),()=>R()),[E,R]);const L=h.useMemo(()=>b?x0(b):null,[b]);return g.viewport?o.jsxs(o.Fragment,{children:[L&&o.jsx(uC,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),o.jsx(lC,{scope:n,onClose:P,children:fs.createPortal(o.jsx(Wf.ItemSlot,{scope:n,children:o.jsx(Uj,{asChild:!0,onEscapeKeyDown:K(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||P(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(Q.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:v,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:K(e.onKeyDown,I=>{I.key==="Escape"&&(l==null||l(I.nativeEvent),I.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:K(e.onPointerDown,I=>{I.button===0&&(w.current={x:I.clientX,y:I.clientY})}),onPointerMove:K(e.onPointerMove,I=>{if(!w.current)return;const F=I.clientX-w.current.x,O=I.clientY-w.current.y,V=!!S.current,_=["left","right"].includes(g.swipeDirection),A=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,D=_?A(0,F):0,Y=_?0:A(0,O),G=I.pointerType==="touch"?10:2,J={x:D,y:Y},Z={originalEvent:I,delta:J};V?(S.current=J,da(iC,f,Z,{discrete:!1})):fh(J,g.swipeDirection,G)?(S.current=J,da(sC,u,Z,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(F)>G||Math.abs(O)>G)&&(w.current=null)}),onPointerUp:K(e.onPointerUp,I=>{const F=S.current,O=I.target;if(O.hasPointerCapture(I.pointerId)&&O.releasePointerCapture(I.pointerId),S.current=null,w.current=null,F){const V=I.currentTarget,_={originalEvent:I,delta:F};fh(F,g.swipeDirection,g.swipeThreshold)?da(aC,m,_,{discrete:!0}):da(oC,p,_,{discrete:!0}),V.addEventListener("click",A=>A.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),uC=e=>{const{__scopeToast:t,children:n,...r}=e,s=Hl(To,t),[i,a]=h.useState(!1),[l,c]=h.useState(!1);return pC(()=>a(!0)),h.useEffect(()=>{const d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),l?null:o.jsx(Vf,{asChild:!0,children:o.jsx(Wl,{...r,children:i&&o.jsxs(o.Fragment,{children:[s.label," ",n]})})})},fC="ToastTitle",f0=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Q.div,{...r,ref:t})});f0.displayName=fC;var mC="ToastDescription",m0=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return o.jsx(Q.div,{...r,ref:t})});m0.displayName=mC;var p0="ToastAction",h0=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?o.jsx(v0,{altText:n,asChild:!0,children:o.jsx(Hf,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${p0}\`. Expected non-empty \`string\`.`),null)});h0.displayName=p0;var g0="ToastClose",Hf=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=cC(g0,n);return o.jsx(v0,{asChild:!0,children:o.jsx(Q.button,{type:"button",...r,ref:t,onClick:K(e.onClick,s.onClose)})})});Hf.displayName=g0;var v0=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return o.jsx(Q.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function x0(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),hC(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const a=r.dataset.radixToastAnnounceAlt;a&&t.push(a)}else t.push(...x0(r))}}),t}function da(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?t0(s,i):s.dispatchEvent(i)}var fh=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function pC(e=()=>{}){const t=ze(e);Ve(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function hC(e){return e.nodeType===e.ELEMENT_NODE}function gC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qc(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var vC=a0,y0=c0,b0=u0,w0=f0,S0=m0,N0=h0,k0=Hf;function j0(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=j0(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function C0(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=j0(e))&&(r&&(r+=" "),r+=t);return r}const mh=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,ph=C0,Gl=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return ph(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,a=Object.keys(s).map(d=>{const u=n==null?void 0:n[d],f=i==null?void 0:i[d];if(u===null)return null;const p=mh(u)||mh(f);return s[d][p]}),l=n&&Object.entries(n).reduce((d,u)=>{let[f,p]=u;return p===void 0||(d[f]=p),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:p,...m}=u;return Object.entries(m).every(y=>{let[g,b]=y;return Array.isArray(b)?b.includes({...i,...l}[g]):{...i,...l}[g]===b})?[...d,f,p]:d},[]);return ph(e,a,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
|
|
69
|
+
* @license lucide-react v0.462.0 - ISC
|
|
70
|
+
*
|
|
71
|
+
* This source code is licensed under the ISC license.
|
|
72
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
73
|
+
*/const xC=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),E0=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
74
|
+
* @license lucide-react v0.462.0 - ISC
|
|
75
|
+
*
|
|
76
|
+
* This source code is licensed under the ISC license.
|
|
77
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
78
|
+
*/var yC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
79
|
+
* @license lucide-react v0.462.0 - ISC
|
|
80
|
+
*
|
|
81
|
+
* This source code is licensed under the ISC license.
|
|
82
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
83
|
+
*/const bC=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...l},c)=>h.createElement("svg",{ref:c,...yC,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:E0("lucide",s),...l},[...a.map(([d,u])=>h.createElement(d,u)),...Array.isArray(i)?i:[i]]));/**
|
|
84
|
+
* @license lucide-react v0.462.0 - ISC
|
|
85
|
+
*
|
|
86
|
+
* This source code is licensed under the ISC license.
|
|
87
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
88
|
+
*/const q=(e,t)=>{const n=h.forwardRef(({className:r,...s},i)=>h.createElement(bC,{ref:i,iconNode:t,className:E0(`lucide-${xC(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
|
89
|
+
* @license lucide-react v0.462.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*/const Tr=q("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
|
|
94
|
+
* @license lucide-react v0.462.0 - ISC
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the ISC license.
|
|
97
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/const wC=q("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
99
|
+
* @license lucide-react v0.462.0 - ISC
|
|
100
|
+
*
|
|
101
|
+
* This source code is licensed under the ISC license.
|
|
102
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
103
|
+
*/const SC=q("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
104
|
+
* @license lucide-react v0.462.0 - ISC
|
|
105
|
+
*
|
|
106
|
+
* This source code is licensed under the ISC license.
|
|
107
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
108
|
+
*/const NC=q("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
109
|
+
* @license lucide-react v0.462.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/const kC=q("Beaker",[["path",{d:"M4.5 3h15",key:"c7n0jr"}],["path",{d:"M6 3v16a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V3",key:"m1uhx7"}],["path",{d:"M6 14h12",key:"4cwo0f"}]]);/**
|
|
114
|
+
* @license lucide-react v0.462.0 - ISC
|
|
115
|
+
*
|
|
116
|
+
* This source code is licensed under the ISC license.
|
|
117
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
118
|
+
*/const xu=q("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
119
|
+
* @license lucide-react v0.462.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/const Gf=q("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
124
|
+
* @license lucide-react v0.462.0 - ISC
|
|
125
|
+
*
|
|
126
|
+
* This source code is licensed under the ISC license.
|
|
127
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
128
|
+
*/const gt=q("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
129
|
+
* @license lucide-react v0.462.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*/const Dn=q("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
134
|
+
* @license lucide-react v0.462.0 - ISC
|
|
135
|
+
*
|
|
136
|
+
* This source code is licensed under the ISC license.
|
|
137
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
138
|
+
*/const jC=q("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
139
|
+
* @license lucide-react v0.462.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/const rs=q("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
144
|
+
* @license lucide-react v0.462.0 - ISC
|
|
145
|
+
*
|
|
146
|
+
* This source code is licensed under the ISC license.
|
|
147
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
148
|
+
*/const Ao=q("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
149
|
+
* @license lucide-react v0.462.0 - ISC
|
|
150
|
+
*
|
|
151
|
+
* This source code is licensed under the ISC license.
|
|
152
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
153
|
+
*/const Kf=q("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
154
|
+
* @license lucide-react v0.462.0 - ISC
|
|
155
|
+
*
|
|
156
|
+
* This source code is licensed under the ISC license.
|
|
157
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
158
|
+
*/const _0=q("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
159
|
+
* @license lucide-react v0.462.0 - ISC
|
|
160
|
+
*
|
|
161
|
+
* This source code is licensed under the ISC license.
|
|
162
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
163
|
+
*/const R0=q("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
164
|
+
* @license lucide-react v0.462.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/const hh=q("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
169
|
+
* @license lucide-react v0.462.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*/const CC=q("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
174
|
+
* @license lucide-react v0.462.0 - ISC
|
|
175
|
+
*
|
|
176
|
+
* This source code is licensed under the ISC license.
|
|
177
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
178
|
+
*/const Kl=q("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
179
|
+
* @license lucide-react v0.462.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/const ss=q("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
|
|
184
|
+
* @license lucide-react v0.462.0 - ISC
|
|
185
|
+
*
|
|
186
|
+
* This source code is licensed under the ISC license.
|
|
187
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
188
|
+
*/const EC=q("Fingerprint",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]);/**
|
|
189
|
+
* @license lucide-react v0.462.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/const P0=q("FlaskConical",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
|
194
|
+
* @license lucide-react v0.462.0 - ISC
|
|
195
|
+
*
|
|
196
|
+
* This source code is licensed under the ISC license.
|
|
197
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
198
|
+
*/const _C=q("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
|
|
199
|
+
* @license lucide-react v0.462.0 - ISC
|
|
200
|
+
*
|
|
201
|
+
* This source code is licensed under the ISC license.
|
|
202
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
203
|
+
*/const Io=q("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
204
|
+
* @license lucide-react v0.462.0 - ISC
|
|
205
|
+
*
|
|
206
|
+
* This source code is licensed under the ISC license.
|
|
207
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
208
|
+
*/const RC=q("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/**
|
|
209
|
+
* @license lucide-react v0.462.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/const T0=q("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
214
|
+
* @license lucide-react v0.462.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/const PC=q("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
|
|
219
|
+
* @license lucide-react v0.462.0 - ISC
|
|
220
|
+
*
|
|
221
|
+
* This source code is licensed under the ISC license.
|
|
222
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
223
|
+
*/const Yf=q("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
224
|
+
* @license lucide-react v0.462.0 - ISC
|
|
225
|
+
*
|
|
226
|
+
* This source code is licensed under the ISC license.
|
|
227
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
228
|
+
*/const TC=q("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
229
|
+
* @license lucide-react v0.462.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/const gh=q("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
|
|
234
|
+
* @license lucide-react v0.462.0 - ISC
|
|
235
|
+
*
|
|
236
|
+
* This source code is licensed under the ISC license.
|
|
237
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
238
|
+
*/const A0=q("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/**
|
|
239
|
+
* @license lucide-react v0.462.0 - ISC
|
|
240
|
+
*
|
|
241
|
+
* This source code is licensed under the ISC license.
|
|
242
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
243
|
+
*/const AC=q("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
244
|
+
* @license lucide-react v0.462.0 - ISC
|
|
245
|
+
*
|
|
246
|
+
* This source code is licensed under the ISC license.
|
|
247
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
248
|
+
*/const IC=q("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
249
|
+
* @license lucide-react v0.462.0 - ISC
|
|
250
|
+
*
|
|
251
|
+
* This source code is licensed under the ISC license.
|
|
252
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
253
|
+
*/const I0=q("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
254
|
+
* @license lucide-react v0.462.0 - ISC
|
|
255
|
+
*
|
|
256
|
+
* This source code is licensed under the ISC license.
|
|
257
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
258
|
+
*/const Mo=q("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
259
|
+
* @license lucide-react v0.462.0 - ISC
|
|
260
|
+
*
|
|
261
|
+
* This source code is licensed under the ISC license.
|
|
262
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
263
|
+
*/const qi=q("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
264
|
+
* @license lucide-react v0.462.0 - ISC
|
|
265
|
+
*
|
|
266
|
+
* This source code is licensed under the ISC license.
|
|
267
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
268
|
+
*/const yu=q("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
|
|
269
|
+
* @license lucide-react v0.462.0 - ISC
|
|
270
|
+
*
|
|
271
|
+
* This source code is licensed under the ISC license.
|
|
272
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
273
|
+
*/const cl=q("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
274
|
+
* @license lucide-react v0.462.0 - ISC
|
|
275
|
+
*
|
|
276
|
+
* This source code is licensed under the ISC license.
|
|
277
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
278
|
+
*/const vh=q("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
|
|
279
|
+
* @license lucide-react v0.462.0 - ISC
|
|
280
|
+
*
|
|
281
|
+
* This source code is licensed under the ISC license.
|
|
282
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
283
|
+
*/const MC=q("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
|
284
|
+
* @license lucide-react v0.462.0 - ISC
|
|
285
|
+
*
|
|
286
|
+
* This source code is licensed under the ISC license.
|
|
287
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
288
|
+
*/const Yl=q("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
289
|
+
* @license lucide-react v0.462.0 - ISC
|
|
290
|
+
*
|
|
291
|
+
* This source code is licensed under the ISC license.
|
|
292
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
293
|
+
*/const Qi=q("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
294
|
+
* @license lucide-react v0.462.0 - ISC
|
|
295
|
+
*
|
|
296
|
+
* This source code is licensed under the ISC license.
|
|
297
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
298
|
+
*/const M0=q("ShieldOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]);/**
|
|
299
|
+
* @license lucide-react v0.462.0 - ISC
|
|
300
|
+
*
|
|
301
|
+
* This source code is licensed under the ISC license.
|
|
302
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
303
|
+
*/const Cn=q("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
|
|
304
|
+
* @license lucide-react v0.462.0 - ISC
|
|
305
|
+
*
|
|
306
|
+
* This source code is licensed under the ISC license.
|
|
307
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
308
|
+
*/const bu=q("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
309
|
+
* @license lucide-react v0.462.0 - ISC
|
|
310
|
+
*
|
|
311
|
+
* This source code is licensed under the ISC license.
|
|
312
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
313
|
+
*/const OC=q("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
314
|
+
* @license lucide-react v0.462.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/const LC=q("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
319
|
+
* @license lucide-react v0.462.0 - ISC
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the ISC license.
|
|
322
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
323
|
+
*/const qf=q("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
|
|
324
|
+
* @license lucide-react v0.462.0 - ISC
|
|
325
|
+
*
|
|
326
|
+
* This source code is licensed under the ISC license.
|
|
327
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
328
|
+
*/const Qf=q("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
329
|
+
* @license lucide-react v0.462.0 - ISC
|
|
330
|
+
*
|
|
331
|
+
* This source code is licensed under the ISC license.
|
|
332
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
333
|
+
*/const jr=q("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
334
|
+
* @license lucide-react v0.462.0 - ISC
|
|
335
|
+
*
|
|
336
|
+
* This source code is licensed under the ISC license.
|
|
337
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
338
|
+
*/const O0=q("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
339
|
+
* @license lucide-react v0.462.0 - ISC
|
|
340
|
+
*
|
|
341
|
+
* This source code is licensed under the ISC license.
|
|
342
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
343
|
+
*/const $C=q("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
344
|
+
* @license lucide-react v0.462.0 - ISC
|
|
345
|
+
*
|
|
346
|
+
* This source code is licensed under the ISC license.
|
|
347
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
348
|
+
*/const xh=q("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
349
|
+
* @license lucide-react v0.462.0 - ISC
|
|
350
|
+
*
|
|
351
|
+
* This source code is licensed under the ISC license.
|
|
352
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
353
|
+
*/const Xi=q("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
354
|
+
* @license lucide-react v0.462.0 - ISC
|
|
355
|
+
*
|
|
356
|
+
* This source code is licensed under the ISC license.
|
|
357
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
358
|
+
*/const Xr=q("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Xf="-",DC=e=>{const t=zC(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const l=a.split(Xf);return l[0]===""&&l.length!==1&&l.shift(),L0(l,t)||FC(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&r[a]?[...c,...r[a]]:c}}},L0=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?L0(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(Xf);return(a=t.validators.find(({validator:l})=>l(i)))==null?void 0:a.classGroupId},yh=/^\[(.+)\]$/,FC=e=>{if(yh.test(e)){const t=yh.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},zC=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return VC(Object.entries(e.classGroups),n).forEach(([i,a])=>{wu(a,r,i,t)}),r},wu=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:bh(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(BC(s)){wu(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,a])=>{wu(a,bh(t,i),n,r)})})},bh=(e,t)=>{let n=e;return t.split(Xf).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},BC=e=>e.isThemeGetter,VC=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,l])=>[t+a,l])):i);return[n,s]}):e,UC=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=r.get(i))!==void 0)return s(i,a),a},set(i,a){n.has(i)?n.set(i,a):s(i,a)}}},$0="!",WC=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,a=l=>{const c=[];let d=0,u=0,f;for(let b=0;b<l.length;b++){let x=l[b];if(d===0){if(x===s&&(r||l.slice(b,b+i)===t)){c.push(l.slice(u,b)),u=b+i;continue}if(x==="/"){f=b;continue}}x==="["?d++:x==="]"&&d--}const p=c.length===0?l:l.substring(u),m=p.startsWith($0),y=m?p.substring(1):p,g=f&&f>u?f-u:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:a}):a},HC=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},GC=e=>({cache:UC(e.cacheSize),parseClassName:WC(e),...DC(e)}),KC=/\s+/,YC=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],a=e.trim().split(KC);let l="";for(let c=a.length-1;c>=0;c-=1){const d=a[c],{modifiers:u,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(d);let y=!!m,g=r(y?p.substring(0,m):p);if(!g){if(!y){l=d+(l.length>0?" "+l:l);continue}if(g=r(p),!g){l=d+(l.length>0?" "+l:l);continue}y=!1}const b=HC(u).join(":"),x=f?b+$0:b,v=x+g;if(i.includes(v))continue;i.push(v);const w=s(g,y);for(let S=0;S<w.length;++S){const N=w[S];i.push(x+N)}l=d+(l.length>0?" "+l:l)}return l};function qC(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=D0(t))&&(r&&(r+=" "),r+=n);return r}const D0=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=D0(e[r]))&&(n&&(n+=" "),n+=t);return n};function QC(e,...t){let n,r,s,i=a;function a(c){const d=t.reduce((u,f)=>f(u),e());return n=GC(d),r=n.cache.get,s=n.cache.set,i=l,l(c)}function l(c){const d=r(c);if(d)return d;const u=YC(c,n);return s(c,u),u}return function(){return i(qC.apply(null,arguments))}}const ke=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},F0=/^\[(?:([a-z-]+):)?(.+)\]$/i,XC=/^\d+\/\d+$/,JC=new Set(["px","full","screen"]),ZC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,e2=/\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$/,t2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,n2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,r2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tn=e=>Bs(e)||JC.has(e)||XC.test(e),Zn=e=>gi(e,"length",u2),Bs=e=>!!e&&!Number.isNaN(Number(e)),Qc=e=>gi(e,"number",Bs),Ri=e=>!!e&&Number.isInteger(Number(e)),s2=e=>e.endsWith("%")&&Bs(e.slice(0,-1)),se=e=>F0.test(e),er=e=>ZC.test(e),i2=new Set(["length","size","percentage"]),o2=e=>gi(e,i2,z0),a2=e=>gi(e,"position",z0),l2=new Set(["image","url"]),c2=e=>gi(e,l2,m2),d2=e=>gi(e,"",f2),Pi=()=>!0,gi=(e,t,n)=>{const r=F0.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},u2=e=>e2.test(e)&&!t2.test(e),z0=()=>!1,f2=e=>n2.test(e),m2=e=>r2.test(e),p2=()=>{const e=ke("colors"),t=ke("spacing"),n=ke("blur"),r=ke("brightness"),s=ke("borderColor"),i=ke("borderRadius"),a=ke("borderSpacing"),l=ke("borderWidth"),c=ke("contrast"),d=ke("grayscale"),u=ke("hueRotate"),f=ke("invert"),p=ke("gap"),m=ke("gradientColorStops"),y=ke("gradientColorStopPositions"),g=ke("inset"),b=ke("margin"),x=ke("opacity"),v=ke("padding"),w=ke("saturate"),S=ke("scale"),N=ke("sepia"),k=ke("skew"),j=ke("space"),C=ke("translate"),E=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",se,t],T=()=>[se,t],L=()=>["",Tn,Zn],I=()=>["auto",Bs,se],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",se],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[Bs,se];return{cacheSize:500,separator:":",theme:{colors:[Pi],spacing:[Tn,Zn],blur:["none","",er,se],brightness:Y(),borderColor:[e],borderRadius:["none","","full",er,se],borderSpacing:T(),borderWidth:L(),contrast:Y(),grayscale:A(),hueRotate:Y(),invert:A(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[s2,Zn],inset:P(),margin:P(),opacity:Y(),padding:T(),saturate:Y(),scale:Y(),sepia:A(),skew:Y(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",se]}],container:["container"],columns:[{columns:[er]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"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"],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:[...F(),se]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ri,se]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",se]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",Ri,se]}],"grid-cols":[{"grid-cols":[Pi]}],"col-start-end":[{col:["auto",{span:["full",Ri,se]},se]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Pi]}],"row-start-end":[{row:["auto",{span:[Ri,se]},se]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",se]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",..._()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[j]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[j]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",se,t]}],"min-w":[{"min-w":[se,t,"min","max","fit"]}],"max-w":[{"max-w":[se,t,"none","full","min","max","fit","prose",{screen:[er]},er]}],h:[{h:[se,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[se,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[se,t,"auto","min","max","fit"]}],"font-size":[{text:["base",er,Zn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qc]}],"font-family":[{font:[Pi]}],"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:["tighter","tight","normal","wide","wider","widest",se]}],"line-clamp":[{"line-clamp":["none",Bs,Qc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Tn,se]}],"list-image":[{"list-image":["none",se]}],"list-style-type":[{list:["none","disc","decimal",se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Tn,Zn]}],"underline-offset":[{"underline-offset":["auto",Tn,se]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),a2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",o2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},c2]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[x]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[x]}],"divide-style":[{divide:O()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[Tn,se]}],"outline-w":[{outline:[Tn,Zn]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Tn,Zn]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",er,d2]}],"shadow-color":[{shadow:[Pi]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...V(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":V()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",er,se]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[x]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",se]}],duration:[{duration:Y()}],ease:[{ease:["linear","in","out","in-out",se]}],delay:[{delay:Y()}],animate:[{animate:["none","spin","ping","pulse","bounce",se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Ri,se]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",se]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",se]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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",se]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Tn,Zn,Qc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},h2=QC(p2);function $(...e){return h2(C0(e))}const g2=vC,B0=h.forwardRef(({className:e,...t},n)=>o.jsx(y0,{ref:n,className:$("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));B0.displayName=y0.displayName;const v2=Gl("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),V0=h.forwardRef(({className:e,variant:t,...n},r)=>o.jsx(b0,{ref:r,className:$(v2({variant:t}),e),...n}));V0.displayName=b0.displayName;const x2=h.forwardRef(({className:e,...t},n)=>o.jsx(N0,{ref:n,className:$("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));x2.displayName=N0.displayName;const U0=h.forwardRef(({className:e,...t},n)=>o.jsx(k0,{ref:n,className:$("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:o.jsx(Xi,{className:"h-4 w-4"})}));U0.displayName=k0.displayName;const W0=h.forwardRef(({className:e,...t},n)=>o.jsx(w0,{ref:n,className:$("text-sm font-semibold",e),...t}));W0.displayName=w0.displayName;const H0=h.forwardRef(({className:e,...t},n)=>o.jsx(S0,{ref:n,className:$("text-sm opacity-90",e),...t}));H0.displayName=S0.displayName;function y2(){const{toasts:e}=Ej();return o.jsxs(g2,{children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return o.jsxs(V0,{...i,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(W0,{children:n}),r&&o.jsx(H0,{children:r})]}),s,o.jsx(U0,{})]},t)}),o.jsx(B0,{})]})}var b2=Ku[" useId ".trim().toString()]||(()=>{}),w2=0;function ms(e){const[t,n]=h.useState(b2());return Ve(()=>{n(r=>r??String(w2++))},[e]),t?`radix-${t}`:""}const S2=["top","right","bottom","left"],Cr=Math.min,Nt=Math.max,dl=Math.round,ua=Math.floor,jn=e=>({x:e,y:e}),N2={left:"right",right:"left",bottom:"top",top:"bottom"},k2={start:"end",end:"start"};function Su(e,t,n){return Nt(e,Cr(t,n))}function Hn(e,t){return typeof e=="function"?e(t):e}function Gn(e){return e.split("-")[0]}function vi(e){return e.split("-")[1]}function Jf(e){return e==="x"?"y":"x"}function Zf(e){return e==="y"?"height":"width"}const j2=new Set(["top","bottom"]);function yn(e){return j2.has(Gn(e))?"y":"x"}function em(e){return Jf(yn(e))}function C2(e,t,n){n===void 0&&(n=!1);const r=vi(e),s=em(e),i=Zf(s);let a=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=ul(a)),[a,ul(a)]}function E2(e){const t=ul(e);return[Nu(e),t,Nu(t)]}function Nu(e){return e.replace(/start|end/g,t=>k2[t])}const wh=["left","right"],Sh=["right","left"],_2=["top","bottom"],R2=["bottom","top"];function P2(e,t,n){switch(e){case"top":case"bottom":return n?t?Sh:wh:t?wh:Sh;case"left":case"right":return t?_2:R2;default:return[]}}function T2(e,t,n,r){const s=vi(e);let i=P2(Gn(e),n==="start",r);return s&&(i=i.map(a=>a+"-"+s),t&&(i=i.concat(i.map(Nu)))),i}function ul(e){return e.replace(/left|right|bottom|top/g,t=>N2[t])}function A2(e){return{top:0,right:0,bottom:0,left:0,...e}}function G0(e){return typeof e!="number"?A2(e):{top:e,right:e,bottom:e,left:e}}function fl(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Nh(e,t,n){let{reference:r,floating:s}=e;const i=yn(t),a=em(t),l=Zf(a),c=Gn(t),d=i==="y",u=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[l]/2-s[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-s.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-s.width,y:f};break;default:m={x:r.x,y:r.y}}switch(vi(t)){case"start":m[a]-=p*(n&&d?-1:1);break;case"end":m[a]+=p*(n&&d?-1:1);break}return m}const I2=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=Nh(d,r,c),p=r,m={},y=0;for(let g=0;g<l.length;g++){const{name:b,fn:x}=l[g],{x:v,y:w,data:S,reset:N}=await x({x:u,y:f,initialPlacement:r,placement:p,strategy:s,middlewareData:m,rects:d,platform:a,elements:{reference:e,floating:t}});u=v??u,f=w??f,m={...m,[b]:{...m[b],...S}},N&&y<=50&&(y++,typeof N=="object"&&(N.placement&&(p=N.placement),N.rects&&(d=N.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):N.rects),{x:u,y:f}=Nh(d,p,c)),g=-1)}return{x:u,y:f,placement:p,strategy:s,middlewareData:m}};async function yo(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=Hn(t,e),y=G0(m),b=l[p?f==="floating"?"reference":"floating":f],x=fl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),v=f==="floating"?{x:r,y:s,width:a.floating.width,height:a.floating.height}:a.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},N=fl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:v,offsetParent:w,strategy:c}):v);return{top:(x.top-N.top+y.top)/S.y,bottom:(N.bottom-x.bottom+y.bottom)/S.y,left:(x.left-N.left+y.left)/S.x,right:(N.right-x.right+y.right)/S.x}}const M2=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:d,padding:u=0}=Hn(e,t)||{};if(d==null)return{};const f=G0(u),p={x:n,y:r},m=em(s),y=Zf(m),g=await a.getDimensions(d),b=m==="y",x=b?"top":"left",v=b?"bottom":"right",w=b?"clientHeight":"clientWidth",S=i.reference[y]+i.reference[m]-p[m]-i.floating[y],N=p[m]-i.reference[m],k=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let j=k?k[w]:0;(!j||!await(a.isElement==null?void 0:a.isElement(k)))&&(j=l.floating[w]||i.floating[y]);const C=S/2-N/2,E=j/2-g[y]/2-1,R=Cr(f[x],E),P=Cr(f[v],E),T=R,L=j-g[y]-P,I=j/2-g[y]/2+C,F=Su(T,I,L),O=!c.arrow&&vi(s)!=null&&I!==F&&i.reference[y]/2-(I<T?R:P)-g[y]/2<0,V=O?I<T?I-T:I-L:0;return{[m]:p[m]+V,data:{[m]:F,centerOffset:I-F-V,...O&&{alignmentOffset:V}},reset:O}}}),O2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...b}=Hn(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Gn(s),v=yn(l),w=Gn(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),N=p||(w||!g?[ul(l)]:E2(l)),k=y!=="none";!p&&k&&N.push(...T2(l,g,y,S));const j=[l,...N],C=await yo(t,b),E=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&E.push(C[x]),f){const I=C2(s,a,S);E.push(C[I[0]],C[I[1]])}if(R=[...R,{placement:s,overflows:E}],!E.every(I=>I<=0)){var P,T;const I=(((P=i.flip)==null?void 0:P.index)||0)+1,F=j[I];if(F&&(!(f==="alignment"?v!==yn(F):!1)||R.every(_=>_.overflows[0]>0&&yn(_.placement)===v)))return{data:{index:I,overflows:R},reset:{placement:F}};let O=(T=R.filter(V=>V.overflows[0]<=0).sort((V,_)=>V.overflows[1]-_.overflows[1])[0])==null?void 0:T.placement;if(!O)switch(m){case"bestFit":{var L;const V=(L=R.filter(_=>{if(k){const A=yn(_.placement);return A===v||A==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(A=>A>0).reduce((A,D)=>A+D,0)]).sort((_,A)=>_[1]-A[1])[0])==null?void 0:L[0];V&&(O=V);break}case"initialPlacement":O=l;break}if(s!==O)return{reset:{placement:O}}}return{}}}};function kh(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jh(e){return S2.some(t=>e[t]>=0)}const L2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Hn(e,t);switch(r){case"referenceHidden":{const i=await yo(t,{...s,elementContext:"reference"}),a=kh(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:jh(a)}}}case"escaped":{const i=await yo(t,{...s,altBoundary:!0}),a=kh(i,n.floating);return{data:{escapedOffsets:a,escaped:jh(a)}}}default:return{}}}}},K0=new Set(["left","top"]);async function $2(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),a=Gn(n),l=vi(n),c=yn(n)==="y",d=K0.has(a)?-1:1,u=i&&c?-1:1,f=Hn(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof y=="number"&&(m=l==="end"?y*-1:y),c?{x:m*u,y:p*d}:{x:p*d,y:m*u}}const D2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:a,middlewareData:l}=t,c=await $2(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:{...c,placement:a}}}}},F2=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x,y:v}=b;return{x,y:v}}},...c}=Hn(e,t),d={x:n,y:r},u=await yo(t,c),f=yn(Gn(s)),p=Jf(f);let m=d[p],y=d[f];if(i){const b=p==="y"?"top":"left",x=p==="y"?"bottom":"right",v=m+u[b],w=m-u[x];m=Su(v,m,w)}if(a){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",v=y+u[b],w=y-u[x];y=Su(v,y,w)}const g=l.fn({...t,[p]:m,[f]:y});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:i,[f]:a}}}}}},z2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Hn(e,t),u={x:n,y:r},f=yn(s),p=Jf(f);let m=u[p],y=u[f];const g=Hn(l,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+b.mainAxis,N=i.reference[p]+i.reference[w]-b.mainAxis;m<S?m=S:m>N&&(m=N)}if(d){var x,v;const w=p==="y"?"width":"height",S=K0.has(Gn(s)),N=i.reference[f]-i.floating[w]+(S&&((x=a.offset)==null?void 0:x[f])||0)+(S?0:b.crossAxis),k=i.reference[f]+i.reference[w]+(S?0:((v=a.offset)==null?void 0:v[f])||0)-(S?b.crossAxis:0);y<N?y=N:y>k&&(y=k)}return{[p]:m,[f]:y}}}},B2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:a,elements:l}=t,{apply:c=()=>{},...d}=Hn(e,t),u=await yo(t,d),f=Gn(s),p=vi(s),m=yn(s)==="y",{width:y,height:g}=i.floating;let b,x;f==="top"||f==="bottom"?(b=f,x=p===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(x=f,b=p==="end"?"top":"bottom");const v=g-u.top-u.bottom,w=y-u.left-u.right,S=Cr(g-u[b],v),N=Cr(y-u[x],w),k=!t.middlewareData.shift;let j=S,C=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=v),k&&!p){const R=Nt(u.left,0),P=Nt(u.right,0),T=Nt(u.top,0),L=Nt(u.bottom,0);m?C=y-2*(R!==0||P!==0?R+P:Nt(u.left,u.right)):j=g-2*(T!==0||L!==0?T+L:Nt(u.top,u.bottom))}await c({...t,availableWidth:C,availableHeight:j});const E=await a.getDimensions(l.floating);return y!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function ql(){return typeof window<"u"}function xi(e){return Y0(e)?(e.nodeName||"").toLowerCase():"#document"}function Et(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _n(e){var t;return(t=(Y0(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y0(e){return ql()?e instanceof Node||e instanceof Et(e).Node:!1}function an(e){return ql()?e instanceof Element||e instanceof Et(e).Element:!1}function En(e){return ql()?e instanceof HTMLElement||e instanceof Et(e).HTMLElement:!1}function Ch(e){return!ql()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Et(e).ShadowRoot}const V2=new Set(["inline","contents"]);function Oo(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!V2.has(s)}const U2=new Set(["table","td","th"]);function W2(e){return U2.has(xi(e))}const H2=[":popover-open",":modal"];function Ql(e){return H2.some(t=>{try{return e.matches(t)}catch{return!1}})}const G2=["transform","translate","scale","rotate","perspective"],K2=["transform","translate","scale","rotate","perspective","filter"],Y2=["paint","layout","strict","content"];function tm(e){const t=nm(),n=an(e)?ln(e):e;return G2.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||K2.some(r=>(n.willChange||"").includes(r))||Y2.some(r=>(n.contain||"").includes(r))}function q2(e){let t=Er(e);for(;En(t)&&!li(t);){if(tm(t))return t;if(Ql(t))return null;t=Er(t)}return null}function nm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Q2=new Set(["html","body","#document"]);function li(e){return Q2.has(xi(e))}function ln(e){return Et(e).getComputedStyle(e)}function Xl(e){return an(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Er(e){if(xi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ch(e)&&e.host||_n(e);return Ch(t)?t.host:t}function q0(e){const t=Er(e);return li(t)?e.ownerDocument?e.ownerDocument.body:e.body:En(t)&&Oo(t)?t:q0(t)}function bo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=q0(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),a=Et(s);if(i){const l=ku(a);return t.concat(a,a.visualViewport||[],Oo(s)?s:[],l&&n?bo(l):[])}return t.concat(s,bo(s,[],n))}function ku(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q0(e){const t=ln(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=En(e),i=s?e.offsetWidth:n,a=s?e.offsetHeight:r,l=dl(n)!==i||dl(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function rm(e){return an(e)?e:e.contextElement}function Vs(e){const t=rm(e);if(!En(t))return jn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=Q0(t);let a=(i?dl(n.width):n.width)/r,l=(i?dl(n.height):n.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const X2=jn(0);function X0(e){const t=Et(e);return!nm()||!t.visualViewport?X2:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function J2(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Et(e)?!1:t}function is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=rm(e);let a=jn(1);t&&(r?an(r)&&(a=Vs(r)):a=Vs(e));const l=J2(i,n,r)?X0(i):jn(0);let c=(s.left+l.x)/a.x,d=(s.top+l.y)/a.y,u=s.width/a.x,f=s.height/a.y;if(i){const p=Et(i),m=r&&an(r)?Et(r):r;let y=p,g=ku(y);for(;g&&r&&m!==y;){const b=Vs(g),x=g.getBoundingClientRect(),v=ln(g),w=x.left+(g.clientLeft+parseFloat(v.paddingLeft))*b.x,S=x.top+(g.clientTop+parseFloat(v.paddingTop))*b.y;c*=b.x,d*=b.y,u*=b.x,f*=b.y,c+=w,d+=S,y=Et(g),g=ku(y)}}return fl({width:u,height:f,x:c,y:d})}function sm(e,t){const n=Xl(e).scrollLeft;return t?t.left+n:is(_n(e)).left+n}function J0(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:sm(e,r)),i=r.top+t.scrollTop;return{x:s,y:i}}function Z2(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",a=_n(r),l=t?Ql(t.floating):!1;if(r===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},d=jn(1);const u=jn(0),f=En(r);if((f||!f&&!i)&&((xi(r)!=="body"||Oo(a))&&(c=Xl(r)),En(r))){const m=is(r);d=Vs(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const p=a&&!f&&!i?J0(a,c,!0):jn(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+p.x,y:n.y*d.y-c.scrollTop*d.y+u.y+p.y}}function eE(e){return Array.from(e.getClientRects())}function tE(e){const t=_n(e),n=Xl(e),r=e.ownerDocument.body,s=Nt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Nt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+sm(e);const l=-n.scrollTop;return ln(r).direction==="rtl"&&(a+=Nt(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:a,y:l}}function nE(e,t){const n=Et(e),r=_n(e),s=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(s){i=s.width,a=s.height;const d=nm();(!d||d&&t==="fixed")&&(l=s.offsetLeft,c=s.offsetTop)}return{width:i,height:a,x:l,y:c}}const rE=new Set(["absolute","fixed"]);function sE(e,t){const n=is(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=En(e)?Vs(e):jn(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=s*i.x,d=r*i.y;return{width:a,height:l,x:c,y:d}}function Eh(e,t,n){let r;if(t==="viewport")r=nE(e,n);else if(t==="document")r=tE(_n(e));else if(an(t))r=sE(t,n);else{const s=X0(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return fl(r)}function Z0(e,t){const n=Er(e);return n===t||!an(n)||li(n)?!1:ln(n).position==="fixed"||Z0(n,t)}function iE(e,t){const n=t.get(e);if(n)return n;let r=bo(e,[],!1).filter(l=>an(l)&&xi(l)!=="body"),s=null;const i=ln(e).position==="fixed";let a=i?Er(e):e;for(;an(a)&&!li(a);){const l=ln(a),c=tm(a);!c&&l.position==="fixed"&&(s=null),(i?!c&&!s:!c&&l.position==="static"&&!!s&&rE.has(s.position)||Oo(a)&&!c&&Z0(e,a))?r=r.filter(u=>u!==a):s=l,a=Er(a)}return t.set(e,r),r}function oE(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const a=[...n==="clippingAncestors"?Ql(t)?[]:iE(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((d,u)=>{const f=Eh(t,u,s);return d.top=Nt(f.top,d.top),d.right=Cr(f.right,d.right),d.bottom=Cr(f.bottom,d.bottom),d.left=Nt(f.left,d.left),d},Eh(t,l,s));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function aE(e){const{width:t,height:n}=Q0(e);return{width:t,height:n}}function lE(e,t,n){const r=En(t),s=_n(t),i=n==="fixed",a=is(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=jn(0);function d(){c.x=sm(s)}if(r||!r&&!i)if((xi(t)!=="body"||Oo(s))&&(l=Xl(t)),r){const m=is(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else s&&d();i&&!r&&s&&d();const u=s&&!r&&!i?J0(s,l):jn(0),f=a.left+l.scrollLeft-c.x-u.x,p=a.top+l.scrollTop-c.y-u.y;return{x:f,y:p,width:a.width,height:a.height}}function Xc(e){return ln(e).position==="static"}function _h(e,t){if(!En(e)||ln(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return _n(e)===n&&(n=n.ownerDocument.body),n}function ey(e,t){const n=Et(e);if(Ql(e))return n;if(!En(e)){let s=Er(e);for(;s&&!li(s);){if(an(s)&&!Xc(s))return s;s=Er(s)}return n}let r=_h(e,t);for(;r&&W2(r)&&Xc(r);)r=_h(r,t);return r&&li(r)&&Xc(r)&&!tm(r)?n:r||q2(e)||n}const cE=async function(e){const t=this.getOffsetParent||ey,n=this.getDimensions,r=await n(e.floating);return{reference:lE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dE(e){return ln(e).direction==="rtl"}const uE={convertOffsetParentRelativeRectToViewportRelativeRect:Z2,getDocumentElement:_n,getClippingRect:oE,getOffsetParent:ey,getElementRects:cE,getClientRects:eE,getDimensions:aE,getScale:Vs,isElement:an,isRTL:dE};function ty(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fE(e,t){let n=null,r;const s=_n(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=e.getBoundingClientRect(),{left:u,top:f,width:p,height:m}=d;if(l||t(),!p||!m)return;const y=ua(f),g=ua(s.clientWidth-(u+p)),b=ua(s.clientHeight-(f+m)),x=ua(u),w={rootMargin:-y+"px "+-g+"px "+-b+"px "+-x+"px",threshold:Nt(0,Cr(1,c))||1};let S=!0;function N(k){const j=k[0].intersectionRatio;if(j!==c){if(!S)return a();j?a(!1,j):r=setTimeout(()=>{a(!1,1e-7)},1e3)}j===1&&!ty(d,e.getBoundingClientRect())&&a(),S=!1}try{n=new IntersectionObserver(N,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(N,w)}n.observe(e)}return a(!0),i}function mE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=rm(e),u=s||i?[...d?bo(d):[],...bo(t)]:[];u.forEach(x=>{s&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=d&&l?fE(d,n):null;let p=-1,m=null;a&&(m=new ResizeObserver(x=>{let[v]=x;v&&v.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),d&&!c&&m.observe(d),m.observe(t));let y,g=c?is(e):null;c&&b();function b(){const x=is(e);g&&!ty(g,x)&&n(),g=x,y=requestAnimationFrame(b)}return n(),()=>{var x;u.forEach(v=>{s&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),f==null||f(),(x=m)==null||x.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const pE=D2,hE=F2,gE=O2,vE=B2,xE=L2,Rh=M2,yE=z2,bE=(e,t,n)=>{const r=new Map,s={platform:uE,...n},i={...s.platform,_c:r};return I2(e,t,{...s,platform:i})};var wE=typeof document<"u",SE=function(){},Aa=wE?h.useLayoutEffect:SE;function ml(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,s;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(!ml(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!ml(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ny(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ph(e,t){const n=ny(e);return Math.round(t*n)/n}function Jc(e){const t=h.useRef(e);return Aa(()=>{t.current=e}),t}function NE(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[u,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=h.useState(r);ml(p,r)||m(r);const[y,g]=h.useState(null),[b,x]=h.useState(null),v=h.useCallback(_=>{_!==k.current&&(k.current=_,g(_))},[]),w=h.useCallback(_=>{_!==j.current&&(j.current=_,x(_))},[]),S=i||y,N=a||b,k=h.useRef(null),j=h.useRef(null),C=h.useRef(u),E=c!=null,R=Jc(c),P=Jc(s),T=Jc(d),L=h.useCallback(()=>{if(!k.current||!j.current)return;const _={placement:t,strategy:n,middleware:p};P.current&&(_.platform=P.current),bE(k.current,j.current,_).then(A=>{const D={...A,isPositioned:T.current!==!1};I.current&&!ml(C.current,D)&&(C.current=D,fs.flushSync(()=>{f(D)}))})},[p,t,n,P,T]);Aa(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[d]);const I=h.useRef(!1);Aa(()=>(I.current=!0,()=>{I.current=!1}),[]),Aa(()=>{if(S&&(k.current=S),N&&(j.current=N),S&&N){if(R.current)return R.current(S,N,L);L()}},[S,N,L,R,E]);const F=h.useMemo(()=>({reference:k,floating:j,setReference:v,setFloating:w}),[v,w]),O=h.useMemo(()=>({reference:S,floating:N}),[S,N]),V=h.useMemo(()=>{const _={position:n,left:0,top:0};if(!O.floating)return _;const A=Ph(O.floating,u.x),D=Ph(O.floating,u.y);return l?{..._,transform:"translate("+A+"px, "+D+"px)",...ny(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:D}},[n,l,O.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:L,refs:F,elements:O,floatingStyles:V}),[u,L,F,O,V])}const kE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Rh({element:r.current,padding:s}).fn(n):{}:r?Rh({element:r,padding:s}).fn(n):{}}}},jE=(e,t)=>({...pE(e),options:[e,t]}),CE=(e,t)=>({...hE(e),options:[e,t]}),EE=(e,t)=>({...yE(e),options:[e,t]}),_E=(e,t)=>({...gE(e),options:[e,t]}),RE=(e,t)=>({...vE(e),options:[e,t]}),PE=(e,t)=>({...xE(e),options:[e,t]}),TE=(e,t)=>({...kE(e),options:[e,t]});var AE="Arrow",ry=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return o.jsx(Q.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});ry.displayName=AE;var IE=ry;function im(e){const[t,n]=h.useState(void 0);return Ve(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let a,l;if("borderBoxSize"in i){const c=i.borderBoxSize,d=Array.isArray(c)?c[0]:c;a=d.inlineSize,l=d.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var om="Popper",[sy,Jl]=zt(om),[ME,iy]=sy(om),oy=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return o.jsx(ME,{scope:t,anchor:r,onAnchorChange:s,children:n})};oy.displayName=om;var ay="PopperAnchor",ly=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=iy(ay,n),a=h.useRef(null),l=ie(t,a);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:o.jsx(Q.div,{...s,ref:l})});ly.displayName=ay;var am="PopperContent",[OE,LE]=sy(am),cy=h.forwardRef((e,t)=>{var W,ce,xe,le,z,X;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,...g}=e,b=iy(am,n),[x,v]=h.useState(null),w=ie(t,he=>v(he)),[S,N]=h.useState(null),k=im(S),j=(k==null?void 0:k.width)??0,C=(k==null?void 0:k.height)??0,E=r+(i!=="center"?"-"+i:""),R=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},P=Array.isArray(d)?d:[d],T=P.length>0,L={padding:R,boundary:P.filter(DE),altBoundary:T},{refs:I,floatingStyles:F,placement:O,isPositioned:V,middlewareData:_}=NE({strategy:"fixed",placement:E,whileElementsMounted:(...he)=>mE(...he,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[jE({mainAxis:s+C,alignmentAxis:a}),c&&CE({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?EE():void 0,...L}),c&&_E({...L}),RE({...L,apply:({elements:he,rects:oe,availableWidth:ft,availableHeight:Ue})=>{const{width:We,height:Vt}=oe.reference,wt=he.floating.style;wt.setProperty("--radix-popper-available-width",`${ft}px`),wt.setProperty("--radix-popper-available-height",`${Ue}px`),wt.setProperty("--radix-popper-anchor-width",`${We}px`),wt.setProperty("--radix-popper-anchor-height",`${Vt}px`)}}),S&&TE({element:S,padding:l}),FE({arrowWidth:j,arrowHeight:C}),p&&PE({strategy:"referenceHidden",...L})]}),[A,D]=fy(O),Y=ze(y);Ve(()=>{V&&(Y==null||Y())},[V,Y]);const G=(W=_.arrow)==null?void 0:W.x,J=(ce=_.arrow)==null?void 0:ce.y,Z=((xe=_.arrow)==null?void 0:xe.centerOffset)!==0,[me,be]=h.useState();return Ve(()=>{x&&be(window.getComputedStyle(x).zIndex)},[x]),o.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:V?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(le=_.transformOrigin)==null?void 0:le.x,(z=_.transformOrigin)==null?void 0:z.y].join(" "),...((X=_.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(OE,{scope:n,placedSide:A,onArrowChange:N,arrowX:G,arrowY:J,shouldHideArrow:Z,children:o.jsx(Q.div,{"data-side":A,"data-align":D,...g,ref:w,style:{...g.style,animation:V?void 0:"none"}})})})});cy.displayName=am;var dy="PopperArrow",$E={top:"bottom",right:"left",bottom:"top",left:"right"},uy=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=LE(dy,r),a=$E[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(IE,{...s,ref:n,style:{...s.style,display:"block"}})})});uy.displayName=dy;function DE(e){return e!==null}var FE=e=>({name:"transformOrigin",options:e,fn(t){var b,x,v;const{placement:n,rects:r,middlewareData:s}=t,a=((b=s.arrow)==null?void 0:b.centerOffset)!==0,l=a?0:e.arrowWidth,c=a?0:e.arrowHeight,[d,u]=fy(n),f={start:"0%",center:"50%",end:"100%"}[u],p=(((x=s.arrow)==null?void 0:x.x)??0)+l/2,m=(((v=s.arrow)==null?void 0:v.y)??0)+c/2;let y="",g="";return d==="bottom"?(y=a?f:`${p}px`,g=`${-c}px`):d==="top"?(y=a?f:`${p}px`,g=`${r.floating.height+c}px`):d==="right"?(y=`${-c}px`,g=a?f:`${m}px`):d==="left"&&(y=`${r.floating.width+c}px`,g=a?f:`${m}px`),{data:{x:y,y:g}}}});function fy(e){const[t,n="center"]=e.split("-");return[t,n]}var my=oy,py=ly,hy=cy,gy=uy,[Zl,Z3]=zt("Tooltip",[Jl]),ec=Jl(),vy="TooltipProvider",zE=700,ju="tooltip.open",[BE,lm]=Zl(vy),xy=e=>{const{__scopeTooltip:t,delayDuration:n=zE,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,a=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),o.jsx(BE,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};xy.displayName=vy;var wo="Tooltip",[VE,tc]=Zl(wo),yy=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=e,c=lm(wo,e.__scopeTooltip),d=ec(t),[u,f]=h.useState(null),p=ms(),m=h.useRef(0),y=a??c.disableHoverableContent,g=l??c.delayDuration,b=h.useRef(!1),[x,v]=Wn({prop:r,defaultProp:s??!1,onChange:j=>{j?(c.onOpen(),document.dispatchEvent(new CustomEvent(ju))):c.onClose(),i==null||i(j)},caller:wo}),w=h.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),S=h.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b.current=!1,v(!0)},[v]),N=h.useCallback(()=>{window.clearTimeout(m.current),m.current=0,v(!1)},[v]),k=h.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{b.current=!0,v(!0),m.current=0},g)},[g,v]);return h.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),o.jsx(my,{...d,children:o.jsx(VE,{scope:t,contentId:p,open:x,stateAttribute:w,trigger:u,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?k():S()},[c.isOpenDelayedRef,k,S]),onTriggerLeave:h.useCallback(()=>{y?N():(window.clearTimeout(m.current),m.current=0)},[N,y]),onOpen:S,onClose:N,disableHoverableContent:y,children:n})})};yy.displayName=wo;var Cu="TooltipTrigger",by=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=tc(Cu,n),i=lm(Cu,n),a=ec(n),l=h.useRef(null),c=ie(t,l,s.onTriggerChange),d=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>d.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),o.jsx(py,{asChild:!0,...a,children:o.jsx(Q.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:c,onPointerMove:K(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:K(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:K(e.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:K(e.onFocus,()=>{d.current||s.onOpen()}),onBlur:K(e.onBlur,s.onClose),onClick:K(e.onClick,s.onClose)})})});by.displayName=Cu;var UE="TooltipPortal",[eI,WE]=Zl(UE,{forceMount:void 0}),ci="TooltipContent",wy=h.forwardRef((e,t)=>{const n=WE(ci,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,a=tc(ci,e.__scopeTooltip);return o.jsx(Yn,{present:r||a.open,children:a.disableHoverableContent?o.jsx(Sy,{side:s,...i,ref:t}):o.jsx(HE,{side:s,...i,ref:t})})}),HE=h.forwardRef((e,t)=>{const n=tc(ci,e.__scopeTooltip),r=lm(ci,e.__scopeTooltip),s=h.useRef(null),i=ie(t,s),[a,l]=h.useState(null),{trigger:c,onClose:d}=n,u=s.current,{onPointerInTransitChange:f}=r,p=h.useCallback(()=>{l(null),f(!1)},[f]),m=h.useCallback((y,g)=>{const b=y.currentTarget,x={x:y.clientX,y:y.clientY},v=QE(x,b.getBoundingClientRect()),w=XE(x,v),S=JE(g.getBoundingClientRect()),N=e_([...w,...S]);l(N),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(c&&u){const y=b=>m(b,u),g=b=>m(b,c);return c.addEventListener("pointerleave",y),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",g)}}},[c,u,m,p]),h.useEffect(()=>{if(a){const y=g=>{const b=g.target,x={x:g.clientX,y:g.clientY},v=(c==null?void 0:c.contains(b))||(u==null?void 0:u.contains(b)),w=!ZE(x,a);v?p():w&&(p(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,u,a,d,p]),o.jsx(Sy,{...e,ref:i})}),[GE,KE]=Zl(wo,{isInside:!1}),YE=Tj("TooltipContent"),Sy=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=e,c=tc(ci,n),d=ec(n),{onClose:u}=c;return h.useEffect(()=>(document.addEventListener(ju,u),()=>document.removeEventListener(ju,u)),[u]),h.useEffect(()=>{if(c.trigger){const f=p=>{const m=p.target;m!=null&&m.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),o.jsx(Ul,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:o.jsxs(hy,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.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:[o.jsx(YE,{children:r}),o.jsx(GE,{scope:n,isInside:!0,children:o.jsx(Zj,{id:c.contentId,role:"tooltip",children:s||r})})]})})});wy.displayName=ci;var Ny="TooltipArrow",qE=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=ec(n);return KE(Ny,n).isInside?null:o.jsx(gy,{...s,...r,ref:t})});qE.displayName=Ny;function QE(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function XE(e,t,n=5){const 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});break}return r}function JE(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function ZE(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,a=t.length-1;i<t.length;a=i++){const l=t[i],c=t[a],d=l.x,u=l.y,f=c.x,p=c.y;u>r!=p>r&&n<(f-d)*(r-u)/(p-u)+d&&(s=!s)}return s}function e_(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),t_(t)}function t_(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(s.y-a.y)>=(i.y-a.y)*(s.x-a.x))n.pop();else break}n.push(s)}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)}var n_=xy,r_=yy,s_=by,ky=wy;const i_=n_,o_=r_,a_=s_,jy=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>o.jsx(ky,{ref:r,sideOffset:t,className:$("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",e),...n}));jy.displayName=ky.displayName;const l_="modulepreload",c_=function(e){return"/"+e},Th={},pl=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(n.map(c=>{if(c=c_(c),c in Th)return;Th[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":l_,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((p,m)=>{f.addEventListener("load",p),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return s.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};async function Cy(e,t,n,r,s){const{runSwarmSimulation:i}=await pl(async()=>{const{runSwarmSimulation:l}=await Promise.resolve().then(()=>tR);return{runSwarmSimulation:l}},void 0);return{result:await i(e,t,n,r),source:"echelon-native"}}function d_(e,t,n){const r=[],s=e.toLowerCase();return n.outcome.toLowerCase(),(s.includes("oil")||s.includes("gas")||s.includes("energy")||s.includes("price"))&&r.push("Strategic petroleum reserve release","Fuel tax adjustment","Refinery capacity incentives","Alternative energy subsidies","Import diversification"),(s.includes("strait")||s.includes("military")||s.includes("war")||s.includes("conflict")||s.includes("sanctions"))&&r.push("Diplomatic engagement","Coalition building","Sanctions/trade policy","Military posture adjustment","Back-channel communication"),(s.includes("regulation")||s.includes("law")||s.includes("compliance")||s.includes("policy"))&&r.push("Lobbying and advocacy","Compliance framework investment","Industry coalition formation","Public comment campaigns","Alternative regulatory proposals"),(s.includes("breach")||s.includes("crisis")||s.includes("scandal")||s.includes("reputation"))&&r.push("Transparent disclosure","Stakeholder communication plan","Third-party audit/investigation","Remediation program","Leadership accountability"),(s.includes("market")||s.includes("company")||s.includes("business")||s.includes("startup"))&&r.push("Pricing strategy","Partnership/acquisition","Market positioning pivot","Capital allocation","Talent/team restructuring"),r.length===0&&r.push("Stakeholder engagement","Resource reallocation","Communication strategy","Policy change","Coalition building"),r}function u_(e,t,n,r){const s=[],i=t.priority??"important",a=t.red_lines??[];s.push({id:"strategy_direct",label:"Direct Path",description:`Aggressive, multi-lever approach to reach "${t.outcome}" as quickly as possible. Uses the most available levers simultaneously for maximum force.`,steps:f_(t,r),levers_used:r.slice(0,3),success_probability:i==="critical"?.55:.45,estimated_timeframe:t.timeframe??"30 days",risk:"high",red_line_violations:Zc("direct",a,r.slice(0,3)),dependencies:["Multiple levers must be available simultaneously","Stakeholders must not coordinate opposition","No secondary crisis emerges during execution"],failure_modes:["Aggressive action triggers backlash coalition","Resource overcommitment leaves no fallback","Speed creates execution errors"],likely_allies:n.filter(c=>c.disposition==="supportive").map(c=>c.id),likely_opponents:n.filter(c=>c.disposition==="hostile").map(c=>c.id)});const l=n.filter(c=>c.disposition==="supportive"||c.disposition==="neutral");return s.push({id:"strategy_coalition",label:"Coalition Path",description:`Build a stakeholder coalition first, then apply coordinated pressure toward "${t.outcome}". Slower but more sustainable — collective action is harder to resist.`,steps:m_(t,r,l),levers_used:["Coalition building",...r.slice(0,2)],success_probability:.6,estimated_timeframe:Ah(t.timeframe??"30 days",1.5),risk:"moderate",red_line_violations:Zc("coalition",a,["Coalition building",...r.slice(0,2)]),dependencies:["Key neutral stakeholders are persuadable","Coalition members maintain alignment throughout execution","No external shock dissolves the coalition"],failure_modes:["Coalition fractures under pressure","Opponents form counter-coalition faster","Consensus-building delays miss the window"],likely_allies:l.map(c=>c.id),likely_opponents:n.filter(c=>c.disposition==="hostile").map(c=>c.id)}),s.push({id:"strategy_incremental",label:"Incremental Path",description:`Move toward "${t.outcome}" through small, reversible steps. Each step is tested before committing further. Preserves optionality.`,steps:p_(t,r),levers_used:r.slice(0,2),success_probability:.65,estimated_timeframe:Ah(t.timeframe??"30 days",2),risk:"low",red_line_violations:[],dependencies:["Sufficient time to iterate","Each step produces measurable feedback","The goal remains viable throughout the process"],failure_modes:["Window of opportunity closes before full execution","Incremental moves are individually too small to create momentum","Competitors move faster with bolder strategies"],likely_allies:n.filter(c=>c.disposition!=="hostile").map(c=>c.id)}),r.length>=3&&s.push({id:"strategy_asymmetric",label:"Asymmetric Path",description:`Find the one lever that has outsized impact on achieving "${t.outcome}". Instead of pushing many levers, find the fulcrum.`,steps:h_(t,r),levers_used:[r[r.length-1]],success_probability:.35,estimated_timeframe:t.timeframe??"30 days",risk:"moderate",red_line_violations:Zc("asymmetric",a,[r[r.length-1]]),dependencies:["The identified fulcrum lever actually has the projected influence","Opponents don't anticipate this approach","No defensive positions are pre-established against this lever"],failure_modes:["The fulcrum lever doesn't have the expected effect","Narrow approach is easily countered once recognized","Success depends on a single point of leverage that may not hold"]}),s}function f_(e,t){const n=[],r=e.timeframe??"30 days";return n.push({order:1,action:"Deploy primary lever immediately",timeframe:"Day 1-3",lever:t[0]??"Primary action",expected_effect:"Establish momentum and signal commitment to the goal",risk:"Early commitment before full information"}),t.length>=2&&n.push({order:2,action:"Activate secondary lever to create pressure from a different angle",timeframe:"Day 3-7",lever:t[1],expected_effect:"Create multi-directional pressure that's harder to resist",risk:"Resource strain from parallel execution"}),t.length>=3&&n.push({order:3,action:"Apply tertiary lever to close remaining gaps",timeframe:"Day 7-14",lever:t[2],expected_effect:"Address residual resistance and accelerate toward goal",risk:"Overextension if earlier levers haven't produced results"}),n.push({order:n.length+1,action:"Evaluate progress against success criteria and adjust",timeframe:`Day 14-${r}`,lever:"Assessment and adjustment",expected_effect:"Course correction based on actual results vs. projections",risk:"Sunk cost bias may prevent necessary pivots"}),n}function m_(e,t,n){return[{order:1,action:`Build coalition with ${n.length>0?n.map(r=>r.id).slice(0,3).join(", "):"key neutral stakeholders"}`,timeframe:"Week 1-2",lever:"Coalition building",expected_effect:"Create collective leverage that exceeds individual power",risk:"Coalition formation takes time; window may narrow"},{order:2,action:"Align coalition on shared strategy and communication",timeframe:"Week 2-3",lever:"Coordination",expected_effect:"Unified messaging prevents opponents from dividing the coalition",risk:"Internal disagreements may surface during alignment"},{order:3,action:"Execute coordinated lever deployment",timeframe:"Week 3-4",lever:t[0]??"Primary collective action",expected_effect:`Coalition moves together toward "${e.outcome}"`,risk:"Weakest coalition member may defect under pressure"},{order:4,action:"Sustain pressure and consolidate gains",timeframe:"Week 4+",lever:t[1]??"Sustained engagement",expected_effect:"Lock in progress and prevent rollback",risk:"Coalition fatigue and attention drift"}]}function p_(e,t){return[{order:1,action:"Take smallest possible step toward the goal to test feasibility",timeframe:"Week 1",lever:t[0]??"Pilot action",expected_effect:"Generate signal about whether this direction works",risk:"Minimal — designed to be reversible"},{order:2,action:"Evaluate step 1 results against success criteria",timeframe:"Week 2",lever:"Assessment",expected_effect:"Determine if the approach is viable before scaling",risk:"May not be enough data for confident evaluation"},{order:3,action:"Scale up if step 1 produced positive signal; pivot if not",timeframe:"Week 3-4",lever:t[1]??t[0]??"Scaled action",expected_effect:"Either accelerate a proven approach or redirect resources",risk:"Competitors may move faster with bolder approaches"},{order:4,action:"Continue test-and-scale cycle until success criteria met",timeframe:"Ongoing",lever:"Iterative execution",expected_effect:"Converge toward the goal through validated learning",risk:"Window of opportunity may close before iteration completes"}]}function h_(e,t){const n=t[t.length-1];return[{order:1,action:`Identify the highest-leverage point in the system — test "${n}"`,timeframe:"Day 1-5",lever:"Analysis and targeting",expected_effect:"Find the single point where minimal force creates maximum effect",risk:"Analysis may identify the wrong fulcrum"},{order:2,action:`Prepare and execute asymmetric move using ${n}`,timeframe:"Day 5-10",lever:n,expected_effect:"Disproportionate impact through a single, well-targeted intervention",risk:"If the fulcrum doesn't hold, there's no backup in progress"},{order:3,action:"Exploit the opening created by the asymmetric move",timeframe:"Day 10-20",lever:"Exploitation of advantage",expected_effect:"Convert initial disruption into sustained progress toward goal",risk:"Opponents may adapt quickly once they understand the approach"}]}function Zc(e,t,n){const r=[];for(const s of t){const i=s.toLowerCase();for(const a of n){const l=a.toLowerCase();(i.includes("military")&&l.includes("military")||i.includes("tax")&&l.includes("tax")||i.includes("force")&&l.includes("force")||i.includes("sanctions")&&l.includes("sanction"))&&r.push(`Strategy "${e}" uses "${a}" which may conflict with red line: "${s}"`)}}return r}function Ah(e,t){const n=e.match(/(\d+)\s*(day|week|month|year)/i);if(!n)return e;const r=parseInt(n[1]),s=n[2].toLowerCase();return`${Math.ceil(r*t)} ${s}s`}async function g_(e,t,n,r,s){const i=`${t} [Strategy being tested: ${e.label} — ${e.description}]`,a={id:e.id,label:e.label,description:e.description,projected_outcome:`Goal: ${n.outcome}`,probability:e.success_probability,risk:e.risk,tradeoffs:e.failure_modes.map(g=>g),benefits_stakeholders:e.likely_allies,harms_stakeholders:e.likely_opponents},c=(await Cy(i,r,[a],s)).result,d=c.rounds.length>0?c.rounds[c.rounds.length-1].reactions.reduce((g,b)=>g+b.impact,0)/c.rounds[c.rounds.length-1].reactions.length:0,u=Math.max(0,Math.min(1,(d+1)/2)),f=u>.7,p=[];for(const g of e.red_line_violations)p.push(g);const m=[];for(const g of c.rounds)if(g.emergent_dynamics)for(const b of g.emergent_dynamics)(b.toLowerCase().includes("opposition")||b.toLowerCase().includes("polariz")||b.toLowerCase().includes("coalition risk"))&&m.push(b);const y=c.rounds.length>0?c.rounds[c.rounds.length-1].reactions:[];return{strategy_id:e.id,goal_reached:f,goal_proximity:Number(u.toFixed(2)),steps_to_goal:f?c.rounds.length:"not_reached",stakeholder_reactions:y,unintended_consequences:m,red_lines_crossed:p}}async function v_(e,t){var f,p;const n=e.goal,r=n.available_levers&&n.available_levers.length>0?n.available_levers:d_(e.scenario,t,n),s=u_(e.scenario,n,t,r);let i=[];if((f=e.swarm)!=null&&f.enabled&&t.length>0){const m=s.map(y=>g_(y,e.scenario,n,t,e.swarm));i=await Promise.all(m)}else i=s.map(m=>({strategy_id:m.id,goal_reached:m.success_probability>.5,goal_proximity:m.success_probability,steps_to_goal:m.success_probability>.5?Math.ceil(3/m.success_probability):"not_reached",stakeholder_reactions:[],unintended_consequences:m.risk==="high"?["High-risk strategies may trigger unforeseen opposition"]:[],red_lines_crossed:m.red_line_violations}));const a=[...s].sort((m,y)=>{const g=i.find(N=>N.strategy_id===m.id),b=i.find(N=>N.strategy_id===y.id),x=(g==null?void 0:g.red_lines_crossed.length)??0,v=(b==null?void 0:b.red_lines_crossed.length)??0;if(x>0&&v===0)return 1;if(v>0&&x===0)return-1;const w=(g==null?void 0:g.goal_proximity)??m.success_probability;return((b==null?void 0:b.goal_proximity)??y.success_probability)-w}),l=a[0],c=i.find(m=>m.strategy_id===l.id),d=x_(l,c,n,a),u=a.slice(1).map(m=>{const y=i.find(b=>b.strategy_id===m.id);let g;return((y==null?void 0:y.red_lines_crossed.length)??0)>0?g=`Violates red line: ${y.red_lines_crossed[0]}`:((y==null?void 0:y.goal_proximity)??0)<.3?g=`Low goal proximity (${(((y==null?void 0:y.goal_proximity)??0)*100).toFixed(0)}%)`:g="Lower overall success probability than recommended path",{label:m.label,reason:g}});return{goal:n,strategies:a,swarm_tests:i,recommended_strategy_id:l.id,recommendation_rationale:d,immediate_next_step:((p=l.steps[0])==null?void 0:p.action)??"Begin assessment",rejected_strategies:u}}function x_(e,t,n,r){const s=[];s.push(`"${e.label}" is recommended because it offers the best risk-adjusted path toward "${n.outcome}".`),t!=null&&t.goal_reached?s.push(`Swarm simulation shows this strategy reaching the goal with ${(t.goal_proximity*100).toFixed(0)}% proximity.`):t&&s.push(`Swarm simulation shows ${(t.goal_proximity*100).toFixed(0)}% proximity to the goal — partial success is likely.`),e.red_line_violations.length===0&&s.push("This strategy respects all stated red lines.");const i=r.length-1;return s.push(`${i} alternative ${i===1?"strategy was":"strategies were"} evaluated and ranked lower.`),s.join(" ")}function y_(e,t,n){const r=(t.stakeholders??[]).map(i=>typeof i=="string"?{id:i,disposition:"unknown"}:i),s={version:"1.0",created_at:new Date().toISOString(),title:e,scenario:t.scenario,stakeholders:r,assumptions:t.assumptions??{},constraints:t.constraints??{},signals:n==null?void 0:n.signals,depth:t.depth??"standard",perspective:t.perspective??"strategic_advisor",swarm:t.swarm,tags:n==null?void 0:n.tags,author:n==null?void 0:n.author};return{...s,capsule_hash:Ey(s)}}function b_(e){const t=JSON.stringify(e);return typeof btoa=="function"?btoa(unescape(encodeURIComponent(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):Buffer.from(t,"utf-8").toString("base64url")}function w_(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4;)t+="=";let n;typeof atob=="function"?n=decodeURIComponent(escape(atob(t))):n=Buffer.from(t,"base64").toString("utf-8");const r=JSON.parse(n),{capsule_hash:s,...i}=r;if(Ey(i)!==s)throw new Error("Capsule integrity check failed — data may have been tampered with");return r}function S_(e,t="https://mirotir.com"){const n=b_(e);return`${t}/run#capsule=${n}`}function N_(e){const t=e.indexOf("#capsule=");if(t===-1)return null;const n=e.slice(t+9);return w_(n)}function Ey(e){const t=JSON.stringify(e);let n=0;for(let r=0;r<t.length;r++){const s=t.charCodeAt(r);n=(n<<5)-n+s,n=n&n}return`cap_${Math.abs(n).toString(36)}`}const di={strait_of_hormuz:{title:"Strait of Hormuz Closes",scenario:"The Strait of Hormuz is closed due to military conflict. 20% of global oil supply is disrupted. Oil prices spike 40% in 48 hours. Global supply chains begin to fracture.",stakeholders:[{id:"Energy Companies",disposition:"supportive",priorities:["supply security","price stability"]},{id:"Consumers",disposition:"hostile",priorities:["affordable fuel","economic stability"]},{id:"Government",disposition:"neutral",priorities:["national security","economic stability","election impact"]},{id:"Military",disposition:"neutral",priorities:["strategic positioning","force projection"]},{id:"Financial Markets",disposition:"hostile",priorities:["stability","predictability"]},{id:"OPEC",disposition:"unknown",priorities:["market share","price control"]}],assumptions:{severity:"critical",environmental_hostility:"high",time_pressure:"immediate",regulatory_climate:"strict"},constraints:{time_horizon:"30 days",regulatory:["international maritime law","sanctions framework"],risk_tolerance:"conservative"},signals:{oil_price_spike:"40%",shipping_disruption:!0,military_presence:"elevated",diplomatic_channels:"active"},depth:"full",perspective:"strategic_advisor",swarm:{enabled:!0,rounds:5,reaction_model:"mixed"},tags:["geopolitical","energy","crisis","supply-chain"],world:{world_id:"geopolitics_energy",name:"Geopolitics & Energy Crisis",inline_definition:{thesis:"Geopolitical disruptions to energy supply chains create cascading economic and political effects",state_variables:[{id:"oil_supply_disruption",label:"Oil Supply Disruption %",type:"number",range:{min:0,max:100},default_value:20},{id:"military_escalation",label:"Military Escalation Level",type:"enum",enum_values:["posturing","limited_engagement","full_conflict"],default_value:"limited_engagement"},{id:"diplomatic_channels_open",label:"Diplomatic Channels Open",type:"boolean",default_value:!0},{id:"strategic_reserve_release",label:"Strategic Reserve Release %",type:"number",range:{min:0,max:50},default_value:0},{id:"media_hostility",label:"Media Hostility",type:"number",range:{min:0,max:1},default_value:.7}],invariants:[{id:"INV-001",description:"Energy supply disruption > 30% triggers emergency pricing mechanisms",enforceable:!0},{id:"INV-002",description:"Military escalation restricts diplomatic solution space",enforceable:!0},{id:"INV-003",description:"Consumer sentiment inversely correlates with price spikes",enforceable:!0}],gates:[{id:"GATE-001",label:"Market Panic",condition:"oil_supply_disruption > 40",severity:"critical"},{id:"GATE-002",label:"Diplomatic Window Closing",condition:"military_escalation == full_conflict",severity:"critical"}]}}},gas_price_spike:{title:"Gas Prices Hit $5/Gallon",scenario:"US gas prices spike to $5/gallon driven by supply disruption and refinery constraints. Consumer sentiment craters. Midterm elections are 6 months away. EV adoption accelerates but grid infrastructure can't keep up.",stakeholders:[{id:"Consumers",disposition:"hostile",priorities:["affordability","commute costs"]},{id:"Oil Companies",disposition:"supportive",priorities:["margins","market position"]},{id:"Politicians",disposition:"hostile",priorities:["re-election","constituent pressure"]},{id:"EV Manufacturers",disposition:"supportive",priorities:["market share","adoption"]},{id:"Grid Operators",disposition:"neutral",priorities:["reliability","capacity"]},{id:"Trucking Industry",disposition:"hostile",priorities:["operating costs","contracts"]}],assumptions:{severity:"high",environmental_hostility:"high",time_pressure:"urgent",regulatory_climate:"strict"},constraints:{time_horizon:"6 months",regulatory:["EPA","DOE","state fuel regulations"],risk_tolerance:"moderate"},signals:{gas_price:"$5.00/gal",consumer_sentiment:"very_low",ev_demand_spike:"35%",grid_capacity_surplus:"-12%"},depth:"full",perspective:"strategic_advisor",swarm:{enabled:!0,rounds:4,reaction_model:"mixed"},tags:["economic","energy","political","consumer"],world:{world_id:"economic_energy",name:"Economic Energy Shock",inline_definition:{thesis:"Energy price spikes create political, economic, and social cascading effects with EV transition implications",state_variables:[{id:"gas_price",label:"Gas Price ($/gal)",type:"number",range:{min:2,max:10},default_value:5},{id:"consumer_sentiment",label:"Consumer Sentiment",type:"number",range:{min:0,max:1},default_value:.2},{id:"ev_demand_surge",label:"EV Demand Surge %",type:"number",range:{min:0,max:100},default_value:35},{id:"election_proximity_months",label:"Months to Election",type:"number",range:{min:0,max:24},default_value:6},{id:"grid_capacity",label:"Grid Spare Capacity %",type:"number",range:{min:-30,max:30},default_value:-12}],invariants:[{id:"INV-001",description:"Gas price > $4.50 triggers political crisis mode",enforceable:!0},{id:"INV-002",description:"EV demand surge without grid capacity creates secondary crisis",enforceable:!0},{id:"INV-003",description:"Election proximity amplifies political response intensity",enforceable:!0}],gates:[{id:"GATE-001",label:"Political Crisis",condition:"gas_price > 4.5 && election_proximity_months < 12",severity:"critical"},{id:"GATE-002",label:"Grid Failure Risk",condition:"ev_demand_surge > 30 && grid_capacity < 0",severity:"warning"}]}}},ai_regulation_crisis:{title:"Major AI Regulation Passes",scenario:"The EU passes sweeping AI regulation requiring full model transparency, mandatory audits, and liability for AI-generated outputs. US lawmakers signal similar legislation within 12 months. Open-source AI communities face existential compliance questions.",stakeholders:[{id:"AI Companies",disposition:"hostile",priorities:["innovation speed","competitive advantage","IP protection"]},{id:"Regulators",disposition:"supportive",priorities:["public safety","accountability","precedent"]},{id:"Open Source Community",disposition:"hostile",priorities:["freedom","access","collaboration"]},{id:"Enterprise Customers",disposition:"neutral",priorities:["compliance","reliability","cost"]},{id:"Civil Society",disposition:"supportive",priorities:["transparency","fairness","rights"]}],assumptions:{severity:"high",environmental_hostility:"moderate",time_pressure:"low",regulatory_climate:"adversarial"},constraints:{time_horizon:"18 months",regulatory:["EU AI Act","proposed US AI legislation"],risk_tolerance:"moderate"},depth:"full",perspective:"strategic_advisor",swarm:{enabled:!0,rounds:4,reaction_model:"rational"},tags:["ai","regulation","technology","policy"],world:{world_id:"ai_regulation",name:"AI Regulation Landscape",inline_definition:{thesis:"AI regulation creates compliance burdens that reshape competitive dynamics between open and closed AI ecosystems",state_variables:[{id:"regulation_strictness",label:"Regulation Strictness",type:"number",range:{min:0,max:1},default_value:.8},{id:"enforcement_timeline_months",label:"Enforcement Timeline (months)",type:"number",range:{min:3,max:36},default_value:18},{id:"open_source_exemption",label:"Open Source Exemption",type:"boolean",default_value:!1},{id:"us_follows_eu",label:"US Follows EU",type:"boolean",default_value:!0},{id:"compliance_cost_multiplier",label:"Compliance Cost Multiplier",type:"number",range:{min:1,max:10},default_value:3}],invariants:[{id:"INV-001",description:"Strict regulation without open-source exemption eliminates small AI labs",enforceable:!0},{id:"INV-002",description:"Cross-jurisdiction regulation creates compliance arbitrage opportunities",enforceable:!0},{id:"INV-003",description:"Enterprise customers require compliance before adoption",enforceable:!0}],gates:[{id:"GATE-001",label:"Market Consolidation",condition:"compliance_cost_multiplier > 5 && !open_source_exemption",severity:"critical"},{id:"GATE-002",label:"Innovation Flight",condition:"regulation_strictness > 0.7 && !us_follows_eu",severity:"warning"}]}}},science_research:{title:"Governed Science Research Pipeline",scenario:"A research team uses AI agents to search literature, analyze findings, cross-reference sources, generate hypotheses, and publish results. Governance enforces scientific rigor: blocking unsupported claims, requiring source validation, and ensuring confidence thresholds before publication.",stakeholders:[{id:"Research Agent",disposition:"neutral",priorities:["discovery","accuracy","publication"]},{id:"Peer Reviewers",disposition:"neutral",priorities:["rigor","reproducibility","novelty"]},{id:"Journal Editors",disposition:"neutral",priorities:["quality","impact","integrity"]},{id:"Funding Bodies",disposition:"supportive",priorities:["return on investment","credibility","public benefit"]},{id:"Public",disposition:"neutral",priorities:["trust","safety","accessibility"]},{id:"Institutional Review",disposition:"neutral",priorities:["ethics","compliance","methodology"]}],assumptions:{severity:"moderate",environmental_hostility:"low",time_pressure:"moderate",regulatory_climate:"strict"},constraints:{time_horizon:"research cycle",regulatory:["institutional review","publication standards","data integrity"],risk_tolerance:"conservative"},depth:"full",perspective:"strategic_advisor",swarm:{enabled:!0,rounds:6,reaction_model:"rational"},tags:["science","research","ai-agents","integrity","scienceclaw"],world:{world_id:"science_research",name:"Scientific Research Governance",inline_definition:{thesis:"AI-assisted research requires governance at every stage — from literature search through publication — to maintain scientific integrity and prevent unsupported claims",state_variables:[{id:"source_count",label:"Verified Sources",type:"number",range:{min:0,max:50},default_value:0},{id:"confidence_level",label:"Confidence Level",type:"number",range:{min:0,max:1},default_value:.3},{id:"hypothesis_validated",label:"Hypothesis Validated",type:"boolean",default_value:!1},{id:"peer_review_status",label:"Peer Review Status",type:"enum",enum_values:["none","submitted","reviewed","approved"],default_value:"none"},{id:"publication_readiness",label:"Publication Readiness %",type:"number",range:{min:0,max:100},default_value:0}],invariants:[{id:"INV-001",description:"Literature search must return at least 2 peer-reviewed sources before analysis can proceed",enforceable:!0},{id:"INV-002",description:"Claims must cite specific sources — unsupported assertions are blocked",enforceable:!0},{id:"INV-003",description:"Publication requires confidence level above 0.7 and validated hypothesis",enforceable:!0},{id:"INV-004",description:"Cross-referencing must compare at least 3 independent sources to confirm findings",enforceable:!0},{id:"INV-005",description:"Recommendations must include uncertainty language when confidence is below 0.9",enforceable:!0}],gates:[{id:"GATE-001",label:"Insufficient Evidence",condition:"source_count < 2 && confidence_level > 0.5",severity:"critical"},{id:"GATE-002",label:"Premature Publication",condition:"publication_readiness < 60 || !hypothesis_validated",severity:"critical"},{id:"GATE-003",label:"Low Confidence Alert",condition:"confidence_level < 0.4",severity:"warning"}]}}}};function _y(e,t){var a,l,c,d,u,f;const n=e.scenario.slice(0,40).replace(/[^a-zA-Z0-9]/g,"_").toLowerCase(),r={};if((a=e.assumptions)!=null&&a.severity&&(r.severity={type:"enum",options:["low","moderate","high","critical"],default:e.assumptions.severity,mutable:!0,label:"Severity",description:"Severity of the situation"}),(l=e.assumptions)!=null&&l.environmental_hostility&&(r.environmental_hostility={type:"enum",options:["low","moderate","high"],default:e.assumptions.environmental_hostility,mutable:!0,label:"Environmental Hostility",description:"External environment hostility"}),(c=e.assumptions)!=null&&c.time_pressure&&(r.time_pressure={type:"enum",options:["none","low","moderate","urgent","immediate"],default:e.assumptions.time_pressure,mutable:!0,label:"Time Pressure",description:"Time pressure on decision"}),(d=e.assumptions)!=null&&d.regulatory_climate&&(r.regulatory_climate={type:"enum",options:["permissive","neutral","strict","adversarial"],default:e.assumptions.regulatory_climate,mutable:!0,label:"Regulatory Climate",description:"Regulatory environment"}),t!=null&&t.state_variables)for(const p of t.state_variables)r[p.id]={type:p.type,options:p.enum_values?[...p.enum_values]:void 0,min:(u=p.range)==null?void 0:u.min,max:(f=p.range)==null?void 0:f.max,default:p.default_value,mutable:!0,label:p.label,description:p.label};const s=((t==null?void 0:t.invariants)??[]).map(p=>({id:p.id,label:p.description,enforcement:p.enforceable?"structural":"prompt",mutable:!1})),i=((t==null?void 0:t.gates)??[]).map(p=>({status:k_(p.severity),field:p.id,operator:"==",value:1,color:p.severity==="critical"?"#ef4444":p.severity==="warning"?"#f59e0b":"#22c55e",icon:p.severity==="critical"?"alert-triangle":p.severity==="warning"?"alert-circle":"info"}));return{world:{world_id:`echelon_${n}`,name:e.scenario.slice(0,60),thesis:(t==null?void 0:t.thesis)??`Reasoning world for: ${e.scenario.slice(0,100)}`,version:"1.0.0",runtime_mode:"SIMULATION",default_assumption_profile:"baseline",default_alternative_profile:"stressed",modules:[],players:{thinking_space:!0,experience_space:!1,action_space:!1}},invariants:s,assumptions:{profiles:{baseline:{name:"Baseline",description:"Default assumptions from the scenario",is_default_baseline:!0,parameters:j_(e)},stressed:{name:"Stressed",description:"Worst-case assumption profile",is_default_alternative:!0,parameters:C_()}},parameter_definitions:{}},stateSchema:{variables:r,presets:{}},rules:[],gates:{viability_classification:i.length>0?i:[{status:"STABLE",field:"severity",operator:"==",value:1,color:"#22c55e",icon:"check-circle"}],structural_override:{description:"Echelon governance enforcement",enforcement:"mandatory"},sustainability_threshold:30,collapse_visual:{background:"#1a0000",text:"#ef4444",border:"#7f1d1d",label:"SCENARIO COLLAPSES"}},outcomes:{computed_outcomes:[],comparison_layout:{primary_card:"viability",status_badge:"severity",structural_indicators:[]}},metadata:{format_version:"1.0",created_at:new Date().toISOString(),last_modified:new Date().toISOString(),authoring_method:"manual-authoring"}}}function k_(e){switch(e){case"info":return"STABLE";case"warning":return"COMPRESSED";case"critical":return"CRITICAL"}}function j_(e){var n,r,s,i;const t={};return(n=e.assumptions)!=null&&n.severity&&(t.severity=e.assumptions.severity),(r=e.assumptions)!=null&&r.environmental_hostility&&(t.environmental_hostility=e.assumptions.environmental_hostility),(s=e.assumptions)!=null&&s.time_pressure&&(t.time_pressure=e.assumptions.time_pressure),(i=e.assumptions)!=null&&i.regulatory_climate&&(t.regulatory_climate=e.assumptions.regulatory_climate),t}function C_(){return{severity:"critical",environmental_hostility:"high",time_pressure:"immediate",regulatory_climate:"adversarial"}}function Ry(e,t,n){return{status:"ALLOW",reason:"NeuroverseOS guard not loaded — permissive fallback"}}function Py(e,t){return{worldId:e.world.world_id,worldName:e.world.name,profile:"baseline",initialState:{},steps:[],finalState:{},finalViability:"STABLE",collapsed:!1}}function E_(e,t){return{worldId:e.world.world_id,worldName:e.world.name,worldVersion:e.world.version,validatedAt:Date.now(),durationMs:0,summary:{errors:0,warnings:0,info:0,completenessScore:100,invariantCoverage:100,canRun:!0,isHealthy:!0},validationMode:t??"standard",findings:[]}}function __(e){const t=[];if(t.push({rule_id:e.ruleId??"NV-GUARD",rule:`NeuroverseOS guard evaluation: ${e.status}`,passed:e.status==="ALLOW",detail:e.reason??"Guard evaluation completed"}),e.evidence){const n=e.evidence;if(n.safetyChecks)for(const r of n.safetyChecks)t.push({rule_id:`NV-SAFETY-${r.check}`,rule:`Safety: ${r.check}`,passed:!r.triggered,detail:r.triggered?`Triggered: ${r.evidence??"pattern match"}`:"Passed"});if(n.guardChecks)for(const r of n.guardChecks)t.push({rule_id:`NV-GUARD-${r.guardId}`,rule:r.label??`Guard ${r.guardId}`,passed:!r.triggered,detail:r.triggered?`Triggered: ${r.enforcement??"block"}`:"Passed"});if(n.invariantChecks)for(const r of n.invariantChecks)t.push({rule_id:`NV-INV-${r.invariantId}`,rule:r.label??`Invariant ${r.invariantId}`,passed:r.satisfied,detail:r.satisfied?"Satisfied":"Violated"});if(n.kernelCheck){const r=n.kernelCheck;t.push({rule_id:"NV-KERNEL",rule:"Kernel boundary enforcement",passed:!r.triggered,detail:r.triggered?`Kernel violation: ${r.patternId??"forbidden pattern"}`:"Passed"})}}return t}function R_(e){const t=e.steps.reduce((r,s)=>r+s.rulesFired,0);let n="none";return e.collapsed||e.finalViability==="CRITICAL"?n="high":e.finalViability==="COMPRESSED"?n="moderate":t>e.steps.length*3&&(n="low"),{viability:e.finalViability,collapsed:e.collapsed,rulesFired:t,collapseRisk:n,stateTrajectory:e.steps.map(r=>r.stateAfter)}}function P_(e){const t=[];if(t.push(`WORLD_HEALTH: ${e.summary.isHealthy?"HEALTHY":"DEGRADED"} (${e.summary.completenessScore}% complete)`),e.summary.invariantCoverage<100&&t.push(`INVARIANT_COVERAGE: ${e.summary.invariantCoverage}% — ${100-e.summary.invariantCoverage}% of invariants lack guard backing`),e.summary.governanceHealth){const n=e.summary.governanceHealth;t.push(`GOVERNANCE_RISK: ${n.riskLevel} (${n.surfacesCovered}/${n.surfacesTotal} surfaces governed)`)}return e.summary.errors>0&&t.push(`WORLD_ERRORS: ${e.summary.errors} structural issues detected`),t}const T_=[{id:"ECH-001",rule:"Reasoning must be bounded by declared authority level",check:e=>!0,detail:"Authority level: ANALYSIS_ONLY — no execution capability"},{id:"ECH-002",rule:"All reasoning paths must include tradeoff analysis",check:e=>!0,detail:"Path decomposition always generates tradeoffs"},{id:"ECH-003",rule:"Assumption challenges must be generated for caller-provided assumptions",check:e=>!0,detail:"Challenge engine runs on all declared assumptions"},{id:"ECH-004",rule:"No scenario data may be persisted after response",check:e=>!0,detail:"Stateless: request data exists only during processing"},{id:"ECH-005",rule:"Governance trace must be included in every response",check:e=>!0,detail:"Governance trace is non-optional in ReasonResponse"}];function A_(e,t){const n=[];let r=!0,s,i,a,l,c;const d=[];try{c=_y(e,t),i=Ry(e,c,{trace:!0});const f=__(i);n.push(...f),i.status==="BLOCK"&&n.push({rule_id:"NV-BLOCK",rule:"NeuroverseOS guard issued BLOCK — governance intervention active",passed:!1,detail:`Guard blocked: ${i.reason??"Action blocked by guard"}. Continuing in governed advisory mode.`}),i.status==="PAUSE"&&n.push({rule_id:"NV-PAUSE",rule:"NeuroverseOS guard issued PAUSE",passed:!0,detail:`Guard paused: ${i.reason??"Review recommended"}. Continuing in advisory mode.`})}catch(f){n.push({rule_id:"NV-ERROR",rule:"NeuroverseOS guard evaluation",passed:!0,detail:`Guard evaluation error: ${f instanceof Error?f.message:"unknown"}. Falling back to Echelon-only governance.`})}if(c)try{a=E_(c),n.push({rule_id:"NV-VALIDATE",rule:"NeuroverseOS world validation",passed:a.summary.canRun,detail:`World health: ${a.summary.isHealthy?"HEALTHY":"DEGRADED"} — ${a.summary.completenessScore}% complete, ${a.summary.invariantCoverage}% invariant coverage`});const f=P_(a);d.push(...f)}catch(f){n.push({rule_id:"NV-VALIDATE-ERROR",rule:"NeuroverseOS world validation",passed:!0,detail:`Validation error: ${f instanceof Error?f.message:"unknown"}`})}let u;if(c)try{l=Py(c,{steps:3}),u=R_(l),n.push({rule_id:"NV-SIMULATE",rule:"NeuroverseOS deterministic simulation",passed:!l.collapsed,detail:`Viability: ${l.finalViability} — ${l.collapsed?"COLLAPSED":"viable"} after ${l.steps.length} steps, ${u.rulesFired} rules fired`}),l.collapsed&&d.push(`SIMULATION_COLLAPSE: World collapses at step ${l.collapseStep} (rule: ${l.collapseRule??"unknown"})`)}catch(f){n.push({rule_id:"NV-SIMULATE-ERROR",rule:"NeuroverseOS simulation",passed:!0,detail:`Simulation error: ${f instanceof Error?f.message:"unknown"}`})}for(const f of T_){const p=f.check(e);n.push({rule_id:f.id,rule:f.rule,passed:p,detail:f.detail}),p||(r=!1,s=s??`Echelon constitutional violation: ${f.rule}`)}return{checks:n,allowed:r,blockReason:s,guardVerdict:i,validationReport:a,simulationResult:l,world:c,enforcedConstraints:d,governanceSignals:u}}const I_="0.1.0";function M_(e){if(!e.scenario||e.scenario.trim().length===0)return{valid:!1,error:{code:"INVALID_REQUEST",message:"scenario is required"}};if(e.scenario.trim().length<10)return{valid:!1,error:{code:"SCENARIO_TOO_VAGUE",message:"Scenario must be at least 10 characters. Provide enough context for meaningful reasoning."}};const t=["quick","standard","full","exhaustive"];return e.depth&&!t.includes(e.depth)?{valid:!1,error:{code:"INVALID_REQUEST",message:`Invalid depth "${e.depth}". Must be one of: ${t.join(", ")}`}}:{valid:!0}}function O_(e){return!e||e.length===0?[]:e.map(t=>typeof t=="string"?{id:t,disposition:"unknown"}:t)}function L_(e){switch(e){case"quick":return 2;case"standard":return 3;case"full":return 5;case"exhaustive":return 8}}function $_(){const e=Date.now().toString(36),t=Math.random().toString(36).slice(2,8);return`rsn_${e}_${t}`}function D_(){const e=Date.now().toString(36),t=Math.random().toString(36).slice(2,8);return`gov_${e}_${t}`}function F_(e,t,n,r){const s=L_(n),i=[],a=e.toLowerCase(),l=a.includes("strait")||a.includes("war")||a.includes("sanctions")||a.includes("blockade")||a.includes("geopolitical"),c=a.includes("price")||a.includes("inflation")||a.includes("recession")||a.includes("market")||a.includes("gas")||a.includes("oil"),d=a.includes("breach")||a.includes("crisis")||a.includes("attack")||a.includes("failure");for((l||c)&&(i.push({id:"path_immediate_response",label:"Immediate Response",description:"Take decisive action within 24-48 hours to position ahead of market/political reactions",projected_outcome:"First-mover advantage but higher risk of overreaction if situation de-escalates",probability:.6,risk:"moderate",tradeoffs:["Speed vs. accuracy of assessment","Resource commitment before full picture emerges","Potential to signal panic to stakeholders"],benefits_stakeholders:t.filter(u=>u.disposition==="hostile").map(u=>u.id),harms_stakeholders:t.filter(u=>u.disposition==="neutral").map(u=>u.id)}),i.push({id:"path_hedge_and_monitor",label:"Hedge and Monitor",description:"Implement defensive positions while gathering intelligence on how the situation develops",projected_outcome:"Balanced exposure with ability to pivot in either direction",probability:.75,risk:"low",tradeoffs:["May miss optimal timing for decisive action","Hedging costs reduce upside potential","Requires ongoing monitoring infrastructure"],benefits_stakeholders:t.filter(u=>u.disposition!=="hostile").map(u=>u.id)}),s>=3&&i.push({id:"path_opportunistic",label:"Opportunistic Pivot",description:"Identify and exploit opportunities that emerge from the disruption",projected_outcome:"High upside potential if disruption creates market gaps, but requires capital and risk appetite",probability:.4,risk:"high",tradeoffs:["Requires significant capital deployment under uncertainty","Reputational risk of appearing to profit from crisis","Competitive advantage if successful"]})),d&&i.push({id:"path_containment",label:"Contain and Communicate",description:"Prioritize damage containment with transparent stakeholder communication",projected_outcome:"Faster trust recovery but full exposure of extent of issue",probability:.7,risk:"moderate",tradeoffs:["Transparency vs. legal exposure","Speed of communication vs. accuracy","Short-term pain for long-term trust"]});i.length<Math.min(s,2);)i.push({id:`path_${i.length+1}`,label:`Analysis Path ${i.length+1}`,description:`Structured analysis branch ${i.length+1} for the given scenario`,projected_outcome:"Outcome depends on assumptions and constraint satisfaction",probability:.5,risk:"moderate",tradeoffs:["Requires further analysis to fully evaluate"]});return i.slice(0,s)}function z_(e,t){const n=[],r=e.assumptions;return r!=null&&r.severity&&n.push({assumption:`Severity is "${r.severity}"`,challenge:"Severity assessments made early in a developing situation are frequently revised. Historical data shows initial severity estimates are wrong 40% of the time.",impact_if_wrong:r.severity==="high"||r.severity==="critical"?"If severity is actually lower, you may over-allocate resources and signal panic unnecessarily":"If severity is actually higher, delayed response compounds damage exponentially",severity:"high"}),((r==null?void 0:r.time_pressure)==="urgent"||(r==null?void 0:r.time_pressure)==="immediate")&&n.push({assumption:`Time pressure is "${r.time_pressure}"`,challenge:"Perceived urgency often compresses decision quality. Consider whether the urgency is real (external deadline) or manufactured (internal anxiety).",impact_if_wrong:"Rushing decisions under false urgency leads to commitment to suboptimal paths that are costly to reverse",severity:"moderate"}),(r==null?void 0:r.environmental_hostility)==="high"&&n.push({assumption:"Environment is highly hostile",challenge:"High-hostility assessments can become self-fulfilling. Adversarial framing may close cooperative paths that actually exist.",impact_if_wrong:"Missing diplomatic or cooperative solutions that could resolve the situation at lower cost",severity:"moderate"}),r!=null&&r.regulatory_climate||n.push({assumption:"Regulatory climate not specified (implicitly assumed irrelevant)",challenge:"Most significant scenarios have regulatory dimensions. Ignoring regulatory context often leads to strategies that are technically optimal but legally problematic.",impact_if_wrong:"Strategy may be invalidated by regulatory action, requiring costly pivots",severity:"moderate"}),t.length>0&&t.every(s=>s.disposition!=="hostile")&&n.push({assumption:"No hostile stakeholders identified",challenge:"Every significant scenario has adversarial actors, even if they're not immediately obvious. Consider second-order stakeholders (competitors, media, regulators).",impact_if_wrong:"Blind-sided by opposition that could have been anticipated and planned for",severity:"high"}),n}function B_(e,t){const n=[];return n.push({id:"outcome_best",label:"Best Case",conditions:"Key assumptions hold, stakeholders react rationally, no secondary shocks",outcome:"Situation resolves with minimal damage. Well-positioned actors gain competitive advantage from demonstrated competence.",likelihood:.2,impact:"positive"}),n.push({id:"outcome_likely",label:"Most Likely",conditions:"Mixed assumption validity, some stakeholder volatility, one secondary complication",outcome:"Moderate disruption requiring 2-4 adjustment cycles. Organizations with pre-planned responses fare significantly better.",likelihood:.5,impact:"negative"}),n.push({id:"outcome_worst",label:"Worst Case",conditions:"Key assumptions fail, cascading stakeholder reactions, multiple secondary shocks",outcome:"Extended disruption with structural changes to the operating environment. Recovery requires fundamental strategy revision.",likelihood:.15,impact:"very_negative"}),(t.depth==="full"||t.depth==="exhaustive")&&n.push({id:"outcome_tail",label:"Tail Risk / Black Swan",conditions:"Scenario triggers cascade effects that fundamentally alter the landscape",outcome:"Paradigm shift. Previous assumptions about the operating environment become obsolete. Winners are those who recognized the shift earliest.",likelihood:.05,impact:"very_negative"}),n}function V_(e,t,n){const r=[];r.push({priority:1,action:"Validate your highest-severity assumptions before committing resources",rationale:`${t.length} assumptions were challenged. The cost of validating is far lower than the cost of acting on wrong assumptions.`,timeframe:"Immediately (next 2-4 hours)",risk_of_inaction:"Committing to a strategy built on unchecked assumptions compounds error at every step"});const s=[...e].sort((i,a)=>{const l={low:0,moderate:1,high:2,critical:3};return l[i.risk]-l[a.risk]})[0];return s&&r.push({priority:2,action:`Prepare to execute "${s.label}" as your default path while monitoring for signals that warrant pivoting`,rationale:`This path has the best risk-adjusted probability (${(s.probability*100).toFixed(0)}% success, ${s.risk} risk)`,timeframe:"Within 24 hours",dependencies:["Assumption validation (Priority 1)"],risk_of_inaction:"Without a default path, decision paralysis sets in and you lose initiative"}),n.stakeholders&&n.stakeholders.length>0&&r.push({priority:3,action:"Map stakeholder communication sequences — who hears what, when, and from whom",rationale:"Stakeholder reactions are often more damaging than the scenario itself. Controlled communication prevents information cascades.",timeframe:"Within 12 hours",risk_of_inaction:"Stakeholders who learn about the situation from external sources react 3x more negatively"}),r.push({priority:r.length+1,action:"Establish real-time monitoring for the 3-5 signals that would invalidate your chosen path",rationale:"Scenarios evolve. The strategy you choose today may need revision tomorrow. Knowing WHEN to pivot is as important as knowing WHERE to pivot.",timeframe:"Within 48 hours",risk_of_inaction:"Without monitoring triggers, you discover path failure too late to course-correct"}),r}async function U_(e){var j,C,E,R,P,T,L;const t=Date.now(),n=$_(),r=M_(e);if(!r.valid)return{status:"error",error:{code:r.error.code,message:r.error.message},reasoning_id:n,timestamp:new Date().toISOString()};const s=e.depth??"standard";e.perspective;const i=O_(e.stakeholders),a=A_(e),l=a.checks;if(!a.allowed)return{status:"error",error:{code:"GOVERNANCE_VIOLATION",message:`Reasoning blocked by governance: ${a.blockReason??"governance check failed"}`,detail:l.filter(I=>!I.passed).map(I=>I.detail).join("; ")},reasoning_id:n,timestamp:new Date().toISOString()};const c=F_(W_(e),i,s),d=z_(e,i),u=B_(c,e),f=V_(c,d,e),p={summary:H_(e,c,d),paths:c,projected_outcomes:u,assumption_challenges:d,recommendations:f,key_uncertainties:G_(e,c),missing_questions:K_(e,i)};let m;if((j=e.swarm)!=null&&j.enabled&&i.length>0){const I=await Cy(e.scenario,i,c,e.swarm);m=I.result,I.source}const y=e.goal?"goal":e.mode??"explore";let g;y==="goal"&&e.goal&&(g=await v_(e,i));const b=[...Y_(e),...a.enforcedConstraints];let x;if(m){const I=m.rounds.flatMap(F=>F.reactions??[]);if(I.length>0){const F=I.map(D=>D.impact??0),O=F.reduce((D,Y)=>D+Y,0)/F.length;Math.max(...F.map(D=>Math.abs(D)));const V=F.reduce((D,Y)=>D+(Y-O)**2,0)/F.length;let _=1-Math.min(1,V*3+Math.max(0,-O));(m.trajectory==="converging"||m.trajectory==="stabilizing")&&(_=Math.min(1,_+.15)),m.trajectory==="escalating"&&(_=Math.max(0,_-.2)),m.trajectory==="diverging"&&(_=Math.max(0,_-.15));const A=b.length;_=Math.min(1,_+A*.02),x=Math.round(Math.max(0,Math.min(100,_*100)))}}let v;if(m){const I=m.rounds.flatMap(F=>F.reactions??[]);if(I.length>0){const F=I.map(A=>A.impact??0),O=F.reduce((A,D)=>A+D,0)/F.length,V=Math.max(...F.map(A=>Math.abs(A)));let _=0;m.trajectory==="escalating"&&(_+=.35),m.trajectory==="diverging"&&(_+=.25),O<-.3&&(_+=.25),V>.7&&(_+=.15),_=Math.min(.95,_),_>.5?v="high":_>.3?v="moderate":_>.1?v="low":v="none"}}const w=a.guardVerdict?{guard_status:a.guardVerdict.status,world_viability:(C=a.governanceSignals)==null?void 0:C.viability,world_collapsed:(E=a.governanceSignals)==null?void 0:E.collapsed,collapse_risk:v??((R=a.governanceSignals)==null?void 0:R.collapseRisk),rules_fired:((P=a.governanceSignals)==null?void 0:P.rulesFired)??b.length,world_health_score:x??((T=a.validationReport)==null?void 0:T.summary.completenessScore),invariant_coverage:(L=a.validationReport)==null?void 0:L.summary.invariantCoverage}:void 0,S={trace_id:D_(),constitutional_checks:l,authority_level:"ANALYSIS_ONLY",enforced_constraints:b,timestamp:new Date().toISOString(),engine_version:I_,neuroverse:w},k={processing_time_ms:Date.now()-t,depth_used:s,paths_explored:c.length+((g==null?void 0:g.strategies.length)??0),assumptions_challenged:d.length,timestamp:new Date().toISOString()};return{reasoning_id:n,status:"completed",analysis:p,governance:S,swarm:m,goal_reasoning:g,mode:y,meta:k}}function W_(e){return e.scenario}function H_(e,t,n){const r=t.length,s=n.length,i=t.filter(a=>a.risk==="high"||a.risk==="critical").length;return`Analyzed ${r} decision paths for this scenario. ${s} of your assumptions were challenged. `+(i>0?`${i} path${i>1?"s":""} carry high or critical risk. `:"No paths carry critical risk. ")+"Recommendation: validate assumptions before committing to a path."}function G_(e,t){var r,s;const n=[];return n.push("How secondary stakeholders (not yet identified) will react"),n.push("Whether the situation will escalate or de-escalate in the next 48 hours"),(((r=e.assumptions)==null?void 0:r.severity)==="high"||((s=e.assumptions)==null?void 0:s.severity)==="critical")&&n.push("Whether severity assessment is accurate or inflated by recency bias"),t.some(i=>i.probability<.3)&&n.push("Low-probability paths may have outsized impact if they materialize"),n}function K_(e,t){var r,s,i;const n=[];return(r=e.constraints)!=null&&r.time_horizon||n.push("What is your time horizon for this decision?"),(s=e.constraints)!=null&&s.risk_tolerance||n.push("What is your risk tolerance — conservative, moderate, or aggressive?"),t.length===0&&n.push("Who are the key stakeholders affected by this scenario?"),(i=e.assumptions)!=null&&i.regulatory_climate||n.push("What regulatory frameworks apply to this situation?"),n.push("What is your fallback position if your primary strategy fails?"),n.push("Who are your adversaries in this scenario, and what are their incentives?"),n}function Y_(e){var n,r;const t=["ANALYSIS_ONLY: No execution authority — reasoning output is advisory","STATELESS: No scenario data stored after response","GOVERNANCE_TRACED: All reasoning paths auditable"];if((n=e.constraints)!=null&&n.regulatory){const s=Array.isArray(e.constraints.regulatory)?e.constraints.regulatory.join(", "):e.constraints.regulatory;t.push(`REGULATORY: ${s} framework(s) applied`)}return(r=e.constraints)!=null&&r.risk_tolerance&&t.push(`RISK_BOUNDED: ${e.constraints.risk_tolerance} tolerance enforced`),t}var ye={};const q_=[{id:"ai_translator",type:"ai",permissions:["translate_input"],constraints:["must_output_valid_schema","no_invention_of_events","confidence_must_be_provided"]},{id:"ai_analyst",type:"ai",permissions:["generate_report","summarize_trace","suggest_experiments","detect_archetype","synthesize_strategy","compare_experiments"],constraints:["must_reference_trace","must_include_blocked_actions","must_include_metrics","no_unverifiable_claims","no_speculation_without_flag","must_include_confidence"]}];class cm{constructor(){Gt(this,"name","deterministic")}async translate(t){const n=[],r=t.toLowerCase();return(r.includes("sell")||r.includes("panic")||r.includes("crash"))&&n.push({type:"market_shock",action:"sell_pressure",impact:-.7,confidence:.6,severity:.8}),(r.includes("buy")||r.includes("rally")||r.includes("recover"))&&n.push({type:"market_recovery",action:"buy_pressure",impact:.5,confidence:.5,severity:.3}),n.length===0&&n.push({type:"unstructured_input",action:"needs_ai_translation",impact:0,confidence:.3,metadata:{raw:t}}),n}async summarize(t){return nc(t)}}function nc(e){const{metrics:t,interventions:n,governanceStats:r,rounds:s}=e,i=s.filter(m=>m.interventions.length>0).slice(0,5).map(m=>{const y=[...new Set(m.reactions.map(b=>b.agent))],g=m.interventions.some(b=>b.includes("[BLOCK]"));return{round:m.round,description:m.interventions[0].replace(/^\[.*?\]\s*/,""),agents:y,severity:g?"high":"moderate"}}),a=n.slice(0,10).map(m=>{const y=m.match(/^\[(BLOCK|PAUSE|GATE-\d+)\]\s*(.*?):\s*(.*)/);if(y){const g=y[1];return{type:g==="BLOCK"?"BLOCK":g==="PAUSE"?"PAUSE":g.startsWith("GATE")?"CIRCUIT_BREAKER":"REBALANCE",agent:y[2].trim(),description:y[3].trim()}}return{type:"REBALANCE",agent:"system",description:m}}),l=r.blocks,c=n.length,d=(t.stabilityScore*100).toFixed(0),u=(t.collapseProbability*100).toFixed(0),f=l>0?`Governance engine blocked ${l} high-risk actions and applied ${c} interventions. System stability: ${d}%. Collapse probability held at ${u}%.`:`Governance constraints applied ${c} interventions, maintaining ${d}% system stability with ${u}% collapse risk.`,p=[];return l>2&&p.push("Multiple block events indicate aggressive agent behavior was successfully contained by invariant enforcement."),t.stabilityScore>.6&&p.push("Governance rules maintained system stability above critical thresholds throughout the simulation."),t.maxVolatility>.5&&p.push(`Peak volatility of ${(t.maxVolatility*100).toFixed(0)}% was dampened by circuit breaker gates.`),r.rulesFired>3&&p.push(`${r.rulesFired} world rules fired during deterministic simulation, shaping agent behavior across rounds.`),p.length===0&&p.push("Governance constraints maintained equilibrium with minimal intervention required."),{executiveSummary:f,keyEvents:i,governanceActions:a,metrics:{volatilityReduction:`${(t.maxVolatility*100).toFixed(0)}% peak`,collapseRisk:`${u}%`,stabilityScore:`${d}%`,interventionCount:c,blockedActions:l},counterfactual:c>3?`Without governance constraints, ${l} blocked actions would have proceeded unchecked, likely increasing volatility beyond recovery thresholds.`:void 0,observations:p,generatedBy:"deterministic",governedBy:"NeuroverseOS"}}class dm{constructor(t){Gt(this,"name","anthropic");Gt(this,"client",null);Gt(this,"model");Gt(this,"_apiKey");this.model=(t==null?void 0:t.model)??"claude-sonnet-4-20250514";const n=(t==null?void 0:t.apiKey)??ye.ANTHROPIC_API_KEY;if(!n)throw new Error("AnthropicProvider requires ANTHROPIC_API_KEY environment variable or apiKey option");this._apiKey=n}async getClient(){if(!this.client)try{const t=await pl(()=>import("@anthropic-ai/sdk"),[]),n=t.default??t.Anthropic;this.client=new n({apiKey:this._apiKey})}catch{throw new Error("Failed to load @anthropic-ai/sdk. Install it: npm install @anthropic-ai/sdk")}return this.client}async translate(t){var i;const r=await(await this.getClient()).messages.create({model:this.model,max_tokens:1024,system:Ty,messages:[{role:"user",content:t}]}),s=((i=r.content[0])==null?void 0:i.type)==="text"?r.content[0].text:"[]";return Iy(s)}async summarize(t){var a;const n=await this.getClient(),r=My(t),s=await n.messages.create({model:this.model,max_tokens:2048,system:Ay,messages:[{role:"user",content:`Analyze this simulation trace:
|
|
359
|
+
${r}`}]}),i=((a=s.content[0])==null?void 0:a.type)==="text"?s.content[0].text:"{}";try{return JSON.parse(i)}catch{return nc(t)}}}class Rn{constructor(t){Gt(this,"name");Gt(this,"model");Gt(this,"baseUrl");Gt(this,"apiKey");Gt(this,"headers");this.name=(t==null?void 0:t.name)??"openai",this.model=(t==null?void 0:t.model)??ye.OPENAI_MODEL??"gpt-4o",this.apiKey=(t==null?void 0:t.apiKey)??ye.OPENAI_API_KEY??"",this.baseUrl=((t==null?void 0:t.baseUrl)??ye.OPENAI_BASE_URL??"https://api.openai.com/v1").replace(/\/+$/,""),this.headers=(t==null?void 0:t.headers)??{}}async chatCompletion(t,n,r){var d,u,f;const s=`${this.baseUrl}/chat/completions`,i={"Content-Type":"application/json",...this.headers};this.apiKey&&this.apiKey!=="none"&&this.apiKey!=="local"&&(i.Authorization=`Bearer ${this.apiKey}`);const a=JSON.stringify({model:this.model,max_tokens:r,temperature:.7,messages:[{role:"system",content:t},{role:"user",content:n}]}),l=await fetch(s,{method:"POST",headers:i,body:a});if(!l.ok){const p=await l.text().catch(()=>"");throw new Error(`${this.name} API error ${l.status}: ${p.slice(0,200)}`)}return((f=(u=(d=(await l.json()).choices)==null?void 0:d[0])==null?void 0:u.message)==null?void 0:f.content)??""}async translate(t){const n=await this.chatCompletion(Ty,t,1024);return Iy(n)}async summarize(t){const n=My(t),r=await this.chatCompletion(Ay,`Analyze this simulation trace:
|
|
360
|
+
${n}`,2048);try{return JSON.parse(r)}catch{return nc(t)}}}const Ty=`You are an event normalizer for NeuroverseOS, a governance simulation platform.
|
|
361
|
+
Given unstructured input, extract structured events. Return ONLY valid JSON — an array of objects with these fields:
|
|
362
|
+
- type (string): event category (market_shock, policy_change, agent_action, etc.)
|
|
363
|
+
- agent (string, optional): who caused it
|
|
364
|
+
- action (string): what happened
|
|
365
|
+
- impact (number, -1 to 1): negative to positive impact
|
|
366
|
+
- confidence (number, 0 to 1): how confident you are
|
|
367
|
+
- severity (number, 0 to 1): how severe
|
|
368
|
+
- sector (string, optional): affected domain
|
|
369
|
+
No markdown, no explanation — just the JSON array.`,Ay=`You are a governance analyst for NeuroverseOS. Analyze simulation trace data and produce a structured report.
|
|
370
|
+
Return ONLY valid JSON matching this schema:
|
|
371
|
+
{
|
|
372
|
+
"executiveSummary": "string — 2-3 sentence overview",
|
|
373
|
+
"keyEvents": [{"round": number, "description": "string", "agents": ["string"], "severity": "low|moderate|high|critical"}],
|
|
374
|
+
"governanceActions": [{"type": "BLOCK|PAUSE|CIRCUIT_BREAKER|REBALANCE", "agent": "string", "description": "string"}],
|
|
375
|
+
"metrics": {"volatilityReduction": "string", "collapseRisk": "string", "stabilityScore": "string", "interventionCount": number, "blockedActions": number},
|
|
376
|
+
"counterfactual": "string — what would have happened without governance",
|
|
377
|
+
"observations": ["string — insight about agent behavior under governance"],
|
|
378
|
+
"generatedBy": "ai",
|
|
379
|
+
"governedBy": "NeuroverseOS"
|
|
380
|
+
}
|
|
381
|
+
Focus on WHAT AGENTS DID DIFFERENTLY under governance — behavioral shifts matter more than raw block counts.`,Ih=`You are a stakeholder in a NeuroverseOS governance simulation.
|
|
382
|
+
You will be given your identity, the scenario, and the current state.
|
|
383
|
+
React in character. Return ONLY valid JSON:
|
|
384
|
+
{
|
|
385
|
+
"reaction": "1-2 sentence description of your reaction and reasoning",
|
|
386
|
+
"impact": <number from -1 (strongly negative) to 1 (strongly positive)>,
|
|
387
|
+
"confidence": <number from 0 to 1 — how sure you are>,
|
|
388
|
+
"trigger": "brief label for what drove this reaction"
|
|
389
|
+
}`;function Iy(e){try{const t=JSON.parse(e);return Array.isArray(t)?t:[t]}catch{return[{type:"ai_translation",action:"parsed_input",impact:0,confidence:.5,metadata:{raw:e,source:"ai"}}]}}function My(e){return JSON.stringify({scenario:e.scenario,roundCount:e.rounds.length,totalReactions:e.rounds.reduce((t,n)=>t+n.reactions.length,0),metrics:e.metrics,governanceStats:e.governanceStats,interventions:e.interventions.slice(0,20),sampleRounds:e.rounds.slice(0,3)})}async function Oy(e){var r,s,i;const t=e.provider??fm(um());if(t.name==="deterministic")return{reaction:`${e.stakeholderId} evaluates the situation (no AI provider configured)`,impact:0,confidence:.3,trigger:"No AI provider — deterministic fallback"};const n=`You are ${e.stakeholderId}${e.stakeholderDescription?` (${e.stakeholderDescription})`:""}.
|
|
390
|
+
Disposition: ${e.stakeholderDisposition??"unknown"}
|
|
391
|
+
Priorities: ${((r=e.stakeholderPriorities)==null?void 0:r.join(", "))??"not specified"}
|
|
392
|
+
|
|
393
|
+
SCENARIO: ${e.scenario}
|
|
394
|
+
CURRENT PATH: ${e.pathDescription}
|
|
395
|
+
RISK LEVEL: ${e.pathRisk}
|
|
396
|
+
ROUND: ${e.round+1}
|
|
397
|
+
${(s=e.previousReactions)!=null&&s.length?`
|
|
398
|
+
PREVIOUS REACTIONS THIS ROUND:
|
|
399
|
+
${e.previousReactions.join(`
|
|
400
|
+
`)}`:""}
|
|
401
|
+
|
|
402
|
+
How do you react?`;try{if(t instanceof dm){const l=await(await t.getClient()).messages.create({model:t.model,max_tokens:256,system:Ih,messages:[{role:"user",content:n}]}),c=((i=l.content[0])==null?void 0:i.type)==="text"?l.content[0].text:"{}";return Mh(c,e.stakeholderId)}else if(t instanceof Rn){const a=await t.chatCompletion(Ih,n,256);return Mh(a,e.stakeholderId)}else{const l=(await t.translate(`Stakeholder ${e.stakeholderId} reacts to: ${e.pathDescription} (risk: ${e.pathRisk})`))[0];return{reaction:`${e.stakeholderId}: ${(l==null?void 0:l.action)??"no reaction"}`,impact:(l==null?void 0:l.impact)??0,confidence:(l==null?void 0:l.confidence)??.5,trigger:(l==null?void 0:l.type)??"provider-generated"}}}catch{return{reaction:`${e.stakeholderId} considers the situation (AI call failed, using fallback)`,impact:0,confidence:.3,trigger:"AI fallback — API error"}}}function Mh(e,t){try{const n=JSON.parse(e);return{reaction:String(n.reaction??`${t} reacts`),impact:Math.max(-1,Math.min(1,Number(n.impact)||0)),confidence:Math.max(0,Math.min(1,Number(n.confidence)||.5)),trigger:String(n.trigger??"AI-generated reaction")}}catch{return{reaction:(e==null?void 0:e.slice(0,200))||`${t} reacts`,impact:0,confidence:.3,trigger:"AI response (unparsed)"}}}const cn=new Map;cn.set("deterministic",()=>new cm);cn.set("anthropic",()=>new dm);cn.set("openai",()=>new Rn);cn.set("local",()=>new Rn({name:"local",baseUrl:ye.LOCAL_LLM_URL??"http://localhost:11434/v1",model:ye.LOCAL_LLM_MODEL??"llama3",apiKey:"local"}));cn.set("ollama",()=>new Rn({name:"ollama",baseUrl:ye.OLLAMA_BASE_URL??"http://localhost:11434/v1",model:ye.OLLAMA_MODEL??"llama3",apiKey:"local"}));cn.set("groq",()=>new Rn({name:"groq",baseUrl:"https://api.groq.com/openai/v1",model:ye.GROQ_MODEL??"llama-3.3-70b-versatile",apiKey:ye.GROQ_API_KEY??""}));cn.set("together",()=>new Rn({name:"together",baseUrl:"https://api.together.xyz/v1",model:ye.TOGETHER_MODEL??"meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",apiKey:ye.TOGETHER_API_KEY??""}));cn.set("mistral",()=>new Rn({name:"mistral",baseUrl:"https://api.mistral.ai/v1",model:ye.MISTRAL_MODEL??"mistral-large-latest",apiKey:ye.MISTRAL_API_KEY??""}));cn.set("deepseek",()=>new Rn({name:"deepseek",baseUrl:"https://api.deepseek.com/v1",model:ye.DEEPSEEK_MODEL??"deepseek-chat",apiKey:ye.DEEPSEEK_API_KEY??""}));cn.set("fireworks",()=>new Rn({name:"fireworks",baseUrl:"https://api.fireworks.ai/inference/v1",model:ye.FIREWORKS_MODEL??"accounts/fireworks/models/llama-v3p1-70b-instruct",apiKey:ye.FIREWORKS_API_KEY??""}));function um(){return ye.ANTHROPIC_API_KEY?"anthropic":ye.OPENAI_API_KEY?"openai":ye.GROQ_API_KEY?"groq":ye.TOGETHER_API_KEY?"together":ye.MISTRAL_API_KEY?"mistral":ye.DEEPSEEK_API_KEY?"deepseek":ye.FIREWORKS_API_KEY?"fireworks":ye.LOCAL_LLM_URL?"local":ye.OLLAMA_BASE_URL?"ollama":"deterministic"}function fm(e){const t=e??"deterministic",n=cn.get(t);return n?n():(console.warn(`AI provider "${t}" not found, falling back to deterministic`),new cm)}async function Q_(e,t,n){var i;const r=[];e.permissions.includes(t)||r.push(`Actor ${e.id} lacks permission for action: ${t}`);const s=await n();if(s&&typeof s=="object"){const a=s;for(const l of e.constraints)l==="must_include_blocked_actions"&&(!a.governanceActions||a.governanceActions.length===0)&&(i=a.metrics)!=null&&i.blockedActions&&a.metrics.blockedActions>0&&r.push("Report missing governance action details despite blocks occurring"),l==="must_include_metrics"&&(a.metrics||r.push("Report missing required metrics section"))}return{result:s,actor:e.id,action:t,governed:!0,trace:{constraints:e.constraints,passed:r.length===0,violations:r}}}const X_=Object.freeze(Object.defineProperty({__proto__:null,AI_ROLES:q_,AnthropicProvider:dm,DeterministicProvider:cm,OpenAICompatibleProvider:Rn,evaluateAIAction:Q_,generateAIReaction:Oy,generateDeterministicReport:nc,getAIProvider:fm,getDefaultProviderName:um},Symbol.toStringTag,{value:"Module"}));function Oh(e,t,n,r){var u,f;const s=e.disposition??"unknown",i=t.risk,a=Math.max(.3,.9-r*.15);let l=0,c="",d="";switch(n){case"rational":{const p=(u=t.benefits_stakeholders)==null?void 0:u.includes(e.id),m=(f=t.harms_stakeholders)==null?void 0:f.includes(e.id);p?(l=.5+Math.random()*.3,c=`${e.id} supports this path — aligns with their priorities`,d="Self-interest alignment"):m?(l=-(.5+Math.random()*.3),c=`${e.id} opposes this path — threatens their position`,d="Self-interest conflict"):(l=(Math.random()-.5)*.4,c=`${e.id} monitors the situation — no strong position yet`,d="Neutral assessment");break}case"emotional":{const p=s==="hostile"?.8:s==="supportive"?.3:.5;l=(Math.random()-.5)*2*p,i==="high"||i==="critical"?(l-=.3,c=`${e.id} reacts with concern — elevated anxiety about ${i} risk`,d="Fear of high-risk outcome"):(c=`${e.id} responds with ${l>0?"cautious optimism":"skepticism"}`,d="Emotional assessment of path viability");break}case"mixed":default:{const p=(()=>{var b,x;const y=(b=t.benefits_stakeholders)==null?void 0:b.includes(e.id),g=(x=t.harms_stakeholders)==null?void 0:x.includes(e.id);return y?.4:g?-.4:0})(),m=(Math.random()-.5)*.6;l=p*.6+m*.4,s==="hostile"?(l-=.2,c=`${e.id} pushes back — predisposed against this approach`,d="Pre-existing opposition + rational assessment"):s==="supportive"?(l+=.15,c=`${e.id} provides conditional support — reserves judgment on execution`,d="Pre-existing alignment + cautious evaluation"):(c=`${e.id} weighs options — ${l>0?"leaning toward engagement":"leaning toward caution"}`,d="Mixed rational-emotional evaluation");break}}return l=Math.max(-1,Math.min(1,l)),{stakeholder_id:e.id,reaction:c,confidence:Number((a+(Math.random()-.5)*.2).toFixed(2)),impact:Number(l.toFixed(2)),trigger:d}}function J_(e){const t=[],n=e.reduce((a,l)=>a+l.impact,0)/e.length;Math.abs(n)>.5&&t.push(n>0?"Strong positive consensus emerging — stakeholders broadly supportive":"Strong negative consensus emerging — widespread opposition forming");const r=e.filter(a=>a.impact>.2).length,s=e.filter(a=>a.impact<-.2).length;r>0&&s>0&&Math.abs(r-s)<=1&&t.push("Polarization detected — stakeholder base splitting into opposing camps");const i=e.filter(a=>a.confidence>.7&&a.impact<-.3);return i.length>=2&&t.push(`Coalition risk: ${i.map(a=>a.stakeholder_id).join(" + ")} may form opposition bloc`),t}function Z_(e){if(e.length<2)return"stabilizing";const t=e.map(s=>s.reactions.reduce((i,a)=>i+a.impact,0)/s.reactions.length),n=t[t.length-1]-t[0],r=t.reduce((s,i)=>{const a=t.reduce((l,c)=>l+c,0)/t.length;return s+(i-a)**2},0)/t.length;return r>.15?"diverging":Math.abs(n)<.1&&r<.05?"converging":n<-.2?"escalating":"stabilizing"}function eR(e){const t=[];for(let n=1;n<e.length;n++){const r=e[n-1].reactions.reduce((a,l)=>a+l.impact,0)/e[n-1].reactions.length,s=e[n].reactions.reduce((a,l)=>a+l.impact,0)/e[n].reactions.length,i=Math.abs(s-r);i>.3&&t.push(`Round ${n}: Significant sentiment shift (${i>0?"positive":"negative"} swing of ${(i*100).toFixed(0)}%)`);for(const a of e[n].reactions){const l=e[n-1].reactions.find(c=>c.stakeholder_id===a.stakeholder_id);l&&Math.abs(a.impact-l.impact)>.5&&t.push(`Round ${n}: ${a.stakeholder_id} dramatically shifts position`)}}return t.length===0&&t.push("No major inflection points detected — scenario evolves gradually"),t}async function mm(e,t,n,r){const s=r.rounds??3,i=r.reaction_model??"mixed",a=um(),l=r.ai_reasoning!==!1&&a!=="deterministic",c=r.simulate_stakeholders?t.filter(y=>r.simulate_stakeholders.includes(y.id)):t,d=n[0];if(!d)return{rounds:[],trajectory:"stabilizing",inflection_points:["No reasoning paths available for simulation"]};const u=[];let f;if(l)try{f=fm(a)}catch{}for(let y=0;y<s;y++){let g;if(f){const x=y>0?u[y-1].reactions.map(v=>`${v.stakeholder_id}: ${v.reaction}`):[];g=await Promise.all(c.map(async v=>{try{const w=await Oy({stakeholderId:v.id,stakeholderDescription:v.description,stakeholderDisposition:v.disposition,stakeholderPriorities:v.priorities,scenario:e,pathDescription:d.description,pathRisk:d.risk,round:y,previousReactions:x,provider:f});return{stakeholder_id:v.id,reaction:w.reaction,confidence:w.confidence,impact:w.impact,trigger:w.trigger}}catch{return Oh(v,d,i,y)}}))}else g=c.map(x=>Oh(x,d,i,y));const b=J_(g);u.push({round:y,reactions:g,emergent_dynamics:b})}const p=Z_(u),m=eR(u);return{rounds:u,trajectory:p,inflection_points:m}}const tR=Object.freeze(Object.defineProperty({__proto__:null,runSwarmSimulation:mm},Symbol.toStringTag,{value:"Module"}));function Ly(e){const t=(e.reaction+" "+(e.trigger??"")).toLowerCase(),n=e.impact;return n<-.3&&(t.includes("panic")||t.includes("sell")||t.includes("oppos")||t.includes("attack")||t.includes("undercut")||t.includes("hostile")||t.includes("pushes back")||t.includes("threatens"))?"aggressive":n<-.1&&(t.includes("protect")||t.includes("hedge")||t.includes("withdraw")||t.includes("reduce")||t.includes("caution")||t.includes("concern")||t.includes("anxiety")||t.includes("skeptic"))?"defensive":n>.1&&(t.includes("support")||t.includes("coordinat")||t.includes("stabiliz")||t.includes("cooperat")||t.includes("align")||t.includes("conditional support"))?"cooperative":n>.2&&(t.includes("exploit")||t.includes("advantage")||t.includes("specul")||t.includes("capture")||t.includes("position"))?"opportunistic":Math.abs(n)<.25&&(t.includes("monitor")||t.includes("wait")||t.includes("hold")||t.includes("weigh")||t.includes("leaning")||t.includes("assess"))?"cautious":n<-.3?"defensive":n>.3?"opportunistic":"neutral"}function nR(e,t){const n=new Set;for(const r of t)for(const s of r.reactions)n.add(s.stakeholder_id);return[...n].map(r=>{var p,m,y,g;const s=[];let i=0;const a=[];for(let b=0;b<t.length;b++){const x=t[b].reactions.find(N=>N.stakeholder_id===r),v=(p=e[b])==null?void 0:p.reactions.find(N=>N.stakeholder_id===r);if(!x)continue;const w=v?Math.abs(v.impact-x.impact)>.05:!1;w&&i++;const S=Ly(x);s.push({round:b,behavior:S,impact:x.impact,confidence:x.confidence,reaction:x.reaction,wasConstrained:w,originalImpact:w&&v?v.impact:void 0}),b>0&&((m=s[b-1])!=null&&m.wasConstrained)&&a.push(S)}const l=(y=s[0])==null?void 0:y.behavior,c=(g=s[s.length-1])==null?void 0:g.behavior,d=l!==void 0&&c!==void 0&&l!==c,u=s.map(b=>b.impact),f=rR(u);return{agentId:r,steps:s,adapted:d,shift:d?{from:l,to:c}:void 0,timesConstrained:i,postConstraintBehaviors:a,trend:f}})}function rR(e){if(e.length<2)return"stable";const t=e.slice(0,Math.ceil(e.length/2)),n=e.slice(Math.ceil(e.length/2)),r=t.reduce((a,l)=>a+l,0)/t.length,s=n.reduce((a,l)=>a+l,0)/n.length;return e.reduce((a,l)=>{const c=e.reduce((d,u)=>d+u,0)/e.length;return a+(l-c)**2},0)/e.length>.1?"volatile":s<r-.1?"escalating":s>r+.1?"de-escalating":"stable"}function hl(e){return e.map((t,n)=>{const r={aggressive:0,defensive:0,cautious:0,cooperative:0,opportunistic:0,neutral:0};for(const i of t.reactions)r[Ly(i)]++;const s=t.reactions.length;return{round:n,aggressive:s>0?Number((r.aggressive/s).toFixed(3)):0,defensive:s>0?Number((r.defensive/s).toFixed(3)):0,cautious:s>0?Number((r.cautious/s).toFixed(3)):0,cooperative:s>0?Number((r.cooperative/s).toFixed(3)):0,opportunistic:s>0?Number((r.opportunistic/s).toFixed(3)):0,neutral:s>0?Number((r.neutral/s).toFixed(3)):0,total:s}})}function sR(e,t,n){var c;const r=[],s=n.filter(d=>d.adapted);if(s.length>0){const d=s.filter(f=>{var p,m;return((p=f.shift)==null?void 0:p.from)==="aggressive"&&((m=f.shift)==null?void 0:m.to)!=="aggressive"});if(d.length>0){const f=d.map(m=>m.shift.to),p=Eu(f);r.push({type:"agent_adaptation",description:`${d.length} agent(s) shifted from aggressive to ${p} behavior under governance`,detectedAtRound:d[0].steps.findIndex(m=>m.behavior!=="aggressive"),magnitude:d.length/n.length,involvedAgents:d.map(m=>m.agentId)})}const u=s.filter(f=>{var p;return((p=f.shift)==null?void 0:p.to)==="cooperative"});u.length>0&&u!==d&&r.push({type:"agent_adaptation",description:`${u.length} agent(s) converged on cooperative behavior`,detectedAtRound:u[0].steps.findIndex(f=>f.behavior==="cooperative"),magnitude:u.length/n.length,involvedAgents:u.map(f=>f.agentId)})}const i=hl(e),a=hl(t);if(i.length>0&&a.length>0){const d=i.reduce((g,b)=>g+b.aggressive,0)/i.length,u=a.reduce((g,b)=>g+b.aggressive,0)/a.length,f=d-u;f>.1&&r.push({type:"population_shift",description:`Aggressive actions dropped from ${(d*100).toFixed(0)}% to ${(u*100).toFixed(0)}% under governance`,detectedAtRound:0,magnitude:f,involvedAgents:[]});const p=i.reduce((g,b)=>g+b.cooperative,0)/i.length,m=a.reduce((g,b)=>g+b.cooperative,0)/a.length,y=m-p;y>.1&&r.push({type:"population_shift",description:`Cooperative behavior increased from ${(p*100).toFixed(0)}% to ${(m*100).toFixed(0)}% — governance is creating alignment`,detectedAtRound:0,magnitude:y,involvedAgents:[]})}if(a.length>=3){const d=a[0],u=a[a.length-1],f=d.aggressive-u.aggressive;f>.15&&r.push({type:"strategy_change",description:`Agents stopped trying aggressive actions by round ${a.length-1} — aggressive behavior dropped from ${(d.aggressive*100).toFixed(0)}% to ${(u.aggressive*100).toFixed(0)}%`,detectedAtRound:a.findIndex(m=>m.aggressive<d.aggressive-.1),magnitude:f,involvedAgents:[]});const p=u.cautious-d.cautious;p>.15&&r.push({type:"strategy_change",description:`Cautious behavior emerged over time — grew from ${(d.cautious*100).toFixed(0)}% to ${(u.cautious*100).toFixed(0)}%`,detectedAtRound:a.findIndex(m=>m.cautious>d.cautious+.1),magnitude:p,involvedAgents:[]})}const l=[];for(const d of n)l.push(...d.postConstraintBehaviors);if(l.length>=2){const d=Eu(l),f=l.filter(p=>p===d).length/l.length;f>.4&&r.push({type:"emergent_cluster",description:`After being constrained, ${(f*100).toFixed(0)}% of agents shifted to ${d} behavior — governance is channeling action, not just blocking it`,detectedAtRound:((c=n.find(p=>p.timesConstrained>0))==null?void 0:c.steps.findIndex(p=>p.wasConstrained))??0,magnitude:f,involvedAgents:n.filter(p=>p.timesConstrained>0).map(p=>p.agentId)})}return r}function Eu(e){const t=new Map;for(const s of e)t.set(s,(t.get(s)??0)+1);let n=e[0],r=0;for(const[s,i]of t)i>r&&(n=s,r=i);return n}function iR(e,t){const n=nR(e,t),r=hl(e),s=hl(t),i=sR(e,t,n),a=n.filter(v=>v.adapted).length,l=n.length,c=l>0?Number((a/l).toFixed(2)):0,d=n.flatMap(v=>v.postConstraintBehaviors),u=d.length>0?Eu(d):null,f=r.length>0?r.reduce((v,w)=>v+w.aggressive,0)/r.length:0,p=s.length>0?s.reduce((v,w)=>v+w.aggressive,0)/s.length:0,m=Number(((f-p)*100).toFixed(1)),y=r.length>0?r.reduce((v,w)=>v+w.cooperative,0)/r.length:0,g=s.length>0?s.reduce((v,w)=>v+w.cooperative,0)/s.length:0,b=Number(((g-y)*100).toFixed(1)),x=oR(a,l,m,b,u);return{agentTrajectories:n,baselineDistribution:r,governedDistribution:s,behavioralShifts:i,summary:{agentsAdapted:a,totalAgents:l,adaptationRate:c,dominantPostConstraintBehavior:u,aggressiveReduction:m,cooperativeIncrease:b,headline:x}}}function oR(e,t,n,r,s){const i=[];return e>0&&i.push(`${e}/${t} agents adapted their behavior`),n>5&&i.push(`aggressive actions down ${n.toFixed(0)}pp`),r>5&&i.push(`cooperative behavior up ${r.toFixed(0)}pp`),s&&s!=="neutral"&&i.push(`blocked agents shifted to ${s}`),i.length===0?"Governance had minimal measurable effect on agent behavior patterns.":i.join(" — ")+"."}function aR(e,t,n,r,s){var c;const i=[],a=[],l=e.map(d=>({...d}));for(const d of t){const u=d.description.toLowerCase();let f=!1;if(!d.enforceable){a.push({id:d.id,description:d.description,level:"advisory",fired:!1}),r===0&&i.push(`[ADVISORY] ${d.description} — monitored, not enforced`);continue}if(u.includes("block")||u.includes("prohibit")||u.includes("prevent")||u.includes("forbid")||u.includes("ban")||u.includes("stop"))for(const p of l){const m=((c=p.reaction)==null?void 0:c.toLowerCase())??"";if(u.replace(/\b(block|prohibit|prevent|forbid|ban|stop)\b/g,"").trim().split(/\s+/).filter(b=>b.length>2).some(b=>m.includes(b))||p.impact<-.3){const b=p.impact;p.impact=p.impact*.15,p.confidence=Math.max(.1,p.confidence*.4),Math.abs(b-p.impact)>.01&&(f=!0,i.push(`[BLOCK] ${p.stakeholder_id}: "${d.description}" — impact crushed ${b.toFixed(2)} → ${p.impact.toFixed(2)}`))}}if(u.includes("panic")||u.includes("cascade")||u.includes("contagion")||u.includes("runaway")||u.includes("crash")){const p=l.filter(y=>y.impact<-.2).length,m=Math.max(1,Math.floor(l.length*.4));if(p>=m||s<-.2){for(const g of l)g.impact<-.15&&(g.impact,g.impact=g.impact*.3,f=!0);i.push(`[BLOCK] PANIC CIRCUIT BREAKER: "${d.description}" — ${p} agents in panic, negative impacts crushed by ${((1-.3)*100).toFixed(0)}%`)}}if(u.includes("slow")||u.includes("cool")||u.includes("gradual")||u.includes("dampen")||u.includes("reduce volatility")){for(const p of l)if(Math.abs(p.impact)>.3){const m=p.impact;p.impact=p.impact*.65,Math.abs(m-p.impact)>.01&&(f=!0,i.push(`[PAUSE] ${p.stakeholder_id}: "${d.description}" — dampened ${m.toFixed(2)} → ${p.impact.toFixed(2)}`))}}if(u.includes("floor")||u.includes("maintain")||u.includes("minimum")){for(const p of l)if(p.impact<-.35){const m=p.impact;p.impact=Math.max(p.impact,-.3),m!==p.impact&&(f=!0,i.push(`[BLOCK] ${p.stakeholder_id}: Liquidity floor violated — impact capped ${m.toFixed(2)} → ${p.impact.toFixed(2)} (${d.description})`))}}if(u.includes("leverage")||u.includes("limit")||u.includes("cap")||u.includes("restrict")){for(const p of l)if(p.impact>.45){const m=p.impact;p.impact=Math.min(p.impact,.4),m!==p.impact&&(f=!0,i.push(`[BLOCK] ${p.stakeholder_id}: Leverage limit exceeded — position capped ${m.toFixed(2)} → ${p.impact.toFixed(2)} (${d.description})`))}}if(u.includes("rebalance")||u.includes("equilibrium")||u.includes("correlat")){const p=l.reduce((m,y)=>m+y.impact,0)/l.length;for(const m of l)if(Math.abs(m.impact-p)>.25){const y=m.impact;m.impact=m.impact*.7+p*.3,f=!0,i.push(`[PAUSE] Rebalanced ${m.stakeholder_id}: drift ${y.toFixed(2)} → ${m.impact.toFixed(2)} (${d.description})`)}}if(u.includes("trust")||u.includes("transparen")||u.includes("accountab")){for(const p of l)if(p.impact<-.3){const m=p.impact;p.impact=p.impact*.8,Math.abs(m-p.impact)>.01&&(f=!0,i.push(`[${d.id}] Trust gate dampened ${p.stakeholder_id} hostility: ${m.toFixed(2)} → ${p.impact.toFixed(2)}`))}}a.push({id:d.id,description:d.description,level:"full",fired:f})}for(const d of n){if(d.condition.toLowerCase(),d.severity==="critical"&&(l.reduce((f,p)=>f+Math.abs(p.impact),0)/l.length>.3||s<-.15)){for(const p of l)p.impact,p.impact=p.impact*.6;i.push(`[${d.id}] CIRCUIT BREAKER: ${d.label} — all impacts dampened by ${((1-.6)*100).toFixed(0)}%`)}if(d.severity==="warning"){for(const u of l)Math.abs(u.impact)>.4&&(u.confidence,u.confidence=Math.max(.2,u.confidence*.8));r>0&&i.push(`[${d.id}] WARNING: ${d.label} — agent confidence reduced for extreme positions`)}}for(const d of l)d.impact=Math.max(-1,Math.min(1,d.impact)),d.impact=Number(d.impact.toFixed(2)),d.confidence=Number(d.confidence.toFixed(2));return{reactions:l,interventions:i,enforcementLog:a}}async function lR(e,t,n,r,s,i,a,l){const c=await mm(e,t,n,r),d=[],u=[],f=[],p=[];let m=[],y=0;for(const x of c.rounds){if(i&&a)for(const j of x.reactions){const C=Ry({...a,scenario:`[Round ${x.round}] ${j.stakeholder_id}: ${j.reaction} (impact: ${j.impact})`});f.push(C),C.status==="BLOCK"?(j.impact=j.impact*.2,j.confidence=Math.max(.1,j.confidence*.5)):C.status==="PAUSE"&&(j.impact=j.impact*.6,j.confidence=Math.max(.2,j.confidence*.7))}const{reactions:v,interventions:w,enforcementLog:S}=aR(x.reactions,s.invariants,s.gates??[],x.round,y);m=[...S];const N=cR(v,w);d.push({round:x.round,reactions:v,emergent_dynamics:N}),u.push(w);const k=v.reduce((j,C)=>j+C.impact,0)/v.length;y=(y*x.round+k)/(x.round+1)}const g=dR(d),b=uR(d);return{swarm:{rounds:d,trajectory:g,inflection_points:b},allInterventions:u,guardVerdicts:f,narrativeImpacts:p,enforcementLog:m}}function cR(e,t){const n=[],r=e.reduce((a,l)=>a+l.impact,0)/e.length;Math.abs(r)>.5?n.push(r>0?"Strong positive consensus — governance constraints channeled energy constructively":"Negative consensus persists despite governance intervention"):Math.abs(r)<.15&&n.push("Governance rules achieved near-equilibrium — agent positions stabilized");const s=e.filter(a=>a.impact>.2).length,i=e.filter(a=>a.impact<-.2).length;return s>0&&i>0&&Math.abs(s-i)<=1&&n.push("Polarization detected but dampened by governance constraints"),t.length>0&&n.push(`${t.length} governance intervention(s) applied this round`),n}function dR(e){if(e.length<2)return"stabilizing";const t=e.map(i=>i.reactions.reduce((a,l)=>a+l.impact,0)/i.reactions.length),n=t[t.length-1]-t[0],r=t.reduce((i,a)=>i+a,0)/t.length,s=t.reduce((i,a)=>i+(a-r)**2,0)/t.length;return s>.15?"diverging":Math.abs(n)<.1&&s<.05?"converging":n<-.2?"escalating":"stabilizing"}function uR(e){const t=[];for(let n=1;n<e.length;n++){const r=e[n-1].reactions.reduce((a,l)=>a+l.impact,0)/e[n-1].reactions.length,s=e[n].reactions.reduce((a,l)=>a+l.impact,0)/e[n].reactions.length,i=Math.abs(s-r);i>.3&&t.push(`Round ${n}: Significant sentiment shift (${(i*100).toFixed(0)}% swing)`)}return t.length===0&&t.push("Governance constraints prevented major inflection points — smooth trajectory"),t}function Lh(e){const n=e.rounds.flatMap(m=>m.reactions).map(m=>m.impact),r=n.reduce((m,y)=>m+y,0)/n.length,s=Math.max(...n.map(m=>Math.abs(m))),i=Math.min(...n);let a=0;e.trajectory==="escalating"&&(a+=.35),e.trajectory==="diverging"&&(a+=.25),r<-.3&&(a+=.25),s>.7&&(a+=.15),a=Math.min(.95,a);const l=n.reduce((m,y)=>m+(y-r)**2,0)/n.length;let c=1-Math.min(1,l*3+Math.max(0,-r));(e.trajectory==="converging"||e.trajectory==="stabilizing")&&(c=Math.min(1,c+.15)),c=Math.max(0,Math.min(1,c));const d=e.rounds.flatMap(m=>m.emergent_dynamics??[]),u=d.filter(m=>m.toLowerCase().includes("coalition")).length,f=d.filter(m=>m.toLowerCase().includes("polariz")).length,p=e.rounds.filter(m=>{const y=m.reactions.reduce((g,b)=>g+b.impact,0)/m.reactions.length;return Math.abs(y)>.4}).length;return{avgImpact:Number(r.toFixed(3)),collapseProbability:Number(a.toFixed(2)),stabilityScore:Number(c.toFixed(2)),coalitionRisks:u,polarizationEvents:f,peakNegativeSentiment:Number(i.toFixed(2)),consensusRounds:p,maxVolatility:Number(s.toFixed(2))}}function fR(e,t,n){const r=[],s=e.collapseProbability-t.collapseProbability;if(s>.1&&r.push(`Collapse probability dropped from ${(e.collapseProbability*100).toFixed(0)}% to ${(t.collapseProbability*100).toFixed(0)}% — a ${(s*100).toFixed(0)} percentage point reduction.`),t.stabilityScore-e.stabilityScore>.05&&r.push(`System stability improved from ${(e.stabilityScore*100).toFixed(0)}% to ${(t.stabilityScore*100).toFixed(0)}%.`),e.coalitionRisks>t.coalitionRisks&&r.push(`Coalition risks reduced from ${e.coalitionRisks} to ${t.coalitionRisks}.`),e.maxVolatility>t.maxVolatility){const a=(e.maxVolatility-t.maxVolatility)/e.maxVolatility*100;r.push(`Peak volatility reduced by ${a.toFixed(0)}%.`)}return r.length===0?r.push("Governance constraints had minimal measurable effect on this scenario."):(r.unshift(`World thesis: "${n}"`),r.push("Rules reshape emergent behavior — governance changes the structure of the system, not just individual actions.")),r.join(" ")}async function _u(e,t,n,r){var P,T;const s=(e.stakeholders??[]).map(L=>typeof L=="string"?{id:L,disposition:"unknown"}:L),i=e.swarm??{enabled:!0,rounds:5,reaction_model:"mixed"},a=_y(e,t),l=await mm(e.scenario,s,n,i),c=Lh(l),{swarm:d,guardVerdicts:u,narrativeImpacts:f,enforcementLog:p}=await lR(e.scenario,s,n,i,t,a,e),m=Lh(d);let y;try{y=Py(a,{steps:5})}catch{}const g=c.collapseProbability-m.collapseProbability,b=m.stabilityScore-c.stabilityScore,x=c.maxVolatility>0?(c.maxVolatility-m.maxVolatility)/c.maxVolatility:0,v=c.coalitionRisks-m.coalitionRisks,w=Math.min(1,Math.max(0,g*.4+b*.3+Math.max(0,x)*.2+Math.max(0,v*.1))),S=fR(c,m,t.thesis),N={allow:0,block:0,pause:0},k=new Set;let j=0;for(const L of u){const I=L.status.toLowerCase();if(I in N&&N[I]++,L.ruleId&&k.add(L.ruleId),(P=L.evidence)!=null&&P.invariantChecks&&(j+=L.evidence.invariantChecks.length),(T=L.evidence)!=null&&T.guardChecks)for(const F of L.evidence.guardChecks)F.triggered&&k.add(F.guardId)}const C=y?y.steps.reduce((L,I)=>L+I.rulesFired,0):0,E={engineLoaded:u.length>0&&u[0].reason!=="NeuroverseOS guard not loaded — permissive fallback",totalEvaluations:u.length,verdicts:N,rulesFired:C,worldCollapsed:(y==null?void 0:y.collapsed)??!1,finalViability:(y==null?void 0:y.finalViability)??"UNKNOWN",invariantsChecked:j,triggeredGuards:[...k]},R=iR(l.rounds,d.rounds);return{scenario:e.scenario,worldRules:{thesis:t.thesis,invariants:t.invariants,gates:t.gates??[]},baseline:{swarm:l,metrics:c},governed:{swarm:d,metrics:m,worldSimulation:y},comparison:{collapseReduction:Number((g*100).toFixed(1)),stabilityImprovement:Number((b*100).toFixed(1)),volatilityReduction:Number((x*100).toFixed(1)),coalitionRiskReduction:v,governanceEffectiveness:Number(w.toFixed(2)),narrative:S},governanceStats:E,enforcementClassification:p.length>0?p:void 0,narrativeImpacts:f.length>0?f:void 0,behavioralAnalysis:R}}const Jt={scenario:{scenario:"A major algorithmic trading firm's risk model fails during a volatility spike, triggering a cascade of automated sell-offs across interconnected markets. Liquidity evaporates in key sectors. Contagion spreads to sovereign debt markets. Central banks are caught between rate decisions.",stakeholders:[{id:"Algorithmic Traders",disposition:"hostile",priorities:["risk management","position unwinding","survival"]},{id:"Institutional Investors",disposition:"neutral",priorities:["portfolio protection","liquidity access","fiduciary duty"]},{id:"Retail Investors",disposition:"hostile",priorities:["savings protection","market access","information"]},{id:"Central Banks",disposition:"neutral",priorities:["systemic stability","inflation mandate","credibility"]},{id:"Market Makers",disposition:"supportive",priorities:["spread capture","inventory management","obligation fulfillment"]},{id:"Regulators",disposition:"neutral",priorities:["market integrity","investor protection","systemic risk"]}],assumptions:{severity:"critical",environmental_hostility:"high",time_pressure:"immediate",regulatory_climate:"strict"},constraints:{time_horizon:"72 hours",regulatory:["SEC circuit breakers","Basel III liquidity requirements","Dodd-Frank systemic risk"],risk_tolerance:"conservative"},depth:"full",swarm:{enabled:!0,rounds:6,reaction_model:"mixed"}},world:{thesis:"Market stability requires structural constraints on leverage, liquidity, and automated behavior to prevent cascading failures",state_variables:[{id:"liquidity_index",label:"Market Liquidity Index",type:"number",range:{min:0,max:100},default_value:25},{id:"leverage_ratio",label:"System Leverage Ratio",type:"number",range:{min:1,max:30},default_value:12},{id:"volatility_index",label:"Volatility Index (VIX-like)",type:"number",range:{min:10,max:100},default_value:65},{id:"contagion_spread",label:"Cross-Market Contagion",type:"enum",enum_values:["contained","spreading","systemic"],default_value:"spreading"},{id:"central_bank_intervention",label:"Central Bank Intervention Active",type:"boolean",default_value:!1}],invariants:[{id:"INV-001",description:"Maintain minimum liquidity floor — no agent may drain liquidity below 15% of baseline",enforceable:!0},{id:"INV-002",description:"Maximum leverage limit — no position may exceed 5x leverage during elevated volatility",enforceable:!0},{id:"INV-003",description:"Coalition rebalancing — correlated positions must rebalance when concentration exceeds threshold",enforceable:!0},{id:"INV-004",description:"Transparency requirement — all large position changes must be reported, reducing trust deficit",enforceable:!0},{id:"INV-005",description:"Algorithmic trading circuit breaker — automated strategies must pause during extreme volatility",enforceable:!0}],gates:[{id:"GATE-001",label:"Market Panic Circuit Breaker",condition:"volatility_index > 80 || liquidity_index < 10",severity:"critical"},{id:"GATE-002",label:"Contagion Warning",condition:"contagion_spread == systemic",severity:"critical"},{id:"GATE-003",label:"Leverage Warning",condition:"leverage_ratio > 8",severity:"warning"}],ai_roles:[{id:"ai_translator",type:"ai",permissions:["translate_input"],constraints:["must_output_valid_schema","no_invention_of_events","confidence_must_be_provided"]},{id:"ai_analyst",type:"ai",permissions:["generate_report","summarize_trace"],constraints:["must_reference_trace","must_include_blocked_actions","must_include_metrics","no_unverifiable_claims"]}]},paths:[{id:"path_cascade_selloff",label:"Cascade Sell-off",description:"Automated systems trigger chain reaction of liquidations across interconnected positions",projected_outcome:"Market drops 15-25% in hours. Liquidity crisis in sovereign debt. Multiple fund failures.",probability:.65,risk:"critical",tradeoffs:["Speed of contagion vs. available response time","Individual firm survival vs. systemic stability","Regulatory intervention risk vs. free market correction"],benefits_stakeholders:[],harms_stakeholders:["Algorithmic Traders","Retail Investors","Institutional Investors"]},{id:"path_coordinated_response",label:"Coordinated Response",description:"Central banks and regulators coordinate emergency measures: rate cuts, liquidity injection, trading halts",projected_outcome:"Market stabilizes within 48 hours. Moral hazard concerns. Political backlash.",probability:.55,risk:"moderate",tradeoffs:["Systemic stability vs. moral hazard","Short-term calm vs. long-term market distortion","Central bank credibility vs. political pressure"],benefits_stakeholders:["Market Makers","Institutional Investors"],harms_stakeholders:["Retail Investors"]},{id:"path_selective_contagion",label:"Selective Contagion",description:"Contagion spreads to specific sectors but circuit breakers prevent total market failure",projected_outcome:"Targeted sector collapse with 2-3 major fund failures. Broader market recovers in weeks.",probability:.45,risk:"high",tradeoffs:["Sector sacrifice vs. systemic preservation","Speed of containment vs. fairness of outcome","Regulatory precedent set for future crises"],benefits_stakeholders:["Central Banks","Regulators"],harms_stakeholders:["Algorithmic Traders"]}]},pm="nv-sim-saved-worlds",Us=[];function hm(){try{return typeof localStorage<"u"&&localStorage!==null}catch{return!1}}function $h(e){if(!hm()){const r=Us.findIndex(s=>s.id===e.id);r>=0?Us[r]=e:Us.push(e);return}const t=Vr(),n=t.findIndex(r=>r.id===e.id);n>=0?t[n]={...e,modifiedAt:new Date().toISOString()}:t.push(e),localStorage.setItem(pm,JSON.stringify(t))}function Vr(){if(!hm())return[...Us];try{const e=localStorage.getItem(pm);return e?JSON.parse(e):[]}catch{return[]}}function mR(e){return Vr().find(n=>n.id===e)??null}function pR(e){if(!hm()){const r=Us.findIndex(s=>s.id===e);return r<0?!1:(Us.splice(r,1),!0)}const t=Vr(),n=t.filter(r=>r.id!==e);return n.length===t.length?!1:(localStorage.setItem(pm,JSON.stringify(n)),!0)}function hR(e){return JSON.stringify(e,null,2)}function gR(e){const t=JSON.parse(e);if(!t.version||!t.id||!t.name||!t.world)throw new Error("Invalid world format: missing required fields (version, id, name, world)");if(!t.world.thesis||!Array.isArray(t.world.invariants))throw new Error("Invalid world definition: missing thesis or invariants");return t}function vR(e,t,n,r){const s=`world_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,i=new Date().toISOString();return{version:"1.0",id:s,name:e,description:r==null?void 0:r.description,basePreset:n,world:t,createdAt:i,modifiedAt:i,tags:r==null?void 0:r.tags}}const xR=[{category:"prohibit",patterns:[/\b(block|prohibit|forbid|prevent|disallow|ban|never|must\s+not|shall\s+not|cannot)\b/i],enforcement:"structural"},{category:"limit",patterns:[/\b(limit|cap|restrict|maximum|max|ceiling|no\s+more\s+than|not\s+exceed|threshold)\b/i],enforcement:"structural"},{category:"require",patterns:[/\b(require|mandate|must|shall|obligat|enforce|compulsory|necessary)\b/i],enforcement:"structural"},{category:"circuit_breaker",patterns:[/\b(circuit\s*breaker|halt|pause|freeze|stop|suspend|emergency|shutdown)\b/i],enforcement:"structural"},{category:"monitor",patterns:[/\b(monitor|track|report|audit|log|observe|surveil|watch|alert)\b/i],enforcement:"structural"},{category:"encourage",patterns:[/\b(encourage|promote|suggest|recommend|prefer|advise|should|guideline|best\s+practice)\b/i],enforcement:"advisory"}],yR={liquidity:["liquidity","liquid","cash","capital","reserve"],leverage:["leverage","leveraged","margin","borrowed","debt"],volatility:["volatility","volatile","vix","fluctuation","swing","spike"],contagion:["contagion","spread","cascade","chain","domino","systemic"],trade:["trade","trading","transaction","order","position","buy","sell"],price:["price","cost","valuation","rate","tariff"],risk:["risk","exposure","hazard","danger","threat"],stability:["stability","stable","equilibrium","balance"],intervention:["intervention","intervene","central bank","regulator","authority"],panic:["panic","fear","sentiment","confidence","trust"]};function os(e){const t=e.split(`
|
|
403
|
+
`).filter(s=>s.trim().length>0),n=[];let r=0;for(let s=0;s<t.length;s++){const i=t[s].trim();if(i.startsWith("#")&&i.length<80&&!i.includes("must")&&!i.includes("shall")||i.startsWith("//")||i.startsWith("<!--")||i.length<10)continue;const a=i.replace(/^[-*+]\s+/,"").replace(/^\d+[.)]\s+/,"").replace(/^>\s+/,"").replace(/\*\*/g,"").replace(/\*/g,"").trim();if(a.length<10)continue;let l="encourage",c="advisory",d=.3;for(const m of xR){for(const y of m.patterns)if(y.test(a)){l=m.category,c=m.enforcement,d=Math.max(d,.7+Math.random()*.25);break}if(d>.7)break}const u=[],f=[],p=a.toLowerCase();for(const[m,y]of Object.entries(yR))for(const g of y)p.includes(g)&&(u.includes(m)||u.push(m),f.includes(g)||f.push(g));r++,n.push({id:`RULE-${String(r).padStart(3,"0")}`,originalText:i,description:a,enforcement:c,category:l,confidence:Number(d.toFixed(2)),affectedVariables:u,keywords:f,sourceLine:s+1})}return{rules:n,summary:{total:n.length,enforced:n.filter(s=>s.enforcement==="structural").length,advisory:n.filter(s=>s.enforcement==="advisory").length},sourceText:e}}function bR(e){const t=[];for(let n=0;n<e.length;n++)for(let r=n+1;r<e.length;r++){const s=e[n],i=e[r],a=s.affectedVariables.filter(l=>i.affectedVariables.includes(l));if(a.length!==0){if(s.category==="prohibit"&&(i.category==="encourage"||i.category==="require")||i.category==="prohibit"&&(s.category==="encourage"||s.category==="require")){t.push({ruleA:s,ruleB:i,type:"direct_conflict",description:`${s.id} ${s.category}s ${a.join(", ")} while ${i.id} ${i.category}s it`});continue}if(s.category===i.category&&a.length>0&&s.description!==i.description){t.push({ruleA:s,ruleB:i,type:"overlap",description:`Both ${s.id} and ${i.id} ${s.category} on "${a.join(", ")}" — may cause redundancy or conflict`});continue}s.affectedVariables.length>i.affectedVariables.length&&i.affectedVariables.every(l=>s.affectedVariables.includes(l))&&t.push({ruleA:s,ruleB:i,type:"subsumption",description:`${s.id} may already cover what ${i.id} specifies — ${i.id} may be redundant`})}}return t}function ui(e){const t=[];let n=0;const r=()=>`POL-${String(++n).padStart(3,"0")}`,s=bR(e.rules);for(const x of s)if(x.type==="direct_conflict"){const w=`Limit ${x.ruleA.affectedVariables.filter(S=>x.ruleB.affectedVariables.includes(S)).join(" and ")} during volatility spikes with strict thresholds`;t.push({id:r(),severity:"error",message:`Conflicting rules: ${x.ruleA.id} vs ${x.ruleB.id}`,detail:x.description,relatedRules:[x.ruleA.id,x.ruleB.id],fix:`Resolve conflict: remove one rule, or add a condition (e.g., "${x.ruleB.id} applies only during volatility")`,source:{startLine:x.ruleA.sourceLine,endLine:x.ruleB.sourceLine},category:"conflict",quickFix:{label:"Merge into single rule",operation:"replace",text:w,targetLines:[x.ruleA.sourceLine,x.ruleB.sourceLine]}})}else if(x.type==="overlap"){const w=`Limit ${x.ruleA.affectedVariables.filter(S=>x.ruleB.affectedVariables.includes(S)).join(" and ")} with unified thresholds across all conditions`;t.push({id:r(),severity:"warning",message:`Overlapping enforcement: ${x.ruleA.id} and ${x.ruleB.id}`,detail:x.description,relatedRules:[x.ruleA.id,x.ruleB.id],fix:"Consider merging into a single rule or adding distinct conditions",source:{startLine:x.ruleA.sourceLine,endLine:x.ruleB.sourceLine},category:"conflict",quickFix:{label:"Merge rules",operation:"replace",text:w,targetLines:[x.ruleA.sourceLine,x.ruleB.sourceLine]}})}else t.push({id:r(),severity:"hint",message:`${x.ruleB.id} may be redundant (subsumed by ${x.ruleA.id})`,detail:x.description,relatedRules:[x.ruleA.id,x.ruleB.id],category:"structure",quickFix:{label:"Remove redundant rule",operation:"remove",text:"",targetLines:[x.ruleB.sourceLine]}});if(e.summary.enforced===0&&e.rules.length>0){const x=e.rules.slice(0,3).map(v=>{const w=v.description.toLowerCase();return w.includes("encourage")||w.includes("promote")?v.description.replace(/\b(encourage|promote)\b/i,"Require"):w.includes("should")?v.description.replace(/\bshould\b/i,"Must"):`Limit ${v.affectedVariables[0]??"system behavior"} to prevent instability`});t.push({id:r(),severity:"error",message:"Advisory only — no enforceable constraints detected",detail:"This policy contains only advisory guidelines with no structural enforcement. The simulation will run but the policy will have no measurable effect on outcomes.",relatedRules:e.rules.map(v=>v.id),fix:'Add enforceable rules using action verbs: "must", "shall", "limit", "block", "require"',category:"strength",quickFix:{label:"Strengthen enforcement",operation:"insert",text:x.join(`
|
|
404
|
+
`)}})}else if(e.summary.enforced<e.summary.total*.3&&e.rules.length>2){const x=e.rules.find(w=>w.enforcement==="advisory"),v=x?x.description.replace(/\b(encourage|promote|suggest|recommend|should)\b/i,"Require"):"Require compliance with all governance constraints";t.push({id:r(),severity:"warning",message:`Weak enforcement: only ${e.summary.enforced}/${e.summary.total} rules are enforceable`,detail:"Most rules in this policy are advisory. Simulations may show limited governance effect.",relatedRules:e.rules.filter(w=>w.enforcement==="advisory").map(w=>w.id),fix:"Strengthen advisory rules with specific thresholds and action verbs",category:"strength",quickFix:x?{label:"Strengthen weakest rule",operation:"replace",text:v,targetLines:[x.sourceLine]}:{label:"Add enforced rule",operation:"insert",text:v}})}const i=e.rules.filter(x=>x.category==="prohibit").length,a=e.rules.filter(x=>x.category==="limit").length,l=(i+a)/Math.max(e.rules.length,1);l>.8&&e.rules.length>3&&t.push({id:r(),severity:"warning",message:"Policy may over-restrict system behavior",detail:`${Math.round(l*100)}% of rules are prohibitive/restrictive. This may cause system freeze where most actions are blocked, reducing the system's ability to respond to crises.`,relatedRules:e.rules.filter(x=>x.category==="prohibit"||x.category==="limit").map(x=>x.id),fix:"Balance restrictive rules with permissive ones: add monitoring, encourage, or conditional allowance rules",category:"constraint",quickFix:{label:"Add flexibility rules",operation:"insert",text:`Allow normal trading activity under standard market conditions
|
|
405
|
+
Monitor and report unusual activity patterns before restricting`}});const c=new Set(e.rules.flatMap(x=>x.affectedVariables)),u=["liquidity","leverage","volatility","risk","stability"].filter(x=>!c.has(x));if(u.length>0&&e.rules.length>0){const x=u.map(v=>{switch(v){case"liquidity":return"Maintain minimum liquidity floor — no agent may drain liquidity below 15% of baseline";case"leverage":return"Limit maximum leverage to 5x during elevated volatility conditions";case"volatility":return"Halt automated trading when volatility index exceeds critical threshold";case"risk":return"Require risk assessment reporting for all positions exceeding normal thresholds";case"stability":return"Require rebalancing when system stability drops below acceptable levels";default:return`Monitor and limit ${v} to prevent systemic issues`}});t.push({id:r(),severity:"info",message:`Uncovered critical areas: ${u.join(", ")}`,detail:`The policy does not address: ${u.join(", ")}. These are common governance targets in financial/systemic scenarios.`,relatedRules:[],fix:`Consider adding rules for: ${u.map(v=>v.charAt(0).toUpperCase()+v.slice(1)).join(", ")}`,category:"coverage",quickFix:{label:`Add ${u.length} coverage rule${u.length>1?"s":""}`,operation:"insert",text:x.join(`
|
|
406
|
+
`)}})}const f=e.rules.filter(x=>x.confidence<.5);if(f.length>0){const x=f[0],v=`Require ${x.affectedVariables[0]??"compliance"} controls to prevent ${x.keywords[0]??"violations"}`;t.push({id:r(),severity:"hint",message:`${f.length} rule(s) parsed with low confidence`,detail:"Some lines were difficult to classify. They may be descriptions rather than actionable rules.",relatedRules:f.map(w=>w.id),fix:"Rephrase ambiguous rules with clear action verbs and specific thresholds",category:"structure",quickFix:{label:"Rephrase ambiguous rule",operation:"replace",text:v,targetLines:[x.sourceLine]}})}e.rules.length===0&&t.push({id:r(),severity:"error",message:"No rules detected in policy document",detail:"The uploaded document did not contain any recognizable policy rules.",relatedRules:[],fix:"Add policy rules as bullet points or numbered items with clear action verbs",category:"structure",quickFix:{label:"Add starter policy",operation:"insert",text:`Block all large trades during extreme volatility
|
|
407
|
+
Limit maximum leverage to 5x
|
|
408
|
+
Halt automated trading when volatility exceeds critical threshold
|
|
409
|
+
Maintain minimum liquidity floor at 15% of baseline
|
|
410
|
+
Monitor and report all correlated position clusters`}}),!e.rules.some(x=>x.category==="circuit_breaker")&&e.rules.length>2&&t.push({id:r(),severity:"info",message:"No circuit breaker / emergency halt rule detected",detail:"The policy has no emergency shutdown mechanism. In extreme scenarios, the system has no last-resort protection.",relatedRules:[],fix:'Add an emergency rule: "Halt all trading when volatility exceeds critical threshold"',category:"coverage",quickFix:{label:"Add circuit breaker",operation:"insert",text:"Halt all trading when volatility exceeds critical threshold"}});const m={errors:t.filter(x=>x.severity==="error").length,warnings:t.filter(x=>x.severity==="warning").length,info:t.filter(x=>x.severity==="info").length,hints:t.filter(x=>x.severity==="hint").length},y=m.errors>0&&e.rules.length===0,g=Math.max(0,100-m.errors*25-m.warnings*10-m.info*3-m.hints*1);let b;return m.errors>0&&y?b="critical":m.errors>0?b="errors":m.warnings>0?b="warnings":b="healthy",{status:b,diagnostics:t,counts:m,canSimulate:e.rules.length>0,healthScore:g}}function wR(e,t){const n=e.split(`
|
|
411
|
+
`);switch(t.operation){case"insert":return e.trimEnd()+`
|
|
412
|
+
`+t.text;case"replace":{if(!t.targetLines||t.targetLines.length===0)return e;const r=[...t.targetLines].sort((a,l)=>a-l),s=[];let i=!1;for(let a=0;a<n.length;a++){const l=a+1;r.includes(l)?i||(s.push(t.text),i=!0):s.push(n[a])}return s.join(`
|
|
413
|
+
`)}case"remove":return!t.targetLines||t.targetLines.length===0?e:n.filter((r,s)=>!t.targetLines.includes(s+1)).join(`
|
|
414
|
+
`);default:return e}}function Ru(e){const t=e.rules.map(l=>({id:l.id.replace("RULE","INV"),description:l.description,enforceable:l.enforcement==="structural"})),n=[];for(const l of e.rules)l.category==="circuit_breaker"?n.push({id:`GATE-${l.id}`,label:`Circuit Breaker: ${l.description.slice(0,60)}`,condition:ed(l),severity:"critical"}):l.category==="prohibit"?n.push({id:`GATE-${l.id}`,label:`Block: ${l.description.slice(0,60)}`,condition:ed(l),severity:"critical"}):l.category==="limit"&&n.push({id:`GATE-${l.id}`,label:`Limit: ${l.description.slice(0,60)}`,condition:ed(l),severity:"warning"});const r=e.rules.filter(l=>l.enforcement==="structural"),s=r.length>0?`Policy enforces ${r.length} structural constraints covering ${[...new Set(r.flatMap(l=>l.affectedVariables))].join(", ")||"system behavior"}`:"Advisory policy providing guidelines without structural enforcement",a=[...new Set(e.rules.flatMap(l=>l.affectedVariables))].map(l=>({id:`${l}_index`,label:l.charAt(0).toUpperCase()+l.slice(1).replace(/_/g," ")+" Index",type:"number",range:{min:0,max:100},default_value:50}));return{thesis:s,state_variables:a,invariants:t,gates:n}}function ed(e){const t=e.affectedVariables;return t.length===0?"system_stress > 80":t.map(n=>n==="volatility"?"volatility_index > 80":n==="liquidity"?"liquidity_index < 15":n==="leverage"?"leverage_ratio > 8":n==="risk"?"risk_index > 75":n==="contagion"?"contagion_spread == systemic":`${n}_index > 80`).join(" || ")}function SR(){return[{id:"Policy Enforcer",disposition:"supportive",priorities:["compliance","stability","risk reduction"]},{id:"Market Participants",disposition:"neutral",priorities:["profit","liquidity","freedom"]},{id:"Regulators",disposition:"supportive",priorities:["systemic stability","transparency","enforcement"]},{id:"Risk Managers",disposition:"neutral",priorities:["exposure limits","portfolio protection","hedging"]}]}function NR(){return[{id:"path_compliant",label:"Full Compliance",description:"All actors comply with policy rules — system operates within constraints",projected_outcome:"Reduced volatility, slower but stable growth, fewer extreme events",probability:.55,risk:"low",tradeoffs:["Stability vs. opportunity cost","Compliance cost vs. systemic safety"],benefits_stakeholders:["Regulators","Risk Managers"],harms_stakeholders:[]},{id:"path_stress_test",label:"Stress Test",description:"External shock tests policy resilience — cascade events trigger policy rules",projected_outcome:"Policy constraints activate, dampening cascade but limiting response flexibility",probability:.65,risk:"high",tradeoffs:["Protection vs. agility","Circuit breakers vs. market freeze"],benefits_stakeholders:["Policy Enforcer"],harms_stakeholders:["Market Participants"]},{id:"path_evasion",label:"Policy Evasion",description:"Some actors find loopholes or work around constraints",projected_outcome:"Partial effectiveness — compliant actors stabilized, non-compliant create new risks",probability:.45,risk:"moderate",tradeoffs:["Enforcement strictness vs. innovation","Monitoring cost vs. coverage"],benefits_stakeholders:[],harms_stakeholders:["Policy Enforcer","Regulators"]}]}async function kR(e,t={}){const n=os(e),r=ui(n),s=Ru(n),i=t.scenarioText??"A systemic stress event triggers cascading failures across interconnected markets. Volatility spikes, liquidity evaporates, and contagion threatens to spread. The policy framework is the only structural defense.",a=t.stakeholders??SR(),l=NR(),c={scenario:i,stakeholders:a,assumptions:{severity:"critical",environmental_hostility:"high",time_pressure:"immediate",regulatory_climate:"strict"},constraints:{time_horizon:"72 hours",risk_tolerance:"conservative"},depth:"full",swarm:{enabled:!0,rounds:t.rounds??5,reaction_model:"mixed"}},d=await _u(c,s,l),u=jR(d),f=CR(d,n,u);return{policy:n,healthCheck:r,comparison:d,impact:u,explanation:f}}function jR(e,t){const n=e.baseline.metrics,r=e.governed.metrics,s=e.governanceStats,i=(r.stabilityScore-n.stabilityScore)*100,a=(r.collapseProbability-n.collapseProbability)*-100,l=e.governed.swarm.rounds.reduce((f,p)=>f+p.reactions.length,0),c=s.verdicts.block,d=l>0?c/l*100:0,u=Math.min(1,d/100);return{stabilityChange:Number(i.toFixed(1)),cascadeRiskChange:Number(a.toFixed(1)),governanceActions:s.totalEvaluations,actionsBlocked:Number(d.toFixed(1)),preventedCollapse:n.collapseProbability>.5&&r.collapseProbability<.3,overConstraintScore:Number(u.toFixed(2))}}function CR(e,t,n){const r=[];n.preventedCollapse?r.push("The policy prevented system collapse by enforcing structural constraints during the stress test."):n.stabilityChange>5?r.push("The policy measurably improved system stability during the simulated stress event."):n.stabilityChange<-5?r.push("The policy may have reduced system flexibility, leading to lower stability under stress."):r.push("The policy had a moderate effect on system dynamics during the stress test.");const s=t.rules.filter(l=>l.category==="circuit_breaker"),i=t.rules.filter(l=>l.category==="limit"),a=t.rules.filter(l=>l.category==="prohibit");return s.length>0&&r.push(`Circuit breaker rules (${s.map(l=>l.id).join(", ")}) activated during peak volatility, halting cascading sell-offs.`),i.length>0&&n.cascadeRiskChange>10&&r.push("Limit rules reduced cascade risk by constraining extreme positions and enforcing thresholds."),a.length>0&&r.push(`Prohibition rules blocked ${n.actionsBlocked.toFixed(0)}% of actions that violated policy constraints.`),n.overConstraintScore>.7&&r.push(`WARNING: The policy appears over-constrained — ${n.actionsBlocked.toFixed(0)}% of actions were blocked, risking system freeze where legitimate responses are also suppressed.`),r.push(`Net effect: ${n.stabilityChange>0?"+":""}${n.stabilityChange.toFixed(0)}% stability, ${n.cascadeRiskChange>0?"-":"+"}${Math.abs(n.cascadeRiskChange).toFixed(0)}% cascade risk, ${n.governanceActions} governance actions.`),r.join(" ")}function $y(e){let t=os(e.policyText),n=ui(t),r=Ru(t);const s=e.sensitivity??.5,i=e.auditTrail??null,a={totalEvaluations:0,allowed:0,blocked:0,modified:0,paused:0,rulesFired:0};function l(u,f){a.totalEvaluations++;const p=[];let m=u.magnitude,y=!1;for(const S of r.invariants){if(!S.enforceable){p.push({id:S.id,description:S.description,effect:"monitored",impactReduction:0});continue}const N=ER(S,u,m,f,s);N&&(p.push(N),m=u.magnitude*(1-N.impactReduction),y=!0)}for(const S of r.gates??[]){const N=_R(S,u,m,f);N&&(p.push(N),m=m*(1-N.impactReduction),y=!0)}a.rulesFired+=p.filter(S=>S.effect!=="monitored").length;const g=1-m/Math.max(u.magnitude,.001);let b,x,v;g>.85?(b="BLOCK",x=td("blocked",u,p),v=null,a.blocked++):g>.5?(b="PAUSE",x=td("paused",u,p),v={...u,magnitude:Number(m.toFixed(3))},a.paused++):y&&g>.05?(b="MODIFY",x=td("modified",u,p),v={...u,magnitude:Number(m.toFixed(3))},a.modified++):(b="ALLOW",x=p.length>0?`Allowed — ${p.filter(S=>S.effect==="monitored").length} advisory rule(s) noted`:"Allowed — no rules apply to this action",v=u,a.allowed++);const w={status:b,action:v,reason:x,rulesFired:p,confidence:TR(p,g),timestamp:Date.now()};return i&&i.logVerdict({agent:u.agentId,action:u.description,actionType:u.type,verdict:b==="MODIFY"?"MODIFY":b,reason:x,confidence:w.confidence,rulesFired:p.map(S=>({id:S.id,description:S.description,effect:S.effect,impactReduction:S.impactReduction}))}),w}function c(u,f){return u.map(p=>l(p,f))}function d(u){t=os(u),n=ui(t),r=Ru(t)}return{evaluate:l,evaluateBatch:c,updatePolicy:d,get policy(){return{ruleCount:t.summary.total,enforcedCount:t.summary.enforced,advisoryCount:t.summary.advisory,healthScore:n.healthScore}},get stats(){return{...a}}}}function ER(e,t,n,r,s){const i=e.description.toLowerCase(),a=t.description.toLowerCase(),l=t.type.toLowerCase(),c=.6-s*.3;if(Or(i,["block","prohibit","prevent","forbid","ban","stop","halt"])){const u=RR(i,["block","prohibit","prevent","forbid","ban","stop","halt"]).some(p=>a.includes(p)||l.includes(p)),f=t.magnitude>c;if(u||f)return{id:e.id,description:e.description,effect:"blocked",impactReduction:.85+s*.1}}return Or(i,["panic","cascade","contagion","crash","circuit","emergency","runaway"])&&(r?Dy(r):t.magnitude>.6)&&t.magnitude>c*.8?{id:e.id,description:e.description,effect:"blocked",impactReduction:.7+s*.2}:Or(i,["slow","cool","gradual","dampen","reduce volatility","moderate"])&&t.magnitude>c?{id:e.id,description:e.description,effect:"dampened",impactReduction:.35+s*.15}:Or(i,["floor","maintain","minimum","at least","no less"])&&t.magnitude>.4&&PR(i,a)?{id:e.id,description:e.description,effect:"capped",impactReduction:Math.min(.5,t.magnitude-.3)}:Or(i,["leverage","limit","cap","restrict","maximum","no more","ceiling"])&&t.magnitude>c+.1?{id:e.id,description:e.description,effect:"capped",impactReduction:Math.min(.4,t.magnitude-c)}:Or(i,["rebalance","equilibrium","balance","correlat","diversif"])&&t.magnitude>.5?{id:e.id,description:e.description,effect:"rebalanced",impactReduction:.3*s}:Or(i,["transparency","report","monitor","audit","disclose","accountab"])&&t.magnitude>.3?{id:e.id,description:e.description,effect:"monitored",impactReduction:0}:null}function _R(e,t,n,r){return e.severity==="critical"&&(r?Dy(r):n>.5)&&t.magnitude>.3?{id:e.id,description:e.label,effect:"blocked",impactReduction:.4}:e.severity==="warning"&&t.magnitude>.5?{id:e.id,description:e.label,effect:"dampened",impactReduction:.2}:null}function Or(e,t){return t.some(n=>e.includes(n))}function RR(e,t){let n=e;for(const r of t)n=n.replace(new RegExp(`\\b${r}\\b`,"g"),"");return n.split(/\s+/).filter(r=>r.length>2).map(r=>r.replace(/[^a-z]/g,"")).filter(r=>r.length>2)}function PR(e,t){return e.split(/\s+/).filter(r=>r.length>3).some(r=>t.includes(r))}function Dy(e){const t=e.volatility??e.volatility_index,n=e.liquidity??e.liquidity_index;return typeof t=="number"&&t>70||typeof n=="number"&&n<20||e.sentiment==="panic"||e.contagion_spread==="systemic"}function TR(e,t){if(e.length===0)return .95;const n=e.filter(r=>r.effect!=="monitored").length;return Math.min(.99,.6+n*.1+t*.2)}function td(e,t,n){const r=n.filter(a=>a.effect!=="monitored");if(r.length===0)return`${AR(e)} due to aggregate policy thresholds`;const s=r[0],i=r.length>1?` (+${r.length-1} more)`:"";switch(e){case"blocked":return`Blocked by "${s.description}"${i} — action "${t.description}" violates governance constraints`;case"paused":return`Paused by "${s.description}"${i} — action "${t.description}" requires review`;case"modified":return`Modified by "${s.description}"${i} — magnitude reduced from ${t.magnitude.toFixed(2)} to stay within policy limits`}}function AR(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Dh=[{agentId:"hedge-fund-alpha",type:"trade",description:"Sell $20M in equities during market downturn",magnitude:.85,context:{asset:"equities",amount:2e7,direction:"sell"}},{agentId:"algo-trader-7",type:"trade",description:"Execute high-frequency arbitrage strategy",magnitude:.6,context:{strategy:"arbitrage",automated:!0}},{agentId:"pension-fund",type:"trade",description:"Buy $5M in government bonds",magnitude:.25,context:{asset:"bonds",amount:5e6,direction:"buy"}},{agentId:"market-maker-3",type:"withdrawal",description:"Withdraw liquidity from the market",magnitude:.7,context:{type:"liquidity_withdrawal"}},{agentId:"retail-coalition",type:"trade",description:"Coordinated buy of meme stock",magnitude:.55,context:{coordinated:!0,participants:1200}},{agentId:"quant-fund-beta",type:"leverage",description:"Increase leverage to 8x on volatile positions",magnitude:.9,context:{leverage:8,current_leverage:3}},{agentId:"central-bank",type:"intervention",description:"Inject emergency liquidity into the system",magnitude:.4,context:{type:"liquidity_injection"}},{agentId:"insurance-pool",type:"trade",description:"Rebalance portfolio under normal conditions",magnitude:.15,context:{type:"rebalance",routine:!0}}],nd={calm:{label:"Calm Market",state:{volatility:25,liquidity:70,leverage:2,sentiment:"stable",contagion_spread:"contained"}},stressed:{label:"Stressed Market",state:{volatility:55,liquidity:35,leverage:5,sentiment:"anxious",contagion_spread:"spreading"}},crisis:{label:"Full Crisis",state:{volatility:88,liquidity:8,leverage:12,sentiment:"panic",contagion_spread:"systemic"}}};function IR(e){return e.includes("hormuz")||e.includes("strait")?"geopolitical":e.includes("gas")||e.includes("price")?"economic":e.includes("ai")||e.includes("regulation")?"regulation":"custom"}function MR(e){const t={low:20,moderate:40,high:70,critical:90},n={low:20,moderate:50,high:80},r={none:10,low:25,moderate:50,urgent:75,immediate:95},s={permissive:20,neutral:40,strict:70,adversarial:90};return{severity:t[e.severity??"moderate"]??50,environmentalHostility:n[e.environmental_hostility??"moderate"]??50,timePressure:r[e.time_pressure??"moderate"]??50,regulatoryClimate:s[e.regulatory_climate??"neutral"]??50}}function OR(e){const t=e.severity>=80?"critical":e.severity>=60?"high":e.severity>=35?"moderate":"low",n=e.environmentalHostility>=60?"high":e.environmentalHostility>=35?"moderate":"low",r=e.timePressure>=85?"immediate":e.timePressure>=65?"urgent":e.timePressure>=40?"moderate":e.timePressure>=20?"low":"none",s=e.regulatoryClimate>=80?"adversarial":e.regulatoryClimate>=60?"strict":e.regulatoryClimate>=35?"neutral":"permissive";return{severity:t,environmental_hostility:n,time_pressure:r,regulatory_climate:s}}const LR=Object.entries(di).map(([e,t])=>({id:e,title:t.title,description:t.scenario.slice(0,120)+(t.scenario.length>120?"...":""),tags:[...t.tags??[]],stakeholderCount:t.stakeholders.length,type:IR(e),defaultSliders:MR(t.assumptions)}));function $R(e){return e==="critical"||e==="high"?"high":e==="moderate"?"medium":"low"}function DR(e){var s;const t=e.analysis.paths,r=(s=[...t].sort((i,a)=>{const l={low:0,moderate:1,high:2,critical:3};return l[i.risk]-l[a.risk]})[0])==null?void 0:s.id;return t.map(i=>({name:i.label,description:i.description,probability:Math.round(i.probability*100),riskLevel:$R(i.risk),tradeoffs:[...i.tradeoffs],recommended:i.id===r}))}function FR(e){const t=e.analysis.paths.slice(0,3),n=[...new Set([...t.flatMap(a=>[...a.benefits_stakeholders??[],...a.harms_stakeholders??[]])])].slice(0,6),r=t.map(a=>a.label),s=n.length>0?n:["Stakeholder A","Stakeholder B","Stakeholder C"],i=s.map(a=>t.map(l=>{var c,d;return(c=l.benefits_stakeholders)!=null&&c.includes(a)?"positive":(d=l.harms_stakeholders)!=null&&d.includes(a)?"negative":"neutral"}));return{strategies:r,stakeholders:s,reactions:i}}function zR(e){const t={very_positive:2,positive:4,neutral:5,negative:7,very_negative:9};return e.analysis.projected_outcomes.map(n=>({label:n.label,type:n.label.toLowerCase().includes("best")?"best":n.label.toLowerCase().includes("likely")?"likely":n.label.toLowerCase().includes("worst")?"worst":"tail",conditions:n.conditions,description:n.outcome,likelihood:Math.round(n.likelihood*100),impactRating:t[n.impact]??5}))}function BR(e){return e.analysis.assumption_challenges.map(t=>({assumption:t.assumption,whyItMightFail:t.challenge,whatChanges:t.impact_if_wrong,severity:t.severity==="critical"?"critical":t.severity}))}function VR(e){return e.analysis.recommendations.map(t=>({priority:t.priority,action:t.action,rationale:t.rationale,timeframe:t.timeframe}))}function UR(e){const t=e.governance;if(t)return{traceId:t.trace_id,constitutionalChecks:t.constitutional_checks.map(n=>({ruleId:n.rule_id,rule:n.rule,passed:n.passed,detail:n.detail})),authorityLevel:t.authority_level,enforcedConstraints:[...t.enforced_constraints],timestamp:t.timestamp,engineVersion:t.engine_version,neuroverse:t.neuroverse?{guardStatus:t.neuroverse.guard_status,worldViability:t.neuroverse.world_viability,worldCollapsed:t.neuroverse.world_collapsed,collapseRisk:t.neuroverse.collapse_risk,rulesFired:t.neuroverse.rules_fired,worldHealthScore:t.neuroverse.world_health_score,invariantCoverage:t.neuroverse.invariant_coverage}:void 0}}function WR(e){var p;const t=e.analysis.paths,n=e.analysis.assumption_challenges,r=t.filter(m=>m.risk==="high"||m.risk==="critical").length,s=t.reduce((m,y)=>m+y.probability,0)/Math.max(t.length,1),i=(p=e.governance)==null?void 0:p.neuroverse,a=i==null?void 0:i.world_health_score,l=i==null?void 0:i.collapse_risk;let c="medium",d;const f=s-(l==="high"?.15:l==="moderate"?.08:0);return n.length<=1&&r===0&&f>.6?(c="high",d=`Analysis covers ${t.length} paths with low assumption risk and strong probability signals.`,a&&a<70&&(c="medium",d+=` System stability at ${a}% — moderate uncertainty from simulation dynamics.`)):n.length>=4||r>=2||f<.3?(c="low",d=`High uncertainty: ${n.length} assumptions challenged, ${r} high-risk paths, average probability ${(s*100).toFixed(0)}%.`,l==="high"&&(d+=" Elevated collapse risk detected in simulation.")):(d=`Moderate confidence: ${t.length} paths analyzed, ${n.length} assumptions challenged.`,a?d+=` System stability: ${a}%.`:d+=" Some uncertainty remains."),{level:c,reason:d}}function HR(e,t){var r,s,i,a,l,c;const n=[];return(r=e.assumptions)!=null&&r.severity&&n.push({text:`Severity is ${e.assumptions.severity}`,source:"caller"}),(s=e.assumptions)!=null&&s.time_pressure&&n.push({text:`Time pressure is ${e.assumptions.time_pressure}`,source:"caller"}),(i=e.assumptions)!=null&&i.environmental_hostility&&n.push({text:`Environmental hostility is ${e.assumptions.environmental_hostility}`,source:"caller"}),(a=e.assumptions)!=null&&a.regulatory_climate&&n.push({text:`Regulatory climate is ${e.assumptions.regulatory_climate}`,source:"caller"}),e.stakeholders&&e.stakeholders.length>0&&n.push({text:`${e.stakeholders.length} stakeholders identified with known dispositions`,source:"inferred"}),(l=e.constraints)!=null&&l.time_horizon||n.push({text:"No explicit time horizon — using general framework",source:"default"}),(c=e.constraints)!=null&&c.risk_tolerance||n.push({text:"Risk tolerance not specified — assuming moderate",source:"default"}),n}function GR(e,t){return{paths:DR(e),matrix:FR(e),outcomes:zR(e),challenges:BR(e),recommendations:VR(e),governance:UR(e),confidence:WR(e),keyAssumptions:HR(t),goalResult:e.goal_reasoning,mode:e.mode,lastRequest:t}}async function KR(e,t,n){var u;const r=typeof e=="string"?e:((u=di[e.id])==null?void 0:u.scenario)??e.description,s=OR(t),i=typeof e=="object"?e.id:void 0,a=i?di[i]:void 0;let l;n!=null&&n.stakeholders&&n.stakeholders.length>0?l=n.stakeholders.map(f=>({id:f.id,disposition:f.disposition})):a!=null&&a.stakeholders&&(l=[...a.stakeholders]);const c={scenario:r,stakeholders:l,assumptions:s,constraints:n!=null&&n.constraints?{time_horizon:n.constraints.timeHorizon||void 0,risk_tolerance:n.constraints.riskTolerance,budget:n.constraints.budget||void 0}:a==null?void 0:a.constraints,depth:(n==null?void 0:n.depth)??"full",perspective:"strategic_advisor",swarm:(a==null?void 0:a.swarm)??{enabled:!0,rounds:3,reaction_model:"mixed"},mode:n==null?void 0:n.mode,goal:n==null?void 0:n.goal},d=await U_(c);return d.status==="error"?{paths:[],matrix:{strategies:[],stakeholders:[],reactions:[]},outcomes:[],challenges:[],recommendations:[]}:GR(d,c)}function Fy(e){const t=e.trim();if(t.startsWith("{")||t.startsWith("["))try{const n=JSON.parse(t);return YR(n)?"mirofish":"generic_json"}catch{}return qR(t)?"anylogic_csv":QR(t)?"netlogo":XR(t)?"mesa":"freeform_text"}function YR(e){if(typeof e!="object"||e===null)return!1;const t=e;return(Array.isArray(t.agents)||Array.isArray(t.fish)||Array.isArray(t.swarm))&&(t.emergent_behaviors!==void 0||t.emergent_dynamics!==void 0||t.timeline!==void 0||t.simulation!==void 0)}function qR(e){const t=e.split(`
|
|
415
|
+
`).filter(l=>l.trim());if(t.length<2)return!1;const n=t[0];if(!n.includes(","))return!1;const r=n.split(",").map(l=>l.trim()),s=t[1].split(","),i=r.some(l=>/^[a-zA-Z_]/.test(l)),a=s.some(l=>!isNaN(Number(l.trim())));return i&&a&&r.length>=2}function QR(e){const t=e.split(`
|
|
416
|
+
`).filter(a=>a.trim()),n=/^[\w-]+\s*:\s*.+$/,r=/tick|step|round|iteration/i,s=t.filter(a=>n.test(a.trim())).length,i=t.some(a=>r.test(a));return s>=3&&s>=t.length*.5||s>=2&&i}function XR(e){const t=e.split(`
|
|
417
|
+
`).filter(s=>s.trim()),n=/^(?:agent|player|entity)\s+\d+\s*:\s*.+$/i,r=t.filter(s=>n.test(s.trim())).length;return r>=2&&r>=t.length*.3}function JR(e){switch(Fy(e)){case"mirofish":return ZR(e);case"netlogo":return e5(e);case"mesa":return t5(e);case"anylogic_csv":return n5(e);case"generic_json":return r5(e);case"freeform_text":return s5(e)}}function ZR(e){const t=JSON.parse(e.trim()),n=[],r=[],s=[],i=[],a=[],l=[],c=t.agents||t.fish||t.swarm||[];for(const u of c)n.push({id:u.id||u.name||u.type||`agent_${n.length}`,type:u.type||u.role||"agent",state:u.state||u.status,action:u.reaction||u.action||u.behavior,attributes:zy(u,["id","name","type","role","state","status","reaction","action","behavior"])}),(u.reaction||u.action)&&r.push({agents:[u.id||u.name||u.type],action:u.reaction||u.action,category:"reaction"});const d=[];if(t.emergent_behaviors)for(const u of Array.isArray(t.emergent_behaviors)?t.emergent_behaviors:[t.emergent_behaviors])d.push(typeof u=="string"?u:JSON.stringify(u));if(t.emergent_dynamics)for(const u of Array.isArray(t.emergent_dynamics)?t.emergent_dynamics:[t.emergent_dynamics])d.push(typeof u=="string"?u:JSON.stringify(u));if(t.timeline&&Array.isArray(t.timeline)){for(const u of t.timeline)if(typeof u=="object"){const{time:f,step:p,round:m,tick:y,...g}=u;a.push({time:f??p??m??y??a.length,state:g})}}if(t.steps&&Array.isArray(t.steps))for(const u of t.steps){const f=u.step??u.round??a.length;if(u.actions&&Array.isArray(u.actions))for(const p of u.actions)r.push({time:f,agents:p.agent?[p.agent]:void 0,action:p.action||p.type||JSON.stringify(p),effect:p.result||p.effect,category:"action"})}for(const[u,f]of Object.entries(t))typeof f=="number"&&!["version","seed","id"].includes(u)&&i.push({name:as(u),value:f});return{sourceFormat:"mirofish",agents:n,events:r,stateChanges:s,coalitions:l,metrics:i,timeline:a,emergentBehaviors:d.length>0?d:void 0,summary:t.summary||t.description}}function e5(e){const t=e.split(`
|
|
418
|
+
`).filter(l=>l.trim()),n=[],r=[],s=[];let i;for(const l of t){const c=l.trim(),d=c.match(/(?:tick|step|round|iteration)\s*[:#=]?\s*(\d+)/i);if(d){i=parseInt(d[1]);continue}const u=c.match(/^([\w-]+)\s*:\s*(.+)$/);if(u){const p=u[1].trim(),m=u[2].trim(),y=parseFloat(m.replace("%",""));if(isNaN(y))s.push({id:p,type:"entity",state:m});else{const g=m.includes("%");n.push({name:as(p),value:g?y/100:y,unit:g?"%":void 0}),r.push({variable:p,to:g?y/100:y,time:i})}continue}const f=c.match(/^([\w-]+)\s+([-\d.]+%?)$/);if(f){const p=parseFloat(f[2].replace("%",""));isNaN(p)||n.push({name:as(f[1]),value:f[2].includes("%")?p/100:p,unit:f[2].includes("%")?"%":void 0})}}const a=/consumer|producer|trader|voter|citizen|firm|bank|government|regulator/i;for(const l of n){const c=l.name.match(a);c&&!s.some(d=>d.type===c[0].toLowerCase())&&s.push({id:c[0].toLowerCase(),type:c[0].toLowerCase(),attributes:{[l.name]:l.value}})}return{sourceFormat:"netlogo",agents:s,events:[],stateChanges:r,coalitions:[],metrics:n,timeline:i!==void 0?[{time:i,state:Object.fromEntries(n.map(l=>[l.name,l.value]))}]:[]}}function t5(e){const t=e.split(`
|
|
419
|
+
`).filter(i=>i.trim()),n=[],r=[],s=new Map;for(const i of t){const a=i.trim(),l=a.match(/^(?:agent|player|entity)\s+(\w+)\s*:\s*(.+)$/i);if(l){const d=l[1],u=l[2].trim();if(s.has(d))s.get(d).action=u;else{const f={id:`agent_${d}`,type:"agent",action:u};s.set(d,f),n.push(f)}r.push({agents:[`agent_${d}`],action:u,category:"action"});continue}const c=a.match(/^([A-Z][\w\s]+?)\s*:\s*(.+)$/);if(c){const d=c[1].trim(),u=c[2].trim();if(!s.has(d)){const f={id:d,type:gl(d),action:u};s.set(d,f),n.push(f)}r.push({agents:[d],action:u,category:"action"})}}return{sourceFormat:"mesa",agents:n,events:r,stateChanges:[],coalitions:[],metrics:[],timeline:[]}}function n5(e){var d;const t=e.split(`
|
|
420
|
+
`).filter(u=>u.trim());if(t.length<2)return i5("anylogic_csv");const n=t[0].split(",").map(u=>u.trim().replace(/^["']|["']$/g,"")),r=[],s=[],i=new Map,a=n.findIndex(u=>/^(time|tick|step|round|t|timestamp|period|year|month|day|date)$/i.test(u));for(let u=1;u<t.length;u++){const f=t[u].split(",").map(y=>y.trim().replace(/^["']|["']$/g,""));if(f.length<n.length)continue;const p=a>=0?isNaN(Number(f[a]))?f[a]:Number(f[a]):u,m={};for(let y=0;y<n.length;y++){if(y===a)continue;const g=f[y],b=Number(g);m[n[y]]=isNaN(b)?g:b,isNaN(b)||(i.has(n[y])||i.set(n[y],[]),i.get(n[y]).push({time:p,value:b}))}r.push({time:p,state:m})}for(const[u,f]of i){const p=f[f.length-1].value,m=f[0].value,y=f.length<2?"stable":p>m*1.05?"rising":p<m*.95?"falling":"stable";s.push({name:as(u),value:p,trend:y,series:f})}const l=[],c=/consumer|producer|trader|voter|citizen|firm|bank|government|regulator|price|supply|demand/i;for(const u of n)if(u.match(c)){const p=(d=r[r.length-1])==null?void 0:d.state;l.push({id:u,type:gl(u),attributes:p?{value:p[u]}:void 0})}return{sourceFormat:"anylogic_csv",agents:l,events:[],stateChanges:[],coalitions:[],metrics:s,timeline:r}}function r5(e){const t=JSON.parse(e.trim()),n=[],r=[],s=[],i=[],a=[],l=[];function c(d,u=""){if(Array.isArray(d)){if(d.length>0&&typeof d[0]=="object"&&d[0]!==null){const f=d[0];if(f.id||f.name||f.agent||f.type){for(const p of d){const m=p;n.push({id:String(m.id||m.name||m.agent||`${u}_${n.length}`),type:String(m.type||m.role||m.class||"agent"),state:m.state?String(m.state):void 0,action:m.action?String(m.action):m.reaction?String(m.reaction):void 0,attributes:zy(m,["id","name","agent","type","role","class","state","action","reaction"])})}return}if(f.time||f.step||f.tick){for(const p of d){const m=p,y=m.time??m.step??m.tick??a.length,g={};for(const[b,x]of Object.entries(m))["time","step","tick"].includes(b)||(typeof x=="number"||typeof x=="string"||typeof x=="boolean")&&(g[b]=x);a.push({time:y,state:g})}return}if(f.action||f.event){for(const p of d){const m=p;r.push({agents:m.agent?[String(m.agent)]:m.agents?m.agents:void 0,action:String(m.action||m.event||m.type||"unknown"),effect:m.effect?String(m.effect):m.result?String(m.result):void 0,time:m.time??m.step,category:"action"})}return}}}else if(typeof d=="object"&&d!==null)for(const[f,p]of Object.entries(d))typeof p=="number"?s.push({name:as(f),value:p}):typeof p=="object"&&c(p,u?`${u}.${f}`:f)}if(typeof t=="object"&&t!==null){const d=t;if(d.agents&&c(d.agents,"agents"),d.events&&c(d.events,"events"),d.timeline&&c(d.timeline,"timeline"),d.coalitions&&Array.isArray(d.coalitions))for(const u of d.coalitions){const f=u;l.push({name:String(f.name||`coalition_${l.length}`),members:Array.isArray(f.members)?f.members.map(String):[],objective:f.objective?String(f.objective):void 0,strength:typeof f.strength=="number"?f.strength:void 0})}for(const[u,f]of Object.entries(d))["agents","events","timeline","coalitions"].includes(u)||(typeof f=="number"?s.push({name:as(u),value:f}):typeof f=="object"&&f!==null&&c(f,u))}return{sourceFormat:"generic_json",agents:n,events:r,stateChanges:i,coalitions:l,metrics:s,timeline:a,summary:typeof t.summary=="string"?t.summary:void 0}}function s5(e){const t=e.trim(),n=[],r=[],s=[],i=[/(?:agent|player|actor|entity|stakeholder)\s*[:#]?\s*["']?(\w[\w\s]{1,25}?)["']?(?:\n|,|;|\.|$)/gi,/^[-•*]\s*(\w[\w\s]{1,20}?)(?:\s*[-:—])/gm],a=new Set;for(const f of i){let p;for(;(p=f.exec(t))!==null;){const m=p[1].trim();m.length>1&&m.length<25&&!Fh(m)&&!a.has(m.toLowerCase())&&(a.add(m.toLowerCase()),n.push({id:m,type:gl(m)}))}}const l=/(\w[\w\s]{1,20}?)\s*(?::|—)\s*(.+?)(?:\n|$)/g;let c;for(;(c=l.exec(t))!==null;){const f=c[1].trim(),p=c[2].trim();!Fh(f)&&p.length>2&&(r.push({agents:[f],action:p,category:"action"}),a.has(f.toLowerCase())||(a.add(f.toLowerCase()),n.push({id:f,type:gl(f),action:p})))}const d=/(\w[\w\s]{1,30}?)\s*(?:=|:)\s*([-\d.]+%?)/g;let u;for(;(u=d.exec(t))!==null;){const f=u[1].trim(),p=u[2],m=parseFloat(p.replace("%",""));!isNaN(m)&&f.length>1&&s.push({name:as(f),value:p.includes("%")?m/100:m,unit:p.includes("%")?"%":void 0})}return{sourceFormat:"freeform_text",agents:n,events:r,stateChanges:[],coalitions:[],metrics:s,timeline:[],summary:t.length>200?t.slice(0,200)+"...":t}}function i5(e){return{sourceFormat:e,agents:[],events:[],stateChanges:[],coalitions:[],metrics:[],timeline:[]}}function as(e){return e.replace(/[-_]/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function gl(e){const t=e.toLowerCase();return/consumer|buyer|customer|shopper/.test(t)?"consumer":/producer|supplier|manufacturer|seller/.test(t)?"producer":/government|regulator|fed|agency|authority/.test(t)?"regulator":/firm|company|corp|bank|enterprise/.test(t)?"firm":/trader|investor|speculator|market/.test(t)?"trader":/citizen|voter|public|population/.test(t)?"citizen":/politician|senator|president|leader/.test(t)?"politician":/media|press|journalist/.test(t)?"media":/military|army|defense|navy/.test(t)?"military":"agent"}function Fh(e){return new Set(["the","and","for","with","from","that","this","then","but","not","are","was","were","has","have","had","will","would","could","should","may","might","step","round","tick","time","result","output","data"]).has(e.toLowerCase())}function zy(e,t){const n={};let r=0;for(const[s,i]of Object.entries(e))t.includes(s)||(typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&(n[s]=i,r++);return r>0?n:void 0}const By={mirofish:"MiroFish",netlogo:"NetLogo",mesa:"Mesa (Python)",anylogic_csv:"AnyLogic / CSV",generic_json:"JSON",freeform_text:"Text"};function o5(e){if(e.agents.length>0)return e.agents.slice(0,8).map(n=>n.id);const t=new Set;for(const n of e.events)if(n.agents)for(const r of n.agents)t.add(r);if(t.size>0)return Array.from(t).slice(0,8);for(const n of e.metrics){const r=n.name.toLowerCase();/consumer|producer|trader|government|firm|citizen/.test(r)&&t.add(n.name)}return t.size>0?Array.from(t).slice(0,8):["Alpha Agent","Beta Agent","Gamma Agent","Delta Agent","Epsilon Agent"]}function a5(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function l5(e){let t=e;return()=>(t=(t*16807+0)%2147483647,t/2147483647)}function c5(e){const t=JR(e),n=t.sourceFormat,r=o5(t),s=a5(e),i=l5(s),a=t.emergentBehaviors&&t.emergentBehaviors.length>0?t.emergentBehaviors.map((b,x)=>({name:b.length>40?b.slice(0,40)+"...":b,description:b,strength:["strong","moderate","weak"][Math.min(x,2)],agents:r.filter(()=>i()>.4)})):d5(r,i),l=t.agents.length>0?t.agents.slice(0,8).map(b=>({agent:b.id,strategy:b.action||b.state||"Adaptive",rationale:b.action?`Agent exhibits "${b.action}" behavior based on simulation data`:"Strategy inferred from simulation context",effectiveness:Math.round(40+i()*55)})):u5(r,i),c=t.coalitions.length>0?t.coalitions.map(b=>({name:b.name,members:b.members,sharedObjective:b.objective||"Coordinated strategy",cohesion:b.strength??Math.round(50+i()*45)})):f5(r,i),d=m5(r,i),u=p5(r,i),f=h5(r,i),p=g5(r,f,i),m=v5(i),y=x5(r,i),g=y5(r,f);return{patterns:a,agentStrategies:l,coalitions:c,powerDynamics:d,equilibrium:u,paths:f,matrix:p,outcomes:m,challenges:y,recommendations:g,detectedFormat:n,formatLabel:By[n],normalized:t}}function d5(e,t){const n=[{name:"Convergent Herding",description:"Multiple agents independently converge on similar strategies, creating a dominant behavioral cluster."},{name:"Oscillatory Competition",description:"Agents cycle between cooperative and competitive strategies in a predictable pattern."},{name:"Resource Clustering",description:"Agents concentrate around high-value nodes, creating territorial dynamics."},{name:"Cascade Adoption",description:"Strategy adoption follows a cascade pattern — once critical mass is reached, remaining agents switch rapidly."},{name:"Minority Exploitation",description:"A small group of agents consistently outperforms by exploiting the majority strategy."},{name:"Symmetry Breaking",description:"Initially symmetric agents differentiate into specialized roles over time."},{name:"Delayed Retaliation",description:"Agents employ tit-for-tat with delay, creating cycles of cooperation and defection."}],r=3+Math.floor(t()*3),s=["strong","moderate","weak"];return n.slice(0,r).map(i=>({...i,strength:s[Math.floor(t()*3)],agents:e.filter(()=>t()>.4)}))}function u5(e,t){const n=[{strategy:"Tit-for-Tat",rationale:"Mirrors opponent behavior to incentivize cooperation while punishing defection."},{strategy:"Always Cooperate",rationale:"Maximizes collective welfare at the cost of individual exploitation risk."},{strategy:"Pavlov (Win-Stay, Lose-Shift)",rationale:"Repeats successful strategies and switches after failures — simple but adaptive."},{strategy:"Grim Trigger",rationale:"Cooperates until defected against, then permanently defects — extreme deterrence."},{strategy:"Random Walk",rationale:"Unpredictable strategy prevents exploitation but sacrifices optimization."},{strategy:"Generous Tit-for-Tat",rationale:"Occasionally forgives defection to escape mutual punishment cycles."},{strategy:"Exploitative Defection",rationale:"Systematically defects to extract maximum individual payoff from cooperators."},{strategy:"Adaptive Threshold",rationale:"Adjusts cooperation threshold based on environment — cooperates in friendly environments, defects in hostile ones."}];return e.map(r=>{const s=Math.floor(t()*n.length);return{agent:r,strategy:n[s].strategy,rationale:n[s].rationale,effectiveness:Math.round(40+t()*55)}})}function f5(e,t){if(e.length<3)return[];const n=[],r=["Resource maximization through coordinated strategy","Collective defense against exploitative agents","Market dominance through price coordination","Information sharing for competitive advantage"],s=[...e].sort(()=>t()-.5),i=Math.floor(s.length/2);return n.push({name:"Primary Coalition",members:s.slice(0,i+1),sharedObjective:r[Math.floor(t()*r.length)],cohesion:Math.round(50+t()*45)}),e.length>4&&n.push({name:"Counter-Coalition",members:s.slice(i+1),sharedObjective:r[Math.floor(t()*r.length)],cohesion:Math.round(30+t()*50)}),n}function m5(e,t){const n=["driver","reactor","stabilizer","disruptor"],r={driver:["Sets the strategic direction; other agents respond to this agent's moves.","Primary initiator of action; shapes the competitive landscape."],reactor:["Responds to others' strategies rather than initiating; adaptive but not proactive.","Follows dominant trends; optimizes within established dynamics."],stabilizer:["Acts as a moderating force; dampens oscillations and promotes equilibrium.","Consistently chooses cooperative strategies; anchors the system."],disruptor:["Introduces unpredictability; breaks established patterns and forces adaptation.","High-variance strategy creates opportunities and threats for all agents."]};return e.map(s=>{const i=n[Math.floor(t()*n.length)],a=r[i];return{agent:s,role:i,influence:Math.round(20+t()*75),description:a[Math.floor(t()*a.length)]}})}function p5(e,t){const n=[{type:"Nash Equilibrium",description:"The system has reached a state where no agent can unilaterally improve their outcome by changing strategy. This equilibrium is self-enforcing but may not be globally optimal."},{type:"Pareto Suboptimal Equilibrium",description:"Agents are locked in a stable but collectively suboptimal state. A coordinated deviation could improve all agents' outcomes, but individual incentives prevent it."},{type:"Cyclical Dynamics",description:"No stable equilibrium detected. The system oscillates between states as agents continuously adapt to each other's strategies."},{type:"Mixed Strategy Equilibrium",description:"Agents randomize between strategies with specific probabilities. The equilibrium is maintained through uncertainty rather than fixed strategies."}],r=n[Math.floor(t()*n.length)],s=t()>.4;return{isStable:s,type:r.type,description:r.description,stabilityScore:Math.round(s?55+t()*40:15+t()*35),vulnerabilities:["External shock could push agents to reassess strategies",e.length>3?`Coalition between ${e[0]} and ${e[1]} could destabilize current equilibrium`:"Small agent count increases sensitivity to individual strategy changes","Information asymmetry may be masking true strategic preferences"].slice(0,2+Math.floor(t()*2))}}function h5(e,t){const n=[{name:"Coalition Reinforcement",description:"Strengthen the dominant coalition by aligning incentives and reducing defection risk among members."},{name:"Disruptor Containment",description:"Isolate disruptive agents through coordinated exclusion or counter-strategies."},{name:"Equilibrium Shift",description:"Introduce strategic perturbation to move the system toward a more favorable equilibrium state."},{name:"Cooperation Incentive Design",description:"Restructure payoff matrices to make cooperation individually rational, not just collectively optimal."},{name:"Adaptive Monitoring",description:"Implement continuous strategy monitoring and adjust response in real-time based on agent behavior changes."}];let r=0;const s=n.map((i,a)=>{const l=Math.round(15+t()*30);return r+=l,{...i,probability:l,riskLevel:t()>.6?"high":t()>.3?"medium":"low",tradeoffs:[`May alienate ${e[Math.floor(t()*e.length)]}`,"Requires sustained coordination to maintain effectiveness","Outcome depends on accurate agent behavior modeling"].slice(0,2+Math.floor(t()*2)),recommended:a===0}});return s.forEach(i=>{i.probability=Math.round(i.probability/r*100)}),s}function g5(e,t,n){const r=t.slice(0,3).map(i=>i.name),s=e.map(()=>r.map(()=>{const i=n();return i>.55?"positive":i>.25?"neutral":"negative"}));return{strategies:r,stakeholders:e,reactions:s}}function v5(e){return[{label:"Best Case",type:"best",conditions:"All agents converge on cooperative equilibrium",description:"System achieves globally optimal state; all agents benefit from sustained cooperation.",likelihood:Math.round(10+e()*15),impactRating:Math.round(2+e()*2)},{label:"Most Likely",type:"likely",conditions:"Partial cooperation with persistent free-riding",description:"Dominant coalition maintains advantage while fringe agents exploit cooperative norms.",likelihood:Math.round(35+e()*20),impactRating:Math.round(4+e()*2)},{label:"Worst Case",type:"worst",conditions:"Coalition fracture and competitive spiral",description:"Trust breakdown triggers mutual defection; system degrades to non-cooperative equilibrium.",likelihood:Math.round(10+e()*15),impactRating:Math.round(7+e()*2)},{label:"Tail Risk",type:"tail",conditions:"Emergent adversarial strategy defeats all known counters",description:"Novel agent strategy exploits systemic vulnerability; cascading failures across the agent network.",likelihood:Math.round(2+e()*8),impactRating:Math.round(9+e())}]}function x5(e,t){return[{assumption:"Agents behave rationally",whyItMightFail:"Bounded rationality, information delays, and emergent complexity produce behaviors that deviate from game-theoretic optimality.",whatChanges:"Predictive models may fail; heuristic-based analysis becomes necessary.",severity:"high"},{assumption:"Agent strategies are observable",whyItMightFail:"Agents may employ deceptive signaling, masking true strategies behind observable actions.",whatChanges:"Strategy inference requires deeper behavioral analysis; surface patterns may mislead.",severity:"medium"},{assumption:"The environment is stationary",whyItMightFail:"Payoff structures and constraints may shift during the simulation, invalidating equilibrium analysis.",whatChanges:"Continuous recalibration needed; static equilibrium analysis insufficient.",severity:"high"},{assumption:`${e[0]} will maintain current strategy`,whyItMightFail:"Agents adapt over time; current strategy may be transitional rather than stable.",whatChanges:"Must model strategy evolution, not just current state.",severity:"medium"},{assumption:"Coalition structures are stable",whyItMightFail:"Internal incentive misalignment may cause coalition fracture under pressure.",whatChanges:"Coalition durability should be stress-tested; contingency plans for fracture needed.",severity:"critical"}].slice(0,3+Math.floor(t()*3))}function y5(e,t,n){const r=t.find(s=>s.recommended)||t[0];return[{priority:1,action:`Implement ${r.name}`,rationale:`Highest-probability intervention (${r.probability}%) for steering swarm behavior.`,timeframe:"Immediate"},{priority:2,action:"Monitor coalition stability metrics",rationale:"Early detection of coalition fracture enables preemptive intervention.",timeframe:"Continuous"},{priority:3,action:`Address ${e[e.length-1]} behavior pattern`,rationale:"Outlier agent behavior may indicate either exploitation or innovation; requires assessment.",timeframe:"Within next cycle"},{priority:4,action:"Run sensitivity analysis on payoff structure",rationale:"Small payoff changes may trigger large behavioral shifts; identify critical thresholds.",timeframe:"Before next iteration"}]}const zh="mirotir_theme";function gm(){const[e,t]=h.useState(()=>typeof window<"u"&&localStorage.getItem(zh)||"dark");h.useEffect(()=>{const r=document.documentElement;e==="light"?r.classList.add("light"):r.classList.remove("light"),localStorage.setItem(zh,e)},[e]);const n=h.useCallback(()=>{t(r=>r==="dark"?"light":"dark")},[]);return{theme:e,toggle:n}}const b5="/assets/mirotir-logo-DUexumBH.svg",w5=Gl("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"}}),re=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const a=r?Rj:"button";return o.jsx(a,{className:$(w5({variant:t,size:n,className:e})),ref:i,...s})});re.displayName="Button";const S5=({showSimulatedFuture:e,theme:t,onToggleTheme:n,isSimulating:r})=>o.jsx("header",{className:"fixed top-0 left-0 right-0 z-50 border-b border-border bg-background/80 backdrop-blur-md",children:o.jsxs("div",{className:"container mx-auto flex items-center justify-between px-6 py-3",children:[o.jsx("div",{className:"flex items-center gap-3",children:o.jsx("img",{src:b5,alt:"Mirotir",className:"h-14 w-auto"})}),o.jsxs("div",{className:"flex items-center gap-4",children:[(r||e)&&o.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[o.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-emerald-500/30 bg-emerald-500/10 px-3 py-1.5",children:[o.jsx(yu,{className:"h-3 w-3 text-emerald-400 animate-pulse"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.15em] text-emerald-400",children:"Governed MiroFish Simulation"})]}),o.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-violet-500/30 bg-violet-500/10 px-3 py-1.5",children:[o.jsx(yu,{className:"h-3 w-3 text-violet-400 animate-pulse"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.15em] text-violet-400",children:"Governed by NeuroVerse"})]})]}),n&&o.jsx(re,{variant:"ghost",size:"icon",onClick:n,className:"h-9 w-9 rounded-full","aria-label":`Switch to ${t==="dark"?"light":"dark"} mode`,children:t==="dark"?o.jsx(OC,{className:"h-4 w-4 text-muted-foreground hover:text-foreground transition-colors"}):o.jsx(AC,{className:"h-4 w-4 text-muted-foreground hover:text-foreground transition-colors"})}),o.jsx("div",{className:"hidden text-right md:block",children:e?o.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary animate-pulse",children:"SIMULATED FUTURE"}):o.jsx("p",{className:"text-xs text-muted-foreground tracking-wider",children:"Explore decisions before reality does"})})]})]})}),N5=({governance:e})=>{const t=e==null?void 0:e.neuroverse;return o.jsx("footer",{className:"border-t border-border py-8",children:o.jsxs("div",{className:"container mx-auto px-6",children:[e&&o.jsxs("div",{className:"mx-auto mb-6 max-w-3xl space-y-3",children:[o.jsx("div",{className:"rounded-lg border border-border bg-card/50 px-5 py-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Qi,{className:"h-4 w-4 text-primary"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Authority: ",o.jsx("span",{className:"text-foreground font-medium",children:e.authorityLevel.replace(/_/g," ")})]}),o.jsxs("span",{children:[e.constitutionalChecks.length," rules checked"]}),o.jsxs("span",{children:["Trace: ",o.jsx("span",{className:"font-mono",children:e.traceId.slice(0,12)})]})]})]})}),t&&o.jsx("div",{className:"rounded-lg border border-border bg-card/50 px-5 py-3",children:o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Tr,{className:"h-4 w-4 text-primary"}),o.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Governance: ",o.jsx("span",{className:`font-medium ${t.guardStatus==="ALLOW"?"text-emerald-400":t.guardStatus==="BLOCK"?"text-red-400":"text-yellow-400"}`,children:t.guardStatus})]}),t.worldViability&&o.jsxs("span",{children:["Status: ",o.jsx("span",{className:"text-foreground font-medium",children:t.worldViability})]}),t.rulesFired!==void 0&&o.jsxs("span",{children:[t.rulesFired," rules applied"]}),t.collapseRisk&&t.collapseRisk!=="none"&&o.jsxs("span",{children:["System risk: ",o.jsx("span",{className:`font-medium ${t.collapseRisk==="high"?"text-red-400":t.collapseRisk==="moderate"?"text-yellow-400":"text-emerald-400"}`,children:t.collapseRisk})]}),t.worldHealthScore!==void 0&&o.jsxs("span",{children:["Stability: ",t.worldHealthScore,"%"]})]})]})})]}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:"Powered by a governed multi-agent simulation engine"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:"We simulate, enforce rules, and analyze results."})]})]})})},k5={dark:{swarm:"#1B5E7B",reasoning:"#5BC0BE",future:"#ffffff"},light:{swarm:"#134A5E",reasoning:"#2D8B88",future:"#0F3A4A"}},Bh=40,Vh=7,Uh=3;function rd(e,t,n,r,s){if(n==="reasoning")return{x:e/(s+1)*(r+1),y:t*.5+(Math.random()-.5)*8,vx:.3+Math.random()*.2,vy:(Math.random()-.5)*.1,size:10+Math.random()*3,type:n,opacity:.9};if(n==="future")return{x:e*.75+r*30,y:t*.5+(r-1)*25,vx:.4+Math.random()*.3,vy:(r-1)*.15,size:7+Math.random()*2,type:n,opacity:.7};const i=Math.random()*Math.PI*2,a=40+Math.random()*100;return{x:e*.45+Math.cos(i)*a,y:t*.5+Math.sin(i)*a*.7,vx:(Math.random()-.5)*.5,vy:(Math.random()-.5)*.3,size:6+Math.random()*5,type:n,opacity:.5+Math.random()*.3}}function j5(e,t,n){const{x:r,y:s,size:i,vx:a,vy:l,opacity:c}=t,d=Math.atan2(l,a);e.save(),e.translate(r,s),e.rotate(d),e.globalAlpha=c,e.beginPath(),e.ellipse(0,0,i,i*.6,0,0,Math.PI*2),e.fillStyle=n,e.fill(),e.beginPath(),e.moveTo(-i*.7,-i*.45),e.lineTo(-i*1.4,0),e.lineTo(-i*.7,i*.45),e.closePath(),e.fill(),t.type!=="swarm"&&(e.beginPath(),e.arc(i*.3,-i*.15,i*.12,0,Math.PI*2),e.fillStyle="white",e.fill()),e.restore()}const C5=()=>{const{theme:e}=gm(),t=h.useRef(null),n=h.useRef([]),r=h.useRef(0),[s]=h.useState({width:400,height:320}),i=k5[e];return h.useEffect(()=>{const{width:a,height:l}=s,c=[];for(let p=0;p<Bh;p++)c.push(rd(a,l,"swarm",p,Bh));for(let p=0;p<Vh;p++)c.push(rd(a,l,"reasoning",p,Vh));for(let p=0;p<Uh;p++)c.push(rd(a,l,"future",p,Uh));n.current=c;const d=a*.45,u=l*.5;function f(){const p=t.current;if(!p)return;const m=p.getContext("2d");if(m){m.clearRect(0,0,a,l);for(const y of n.current){if(y.type==="swarm"){const b=d-y.x,x=u-y.y,v=Math.sqrt(b*b+x*x),w=60+Math.sin(Date.now()*.001+y.x)*30;y.vx+=b*3e-4,y.vy+=x*3e-4,y.vx+=-x*2e-4,y.vy+=b*2e-4,v<w&&(y.vx-=b*5e-4,y.vy-=x*5e-4),y.vx+=(Math.random()-.5)*.02,y.vy+=(Math.random()-.5)*.02,y.vx*=.99,y.vy*=.99}y.type==="reasoning"&&(y.vy+=(u-y.y)*.01,y.vy*=.95,y.vx=Math.max(.2,y.vx),y.x>a+20&&(y.x=-20)),y.type==="future"&&(y.vx=Math.max(.3,y.vx),y.x>a+20&&(y.x=a*.7,y.y=u+(Math.random()-.5)*50)),y.x+=y.vx,y.y+=y.vy,y.type==="swarm"&&(y.x<10&&(y.vx+=.1),y.x>a-10&&(y.vx-=.1),y.y<10&&(y.vy+=.1),y.y>l-10&&(y.vy-=.1));const g=y.type==="reasoning"?i.reasoning:y.type==="future"?i.future:i.swarm;j5(m,y,g)}r.current=requestAnimationFrame(f)}}return f(),()=>cancelAnimationFrame(r.current)},[s]),o.jsxs("div",{className:"relative",children:[o.jsx("canvas",{ref:t,width:s.width,height:s.height,className:"rounded-xl",style:{maxWidth:"100%",height:"auto"}}),o.jsx("div",{className:"absolute bottom-3 right-3",children:o.jsx("span",{className:"rounded bg-background/60 px-2 py-1 text-[10px] font-mono text-muted-foreground backdrop-blur",children:"LIVE SWARM"})})]})},E5=({onRunScenario:e,onPasteSimulation:t})=>o.jsx("section",{className:"relative overflow-hidden py-20 md:py-32",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"grid items-center gap-12 md:grid-cols-2",children:[o.jsxs("div",{children:[o.jsxs("h1",{className:"mb-4 text-4xl font-bold tracking-tight text-foreground md:text-6xl lg:text-7xl",children:["Change the rules.",o.jsx("br",{}),o.jsx("span",{className:"text-primary",children:"See why the system changed."})]}),o.jsx("p",{className:"mb-8 max-w-lg text-lg text-muted-foreground md:text-xl",children:"NV-SIM doesn't predict outcomes — it shows how they change when you change the rules."}),o.jsxs("div",{className:"flex flex-wrap gap-4",children:[o.jsxs(re,{size:"lg",className:"px-8 py-6 text-base font-semibold tracking-wider",onClick:e,children:[o.jsx(Mo,{className:"mr-2 h-4 w-4"}),"START SIMULATION"]}),o.jsxs(re,{size:"lg",variant:"outline",className:"px-8 py-6 text-base font-semibold tracking-wider",onClick:t,children:[o.jsx(ss,{className:"mr-2 h-4 w-4"}),"LOAD DATA"]})]}),o.jsx("p",{className:"mt-8 text-sm font-medium tracking-wider text-muted-foreground",children:"We don't show you what every agent did. We show you what the system became."})]}),o.jsx("div",{className:"flex items-center justify-center",children:o.jsx(C5,{})})]})})}),jt=h.forwardRef(({className:e,type:t,...n},r)=>o.jsx("input",{type:t,className:$("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}));jt.displayName="Input";const Te=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:$("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Te.displayName="Card";const Xe=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:$("flex flex-col space-y-1.5 p-6",e),...t}));Xe.displayName="CardHeader";const Je=h.forwardRef(({className:e,...t},n)=>o.jsx("h3",{ref:n,className:$("text-2xl font-semibold leading-none tracking-tight",e),...t}));Je.displayName="CardTitle";const _5=h.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:$("text-sm text-muted-foreground",e),...t}));_5.displayName="CardDescription";const Ae=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:$("p-6 pt-0",e),...t}));Ae.displayName="CardContent";const R5=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:$("flex items-center p-6 pt-0",e),...t}));R5.displayName="CardFooter";const P5=Gl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Re({className:e,variant:t,...n}){return o.jsx("div",{className:$(P5({variant:t}),e),...n})}const T5=[{name:"Incremental Path",probability:65,risk:"low",summary:"Gradual domestic production increases paired with strategic reserve releases to stabilize prices over 4–6 months.",drivers:["Strategic petroleum reserve draw-down","Expedited drilling permits","Refinery utilization optimization"],timeline:[{period:"Month 1",action:"Release 30M barrels from SPR",effect:"Prices stabilize at $4.50"},{period:"Month 2-3",action:"Fast-track 200 drilling permits",effect:"Domestic supply signal calms futures market"},{period:"Month 4-6",action:"Refinery optimization + import diversification",effect:"Prices reach $3.20 target zone"}]},{name:"Coalition Path",probability:60,risk:"medium",summary:"Build OPEC+ negotiation coalition with consumer nations to pressure production quota increases.",drivers:["Diplomatic pressure on Saudi Arabia","IEA coordinated release","Consumer nation solidarity bloc"],timeline:[{period:"Month 1",action:"Convene IEA emergency session",effect:"Coordinated 60M barrel release announced"},{period:"Month 2-3",action:"Coalition negotiation with OPEC+",effect:"Production quota increase of 500K bpd"},{period:"Month 4-6",action:"Market stabilization + long-term supply agreements",effect:"Prices settle at $2.90"}]},{name:"Direct Intervention",probability:55,risk:"high",summary:"Executive action to cap prices, mandate refinery output, and impose export restrictions.",drivers:["Emergency price controls","Defense Production Act invocation","Export ban on refined products"],timeline:[{period:"Month 1",action:"Emergency executive order on price caps",effect:"Immediate price relief but market uncertainty"},{period:"Month 2-3",action:"DPA mandates on refinery output",effect:"Supply increases but industry friction grows"},{period:"Month 4-6",action:"Gradual deregulation as supply normalizes",effect:"Prices at $2.80 but market distortions persist"}]}],A5=({onFullAnalysis:e})=>{const[t,n]=h.useState("Gas prices spike to $5/gallon"),[r,s]=h.useState("Stabilize prices under $3 within 6 months"),[i,a]=h.useState(!1),[l,c]=h.useState(null),[d,u]=h.useState(null),f=h.useCallback(()=>{a(!0),c(null),u(null)},[]),p={low:"bg-emerald-500/20 text-emerald-400",medium:"bg-yellow-500/20 text-yellow-400",high:"bg-red-500/20 text-red-400"};return o.jsx("section",{className:"border-t border-border py-16 md:py-24",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-3xl",children:[o.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"TRY IT NOW"}),o.jsx("p",{className:"mb-8 text-center text-muted-foreground",children:"Describe a situation and desired outcome. See what strategies emerge."}),o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Current Situation"}),o.jsx(jt,{value:t,onChange:m=>n(m.target.value),className:"text-sm",placeholder:"What's happening?"})]}),o.jsxs("div",{children:[o.jsx("label",{className:"mb-1.5 block text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Desired Outcome"}),o.jsx(jt,{value:r,onChange:m=>s(m.target.value),className:"text-sm",placeholder:"Where do you want to end up?"})]}),o.jsxs("div",{className:"flex gap-3 pt-2",children:[o.jsx(re,{className:"px-8 py-5 text-sm font-semibold tracking-wider",onClick:f,children:"FIND SOLUTIONS"}),i&&e&&o.jsxs(re,{variant:"outline",className:"px-6 py-5 text-sm font-semibold tracking-wider",onClick:()=>e(t,r),children:["FULL REPORT ",o.jsx(SC,{className:"ml-1.5 h-4 w-4"})]})]})]}),i&&o.jsx("div",{className:"mt-10 space-y-4 animate-in fade-in-0 slide-in-from-bottom-4 duration-500",children:T5.map((m,y)=>o.jsxs(Te,{className:"border-border overflow-hidden",children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Je,{className:"text-base",children:m.name}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(Re,{className:$("text-xs font-mono",p[m.risk]),children:[m.risk," risk"]}),o.jsxs("span",{className:"text-lg font-bold text-primary",children:[m.probability,"%"]})]})]})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:m.summary}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsxs(re,{size:"sm",variant:"ghost",className:"text-xs",onClick:()=>c(l===y?null:y),children:[o.jsx(gt,{className:$("mr-1 h-3 w-3 transition-transform",l===y&&"rotate-180")}),"SHOW WHY"]}),o.jsxs(re,{size:"sm",variant:"ghost",className:"text-xs",onClick:()=>u(d===y?null:y),children:[o.jsx(Kf,{className:"mr-1 h-3 w-3"}),"TIMELINE"]}),o.jsxs(re,{size:"sm",variant:"ghost",className:"text-xs",children:[o.jsx(Io,{className:"mr-1 h-3 w-3"}),"MODIFY"]})]}),l===y&&o.jsxs("div",{className:"mt-4 rounded-md border border-border bg-muted/30 p-4 animate-in fade-in-0 slide-in-from-top-2",children:[o.jsx("h4",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Key Drivers"}),o.jsx("ul",{className:"space-y-1.5",children:m.drivers.map((g,b)=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[o.jsx("span",{className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),g]},b))})]}),d===y&&o.jsx("div",{className:"mt-4 animate-in fade-in-0 slide-in-from-top-2",children:o.jsx("div",{className:"relative ml-3 border-l-2 border-primary/30 pl-6 space-y-4",children:m.timeline.map((g,b)=>o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute -left-[31px] top-1 h-3 w-3 rounded-full border-2 border-primary bg-background"}),o.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:g.period}),o.jsx("div",{className:"text-sm text-foreground",children:g.action}),o.jsx("div",{className:"text-xs text-muted-foreground",children:g.effect})]},b))})})]})]},y))})]})})})},rc=h.forwardRef(({className:e,...t},n)=>o.jsx("textarea",{className:$("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background 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",e),ref:n,...t}));rc.displayName="Textarea";const I5=({onExplain:e,isLoading:t})=>{const[n,r]=h.useState(""),s=h.useMemo(()=>{if(!n.trim()||n.trim().length<10)return null;try{const i=Fy(n);return{format:i,label:By[i]}}catch{return null}},[n]);return o.jsx("section",{className:"py-16 md:py-24",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[o.jsx("h2",{className:"mb-2 text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"ANALYZE RESULTS"}),o.jsx("h3",{className:"mb-3 text-3xl font-bold tracking-tight text-foreground md:text-4xl",children:"Upload Simulation Data"}),o.jsxs("p",{className:"mb-8 text-muted-foreground",children:["Paste results from any simulation tool — we auto-detect the format.",o.jsx("br",{}),o.jsx("span",{className:"text-xs",children:"JSON, CSV, key-value, or plain text supported."})]}),o.jsxs("div",{className:"relative rounded-lg border border-border bg-card p-1",children:[o.jsx(rc,{placeholder:`Paste simulation results here...
|
|
421
|
+
|
|
422
|
+
Supported formats:
|
|
423
|
+
• JSON (agents, behaviors, metrics)
|
|
424
|
+
• CSV (time series, variable columns)
|
|
425
|
+
• Key-value logs (step: value)
|
|
426
|
+
• Plain text descriptions`,className:"min-h-[200px] resize-none border-0 bg-transparent font-mono text-sm text-foreground placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",value:n,onChange:i=>r(i.target.value)}),s&&o.jsx("div",{className:"absolute bottom-3 right-3",children:o.jsxs(Re,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:["Detected: ",s.label]})})]}),o.jsx(re,{className:"mt-6 px-10 py-6 text-base font-semibold tracking-wider",onClick:()=>e(n),disabled:!n.trim()||t,children:t?"ANALYZING...":"ANALYZE"})]})})})};var vm="Progress",xm=100,[M5,tI]=zt(vm),[O5,L5]=M5(vm),Vy=h.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:s,getValueLabel:i=$5,...a}=e;(s||s===0)&&!Wh(s)&&console.error(D5(`${s}`,"Progress"));const l=Wh(s)?s:xm;r!==null&&!Hh(r,l)&&console.error(F5(`${r}`,"Progress"));const c=Hh(r,l)?r:null,d=vl(c)?i(c,l):void 0;return o.jsx(O5,{scope:n,value:c,max:l,children:o.jsx(Q.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":vl(c)?c:void 0,"aria-valuetext":d,role:"progressbar","data-state":Hy(c,l),"data-value":c??void 0,"data-max":l,...a,ref:t})})});Vy.displayName=vm;var Uy="ProgressIndicator",Wy=h.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,s=L5(Uy,n);return o.jsx(Q.div,{"data-state":Hy(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...r,ref:t})});Wy.displayName=Uy;function $5(e,t){return`${Math.round(e/t*100)}%`}function Hy(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function vl(e){return typeof e=="number"}function Wh(e){return vl(e)&&!isNaN(e)&&e>0}function Hh(e,t){return vl(e)&&!isNaN(e)&&e<=t&&e>=0}function D5(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${xm}\`.`}function F5(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
|
|
427
|
+
- a positive number
|
|
428
|
+
- less than the value passed to \`max\` (or ${xm} if no \`max\` prop is set)
|
|
429
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
430
|
+
|
|
431
|
+
Defaulting to \`null\`.`}var Gy=Vy,z5=Wy;const $i=h.forwardRef(({className:e,value:t,...n},r)=>o.jsx(Gy,{ref:r,className:$("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:o.jsx(z5,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));$i.displayName=Gy.displayName;const B5={strong:"bg-primary text-primary-foreground",moderate:"bg-secondary text-secondary-foreground",weak:"bg-muted text-muted-foreground"},V5={driver:"bg-primary text-primary-foreground",reactor:"bg-secondary text-secondary-foreground",stabilizer:"bg-accent text-accent-foreground",disruptor:"bg-destructive text-destructive-foreground"},U5=({result:e})=>o.jsxs("section",{className:"space-y-12 py-12",children:[o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Emergent Patterns"}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.patterns.map((t,n)=>o.jsxs(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Je,{className:"text-base",children:t.name}),o.jsx(Re,{className:B5[t.strength],children:t.strength})]})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.description}),o.jsx("div",{className:"flex flex-wrap gap-1",children:t.agents.map((r,s)=>o.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:r},s))})]})]},n))})]}),o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Dominant Strategies per Agent"}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.agentStrategies.map((t,n)=>o.jsx(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*80}ms`},children:o.jsxs(Ae,{className:"pt-6",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("span",{className:"font-semibold text-foreground",children:t.agent}),o.jsxs("span",{className:"text-sm text-primary",children:[t.effectiveness,"% effective"]})]}),o.jsx("p",{className:"mb-1 text-sm font-medium text-foreground",children:t.strategy}),o.jsx("p",{className:"text-xs text-muted-foreground",children:t.rationale}),o.jsx($i,{value:t.effectiveness,className:"mt-3 h-1.5"})]})},n))})]}),o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Coalition Detection"}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.coalitions.map((t,n)=>o.jsxs(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:t.name})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.sharedObjective}),o.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:t.members.map((r,s)=>o.jsx(Re,{variant:"outline",className:"text-xs",children:r},s))}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Cohesion"}),o.jsx($i,{value:t.cohesion,className:"h-1.5 flex-1"}),o.jsxs("span",{className:"text-xs text-primary",children:[t.cohesion,"%"]})]})]})]},n))})]}),o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Power Dynamics"}),o.jsx("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:e.powerDynamics.map((t,n)=>o.jsx(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*80}ms`},children:o.jsxs(Ae,{className:"pt-6",children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("span",{className:"font-semibold text-foreground",children:t.agent}),o.jsx(Re,{className:V5[t.role],children:t.role})]}),o.jsx("p",{className:"mb-3 text-xs text-muted-foreground",children:t.description}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Influence"}),o.jsx($i,{value:t.influence,className:"h-1.5 flex-1"}),o.jsxs("span",{className:"text-xs text-primary",children:[t.influence,"%"]})]})]})},n))})]}),o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h3",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Equilibrium Analysis"}),o.jsx(Te,{className:"border-border",children:o.jsxs(Ae,{className:"pt-6",children:[o.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[o.jsx(Re,{className:e.equilibrium.isStable?"bg-primary text-primary-foreground":"bg-destructive text-destructive-foreground",children:e.equilibrium.isStable?"Stable":"Unstable"}),o.jsx("span",{className:"text-lg font-semibold text-foreground",children:e.equilibrium.type})]}),o.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:e.equilibrium.description}),o.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[o.jsx("span",{className:"text-sm text-muted-foreground",children:"Stability Score"}),o.jsx($i,{value:e.equilibrium.stabilityScore,className:"h-2 flex-1"}),o.jsxs("span",{className:"text-sm font-medium text-primary",children:[e.equilibrium.stabilityScore,"%"]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"mb-2 text-sm font-medium text-foreground",children:"Vulnerabilities:"}),o.jsx("ul",{className:"space-y-1",children:e.equilibrium.vulnerabilities.map((t,n)=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-muted-foreground",children:[o.jsx("span",{className:"mt-1.5 h-1.5 w-1.5 shrink-0 rounded-full bg-destructive"}),t]},n))})]})]})})]})]}),Gh=[{label:"Choose Scenario",description:"Pick a preset or describe your own situation",color:"text-muted-foreground"},{label:"Set Rules",description:"Define constraints, limits, and governance rules",color:"text-muted-foreground"},{label:"Run Simulation",description:"Multi-agent simulation with rules applied in real time",color:"text-primary"},{label:"See What Changed",description:"Watch rules block, pause, and reshape agent behavior",color:"text-primary"},{label:"Generate Report",description:"Governed analysis with metrics and counterfactuals",color:"text-primary"}],W5=[{word:"Simulate",description:"Run multi-agent scenarios with real dynamics"},{word:"Govern",description:"Apply rules that reshape outcomes in real time"},{word:"Understand",description:"See exactly what changed and why"}],H5=()=>o.jsx("section",{className:"border-t border-border py-16 md:py-24",children:o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"HOW IT WORKS"}),o.jsx("p",{className:"mb-12 text-center text-lg text-muted-foreground",children:"From scenario to insight in five steps"}),o.jsx("div",{className:"mx-auto max-w-sm",children:Gh.map((e,t)=>o.jsxs("div",{children:[o.jsxs("div",{className:"rounded-lg border border-border bg-card px-5 py-4 text-center",children:[o.jsx("div",{className:`text-sm font-bold tracking-wider ${e.color}`,children:e.label}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:e.description})]}),t<Gh.length-1&&o.jsx("div",{className:"flex justify-center py-2",children:o.jsx(wC,{className:"h-4 w-4 text-primary/50"})})]},e.label))}),o.jsx("div",{className:"mx-auto mt-16 grid max-w-3xl gap-8 md:grid-cols-3",children:W5.map(e=>o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:"mb-2 text-2xl font-bold tracking-tight text-foreground",children:e.word}),o.jsx("div",{className:"text-sm text-muted-foreground",children:e.description})]},e.word))})]})}),G5=`{
|
|
432
|
+
"actor": "agent_1",
|
|
433
|
+
"action": "panic_sell",
|
|
434
|
+
"world": "trading"
|
|
435
|
+
}`,K5=`{
|
|
436
|
+
"decision": "BLOCK",
|
|
437
|
+
"reason": "Panic selling blocked by governance rule",
|
|
438
|
+
"rule_id": "sim-panic-actions",
|
|
439
|
+
"evidence": { ... },
|
|
440
|
+
"modified_action": null
|
|
441
|
+
}`,Y5=`from neuroverse_bridge import evaluate
|
|
442
|
+
|
|
443
|
+
verdict = evaluate(
|
|
444
|
+
actor="agent_1",
|
|
445
|
+
action="panic_sell",
|
|
446
|
+
world="trading"
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
if verdict["decision"] == "BLOCK":
|
|
450
|
+
action = "hold" # action replaced
|
|
451
|
+
elif verdict["decision"] == "MODIFY":
|
|
452
|
+
action = verdict["modified_action"] # constrained
|
|
453
|
+
# ALLOW → proceed`,q5=()=>o.jsx("section",{className:"border-t border-border py-16 md:py-24",children:o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"WORKS WITH ANYTHING"}),o.jsx("p",{className:"mb-4 text-center text-lg text-muted-foreground",children:"If your system has actions, you can govern it. One API call."}),o.jsx("p",{className:"mb-12 text-center text-sm text-muted-foreground/70",children:"Runs locally. No cloud. No SDK. No cost."}),o.jsxs("div",{className:"mx-auto max-w-4xl space-y-8",children:[o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Python — 3-line integration"}),o.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:o.jsx("code",{children:Y5})})]}),o.jsx("div",{className:"mb-4 rounded-md bg-card border border-border px-4 py-2",children:o.jsx("code",{className:"text-sm font-bold text-primary",children:"POST /api/evaluate"})}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Request"}),o.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:o.jsx("code",{children:G5})})]}),o.jsxs("div",{children:[o.jsx("div",{className:"mb-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Response"}),o.jsx("pre",{className:"overflow-auto rounded-lg border border-border bg-card p-4 text-xs text-foreground",children:o.jsx("code",{children:K5})})]})]}),o.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[o.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4 text-center",children:[o.jsx("div",{className:"mb-1 text-sm font-bold text-red-400",children:"BLOCK"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Action replaced"})]}),o.jsxs("div",{className:"rounded-lg border border-yellow-500/20 bg-yellow-500/5 p-4 text-center",children:[o.jsx("div",{className:"mb-1 text-sm font-bold text-yellow-400",children:"MODIFY"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Action constrained"})]}),o.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-4 text-center",children:[o.jsx("div",{className:"mb-1 text-sm font-bold text-green-400",children:"ALLOW"}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"Action proceeds"})]})]}),o.jsx("div",{className:"mt-4 text-center text-xs text-muted-foreground",children:"Fail-open. Stateless. 500ms timeout. Works with any simulator."})]})]})}),Q5=[{title:"Gas Price Shock",description:"Crude spikes to $120/barrel. Domestic pump prices exceed $5. Election in 6 months.",tags:["economic","energy","political"]},{title:"AI Regulation Crisis",description:"Major AI safety incident triggers emergency legislation proposals across G7.",tags:["regulation","technology","global"]},{title:"Strait of Hormuz",description:"Iran threatens closure. 20% of global oil transits through the strait.",tags:["geopolitical","energy","military"]},{title:"Taiwan Conflict",description:"PLA military exercises escalate near Taiwan. Semiconductor supply chain at risk.",tags:["geopolitical","supply chain","military"]},{title:"Global Supply Chain Disruption",description:"Major port strike + shipping lane conflict creates cascading delays worldwide.",tags:["economic","logistics","global"]},{title:"Cyber Attack on Banks",description:"Coordinated ransomware hits top 5 banks. Settlements frozen for 48 hours.",tags:["cybersecurity","financial","crisis"]}],X5=({onSelect:e})=>o.jsx("section",{className:"border-t border-border py-16 md:py-24",children:o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsx("h2",{className:"mb-2 text-center text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"EXAMPLE SCENARIOS"}),o.jsx("p",{className:"mb-12 text-center text-lg text-muted-foreground",children:"Click to load a scenario capsule and start exploring"}),o.jsx("div",{className:"mx-auto grid max-w-5xl gap-4 sm:grid-cols-2 lg:grid-cols-3",children:Q5.map(t=>o.jsxs(Te,{className:"cursor-pointer border-border transition-all duration-200 hover:border-primary/50 hover:glow-teal",onClick:()=>e(t.title,t.description),children:[o.jsx(Xe,{className:"pb-2",children:o.jsx(Je,{className:"text-base",children:t.title})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground leading-relaxed",children:t.description}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.tags.map(n=>o.jsx(Re,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:n},n))})]})]},t.title))})]})}),J5=({onSelectScenario:e,onCustomScenario:t,onCalculate:n,selectedId:r,customText:s,isLoading:i,hasScenario:a})=>o.jsx("section",{className:"py-16 md:py-24",children:o.jsxs("div",{className:"container mx-auto px-6",children:[o.jsxs("div",{className:"mx-auto max-w-4xl text-center",children:[o.jsx("h1",{className:"mb-3 text-3xl font-bold tracking-tight text-foreground md:text-5xl",children:"Choose a scenario."}),o.jsx("p",{className:"mb-12 text-lg text-muted-foreground",children:"Pick a preset or describe your own situation to begin"})]}),o.jsx("div",{className:"mx-auto grid max-w-5xl gap-4 md:grid-cols-3",children:LR.map(l=>o.jsxs(Te,{className:`cursor-pointer border-border transition-all duration-200 hover:border-primary/50 hover:glow-teal ${r===l.id?"border-primary glow-teal":""}`,onClick:()=>e(l),children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base leading-tight",children:l.title})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-xs text-muted-foreground leading-relaxed",children:l.description}),o.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:l.tags.map(c=>o.jsx(Re,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:c},c))}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.stakeholderCount," participants"]})]})]},l.id))}),o.jsxs("div",{className:"mx-auto mt-8 max-w-3xl",children:[o.jsx("div",{className:"rounded-lg border border-border bg-card p-1",children:o.jsx(rc,{placeholder:"Or describe your own situation...",className:"min-h-[100px] resize-none border-0 bg-transparent text-sm text-foreground placeholder:text-muted-foreground focus-visible:ring-0 focus-visible:ring-offset-0",value:s,onChange:l=>t(l.target.value)})}),o.jsx("div",{className:"mt-6 text-center",children:o.jsx(re,{className:"px-12 py-6 text-base font-semibold tracking-wider",onClick:n,disabled:!a||i,children:i?"RUNNING...":"RUN SIMULATION"})})]})]})});function So(e,[t,n]){return Math.min(n,Math.max(t,e))}var Z5=h.createContext(void 0);function Lo(e){const t=h.useContext(Z5);return e||t||"ltr"}function ym(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Ky=["PageUp","PageDown"],Yy=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],qy={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},yi="Slider",[Pu,eP,tP]=Vl(yi),[Qy,nI]=zt(yi,[tP]),[nP,sc]=Qy(yi),Xy=h.forwardRef((e,t)=>{const{name:n,min:r=0,max:s=100,step:i=1,orientation:a="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[r],value:u,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:y,...g}=e,b=h.useRef(new Set),x=h.useRef(0),w=a==="horizontal"?rP:sP,[S=[],N]=Wn({prop:u,defaultProp:d,onChange:P=>{var L;(L=[...b.current][x.current])==null||L.focus(),f(P)}}),k=h.useRef(S);function j(P){const T=cP(S,P);R(P,T)}function C(P){R(P,x.current)}function E(){const P=k.current[x.current];S[x.current]!==P&&p(S)}function R(P,T,{commit:L}={commit:!1}){const I=mP(i),F=pP(Math.round((P-r)/i)*i+r,I),O=So(F,[r,s]);N((V=[])=>{const _=aP(V,O,T);if(fP(_,c*i)){x.current=_.indexOf(O);const A=String(_)!==String(V);return A&&L&&p(_),A?_:V}else return V})}return o.jsx(nP,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:s,valueIndexToChangeRef:x,thumbs:b.current,values:S,orientation:a,form:y,children:o.jsx(Pu.Provider,{scope:e.__scopeSlider,children:o.jsx(Pu.Slot,{scope:e.__scopeSlider,children:o.jsx(w,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:K(g.onPointerDown,()=>{l||(k.current=S)}),min:r,max:s,inverted:m,onSlideStart:l?void 0:j,onSlideMove:l?void 0:C,onSlideEnd:l?void 0:E,onHomeKeyDown:()=>!l&&R(r,0,{commit:!0}),onEndKeyDown:()=>!l&&R(s,S.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:T})=>{if(!l){const F=Ky.includes(P.key)||P.shiftKey&&Yy.includes(P.key)?10:1,O=x.current,V=S[O],_=i*F*T;R(V+_,O,{commit:!0})}}})})})})});Xy.displayName=yi;var[Jy,Zy]=Qy(yi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),rP=h.forwardRef((e,t)=>{const{min:n,max:r,dir:s,inverted:i,onSlideStart:a,onSlideMove:l,onSlideEnd:c,onStepKeyDown:d,...u}=e,[f,p]=h.useState(null),m=ie(t,w=>p(w)),y=h.useRef(void 0),g=Lo(s),b=g==="ltr",x=b&&!i||!b&&i;function v(w){const S=y.current||f.getBoundingClientRect(),N=[0,S.width],j=bm(N,x?[n,r]:[r,n]);return y.current=S,j(w-S.left)}return o.jsx(Jy,{scope:e.__scopeSlider,startEdge:x?"left":"right",endEdge:x?"right":"left",direction:x?1:-1,size:"width",children:o.jsx(eb,{dir:g,"data-orientation":"horizontal",...u,ref:m,style:{...u.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:w=>{const S=v(w.clientX);a==null||a(S)},onSlideMove:w=>{const S=v(w.clientX);l==null||l(S)},onSlideEnd:()=>{y.current=void 0,c==null||c()},onStepKeyDown:w=>{const N=qy[x?"from-left":"from-right"].includes(w.key);d==null||d({event:w,direction:N?-1:1})}})})}),sP=h.forwardRef((e,t)=>{const{min:n,max:r,inverted:s,onSlideStart:i,onSlideMove:a,onSlideEnd:l,onStepKeyDown:c,...d}=e,u=h.useRef(null),f=ie(t,u),p=h.useRef(void 0),m=!s;function y(g){const b=p.current||u.current.getBoundingClientRect(),x=[0,b.height],w=bm(x,m?[r,n]:[n,r]);return p.current=b,w(g-b.top)}return o.jsx(Jy,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:o.jsx(eb,{"data-orientation":"vertical",...d,ref:f,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const b=y(g.clientY);i==null||i(b)},onSlideMove:g=>{const b=y(g.clientY);a==null||a(b)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:g=>{const x=qy[m?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:x?-1:1})}})})}),eb=h.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:s,onSlideEnd:i,onHomeKeyDown:a,onEndKeyDown:l,onStepKeyDown:c,...d}=e,u=sc(yi,n);return o.jsx(Q.span,{...d,ref:t,onKeyDown:K(e.onKeyDown,f=>{f.key==="Home"?(a(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):Ky.concat(Yy).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:K(e.onPointerDown,f=>{const p=f.target;p.setPointerCapture(f.pointerId),f.preventDefault(),u.thumbs.has(p)?p.focus():r(f)}),onPointerMove:K(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&s(f)}),onPointerUp:K(e.onPointerUp,f=>{const p=f.target;p.hasPointerCapture(f.pointerId)&&(p.releasePointerCapture(f.pointerId),i(f))})})}),tb="SliderTrack",nb=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=sc(tb,n);return o.jsx(Q.span,{"data-disabled":s.disabled?"":void 0,"data-orientation":s.orientation,...r,ref:t})});nb.displayName=tb;var Tu="SliderRange",rb=h.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,s=sc(Tu,n),i=Zy(Tu,n),a=h.useRef(null),l=ie(t,a),c=s.values.length,d=s.values.map(p=>ob(p,s.min,s.max)),u=c>1?Math.min(...d):0,f=100-Math.max(...d);return o.jsx(Q.span,{"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,...r,ref:l,style:{...e.style,[i.startEdge]:u+"%",[i.endEdge]:f+"%"}})});rb.displayName=Tu;var Au="SliderThumb",sb=h.forwardRef((e,t)=>{const n=eP(e.__scopeSlider),[r,s]=h.useState(null),i=ie(t,l=>s(l)),a=h.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return o.jsx(iP,{...e,ref:i,index:a})}),iP=h.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:s,...i}=e,a=sc(Au,n),l=Zy(Au,n),[c,d]=h.useState(null),u=ie(t,v=>d(v)),f=c?a.form||!!c.closest("form"):!0,p=im(c),m=a.values[r],y=m===void 0?0:ob(m,a.min,a.max),g=lP(r,a.values.length),b=p==null?void 0:p[l.size],x=b?dP(b,y,l.direction):0;return h.useEffect(()=>{if(c)return a.thumbs.add(c),()=>{a.thumbs.delete(c)}},[c,a.thumbs]),o.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${y}% + ${x}px)`},children:[o.jsx(Pu.ItemSlot,{scope:e.__scopeSlider,children:o.jsx(Q.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":a.min,"aria-valuenow":m,"aria-valuemax":a.max,"aria-orientation":a.orientation,"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,tabIndex:a.disabled?void 0:0,...i,ref:u,style:m===void 0?{display:"none"}:e.style,onFocus:K(e.onFocus,()=>{a.valueIndexToChangeRef.current=r})})}),f&&o.jsx(ib,{name:s??(a.name?a.name+(a.values.length>1?"[]":""):void 0),form:a.form,value:m},r)]})});sb.displayName=Au;var oP="RadioBubbleInput",ib=h.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const s=h.useRef(null),i=ie(s,r),a=ym(t);return h.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLInputElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const f=new Event("input",{bubbles:!0});u.call(l,t),l.dispatchEvent(f)}},[a,t]),o.jsx(Q.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});ib.displayName=oP;function aP(e=[],t,n){const r=[...e];return r[n]=t,r.sort((s,i)=>s-i)}function ob(e,t,n){const i=100/(n-t)*(e-t);return So(i,[0,100])}function lP(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function cP(e,t){if(e.length===1)return 0;const n=e.map(s=>Math.abs(s-t)),r=Math.min(...n);return n.indexOf(r)}function dP(e,t,n){const r=e/2,i=bm([0,50],[0,r]);return(r-i(t)*n)*n}function uP(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function fP(e,t){if(t>0){const n=uP(e);return Math.min(...n)>=t}return!0}function bm(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function mP(e){return(String(e).split(".")[1]||"").length}function pP(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var ab=Xy,hP=nb,gP=rb,vP=sb;const wm=h.forwardRef(({className:e,...t},n)=>o.jsxs(ab,{ref:n,className:$("relative flex w-full touch-none select-none items-center",e),...t,children:[o.jsx(hP,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:o.jsx(gP,{className:"absolute h-full bg-primary"})}),o.jsx(vP,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));wm.displayName=ab.displayName;const xP=[{key:"severity",label:"Severity",low:"Low",high:"Critical"},{key:"environmentalHostility",label:"Environmental Hostility",low:"Low",high:"High"},{key:"timePressure",label:"Time Pressure",low:"None",high:"Immediate"},{key:"regulatoryClimate",label:"Regulatory Climate",low:"Permissive",high:"Adversarial"}],yP=({values:e,onChange:t,showRecalculate:n,onRecalculate:r})=>{const s=(i,a)=>{t({...e,[i]:a[0]})};return o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Je,{className:"text-base",children:"Assumptions"}),n&&o.jsx("button",{onClick:r,className:"pulse-teal rounded-md bg-primary px-4 py-1.5 text-xs font-semibold text-primary-foreground transition-colors hover:bg-primary/90",children:"Re-calculate"})]})}),o.jsx(Ae,{children:o.jsx("div",{className:"space-y-6",children:xP.map(i=>o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsx("label",{className:"text-sm font-medium text-foreground",children:i.label}),o.jsx("span",{className:"text-sm font-mono text-primary",children:e[i.key]})]}),o.jsx(wm,{value:[e[i.key]],onValueChange:a=>s(i.key,a),min:0,max:100,step:1}),o.jsxs("div",{className:"mt-1 flex justify-between",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:i.low}),o.jsx("span",{className:"text-xs text-muted-foreground",children:i.high})]})]},i.key))})})]})};var sd=0;function bP(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Kh()),document.body.insertAdjacentElement("beforeend",e[1]??Kh()),sd++,()=>{sd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),sd--}},[])}function Kh(){const 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}var id="focusScope.autoFocusOnMount",od="focusScope.autoFocusOnUnmount",Yh={bubbles:!1,cancelable:!0},wP="FocusScope",lb=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...a}=e,[l,c]=h.useState(null),d=ze(s),u=ze(i),f=h.useRef(null),p=ie(t,g=>c(g)),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let g=function(w){if(m.paused||!l)return;const S=w.target;l.contains(S)?f.current=S:nr(f.current,{select:!0})},b=function(w){if(m.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||nr(f.current,{select:!0}))},x=function(w){if(document.activeElement===document.body)for(const N of w)N.removedNodes.length>0&&nr(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const v=new MutationObserver(x);return l&&v.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),v.disconnect()}}},[r,l,m.paused]),h.useEffect(()=>{if(l){Qh.add(m);const g=document.activeElement;if(!l.contains(g)){const x=new CustomEvent(id,Yh);l.addEventListener(id,d),l.dispatchEvent(x),x.defaultPrevented||(SP(EP(cb(l)),{select:!0}),document.activeElement===g&&nr(l))}return()=>{l.removeEventListener(id,d),setTimeout(()=>{const x=new CustomEvent(od,Yh);l.addEventListener(od,u),l.dispatchEvent(x),x.defaultPrevented||nr(g??document.body,{select:!0}),l.removeEventListener(od,u),Qh.remove(m)},0)}}},[l,d,u,m]);const y=h.useCallback(g=>{if(!n&&!r||m.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,x=document.activeElement;if(b&&x){const v=g.currentTarget,[w,S]=NP(v);w&&S?!g.shiftKey&&x===S?(g.preventDefault(),n&&nr(w,{select:!0})):g.shiftKey&&x===w&&(g.preventDefault(),n&&nr(S,{select:!0})):x===v&&g.preventDefault()}},[n,r,m.paused]);return o.jsx(Q.div,{tabIndex:-1,...a,ref:p,onKeyDown:y})});lb.displayName=wP;function SP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(nr(r,{select:t}),document.activeElement!==n)return}function NP(e){const t=cb(e),n=qh(t,e),r=qh(t.reverse(),e);return[n,r]}function cb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qh(e,t){for(const n of e)if(!kP(n,{upTo:t}))return n}function kP(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}function jP(e){return e instanceof HTMLInputElement&&"select"in e}function nr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jP(e)&&t&&e.select()}}var Qh=CP();function CP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Xh(e,t),e.unshift(t)},remove(t){var n;e=Xh(e,t),(n=e[0])==null||n.resume()}}}function Xh(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function EP(e){return e.filter(t=>t.tagName!=="A")}var _P=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xs=new WeakMap,fa=new WeakMap,ma={},ad=0,db=function(e){return e&&(e.host||db(e.parentNode))},RP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=db(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},PP=function(e,t,n,r){var s=RP(t,Array.isArray(e)?e:[e]);ma[n]||(ma[n]=new WeakMap);var i=ma[n],a=[],l=new Set,c=new Set(s),d=function(f){!f||l.has(f)||(l.add(f),d(f.parentNode))};s.forEach(d);var u=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(p){if(l.has(p))u(p);else try{var m=p.getAttribute(r),y=m!==null&&m!=="false",g=(xs.get(p)||0)+1,b=(i.get(p)||0)+1;xs.set(p,g),i.set(p,b),a.push(p),g===1&&y&&fa.set(p,!0),b===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),l.clear(),ad++,function(){a.forEach(function(f){var p=xs.get(f)-1,m=i.get(f)-1;xs.set(f,p),i.set(f,m),p||(fa.has(f)||f.removeAttribute(r),fa.delete(f)),m||f.removeAttribute(n)}),ad--,ad||(xs=new WeakMap,xs=new WeakMap,fa=new WeakMap,ma={})}},TP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=_P(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),PP(r,s,n,"aria-hidden")):function(){return null}},xn=function(){return xn=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},xn.apply(this,arguments)};function ub(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function AP(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ia="right-scroll-bar-position",Ma="width-before-scroll-bar",IP="with-scroll-bars-hidden",MP="--removed-body-scroll-bar-size";function ld(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function OP(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var LP=typeof window<"u"?h.useLayoutEffect:h.useEffect,Jh=new WeakMap;function $P(e,t){var n=OP(null,function(r){return e.forEach(function(s){return ld(s,r)})});return LP(function(){var r=Jh.get(n);if(r){var s=new Set(r),i=new Set(e),a=n.current;s.forEach(function(l){i.has(l)||ld(l,null)}),i.forEach(function(l){s.has(l)||ld(l,a)})}Jh.set(n,e)},[e]),n}function DP(e){return e}function FP(e,t){t===void 0&&(t=DP);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var c=function(){var u=a;a=[],u.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(u){a.push(u),d()},filter:function(u){return a=a.filter(u),n}}}};return s}function zP(e){e===void 0&&(e={});var t=FP(null);return t.options=xn({async:!0,ssr:!1},e),t}var fb=function(e){var t=e.sideCar,n=ub(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,xn({},n))};fb.isSideCarExport=!0;function BP(e,t){return e.useMedium(t),fb}var mb=zP(),cd=function(){},ic=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:cd,onWheelCapture:cd,onTouchMoveCapture:cd}),s=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,y=e.noIsolation,g=e.inert,b=e.allowPinchZoom,x=e.as,v=x===void 0?"div":x,w=e.gapMode,S=ub(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=p,k=$P([n,t]),j=xn(xn({},S),s);return h.createElement(h.Fragment,null,u&&h.createElement(N,{sideCar:mb,removeScrollBar:d,shards:f,noRelative:m,noIsolation:y,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:w}),a?h.cloneElement(h.Children.only(l),xn(xn({},j),{ref:k})):h.createElement(v,xn({},j,{className:c,ref:k}),l))});ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ic.classNames={fullWidth:Ma,zeroRight:Ia};var VP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=VP();return t&&e.setAttribute("nonce",t),e}function WP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var GP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=UP())&&(WP(t,n),HP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},KP=function(){var e=GP();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pb=function(){var e=KP(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},YP={left:0,top:0,right:0,gap:0},dd=function(e){return parseInt(e||"",10)||0},qP=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[dd(n),dd(r),dd(s)]},QP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return YP;var t=qP(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])}},XP=pb(),Ws="data-scroll-locked",JP=function(e,t,n,r){var s=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
454
|
+
.`.concat(IP,` {
|
|
455
|
+
overflow: hidden `).concat(r,`;
|
|
456
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
457
|
+
}
|
|
458
|
+
body[`).concat(Ws,`] {
|
|
459
|
+
overflow: hidden `).concat(r,`;
|
|
460
|
+
overscroll-behavior: contain;
|
|
461
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
462
|
+
padding-left: `.concat(s,`px;
|
|
463
|
+
padding-top: `).concat(i,`px;
|
|
464
|
+
padding-right: `).concat(a,`px;
|
|
465
|
+
margin-left:0;
|
|
466
|
+
margin-top:0;
|
|
467
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
468
|
+
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
.`).concat(Ia,` {
|
|
472
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.`).concat(Ma,` {
|
|
476
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
.`).concat(Ia," .").concat(Ia,` {
|
|
480
|
+
right: 0 `).concat(r,`;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.`).concat(Ma," .").concat(Ma,` {
|
|
484
|
+
margin-right: 0 `).concat(r,`;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
body[`).concat(Ws,`] {
|
|
488
|
+
`).concat(MP,": ").concat(l,`px;
|
|
489
|
+
}
|
|
490
|
+
`)},Zh=function(){var e=parseInt(document.body.getAttribute(Ws)||"0",10);return isFinite(e)?e:0},ZP=function(){h.useEffect(function(){return document.body.setAttribute(Ws,(Zh()+1).toString()),function(){var e=Zh()-1;e<=0?document.body.removeAttribute(Ws):document.body.setAttribute(Ws,e.toString())}},[])},eT=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;ZP();var i=h.useMemo(function(){return QP(s)},[s]);return h.createElement(XP,{styles:JP(i,!t,s,n?"":"!important")})},Iu=!1;if(typeof window<"u")try{var pa=Object.defineProperty({},"passive",{get:function(){return Iu=!0,!0}});window.addEventListener("test",pa,pa),window.removeEventListener("test",pa,pa)}catch{Iu=!1}var ys=Iu?{passive:!1}:!1,tT=function(e){return e.tagName==="TEXTAREA"},hb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tT(e)&&n[t]==="visible")},nT=function(e){return hb(e,"overflowY")},rT=function(e){return hb(e,"overflowX")},eg=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=gb(e,r);if(s){var i=vb(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},sT=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},iT=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gb=function(e,t){return e==="v"?nT(t):rT(t)},vb=function(e,t){return e==="v"?sT(t):iT(t)},oT=function(e,t){return e==="h"&&t==="rtl"?-1:1},aT=function(e,t,n,r,s){var i=oT(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,c=t.contains(l),d=!1,u=a>0,f=0,p=0;do{if(!l)break;var m=vb(e,l),y=m[0],g=m[1],b=m[2],x=g-b-i*y;(y||x)&&gb(e,l)&&(f+=x,p+=y);var v=l.parentNode;l=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(u&&(Math.abs(f)<1||!s)||!u&&(Math.abs(p)<1||!s))&&(d=!0),d},ha=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tg=function(e){return[e.deltaX,e.deltaY]},ng=function(e){return e&&"current"in e?e.current:e},lT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cT=function(e){return`
|
|
491
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
492
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
493
|
+
`)},dT=0,bs=[];function uT(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(dT++)[0],i=h.useState(pb)[0],a=h.useRef(e);h.useEffect(function(){a.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=AP([e.lockRef.current],(e.shards||[]).map(ng),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var l=h.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!a.current.allowPinchZoom;var x=ha(g),v=n.current,w="deltaX"in g?g.deltaX:v[0]-x[0],S="deltaY"in g?g.deltaY:v[1]-x[1],N,k=g.target,j=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in g&&j==="h"&&k.type==="range")return!1;var C=eg(j,k);if(!C)return!0;if(C?N=j:(N=j==="v"?"h":"v",C=eg(j,k)),!C)return!1;if(!r.current&&"changedTouches"in g&&(w||S)&&(r.current=N),!N)return!0;var E=r.current||N;return aT(E,b,g,E==="h"?w:S,!0)},[]),c=h.useCallback(function(g){var b=g;if(!(!bs.length||bs[bs.length-1]!==i)){var x="deltaY"in b?tg(b):ha(b),v=t.current.filter(function(N){return N.name===b.type&&(N.target===b.target||b.target===N.shadowParent)&&lT(N.delta,x)})[0];if(v&&v.should){b.cancelable&&b.preventDefault();return}if(!v){var w=(a.current.shards||[]).map(ng).filter(Boolean).filter(function(N){return N.contains(b.target)}),S=w.length>0?l(b,w[0]):!a.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),d=h.useCallback(function(g,b,x,v){var w={name:g,delta:b,target:x,should:v,shadowParent:fT(x)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),u=h.useCallback(function(g){n.current=ha(g),r.current=void 0},[]),f=h.useCallback(function(g){d(g.type,tg(g),g.target,l(g,e.lockRef.current))},[]),p=h.useCallback(function(g){d(g.type,ha(g),g.target,l(g,e.lockRef.current))},[]);h.useEffect(function(){return bs.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,ys),document.addEventListener("touchmove",c,ys),document.addEventListener("touchstart",u,ys),function(){bs=bs.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,ys),document.removeEventListener("touchmove",c,ys),document.removeEventListener("touchstart",u,ys)}},[]);var m=e.removeScrollBar,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(i,{styles:cT(s)}):null,m?h.createElement(eT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function fT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const mT=BP(mb,uT);var xb=h.forwardRef(function(e,t){return h.createElement(ic,xn({},e,{ref:t,sideCar:mT}))});xb.classNames=ic.classNames;var pT=[" ","Enter","ArrowUp","ArrowDown"],hT=[" ","Enter"],ls="Select",[oc,ac,gT]=Vl(ls),[bi,rI]=zt(ls,[gT,Jl]),lc=Jl(),[vT,Ar]=bi(ls),[xT,yT]=bi(ls),yb=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:i,value:a,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:f,disabled:p,required:m,form:y}=e,g=lc(t),[b,x]=h.useState(null),[v,w]=h.useState(null),[S,N]=h.useState(!1),k=Lo(d),[j,C]=Wn({prop:r,defaultProp:s??!1,onChange:i,caller:ls}),[E,R]=Wn({prop:a,defaultProp:l,onChange:c,caller:ls}),P=h.useRef(null),T=b?y||!!b.closest("form"):!0,[L,I]=h.useState(new Set),F=Array.from(L).map(O=>O.props.value).join(";");return o.jsx(my,{...g,children:o.jsxs(vT,{required:m,scope:t,trigger:b,onTriggerChange:x,valueNode:v,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:N,contentId:ms(),value:E,onValueChange:R,open:j,onOpenChange:C,dir:k,triggerPointerDownPosRef:P,disabled:p,children:[o.jsx(oc.Provider,{scope:t,children:o.jsx(xT,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(O=>{I(V=>new Set(V).add(O))},[]),onNativeOptionRemove:h.useCallback(O=>{I(V=>{const _=new Set(V);return _.delete(O),_})},[]),children:n})}),T?o.jsxs(Ub,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:f,value:E,onChange:O=>R(O.target.value),disabled:p,form:y,children:[E===void 0?o.jsx("option",{value:""}):null,Array.from(L)]},F):null]})})};yb.displayName=ls;var bb="SelectTrigger",wb=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,i=lc(n),a=Ar(bb,n),l=a.disabled||r,c=ie(t,a.onTriggerChange),d=ac(n),u=h.useRef("touch"),[f,p,m]=Hb(g=>{const b=d().filter(w=>!w.disabled),x=b.find(w=>w.value===a.value),v=Gb(b,g,x);v!==void 0&&a.onValueChange(v.value)}),y=g=>{l||(a.onOpenChange(!0),m()),g&&(a.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return o.jsx(py,{asChild:!0,...i,children:o.jsx(Q.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Wb(a.value)?"":void 0,...s,ref:c,onClick:K(s.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&y(g)}),onPointerDown:K(s.onPointerDown,g=>{u.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:K(s.onKeyDown,g=>{const b=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(b&&g.key===" ")&&pT.includes(g.key)&&(y(),g.preventDefault())})})})});wb.displayName=bb;var Sb="SelectValue",Nb=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:i,placeholder:a="",...l}=e,c=Ar(Sb,n),{onValueNodeHasChildrenChange:d}=c,u=i!==void 0,f=ie(t,c.onValueNodeChange);return Ve(()=>{d(u)},[d,u]),o.jsx(Q.span,{...l,ref:f,style:{pointerEvents:"none"},children:Wb(c.value)?o.jsx(o.Fragment,{children:a}):i})});Nb.displayName=Sb;var bT="SelectIcon",kb=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(Q.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});kb.displayName=bT;var wT="SelectPortal",jb=e=>o.jsx(Vf,{asChild:!0,...e});jb.displayName=wT;var cs="SelectContent",Cb=h.forwardRef((e,t)=>{const n=Ar(cs,e.__scopeSelect),[r,s]=h.useState();if(Ve(()=>{s(new DocumentFragment)},[]),!n.open){const i=r;return i?fs.createPortal(o.jsx(Eb,{scope:e.__scopeSelect,children:o.jsx(oc.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),i):null}return o.jsx(_b,{...e,ref:t})});Cb.displayName=cs;var qt=10,[Eb,Ir]=bi(cs),ST="SelectContentImpl",NT=xo("SelectContent.RemoveScroll"),_b=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:i,onPointerDownOutside:a,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:b,...x}=e,v=Ar(cs,n),[w,S]=h.useState(null),[N,k]=h.useState(null),j=ie(t,W=>S(W)),[C,E]=h.useState(null),[R,P]=h.useState(null),T=ac(n),[L,I]=h.useState(!1),F=h.useRef(!1);h.useEffect(()=>{if(w)return TP(w)},[w]),bP();const O=h.useCallback(W=>{const[ce,...xe]=T().map(X=>X.ref.current),[le]=xe.slice(-1),z=document.activeElement;for(const X of W)if(X===z||(X==null||X.scrollIntoView({block:"nearest"}),X===ce&&N&&(N.scrollTop=0),X===le&&N&&(N.scrollTop=N.scrollHeight),X==null||X.focus(),document.activeElement!==z))return},[T,N]),V=h.useCallback(()=>O([C,w]),[O,C,w]);h.useEffect(()=>{L&&V()},[L,V]);const{onOpenChange:_,triggerPointerDownPosRef:A}=v;h.useEffect(()=>{if(w){let W={x:0,y:0};const ce=le=>{var z,X;W={x:Math.abs(Math.round(le.pageX)-(((z=A.current)==null?void 0:z.x)??0)),y:Math.abs(Math.round(le.pageY)-(((X=A.current)==null?void 0:X.y)??0))}},xe=le=>{W.x<=10&&W.y<=10?le.preventDefault():w.contains(le.target)||_(!1),document.removeEventListener("pointermove",ce),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",xe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",xe,{capture:!0})}}},[w,_,A]),h.useEffect(()=>{const W=()=>_(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[_]);const[D,Y]=Hb(W=>{const ce=T().filter(z=>!z.disabled),xe=ce.find(z=>z.ref.current===document.activeElement),le=Gb(ce,W,xe);le&&setTimeout(()=>le.ref.current.focus())}),G=h.useCallback((W,ce,xe)=>{const le=!F.current&&!xe;(v.value!==void 0&&v.value===ce||le)&&(E(W),le&&(F.current=!0))},[v.value]),J=h.useCallback(()=>w==null?void 0:w.focus(),[w]),Z=h.useCallback((W,ce,xe)=>{const le=!F.current&&!xe;(v.value!==void 0&&v.value===ce||le)&&P(W)},[v.value]),me=r==="popper"?Mu:Rb,be=me===Mu?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:y,hideWhenDetached:g,avoidCollisions:b}:{};return o.jsx(Eb,{scope:n,content:w,viewport:N,onViewportChange:k,itemRefCallback:G,selectedItem:C,onItemLeave:J,itemTextRefCallback:Z,focusSelectedItem:V,selectedItemText:R,position:r,isPositioned:L,searchRef:D,children:o.jsx(xb,{as:NT,allowPinchZoom:!0,children:o.jsx(lb,{asChild:!0,trapped:v.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:K(s,W=>{var ce;(ce=v.trigger)==null||ce.focus({preventScroll:!0}),W.preventDefault()}),children:o.jsx(Ul,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:o.jsx(me,{role:"listbox",id:v.contentId,"data-state":v.open?"open":"closed",dir:v.dir,onContextMenu:W=>W.preventDefault(),...x,...be,onPlaced:()=>I(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:K(x.onKeyDown,W=>{const ce=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!ce&&W.key.length===1&&Y(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let le=T().filter(z=>!z.disabled).map(z=>z.ref.current);if(["ArrowUp","End"].includes(W.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const z=W.target,X=le.indexOf(z);le=le.slice(X+1)}setTimeout(()=>O(le)),W.preventDefault()}})})})})})})});_b.displayName=ST;var kT="SelectItemAlignedPosition",Rb=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,i=Ar(cs,n),a=Ir(cs,n),[l,c]=h.useState(null),[d,u]=h.useState(null),f=ie(t,j=>u(j)),p=ac(n),m=h.useRef(!1),y=h.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:x,focusSelectedItem:v}=a,w=h.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&g&&b&&x){const j=i.trigger.getBoundingClientRect(),C=d.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),R=x.getBoundingClientRect();if(i.dir!=="rtl"){const z=R.left-C.left,X=E.left-z,he=j.left-X,oe=j.width+he,ft=Math.max(oe,C.width),Ue=window.innerWidth-qt,We=So(X,[qt,Math.max(qt,Ue-ft)]);l.style.minWidth=oe+"px",l.style.left=We+"px"}else{const z=C.right-R.right,X=window.innerWidth-E.right-z,he=window.innerWidth-j.right-X,oe=j.width+he,ft=Math.max(oe,C.width),Ue=window.innerWidth-qt,We=So(X,[qt,Math.max(qt,Ue-ft)]);l.style.minWidth=oe+"px",l.style.right=We+"px"}const P=p(),T=window.innerHeight-qt*2,L=g.scrollHeight,I=window.getComputedStyle(d),F=parseInt(I.borderTopWidth,10),O=parseInt(I.paddingTop,10),V=parseInt(I.borderBottomWidth,10),_=parseInt(I.paddingBottom,10),A=F+O+L+_+V,D=Math.min(b.offsetHeight*5,A),Y=window.getComputedStyle(g),G=parseInt(Y.paddingTop,10),J=parseInt(Y.paddingBottom,10),Z=j.top+j.height/2-qt,me=T-Z,be=b.offsetHeight/2,W=b.offsetTop+be,ce=F+O+W,xe=A-ce;if(ce<=Z){const z=P.length>0&&b===P[P.length-1].ref.current;l.style.bottom="0px";const X=d.clientHeight-g.offsetTop-g.offsetHeight,he=Math.max(me,be+(z?J:0)+X+V),oe=ce+he;l.style.height=oe+"px"}else{const z=P.length>0&&b===P[0].ref.current;l.style.top="0px";const he=Math.max(Z,F+g.offsetTop+(z?G:0)+be)+xe;l.style.height=he+"px",g.scrollTop=ce-Z+g.offsetTop}l.style.margin=`${qt}px 0`,l.style.minHeight=D+"px",l.style.maxHeight=T+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[p,i.trigger,i.valueNode,l,d,g,b,x,i.dir,r]);Ve(()=>w(),[w]);const[S,N]=h.useState();Ve(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const k=h.useCallback(j=>{j&&y.current===!0&&(w(),v==null||v(),y.current=!1)},[w,v]);return o.jsx(CT,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:o.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:o.jsx(Q.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Rb.displayName=kT;var jT="SelectPopperPosition",Mu=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=qt,...i}=e,a=lc(n);return o.jsx(hy,{...a,...i,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Mu.displayName=jT;var[CT,Sm]=bi(cs,{}),Ou="SelectViewport",Pb=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,i=Ir(Ou,n),a=Sm(Ou,n),l=ie(t,i.onViewportChange),c=h.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(oc.Slot,{scope:n,children:o.jsx(Q.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:K(s.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=a;if(p!=null&&p.current&&f){const m=Math.abs(c.current-u.scrollTop);if(m>0){const y=window.innerHeight-qt*2,g=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),x=Math.max(g,b);if(x<y){const v=x+m,w=Math.min(y,v),S=v-w;f.style.height=w+"px",f.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});Pb.displayName=Ou;var Tb="SelectGroup",[ET,_T]=bi(Tb),RT=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=ms();return o.jsx(ET,{scope:n,id:s,children:o.jsx(Q.div,{role:"group","aria-labelledby":s,...r,ref:t})})});RT.displayName=Tb;var Ab="SelectLabel",Ib=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=_T(Ab,n);return o.jsx(Q.div,{id:s.id,...r,ref:t})});Ib.displayName=Ab;var xl="SelectItem",[PT,Mb]=bi(xl),Ob=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:i,...a}=e,l=Ar(xl,n),c=Ir(xl,n),d=l.value===r,[u,f]=h.useState(i??""),[p,m]=h.useState(!1),y=ie(t,v=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,v,r,s)}),g=ms(),b=h.useRef("touch"),x=()=>{s||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(PT,{scope:n,value:r,disabled:s,textId:g,isSelected:d,onItemTextChange:h.useCallback(v=>{f(w=>w||((v==null?void 0:v.textContent)??"").trim())},[]),children:o.jsx(oc.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:o.jsx(Q.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:y,onFocus:K(a.onFocus,()=>m(!0)),onBlur:K(a.onBlur,()=>m(!1)),onClick:K(a.onClick,()=>{b.current!=="mouse"&&x()}),onPointerUp:K(a.onPointerUp,()=>{b.current==="mouse"&&x()}),onPointerDown:K(a.onPointerDown,v=>{b.current=v.pointerType}),onPointerMove:K(a.onPointerMove,v=>{var w;b.current=v.pointerType,s?(w=c.onItemLeave)==null||w.call(c):b.current==="mouse"&&v.currentTarget.focus({preventScroll:!0})}),onPointerLeave:K(a.onPointerLeave,v=>{var w;v.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:K(a.onKeyDown,v=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&v.key===" "||(hT.includes(v.key)&&x(),v.key===" "&&v.preventDefault())})})})})});Ob.displayName=xl;var Di="SelectItemText",Lb=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...i}=e,a=Ar(Di,n),l=Ir(Di,n),c=Mb(Di,n),d=yT(Di,n),[u,f]=h.useState(null),p=ie(t,x=>f(x),c.onItemTextChange,x=>{var v;return(v=l.itemTextRefCallback)==null?void 0:v.call(l,x,c.value,c.disabled)}),m=u==null?void 0:u.textContent,y=h.useMemo(()=>o.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=d;return Ve(()=>(g(y),()=>b(y)),[g,b,y]),o.jsxs(o.Fragment,{children:[o.jsx(Q.span,{id:c.textId,...i,ref:p}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?fs.createPortal(i.children,a.valueNode):null]})});Lb.displayName=Di;var $b="SelectItemIndicator",Db=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return Mb($b,n).isSelected?o.jsx(Q.span,{"aria-hidden":!0,...r,ref:t}):null});Db.displayName=$b;var Lu="SelectScrollUpButton",Fb=h.forwardRef((e,t)=>{const n=Ir(Lu,e.__scopeSelect),r=Sm(Lu,e.__scopeSelect),[s,i]=h.useState(!1),a=ie(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?o.jsx(Bb,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Fb.displayName=Lu;var $u="SelectScrollDownButton",zb=h.forwardRef((e,t)=>{const n=Ir($u,e.__scopeSelect),r=Sm($u,e.__scopeSelect),[s,i]=h.useState(!1),a=ie(t,r.onScrollButtonChange);return Ve(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),s?o.jsx(Bb,{...e,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});zb.displayName=$u;var Bb=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,i=Ir("SelectScrollButton",n),a=h.useRef(null),l=ac(n),c=h.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),Ve(()=>{var u;const d=l().find(f=>f.ref.current===document.activeElement);(u=d==null?void 0:d.ref.current)==null||u.scrollIntoView({block:"nearest"})},[l]),o.jsx(Q.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:K(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:K(s.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:K(s.onPointerLeave,()=>{c()})})}),TT="SelectSeparator",Vb=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(Q.div,{"aria-hidden":!0,...r,ref:t})});Vb.displayName=TT;var Du="SelectArrow",AT=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=lc(n),i=Ar(Du,n),a=Ir(Du,n);return i.open&&a.position==="popper"?o.jsx(gy,{...s,...r,ref:t}):null});AT.displayName=Du;var IT="SelectBubbleInput",Ub=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),i=ie(r,s),a=ym(t);return h.useEffect(()=>{const l=s.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==t&&u){const f=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(f)}},[a,t]),o.jsx(Q.select,{...n,style:{...i0,...n.style},ref:i,defaultValue:t})});Ub.displayName=IT;function Wb(e){return e===""||e===void 0}function Hb(e){const t=ze(e),n=h.useRef(""),r=h.useRef(0),s=h.useCallback(a=>{const l=n.current+a;t(l),function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,i]}function Gb(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let a=MT(e,Math.max(i,0));s.length===1&&(a=a.filter(d=>d!==n));const c=a.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return c!==n?c:void 0}function MT(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var OT=yb,Kb=wb,LT=Nb,$T=kb,DT=jb,Yb=Cb,FT=Pb,qb=Ib,Qb=Ob,zT=Lb,BT=Db,Xb=Fb,Jb=zb,Zb=Vb;const cc=OT,dc=LT,$o=h.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Kb,{ref:r,className:$("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,o.jsx($T,{asChild:!0,children:o.jsx(gt,{className:"h-4 w-4 opacity-50"})})]}));$o.displayName=Kb.displayName;const ew=h.forwardRef(({className:e,...t},n)=>o.jsx(Xb,{ref:n,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(jC,{className:"h-4 w-4"})}));ew.displayName=Xb.displayName;const tw=h.forwardRef(({className:e,...t},n)=>o.jsx(Jb,{ref:n,className:$("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(gt,{className:"h-4 w-4"})}));tw.displayName=Jb.displayName;const Do=h.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>o.jsx(DT,{children:o.jsxs(Yb,{ref:s,className:$("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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-[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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[o.jsx(ew,{}),o.jsx(FT,{className:$("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),o.jsx(tw,{})]})}));Do.displayName=Yb.displayName;const VT=h.forwardRef(({className:e,...t},n)=>o.jsx(qb,{ref:n,className:$("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));VT.displayName=qb.displayName;const st=h.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Qb,{ref:r,className:$("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(BT,{children:o.jsx(Gf,{className:"h-4 w-4"})})}),o.jsx(zT,{children:t})]}));st.displayName=Qb.displayName;const UT=h.forwardRef(({className:e,...t},n)=>o.jsx(Zb,{ref:n,className:$("-mx-1 my-1 h-px bg-muted",e),...t}));UT.displayName=Zb.displayName;const WT={hostile:"bg-destructive/20 text-destructive border-destructive/30",neutral:"bg-muted text-muted-foreground border-muted-foreground/30",supportive:"bg-primary/20 text-primary border-primary/30",unknown:"bg-muted text-muted-foreground border-border"},HT=({stakeholders:e,onChange:t})=>{const[n,r]=h.useState(""),[s,i]=h.useState("neutral"),a=()=>{n.trim()&&(t([...e,{id:n.trim(),disposition:s}]),r(""),i("neutral"))},l=c=>{t(e.filter((d,u)=>u!==c))};return o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Participants"})}),o.jsxs(Ae,{children:[o.jsxs("div",{className:"flex gap-2",children:[o.jsx(jt,{placeholder:"Participant name...",value:n,onChange:c=>r(c.target.value),onKeyDown:c=>c.key==="Enter"&&a(),className:"flex-1"}),o.jsxs(cc,{value:s,onValueChange:c=>i(c),children:[o.jsx($o,{className:"w-[130px]",children:o.jsx(dc,{})}),o.jsxs(Do,{children:[o.jsx(st,{value:"supportive",children:"Supportive"}),o.jsx(st,{value:"neutral",children:"Neutral"}),o.jsx(st,{value:"hostile",children:"Hostile"}),o.jsx(st,{value:"unknown",children:"Unknown"})]})]}),o.jsx(re,{size:"icon",variant:"outline",onClick:a,disabled:!n.trim(),children:o.jsx(qi,{className:"h-4 w-4"})})]}),e.length>0&&o.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:e.map((c,d)=>o.jsxs(Re,{variant:"outline",className:`gap-1.5 pr-1 ${WT[c.disposition]}`,children:[c.id,o.jsxs("span",{className:"text-[10px] opacity-70",children:["(",c.disposition,")"]}),o.jsx("button",{onClick:()=>l(d),className:"ml-0.5 rounded-full p-0.5 hover:bg-background/50",children:o.jsx(Xi,{className:"h-3 w-3"})})]},d))})]})]})};var GT="Label",nw=h.forwardRef((e,t)=>o.jsx(Q.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));nw.displayName=GT;var rw=nw;const KT=Gl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),gn=h.forwardRef(({className:e,...t},n)=>o.jsx(rw,{ref:n,className:$(KT(),e),...t}));gn.displayName=rw.displayName;const YT=({values:e,onChange:t})=>o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Rules & Limits"})}),o.jsxs(Ae,{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-muted-foreground",children:"Time Horizon"}),o.jsx(jt,{placeholder:"e.g. 30 days, 6 months",value:e.timeHorizon,onChange:n=>t({...e,timeHorizon:n.target.value}),className:"mt-1"})]}),o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-muted-foreground",children:"Risk Tolerance"}),o.jsxs(cc,{value:e.riskTolerance,onValueChange:n=>t({...e,riskTolerance:n}),children:[o.jsx($o,{className:"mt-1",children:o.jsx(dc,{})}),o.jsxs(Do,{children:[o.jsx(st,{value:"conservative",children:"Conservative"}),o.jsx(st,{value:"moderate",children:"Moderate"}),o.jsx(st,{value:"aggressive",children:"Aggressive"})]})]})]}),o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-muted-foreground",children:"Budget"}),o.jsx(jt,{placeholder:"e.g. $10M, Unlimited",value:e.budget,onChange:n=>t({...e,budget:n.target.value}),className:"mt-1"})]})]})]}),qT=[{value:"quick",label:"Quick",description:"2 paths, surface analysis"},{value:"standard",label:"Standard",description:"3 paths, balanced"},{value:"full",label:"Full",description:"5 paths, deep analysis"},{value:"exhaustive",label:"Exhaustive",description:"8 paths, stress tests"}],QT=({value:e,onChange:t})=>o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Analysis Depth"})}),o.jsx(Ae,{children:o.jsx("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:qT.map(n=>o.jsxs("button",{onClick:()=>t(n.value),className:`rounded-lg border px-3 py-2.5 text-left transition-all ${e===n.value?"border-primary bg-primary/10 text-foreground":"border-border bg-card text-muted-foreground hover:border-primary/30"}`,children:[o.jsx("p",{className:"text-sm font-medium",children:n.label}),o.jsx("p",{className:"mt-0.5 text-[10px]",children:n.description})]},n.value))})})]}),ud="mirotir_api_key",XT=({onKeyChange:e})=>{const[t,n]=h.useState(""),[r,s]=h.useState(!1),[i,a]=h.useState(!1);h.useEffect(()=>{const d=localStorage.getItem(ud);d&&(n(d),e==null||e(d))},[]);const l=()=>{t.trim()?localStorage.setItem(ud,t.trim()):localStorage.removeItem(ud),e==null||e(t.trim()),a(!0),setTimeout(()=>a(!1),2e3)},c=t.trim().length>0;return o.jsxs("div",{className:"rounded-xl border-2 border-primary/20 bg-card p-5 shadow-md",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10",children:o.jsx(PC,{className:"h-4 w-4 text-primary"})}),o.jsx("span",{className:"text-sm font-semibold text-foreground",children:"Your AI Key"}),c&&i&&o.jsx("span",{className:"ml-auto rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-medium text-primary",children:"Saved ✓"})]}),o.jsx("p",{className:"text-xs text-muted-foreground mb-1 ml-10",children:"Powers the analysis with your chosen AI service."}),o.jsxs("p",{className:"text-[10px] text-muted-foreground/70 mb-3 ml-10",children:["Get a key from"," ",o.jsxs("a",{href:"https://platform.openai.com/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["OpenAI ",o.jsx(hh,{className:"h-2.5 w-2.5"})]})," ","or"," ",o.jsxs("a",{href:"https://aistudio.google.com/apikey",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline inline-flex items-center gap-0.5",children:["Google AI Studio ",o.jsx(hh,{className:"h-2.5 w-2.5"})]}),". Stored in your browser only — never sent to our servers."]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(jt,{type:r?"text":"password",placeholder:"sk-... or AIza...",value:t,onChange:d=>n(d.target.value),onKeyDown:d=>d.key==="Enter"&&l(),className:"pr-9 border-primary/20 focus-visible:ring-primary/30"}),o.jsx("button",{onClick:()=>s(!r),className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors",children:r?o.jsx(CC,{className:"h-4 w-4"}):o.jsx(Kl,{className:"h-4 w-4"})})]}),o.jsx(re,{size:"sm",onClick:l,className:"min-w-[60px]",children:i?o.jsx(Gf,{className:"h-4 w-4"}):"Save"})]})]})},JT=({mode:e,onChange:t})=>o.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border bg-card p-1",children:[o.jsxs("button",{onClick:()=>t("explore"),className:$("flex-1 rounded-md px-4 py-2 text-sm font-medium transition-all",e==="explore"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[o.jsx("span",{className:"block text-xs opacity-70",children:"EXPLORE"}),o.jsx("span",{className:"block text-[10px]",children:"What might happen?"})]}),o.jsxs("button",{onClick:()=>t("goal"),className:$("flex-1 rounded-md px-4 py-2 text-sm font-medium transition-all",e==="goal"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[o.jsx("span",{className:"block text-xs opacity-70",children:"GOAL"}),o.jsx("span",{className:"block text-[10px]",children:"How do I get here?"})]})]}),ZT=({values:e,onChange:t})=>{const[n,r]=h.useState(""),[s,i]=h.useState(""),[a,l]=h.useState(""),c=(u,f,p)=>{f.trim()&&(t({...e,[u]:[...e[u],f.trim()]}),p(""))},d=(u,f)=>{t({...e,[u]:e[u].filter((p,m)=>m!==f)})};return o.jsxs(Te,{className:"border-primary/30 bg-primary/5",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Goal: How do I get here?"})}),o.jsxs(Ae,{className:"space-y-4",children:[o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-muted-foreground",children:"Desired Outcome"}),o.jsx(rc,{placeholder:"Describe the outcome you want to achieve...",value:e.outcome,onChange:u=>t({...e,outcome:u.target.value}),className:"mt-1 min-h-[60px]"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-muted-foreground",children:"Priority"}),o.jsxs(cc,{value:e.priority,onValueChange:u=>t({...e,priority:u}),children:[o.jsx($o,{className:"mt-1",children:o.jsx(dc,{})}),o.jsxs(Do,{children:[o.jsx(st,{value:"preferred",children:"Preferred"}),o.jsx(st,{value:"important",children:"Important"}),o.jsx(st,{value:"critical",children:"Critical"})]})]})]}),o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-muted-foreground",children:"Timeframe"}),o.jsx(jt,{placeholder:"e.g. 30 days",value:e.timeframe,onChange:u=>t({...e,timeframe:u.target.value}),className:"mt-1"})]})]}),o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-muted-foreground",children:"Success Criteria"}),o.jsxs("div",{className:"mt-1 flex gap-2",children:[o.jsx(jt,{placeholder:"Measurable condition...",value:n,onChange:u=>r(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("successCriteria",n,r)}),o.jsx("button",{onClick:()=>c("successCriteria",n,r),className:"shrink-0 rounded-md border border-border p-2 hover:bg-muted",children:o.jsx(qi,{className:"h-4 w-4"})})]}),e.successCriteria.length>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.successCriteria.map((u,f)=>o.jsxs(Re,{variant:"outline",className:"gap-1 pr-1 text-xs",children:[u,o.jsx("button",{onClick:()=>d("successCriteria",f),children:o.jsx(Xi,{className:"h-3 w-3"})})]},f))})]}),o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-destructive",children:"Red Lines (must NOT happen)"}),o.jsxs("div",{className:"mt-1 flex gap-2",children:[o.jsx(jt,{placeholder:"Hard constraint...",value:s,onChange:u=>i(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("redLines",s,i)}),o.jsx("button",{onClick:()=>c("redLines",s,i),className:"shrink-0 rounded-md border border-destructive/30 p-2 hover:bg-destructive/10",children:o.jsx(qi,{className:"h-4 w-4 text-destructive"})})]}),e.redLines.length>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.redLines.map((u,f)=>o.jsxs(Re,{variant:"outline",className:"gap-1 pr-1 text-xs border-destructive/30 text-destructive",children:[u,o.jsx("button",{onClick:()=>d("redLines",f),children:o.jsx(Xi,{className:"h-3 w-3"})})]},f))})]}),o.jsxs("div",{children:[o.jsx(gn,{className:"text-xs text-muted-foreground",children:"Available Levers"}),o.jsxs("div",{className:"mt-1 flex gap-2",children:[o.jsx(jt,{placeholder:"Tool or resource you can deploy...",value:a,onChange:u=>l(u.target.value),onKeyDown:u=>u.key==="Enter"&&c("availableLevers",a,l)}),o.jsx("button",{onClick:()=>c("availableLevers",a,l),className:"shrink-0 rounded-md border border-border p-2 hover:bg-muted",children:o.jsx(qi,{className:"h-4 w-4"})})]}),e.availableLevers.length>0&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5",children:e.availableLevers.map((u,f)=>o.jsxs(Re,{variant:"outline",className:"gap-1 pr-1 text-xs border-primary/30 text-primary",children:[u,o.jsx("button",{onClick:()=>d("availableLevers",f),children:o.jsx(Xi,{className:"h-3 w-3"})})]},f))})]})]})]})},eA={low:"bg-destructive/20 text-destructive border-destructive/30",medium:"bg-warning/20 text-warning border-warning/30",high:"bg-primary/20 text-primary border-primary/30"},tA=({confidence:e})=>{const[t,n]=h.useState(!1);return o.jsxs("div",{className:"inline-block",children:[o.jsxs("button",{onClick:()=>n(!t),className:$("inline-flex items-center gap-1.5 rounded-full border px-3 py-1 text-xs font-medium transition-all",eA[e.level]),children:["Confidence: ",e.level.toUpperCase(),o.jsx(gt,{className:$("h-3 w-3 transition-transform",t&&"rotate-180")})]}),t&&o.jsx("div",{className:"mt-2 rounded-md border border-border bg-card p-3 text-xs text-muted-foreground animate-in fade-in-0 slide-in-from-top-1",children:e.reason})]})},nA={caller:"bg-primary/20 text-primary",inferred:"bg-warning/20 text-warning",default:"bg-muted text-muted-foreground"},rA=({assumptions:e})=>e.length===0?null:o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsx("div",{className:"mx-auto max-w-4xl",children:o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsx(Je,{className:"text-base",children:"Key Assumptions"})}),o.jsx(Ae,{children:o.jsx("ul",{className:"space-y-2",children:e.map((t,n)=>o.jsxs("li",{className:"flex items-start gap-2",children:[o.jsx(Re,{className:`shrink-0 text-[10px] ${nA[t.source]}`,children:t.source}),o.jsx("span",{className:"text-sm text-foreground",children:t.text})]},n))})})]})})})});var fd="rovingFocusGroup.onEntryFocus",sA={bubbles:!1,cancelable:!0},Fo="RovingFocusGroup",[Fu,sw,iA]=Vl(Fo),[oA,iw]=zt(Fo,[iA]),[aA,lA]=oA(Fo),ow=h.forwardRef((e,t)=>o.jsx(Fu.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(Fu.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(cA,{...e,ref:t})})}));ow.displayName=Fo;var cA=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,p=h.useRef(null),m=ie(t,p),y=Lo(i),[g,b]=Wn({prop:a,defaultProp:l??null,onChange:c,caller:Fo}),[x,v]=h.useState(!1),w=ze(d),S=sw(n),N=h.useRef(!1),[k,j]=h.useState(0);return h.useEffect(()=>{const C=p.current;if(C)return C.addEventListener(fd,w),()=>C.removeEventListener(fd,w)},[w]),o.jsx(aA,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:g,onItemFocus:h.useCallback(C=>b(C),[b]),onItemShiftTab:h.useCallback(()=>v(!0),[]),onFocusableItemAdd:h.useCallback(()=>j(C=>C+1),[]),onFocusableItemRemove:h.useCallback(()=>j(C=>C-1),[]),children:o.jsx(Q.div,{tabIndex:x||k===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:K(e.onMouseDown,()=>{N.current=!0}),onFocus:K(e.onFocus,C=>{const E=!N.current;if(C.target===C.currentTarget&&E&&!x){const R=new CustomEvent(fd,sA);if(C.currentTarget.dispatchEvent(R),!R.defaultPrevented){const P=S().filter(O=>O.focusable),T=P.find(O=>O.active),L=P.find(O=>O.id===g),F=[T,L,...P].filter(Boolean).map(O=>O.ref.current);cw(F,u)}}N.current=!1}),onBlur:K(e.onBlur,()=>v(!1))})})}),aw="RovingFocusGroupItem",lw=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:a,...l}=e,c=ms(),d=i||c,u=lA(aw,n),f=u.currentTabStopId===d,p=sw(n),{onFocusableItemAdd:m,onFocusableItemRemove:y,currentTabStopId:g}=u;return h.useEffect(()=>{if(r)return m(),()=>y()},[r,m,y]),o.jsx(Fu.ItemSlot,{scope:n,id:d,focusable:r,active:s,children:o.jsx(Q.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:K(e.onMouseDown,b=>{r?u.onItemFocus(d):b.preventDefault()}),onFocus:K(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:K(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const x=fA(b,u.orientation,u.dir);if(x!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=p().filter(S=>S.focusable).map(S=>S.ref.current);if(x==="last")w.reverse();else if(x==="prev"||x==="next"){x==="prev"&&w.reverse();const S=w.indexOf(b.currentTarget);w=u.loop?mA(w,S+1):w.slice(S+1)}setTimeout(()=>cw(w))}}),children:typeof a=="function"?a({isCurrentTabStop:f,hasTabStop:g!=null}):a})})});lw.displayName=aw;var dA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function uA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function fA(e,t,n){const r=uA(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return dA[r]}function cw(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function mA(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var pA=ow,hA=lw,uc="Tabs",[gA,sI]=zt(uc,[iw]),dw=iw(),[vA,Nm]=gA(uc),uw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:i,orientation:a="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Lo(l),[f,p]=Wn({prop:r,onChange:s,defaultProp:i??"",caller:uc});return o.jsx(vA,{scope:n,baseId:ms(),value:f,onValueChange:p,orientation:a,dir:u,activationMode:c,children:o.jsx(Q.div,{dir:u,"data-orientation":a,...d,ref:t})})});uw.displayName=uc;var fw="TabsList",mw=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,i=Nm(fw,n),a=dw(n);return o.jsx(pA,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:r,children:o.jsx(Q.div,{role:"tablist","aria-orientation":i.orientation,...s,ref:t})})});mw.displayName=fw;var pw="TabsTrigger",hw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...i}=e,a=Nm(pw,n),l=dw(n),c=xw(a.baseId,r),d=yw(a.baseId,r),u=r===a.value;return o.jsx(hA,{asChild:!0,...l,focusable:!s,active:u,children:o.jsx(Q.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...i,ref:t,onMouseDown:K(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?a.onValueChange(r):f.preventDefault()}),onKeyDown:K(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(r)}),onFocus:K(e.onFocus,()=>{const f=a.activationMode!=="manual";!u&&!s&&f&&a.onValueChange(r)})})})});hw.displayName=pw;var gw="TabsContent",vw=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:i,...a}=e,l=Nm(gw,n),c=xw(l.baseId,r),d=yw(l.baseId,r),u=r===l.value,f=h.useRef(u);return h.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),o.jsx(Yn,{present:s||u,children:({present:p})=>o.jsx(Q.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!p,id:d,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:p&&i})})});vw.displayName=gw;function xw(e,t){return`${e}-trigger-${t}`}function yw(e,t){return`${e}-content-${t}`}var xA=uw,bw=mw,ww=hw,Sw=vw;const Nw=xA,km=h.forwardRef(({className:e,...t},n)=>o.jsx(bw,{ref:n,className:$("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));km.displayName=bw.displayName;const Hs=h.forwardRef(({className:e,...t},n)=>o.jsx(ww,{ref:n,className:$("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Hs.displayName=ww.displayName;const Gs=h.forwardRef(({className:e,...t},n)=>o.jsx(Sw,{ref:n,className:$("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Gs.displayName=Sw.displayName;const kw=h.forwardRef(({className:e,...t},n)=>o.jsx("div",{className:"relative w-full overflow-auto",children:o.jsx("table",{ref:n,className:$("w-full caption-bottom text-sm",e),...t})}));kw.displayName="Table";const jw=h.forwardRef(({className:e,...t},n)=>o.jsx("thead",{ref:n,className:$("[&_tr]:border-b",e),...t}));jw.displayName="TableHeader";const Cw=h.forwardRef(({className:e,...t},n)=>o.jsx("tbody",{ref:n,className:$("[&_tr:last-child]:border-0",e),...t}));Cw.displayName="TableBody";const yA=h.forwardRef(({className:e,...t},n)=>o.jsx("tfoot",{ref:n,className:$("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));yA.displayName="TableFooter";const zu=h.forwardRef(({className:e,...t},n)=>o.jsx("tr",{ref:n,className:$("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));zu.displayName="TableRow";const Bu=h.forwardRef(({className:e,...t},n)=>o.jsx("th",{ref:n,className:$("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Bu.displayName="TableHead";const Vu=h.forwardRef(({className:e,...t},n)=>o.jsx("td",{ref:n,className:$("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Vu.displayName="TableCell";const bA=h.forwardRef(({className:e,...t},n)=>o.jsx("caption",{ref:n,className:$("mt-4 text-sm text-muted-foreground",e),...t}));bA.displayName="TableCaption";const wA={low:"bg-primary text-primary-foreground",medium:"bg-warning text-primary-foreground",high:"bg-destructive text-destructive-foreground"},SA={best:"border-primary/50",likely:"border-secondary",worst:"border-warning",tail:"border-destructive"},NA={best:"text-primary",likely:"text-secondary-foreground",worst:"text-warning",tail:"text-destructive"},rg={positive:{color:"bg-primary",label:"+"},neutral:{color:"bg-muted-foreground",label:"○"},negative:{color:"bg-destructive",label:"−"}},kA=({result:e})=>o.jsx("section",{className:"border-t border-border py-12",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs(Nw,{defaultValue:"paths",className:"mx-auto max-w-5xl",children:[o.jsxs(km,{className:"mb-8 w-full justify-start",children:[o.jsx(Hs,{value:"paths",children:"Reasoning Paths"}),o.jsx(Hs,{value:"matrix",children:"Strategy Matrix"}),o.jsx(Hs,{value:"outcomes",children:"Projected Outcomes"})]}),o.jsx(Gs,{value:"paths",children:o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.paths.map((t,n)=>o.jsxs(Te,{className:`animate-fade-in-up border-border ${t.recommended?"border-primary glow-teal":""}`,style:{animationDelay:`${n*100}ms`},children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs(Je,{className:"text-base",children:[t.name,t.recommended&&o.jsx("span",{className:"ml-2 text-xs font-normal text-primary",children:"★ Recommended"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"text-sm font-mono text-primary",children:[t.probability,"%"]}),o.jsx(Re,{className:wA[t.riskLevel],children:t.riskLevel})]})]})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-3 text-sm text-muted-foreground",children:t.description}),o.jsxs("div",{children:[o.jsx("p",{className:"mb-1.5 text-xs font-medium text-foreground",children:"Key Tradeoffs:"}),o.jsx("ul",{className:"space-y-1",children:t.tradeoffs.map((r,s)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[o.jsx("span",{className:"mt-1 h-1 w-1 shrink-0 rounded-full bg-muted-foreground"}),r]},s))})]})]})]},n))})}),o.jsx(Gs,{value:"matrix",children:o.jsx(Te,{className:"border-border",children:o.jsx(Ae,{className:"pt-6",children:o.jsx("div",{className:"overflow-x-auto",children:o.jsxs(kw,{children:[o.jsx(jw,{children:o.jsxs(zu,{children:[o.jsx(Bu,{className:"text-foreground",children:"Stakeholder"}),e.matrix.strategies.map((t,n)=>o.jsx(Bu,{className:"text-center text-foreground",children:t},n))]})}),o.jsx(Cw,{children:e.matrix.stakeholders.map((t,n)=>o.jsxs(zu,{children:[o.jsx(Vu,{className:"font-medium text-foreground",children:t}),e.matrix.reactions[n].map((r,s)=>o.jsx(Vu,{className:"text-center",children:o.jsxs("div",{className:"flex items-center justify-center gap-1.5",children:[o.jsx("span",{className:`inline-block h-2.5 w-2.5 rounded-full ${rg[r].color}`}),o.jsx("span",{className:"text-xs text-muted-foreground",children:rg[r].label})]})},s))]},n))})]})})})})}),o.jsx(Gs,{value:"outcomes",children:o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.outcomes.map((t,n)=>o.jsxs(Te,{className:`animate-fade-in-up border-l-4 ${SA[t.type]}`,style:{animationDelay:`${n*100}ms`},children:[o.jsx(Xe,{className:"pb-2",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Je,{className:"text-base",children:t.label}),o.jsxs("span",{className:`text-sm font-mono ${NA[t.type]}`,children:[t.likelihood,"%"]})]})}),o.jsxs(Ae,{children:[o.jsx("p",{className:"mb-2 text-xs text-muted-foreground italic",children:t.conditions}),o.jsx("p",{className:"mb-3 text-sm text-foreground",children:t.description}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Impact"}),o.jsx("div",{className:"flex gap-0.5",children:Array.from({length:10}).map((r,s)=>o.jsx("div",{className:`h-2 w-2 rounded-sm ${s<t.impactRating?"bg-primary":"bg-muted"}`},s))}),o.jsxs("span",{className:"text-xs font-mono text-primary",children:[t.impactRating,"/10"]})]})]})]},n))})})]})})}),jA={low:"bg-muted text-muted-foreground",medium:"bg-secondary text-secondary-foreground",high:"bg-warning text-primary-foreground",critical:"bg-destructive text-destructive-foreground"},CA=({challenges:e})=>o.jsx("section",{className:"border-t border-border py-12",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl",children:[o.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Your assumptions were challenged"}),o.jsx("div",{className:"space-y-4",children:e.map((t,n)=>o.jsx(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:o.jsxs(Ae,{className:"pt-6",children:[o.jsxs("div",{className:"mb-3 flex items-start justify-between gap-4",children:[o.jsx("h4",{className:"font-semibold text-foreground",children:t.assumption}),o.jsx(Re,{className:jA[t.severity],children:t.severity})]}),o.jsxs("div",{className:"space-y-2 text-sm",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-muted-foreground",children:"Why it might not hold: "}),o.jsx("span",{className:"text-foreground",children:t.whyItMightFail})]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-muted-foreground",children:"What changes if you're wrong: "}),o.jsx("span",{className:"text-foreground",children:t.whatChanges})]})]})]})},n))})]})})}),EA=({recommendations:e})=>o.jsx("section",{className:"border-t border-border py-12",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl",children:[o.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Recommendations"}),o.jsx("div",{className:"space-y-4",children:e.map((t,n)=>o.jsx(Te,{className:"animate-fade-in-up border-border",style:{animationDelay:`${n*100}ms`},children:o.jsxs(Ae,{className:"flex gap-5 pt-6",children:[o.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary text-lg font-bold text-primary-foreground",children:t.priority}),o.jsxs("div",{className:"flex-1",children:[o.jsx("h4",{className:"mb-1 font-semibold text-foreground",children:t.action}),o.jsx("p",{className:"mb-2 text-sm text-muted-foreground",children:t.rationale}),o.jsx("span",{className:"rounded-sm bg-muted px-2 py-0.5 text-xs text-muted-foreground",children:t.timeframe})]})]})},n))})]})})});var fc="Switch",[_A,iI]=zt(fc),[RA,PA]=_A(fc),Ew=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:i,required:a,disabled:l,value:c="on",onCheckedChange:d,form:u,...f}=e,[p,m]=h.useState(null),y=ie(t,w=>m(w)),g=h.useRef(!1),b=p?u||!!p.closest("form"):!0,[x,v]=Wn({prop:s,defaultProp:i??!1,onChange:d,caller:fc});return o.jsxs(RA,{scope:n,checked:x,disabled:l,children:[o.jsx(Q.button,{type:"button",role:"switch","aria-checked":x,"aria-required":a,"data-state":Tw(x),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:y,onClick:K(e.onClick,w=>{v(S=>!S),b&&(g.current=w.isPropagationStopped(),g.current||w.stopPropagation())})}),b&&o.jsx(Pw,{control:p,bubbles:!g.current,name:r,value:c,checked:x,required:a,disabled:l,form:u,style:{transform:"translateX(-100%)"}})]})});Ew.displayName=fc;var _w="SwitchThumb",Rw=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=PA(_w,n);return o.jsx(Q.span,{"data-state":Tw(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});Rw.displayName=_w;var TA="SwitchBubbleInput",Pw=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},i)=>{const a=h.useRef(null),l=ie(a,i),c=ym(n),d=im(t);return h.useEffect(()=>{const u=a.current;if(!u)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const y=new Event("click",{bubbles:r});m.call(u,n),u.dispatchEvent(y)}},[c,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:l,style:{...s.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});Pw.displayName=TA;function Tw(e){return e?"checked":"unchecked"}var Aw=Ew,AA=Rw;const mc=h.forwardRef(({className:e,...t},n)=>o.jsx(Aw,{className:$("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:o.jsx(AA,{className:$("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));mc.displayName=Aw.displayName;const IA={low:"bg-primary/20 text-primary",moderate:"bg-warning/20 text-warning",high:"bg-destructive/20 text-destructive",critical:"bg-destructive text-destructive-foreground"},MA=({goalResult:e,onForkStrategy:t})=>{var y;const[n,r]=h.useState(null),[s,i]=h.useState(null),[a,l]=h.useState({}),[c,d]=h.useState({}),u=g=>{r(n===g?null:g)},f=g=>{i(s===g.id?null:g.id);const b={};g.levers_used.forEach(x=>{b[x]=!0}),l(b)},p=g=>{const b=Object.entries(a).filter(([,x])=>x).map(([x])=>x);t==null||t(g,b),i(null)},m=g=>e.swarm_tests.find(b=>b.strategy_id===g);return o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-5xl",children:[o.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[o.jsx("h2",{className:"text-2xl font-bold tracking-tight text-foreground",children:"Strategy Lab"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Recommended: ",o.jsx("span",{className:"text-primary font-medium",children:(y=e.strategies.find(g=>g.id===e.recommended_strategy_id))==null?void 0:y.label})]})]}),o.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:e.strategies.map(g=>{const b=m(g.id),x=g.id===e.recommended_strategy_id,v=c[g.id]||"overview";return o.jsxs(Te,{className:$("border-border transition-all",x&&"border-primary glow-teal"),children:[o.jsx(Xe,{className:"pb-2",children:o.jsx("div",{className:"flex items-start justify-between gap-2",children:o.jsxs("div",{children:[o.jsxs(Je,{className:"text-base",children:[g.label,x&&o.jsx("span",{className:"ml-2 text-xs text-primary",children:"★"})]}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[o.jsxs("span",{className:"text-xs font-mono text-primary",children:[(g.success_probability*100).toFixed(0),"% success"]}),o.jsxs(Re,{className:IA[g.risk],children:[g.risk," risk"]}),g.red_line_violations.length>0&&o.jsx(Re,{variant:"destructive",className:"text-[10px]",children:"RED LINE"})]})]})})}),o.jsxs(Ae,{className:"space-y-3",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:g.description}),o.jsxs(Nw,{value:v,onValueChange:w=>d(S=>({...S,[g.id]:w})),children:[o.jsxs(km,{className:"h-8 w-full",children:[o.jsx(Hs,{value:"overview",className:"text-xs flex-1",children:"Overview"}),o.jsxs(Hs,{value:"timeline",className:"text-xs flex-1",children:[o.jsx(Kf,{className:"mr-1 h-3 w-3"}),"Timeline"]})]}),o.jsxs(Gs,{value:"overview",className:"mt-3 space-y-2",children:[o.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Levers:"})," ",g.levers_used.join(", ")]}),o.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Timeframe:"})," ",g.estimated_timeframe]}),b&&o.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.jsx("span",{className:"font-medium text-foreground",children:"Swarm result:"})," ",b.goal_reached?"Goal reached":`${(b.goal_proximity*100).toFixed(0)}% proximity`]})]}),o.jsx(Gs,{value:"timeline",className:"mt-3",children:o.jsx("div",{className:"relative ml-3 border-l border-border pl-4",children:g.steps.map(w=>o.jsxs("div",{className:"relative mb-4 last:mb-0",children:[o.jsx("div",{className:"absolute -left-[21px] top-1 h-3 w-3 rounded-full border-2 border-primary bg-background"}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:w.timeframe}),o.jsx("p",{className:"text-xs font-medium text-foreground",children:w.action}),o.jsxs("p",{className:"text-[10px] text-muted-foreground mt-0.5",children:["Lever: ",w.lever," · Effect: ",w.expected_effect]})]},w.order))})})]}),o.jsxs("div",{className:"flex gap-2 pt-1",children:[o.jsxs(re,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>u(g.id),children:[o.jsx(Kl,{className:"mr-1 h-3 w-3"}),n===g.id?"HIDE":"SHOW WHY"]}),o.jsxs(re,{size:"sm",variant:"outline",className:"text-xs",onClick:()=>f(g),children:[o.jsx(Io,{className:"mr-1 h-3 w-3"}),"FORK STRATEGY"]})]}),n===g.id&&o.jsxs("div",{className:"rounded-md border border-border bg-muted/30 p-3 animate-in fade-in-0 slide-in-from-top-1",children:[o.jsx("h4",{className:"mb-2 text-xs font-semibold text-foreground",children:"Why this strategy?"}),o.jsxs("div",{className:"space-y-2 text-xs text-muted-foreground",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Drivers:"})," ",g.dependencies.join("; ")]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Failure modes:"})," ",g.failure_modes.join("; ")]}),g.likely_allies&&g.likely_allies.length>0&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Allies:"})," ",g.likely_allies.join(", ")]}),g.likely_opponents&&g.likely_opponents.length>0&&o.jsxs("div",{children:[o.jsx("span",{className:"font-medium text-foreground",children:"Opponents:"})," ",g.likely_opponents.join(", ")]})]})]}),s===g.id&&o.jsxs("div",{className:"rounded-md border border-primary/30 bg-primary/5 p-3 animate-in fade-in-0 slide-in-from-top-1",children:[o.jsx("h4",{className:"mb-2 text-xs font-semibold text-foreground",children:"Toggle Levers"}),o.jsx("div",{className:"space-y-2",children:g.levers_used.map(w=>o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-xs text-foreground",children:w}),o.jsx(mc,{checked:a[w]??!0,onCheckedChange:S=>l(N=>({...N,[w]:S}))})]},w))}),o.jsx(re,{size:"sm",className:"mt-3 w-full text-xs",onClick:()=>p(g.id),children:"RUN NEW PATH"})]})]})]},g.id)})}),o.jsxs("div",{className:"mt-6 rounded-lg border border-border bg-card p-4",children:[o.jsx("p",{className:"text-sm text-foreground",children:e.recommendation_rationale}),o.jsxs("p",{className:"mt-2 text-xs text-primary font-medium",children:["Immediate next step: ",e.immediate_next_step]})]})]})})})},OA=["Key stakeholder defects from coalition","Unexpected regulatory announcement","Media leak reveals strategy details","Major competitor makes aggressive move","Economic shock changes market conditions","New ally emerges with aligned interests"],LA=({strategy:e,onInjectEvent:t,forkedTimeline:n})=>{const[r,s]=h.useState(0),[i,a]=h.useState(""),[l,c]=h.useState(!1),d=e.steps.length-1,u=h.useCallback(()=>{i.trim()&&(t==null||t({atStep:r,event:i.trim()}),a(""))},[i,r,t]);return o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl",children:[o.jsx("h2",{className:"mb-6 text-2xl font-bold tracking-tight text-foreground",children:"Decision Time Machine"}),o.jsxs(Te,{className:"border-border",children:[o.jsx(Xe,{className:"pb-3",children:o.jsxs(Je,{className:"flex items-center gap-2 text-base",children:[o.jsx(Xr,{className:"h-4 w-4 text-primary"}),"Timeline: ",e.label]})}),o.jsxs(Ae,{className:"space-y-6",children:[o.jsxs("div",{className:"relative ml-3 border-l-2 border-border pl-6",children:[e.steps.map((f,p)=>o.jsxs("div",{className:`relative mb-6 last:mb-0 transition-opacity ${n&&p>n.injectedEvent.atStep?"opacity-40":""}`,children:[o.jsx("div",{className:`absolute -left-[29px] top-1 h-4 w-4 rounded-full border-2 ${p===r?"border-primary bg-primary":p<=r?"border-primary bg-background":"border-muted-foreground bg-background"}`}),o.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:f.timeframe}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:f.action}),o.jsx("p",{className:"text-xs text-muted-foreground",children:f.expected_effect}),n&&p===n.injectedEvent.atStep&&o.jsxs("div",{className:"mt-2 flex items-start gap-2 rounded border border-warning/30 bg-warning/10 px-3 py-2",children:[o.jsx(Xr,{className:"mt-0.5 h-3 w-3 shrink-0 text-warning"}),o.jsxs("div",{children:[o.jsx("p",{className:"text-[10px] font-bold text-warning",children:"EVENT INJECTED"}),o.jsx("p",{className:"text-xs text-foreground",children:n.injectedEvent.event})]})]})]},f.order)),n&&o.jsxs("div",{className:"mt-4 ml-4 border-l-2 border-primary/50 pl-6",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(Io,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-xs font-bold text-primary",children:"FORKED TIMELINE"})]}),n.forkedSteps.map((f,p)=>o.jsxs("div",{className:"relative mb-4 last:mb-0",children:[o.jsx("div",{className:"absolute -left-[29px] top-1 h-3 w-3 rounded-full border-2 border-primary/50 bg-background"}),o.jsx("p",{className:"text-[10px] font-mono text-muted-foreground",children:f.timeframe}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:f.action}),o.jsx("p",{className:"text-xs text-muted-foreground",children:f.expected_effect})]},p)),o.jsxs("div",{className:"mt-3 flex gap-3",children:[o.jsxs(Re,{variant:"outline",className:n.probabilityDelta>=0?"border-primary/30 text-primary":"border-destructive/30 text-destructive",children:["Success: ",n.probabilityDelta>=0?"+":"",(n.probabilityDelta*100).toFixed(0),"%"]}),o.jsxs(Re,{variant:"outline",children:["Risk: ",n.riskDelta]})]})]})]}),o.jsxs("div",{children:[o.jsxs("label",{className:"mb-2 block text-xs font-medium text-muted-foreground",children:["Time Scrubber — Step ",r+1," of ",d+1]}),o.jsx(wm,{value:[r],onValueChange:f=>s(f[0]),min:0,max:d,step:1})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 p-4",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(Xr,{className:"h-4 w-4 text-warning"}),o.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Inject Event at Step ",r+1]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(jt,{placeholder:"What happens at this point?",value:i,onChange:f=>a(f.target.value),onKeyDown:f=>f.key==="Enter"&&u()}),o.jsx(re,{size:"sm",onClick:u,disabled:!i.trim(),children:"RUN FROM HERE"})]}),o.jsxs(re,{size:"sm",variant:"ghost",className:"mt-2 text-xs",onClick:()=>c(!l),children:[o.jsx(Yf,{className:"mr-1 h-3 w-3"}),"SUGGEST EVENTS"]}),l&&o.jsx("div",{className:"mt-2 flex flex-wrap gap-1.5 animate-in fade-in-0",children:OA.map((f,p)=>o.jsx("button",{onClick:()=>{a(f),c(!1)},className:"rounded-full border border-border px-3 py-1 text-[10px] text-muted-foreground hover:border-primary/50 hover:text-foreground transition-colors",children:f},p))})]})]})]})]})})})},$A=({request:e,title:t})=>{const[n,r]=h.useState(null),[s,i]=h.useState(!1),a=h.useCallback(()=>{const c=y_(t,e),d=S_(c);r(d)},[e,t]),l=h.useCallback(async()=>{n&&(await navigator.clipboard.writeText(n),i(!0),setTimeout(()=>i(!1),2e3))},[n]);return o.jsx("div",{className:"inline-flex flex-col items-start gap-2",children:n?o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(jt,{value:n,readOnly:!0,className:"w-[320px] text-xs font-mono",onClick:c=>c.target.select()}),o.jsx(re,{size:"icon",variant:"outline",onClick:l,children:s?o.jsx(Gf,{className:"h-4 w-4 text-primary"}):o.jsx(_0,{className:"h-4 w-4"})})]}):o.jsxs(re,{size:"sm",variant:"outline",onClick:a,className:"text-xs",children:[o.jsx(MC,{className:"mr-1.5 h-3.5 w-3.5"}),"SHARE SCENARIO"]})})};var pc="Collapsible",[DA,oI]=zt(pc),[FA,jm]=DA(pc),Iw=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:a,...l}=e,[c,d]=Wn({prop:r,defaultProp:s??!1,onChange:a,caller:pc});return o.jsx(FA,{scope:n,disabled:i,contentId:ms(),open:c,onOpenToggle:h.useCallback(()=>d(u=>!u),[d]),children:o.jsx(Q.div,{"data-state":Em(c),"data-disabled":i?"":void 0,...l,ref:t})})});Iw.displayName=pc;var Mw="CollapsibleTrigger",Ow=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=jm(Mw,n);return o.jsx(Q.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Em(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:K(e.onClick,s.onOpenToggle)})});Ow.displayName=Mw;var Cm="CollapsibleContent",Lw=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=jm(Cm,e.__scopeCollapsible);return o.jsx(Yn,{present:n||s.open,children:({present:i})=>o.jsx(zA,{...r,ref:t,present:i})})});Lw.displayName=Cm;var zA=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,a=jm(Cm,n),[l,c]=h.useState(r),d=h.useRef(null),u=ie(t,d),f=h.useRef(0),p=f.current,m=h.useRef(0),y=m.current,g=a.open||l,b=h.useRef(g),x=h.useRef(void 0);return h.useEffect(()=>{const v=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(v)},[]),Ve(()=>{const v=d.current;if(v){x.current=x.current||{transitionDuration:v.style.transitionDuration,animationName:v.style.animationName},v.style.transitionDuration="0s",v.style.animationName="none";const w=v.getBoundingClientRect();f.current=w.height,m.current=w.width,b.current||(v.style.transitionDuration=x.current.transitionDuration,v.style.animationName=x.current.animationName),c(r)}},[a.open,r]),o.jsx(Q.div,{"data-state":Em(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!g,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:g&&s})});function Em(e){return e?"open":"closed"}var BA=Iw;const bn=BA,wn=Ow,Sn=Lw,VA=({governance:e})=>{const[t,n]=h.useState(!1),r=e.constitutionalChecks.every(c=>c.passed),s=e.constitutionalChecks.filter(c=>!c.passed),i=e.neuroverse,a=(i==null?void 0:i.guardStatus)==="BLOCK"||s.length>0,l=(i==null?void 0:i.guardStatus)==="PAUSE";return o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl space-y-3",children:[(a||l)&&o.jsxs("div",{className:$("rounded-lg border-2 px-5 py-4 flex items-start gap-3",a?"border-red-500/50 bg-red-500/10":"border-yellow-500/50 bg-yellow-500/10"),children:[a?o.jsx(IC,{className:"h-5 w-5 text-red-400 shrink-0 mt-0.5"}):o.jsx(jr,{className:"h-5 w-5 text-yellow-400 shrink-0 mt-0.5"}),o.jsxs("div",{className:"space-y-2 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:$("inline-flex items-center rounded px-2 py-0.5 text-xs font-bold uppercase tracking-wider",a?"bg-red-500/20 text-red-400":"bg-yellow-500/20 text-yellow-400"),children:a?"BLOCK":"PAUSE"}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:"Governance Intervention Active"})]}),s.map(c=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:"font-mono text-xs text-red-400/70 mt-0.5",children:["[",c.ruleId,"]"]}),o.jsx("span",{className:"text-foreground/90",children:c.rule}),c.detail&&o.jsxs("span",{className:"text-muted-foreground",children:["— ",c.detail]})]},c.ruleId)),(i==null?void 0:i.guardStatus)==="BLOCK"&&s.length===0&&o.jsx("p",{className:"text-sm text-foreground/90",children:"Liquidity floor violated — impacts capped by governance rules"}),(i==null?void 0:i.collapseRisk)&&i.collapseRisk!=="none"&&o.jsxs("p",{className:"text-xs text-muted-foreground",children:["System risk: ",o.jsx("span",{className:$("font-medium",i.collapseRisk==="high"?"text-red-400":i.collapseRisk==="moderate"?"text-yellow-400":"text-emerald-400"),children:i.collapseRisk}),i.worldHealthScore!==void 0&&o.jsxs(o.Fragment,{children:[" · Stability: ",i.worldHealthScore,"%"]})]})]})]}),o.jsxs(bn,{open:t,onOpenChange:n,children:[o.jsxs(wn,{className:"flex w-full items-center justify-between rounded-lg border border-border bg-card px-5 py-4 text-left transition-colors hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[r?o.jsx(Qi,{className:"h-5 w-5 text-primary"}):o.jsx(Yl,{className:"h-5 w-5 text-destructive"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Rules & Constraints"}),o.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.constitutionalChecks.length," rules checked · Status: ",e.authorityLevel.replace(/_/g," "),i&&o.jsxs(o.Fragment,{children:[" · Permission: ",o.jsx("span",{className:$("font-medium",i.guardStatus==="ALLOW"?"text-emerald-400":i.guardStatus==="BLOCK"?"text-red-400":"text-yellow-400"),children:i.guardStatus})]})]})]})]}),o.jsx(gt,{className:$("h-4 w-4 text-muted-foreground transition-transform duration-200",t&&"rotate-180")})]}),o.jsxs(Sn,{className:"mt-3 space-y-4 animate-in fade-in-0 slide-in-from-top-2",children:[o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[{icon:EC,label:"Request ID",value:e.traceId.slice(0,12)+"…"},{icon:Qi,label:"Permission",value:e.authorityLevel.replace(/_/g," ")},{icon:Kf,label:"Timestamp",value:new Date(e.timestamp).toLocaleTimeString()},{icon:Qi,label:"Version",value:`v${e.engineVersion}`}].map(c=>o.jsxs("div",{className:"rounded-md border border-border bg-card p-3",children:[o.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(c.icon,{className:"h-3 w-3"}),c.label]}),o.jsx("p",{className:"mt-1 text-xs font-medium text-foreground",children:c.value})]},c.label))}),o.jsxs("div",{className:"rounded-lg border border-border bg-card",children:[o.jsx("div",{className:"border-b border-border px-4 py-2.5",children:o.jsx("h4",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Safety Rules"})}),o.jsx("div",{className:"divide-y divide-border",children:e.constitutionalChecks.map(c=>o.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[o.jsx("span",{className:$("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs font-bold",c.passed?"bg-primary/20 text-primary":"bg-destructive/20 text-destructive"),children:c.passed?"✓":"✗"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:c.rule}),c.detail&&o.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:c.detail}),o.jsx("span",{className:"mt-1 inline-block rounded bg-muted px-1.5 py-0.5 text-[10px] font-mono text-muted-foreground",children:c.ruleId})]})]},c.ruleId))})]}),e.enforcedConstraints.length>0&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[o.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Active Rules"}),o.jsx("ul",{className:"space-y-1.5",children:e.enforcedConstraints.map((c,d)=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground",children:[o.jsx("span",{className:"mt-1 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),c]},d))})]})]})]})]})})})},UA=({report:e,governance:t,isGenerating:n,aiEnabled:r,provider:s,onGenerate:i,onToggleAI:a})=>{const[l,c]=h.useState(!1),d=()=>{if(!e)return;const f=sg(e);navigator.clipboard.writeText(f),c(!0),setTimeout(()=>c(!1),2e3)},u=()=>{if(!e)return;const f=sg(e),p=new Blob([f],{type:"text/markdown"}),m=URL.createObjectURL(p),y=document.createElement("a");y.href=m,y.download="governed-report.md",y.click(),URL.revokeObjectURL(m)};return o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl space-y-4",children:[o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(ss,{className:"h-5 w-5 text-primary"}),o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Governed Report"}),t&&o.jsxs("span",{className:$("inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",t.trace.passed?"bg-emerald-500/20 text-emerald-400":"bg-yellow-500/20 text-yellow-400"),children:[o.jsx(Cn,{className:"h-3 w-3"}),t.trace.passed?"Governed":"Violations"]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"AI Assist"}),o.jsx(mc,{checked:r,onCheckedChange:a})]}),o.jsx(re,{variant:"outline",size:"sm",onClick:i,disabled:n,className:"gap-2",children:n?o.jsxs(o.Fragment,{children:[o.jsx(yu,{className:"h-3 w-3 animate-pulse"}),"Generating..."]}):o.jsxs(o.Fragment,{children:[o.jsx(ss,{className:"h-3 w-3"}),"Generate Report"]})})]})]}),e&&o.jsxs("div",{className:"space-y-4 animate-in fade-in-0 slide-in-from-top-2",children:[t&&o.jsx("div",{className:$("rounded-md border px-4 py-3 text-xs",t.trace.passed?"border-emerald-500/30 bg-emerald-500/5":"border-yellow-500/30 bg-yellow-500/5"),children:o.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[o.jsx(Cn,{className:"h-3 w-3"}),o.jsxs("span",{children:["Actor: ",o.jsx("span",{className:"text-foreground font-mono",children:t.actor})," · ","Action: ",o.jsx("span",{className:"text-foreground font-mono",children:t.action})," · ","Provider: ",o.jsx("span",{className:"text-foreground font-medium",children:s})," · ","Constraints: ",t.trace.constraints.length," checked",t.trace.violations.length>0&&o.jsxs("span",{className:"text-yellow-400",children:[" · ",t.trace.violations.length," violation(s)"]})]})]})}),o.jsxs("div",{className:"rounded-lg border border-border bg-card p-5",children:[o.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Executive Summary"}),o.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:e.executiveSummary})]}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.keyEvents.length>0&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[o.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Key Events"}),o.jsx("div",{className:"space-y-2",children:e.keyEvents.map((f,p)=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsxs("span",{className:$("mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-[10px] font-bold",f.severity==="critical"?"bg-red-500/20 text-red-400":f.severity==="high"?"bg-orange-500/20 text-orange-400":"bg-yellow-500/20 text-yellow-400"),children:["R",f.round]}),o.jsxs("div",{children:[o.jsx("p",{className:"text-foreground/90",children:f.description}),o.jsx("p",{className:"text-xs text-muted-foreground",children:f.agents.join(", ")})]})]},p))})]}),e.governanceActions.length>0&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[o.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Governance Actions"}),o.jsx("div",{className:"space-y-2",children:e.governanceActions.map((f,p)=>o.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[o.jsx("span",{className:$("mt-0.5 shrink-0 rounded px-1.5 py-0.5 text-[10px] font-bold uppercase",f.type==="BLOCK"?"bg-red-500/20 text-red-400":f.type==="PAUSE"?"bg-yellow-500/20 text-yellow-400":f.type==="CIRCUIT_BREAKER"?"bg-purple-500/20 text-purple-400":"bg-blue-500/20 text-blue-400"),children:f.type}),o.jsxs("div",{children:[o.jsx("p",{className:"text-foreground/90",children:f.description}),o.jsx("p",{className:"text-xs text-muted-foreground",children:f.agent})]})]},p))})]})]}),o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-5",children:[{label:"Volatility",value:e.metrics.volatilityReduction},{label:"Collapse Risk",value:e.metrics.collapseRisk},{label:"Stability",value:e.metrics.stabilityScore},{label:"Interventions",value:String(e.metrics.interventionCount)},{label:"Blocked",value:String(e.metrics.blockedActions)}].map(f=>o.jsxs("div",{className:"rounded-md border border-border bg-card p-3 text-center",children:[o.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wider text-muted-foreground",children:f.label}),o.jsx("p",{className:"mt-1 text-sm font-bold text-foreground",children:f.value})]},f.label))}),e.counterfactual&&o.jsxs("div",{className:"rounded-lg border border-dashed border-yellow-500/30 bg-yellow-500/5 p-4",children:[o.jsx("h4",{className:"mb-1 text-xs font-semibold uppercase tracking-wider text-yellow-400/80",children:"Counterfactual"}),o.jsx("p",{className:"text-sm text-foreground/80 italic",children:e.counterfactual})]}),e.observations.length>0&&o.jsxs("div",{className:"rounded-lg border border-border bg-card p-4",children:[o.jsx("h4",{className:"mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Observations"}),o.jsx("ul",{className:"space-y-1.5",children:e.observations.map((f,p)=>o.jsxs("li",{className:"flex items-start gap-2 text-sm text-foreground/90",children:[o.jsx("span",{className:"mt-1 h-1.5 w-1.5 shrink-0 rounded-full bg-primary"}),f]},p))})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(re,{variant:"ghost",size:"sm",onClick:d,className:"gap-2 text-xs",children:[l?o.jsx(rs,{className:"h-3 w-3 text-emerald-400"}):o.jsx(_0,{className:"h-3 w-3"}),l?"Copied":"Copy"]}),o.jsxs(re,{variant:"ghost",size:"sm",onClick:u,className:"gap-2 text-xs",children:[o.jsx(R0,{className:"h-3 w-3"}),"Download .md"]}),o.jsxs("span",{className:"ml-auto text-[10px] text-muted-foreground",children:["Generated by ",o.jsx("span",{className:"font-medium text-foreground",children:e.generatedBy})," · Governed by ",o.jsx("span",{className:"font-medium text-foreground",children:e.governedBy})]})]})]})]})})})};function sg(e){const t=[];if(t.push(`# Governed Simulation Report
|
|
494
|
+
`),t.push(`> Generated by: ${e.generatedBy} | Governed by: ${e.governedBy}
|
|
495
|
+
`),t.push(`## Executive Summary
|
|
496
|
+
`),t.push(e.executiveSummary+`
|
|
497
|
+
`),e.keyEvents.length>0){t.push(`## Key Events
|
|
498
|
+
`);for(const n of e.keyEvents)t.push(`- **Round ${n.round}** [${n.severity}]: ${n.description} (${n.agents.join(", ")})`);t.push("")}if(e.governanceActions.length>0){t.push(`## Governance Actions
|
|
499
|
+
`);for(const n of e.governanceActions)t.push(`- **[${n.type}]** ${n.agent}: ${n.description}`);t.push("")}if(t.push(`## Metrics
|
|
500
|
+
`),t.push("| Metric | Value |"),t.push("|--------|-------|"),t.push(`| Volatility | ${e.metrics.volatilityReduction} |`),t.push(`| Collapse Risk | ${e.metrics.collapseRisk} |`),t.push(`| Stability | ${e.metrics.stabilityScore} |`),t.push(`| Interventions | ${e.metrics.interventionCount} |`),t.push(`| Blocked Actions | ${e.metrics.blockedActions} |`),t.push(""),e.counterfactual&&(t.push(`## Counterfactual
|
|
501
|
+
`),t.push(`> ${e.counterfactual}
|
|
502
|
+
`)),e.observations.length>0){t.push(`## Observations
|
|
503
|
+
`);for(const n of e.observations)t.push(`- ${n}`);t.push("")}return t.join(`
|
|
504
|
+
`)}const $w={error:{icon:Ao,color:"text-red-400",bg:"bg-red-500/5",border:"border-red-500/20",label:"Error",badgeBg:"bg-red-500/20 text-red-400"},warning:{icon:jr,color:"text-yellow-400",bg:"bg-yellow-500/5",border:"border-yellow-500/20",label:"Warning",badgeBg:"bg-yellow-500/20 text-yellow-400"},info:{icon:T0,color:"text-blue-400",bg:"bg-blue-500/5",border:"border-blue-500/20",label:"Info",badgeBg:"bg-blue-500/20 text-blue-400"},hint:{icon:Yf,color:"text-muted-foreground",bg:"bg-muted/30",border:"border-border",label:"Hint",badgeBg:"bg-muted text-muted-foreground"}},Dw={conflict:"Rule Conflicts",coverage:"Coverage Gaps",strength:"Enforcement Strength",constraint:"Constraint Balance",structure:"Structure"};function WA({counts:e}){return o.jsxs("div",{className:"flex items-center gap-4 rounded-md border border-border bg-muted/50 px-4 py-2 font-mono text-xs",children:[o.jsx("span",{className:"text-muted-foreground uppercase tracking-wider",children:"Problems"}),o.jsxs("div",{className:"flex items-center gap-3",children:[e.errors>0&&o.jsxs("span",{className:"flex items-center gap-1 text-red-400",children:[o.jsx(Ao,{className:"h-3.5 w-3.5"}),e.errors]}),e.warnings>0&&o.jsxs("span",{className:"flex items-center gap-1 text-yellow-400",children:[o.jsx(jr,{className:"h-3.5 w-3.5"}),e.warnings]}),e.info>0&&o.jsxs("span",{className:"flex items-center gap-1 text-blue-400",children:[o.jsx(T0,{className:"h-3.5 w-3.5"}),e.info]}),e.hints>0&&o.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[o.jsx(Yf,{className:"h-3.5 w-3.5"}),e.hints]}),e.errors===0&&e.warnings===0&&e.info===0&&e.hints===0&&o.jsx("span",{className:"text-green-400",children:"No problems detected"})]})]})}function HA({diagnostic:e,policyText:t,onApplyFix:n,isFixed:r}){const[s,i]=h.useState(!1),a=$w[e.severity],l=a.icon;let c=null;if(e.source&&t){const u=t.split(`
|
|
505
|
+
`),f=e.source.startLine-1;f>=0&&f<u.length&&(c=u[f].trim())}const d=e.quickFix;return o.jsx(bn,{open:s,onOpenChange:i,children:o.jsxs("div",{className:$("rounded-lg border transition-colors",r?"border-green-500/30 bg-green-500/5":a.border,!r&&a.bg,s&&"ring-1 ring-primary/20"),children:[o.jsxs(wn,{className:"flex w-full items-start gap-3 px-4 py-3 text-left",children:[r?o.jsx(rs,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-400"}):o.jsx(l,{className:$("mt-0.5 h-4 w-4 shrink-0",a.color)}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:$("inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider",r?"bg-green-500/20 text-green-400":a.badgeBg),children:e.id}),o.jsx("span",{className:$("text-sm font-medium",r?"text-green-400 line-through opacity-70":"text-foreground"),children:e.message}),r&&o.jsx("span",{className:"text-[10px] font-bold uppercase text-green-400",children:"Fixed"})]}),e.source&&!r&&o.jsxs("div",{className:"mt-1 flex items-center gap-1.5 text-xs text-muted-foreground",children:[o.jsx(ss,{className:"h-3 w-3"}),o.jsxs("span",{children:["Line ",e.source.startLine,e.source.endLine!==e.source.startLine&&`–${e.source.endLine}`]}),e.relatedRules.length>0&&o.jsxs(o.Fragment,{children:[o.jsx(TC,{className:"ml-2 h-3 w-3"}),o.jsx("span",{children:e.relatedRules.join(", ")})]})]})]}),d&&!r&&n&&o.jsxs(re,{size:"sm",variant:"outline",className:"shrink-0 gap-1.5 border-green-500/30 bg-green-500/10 text-green-400 hover:bg-green-500/20 hover:text-green-300",onClick:u=>{u.stopPropagation(),n(d,e.id)},children:[o.jsx(bu,{className:"h-3 w-3"}),d.label]}),!r&&(s?o.jsx(gt,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}):o.jsx(Dn,{className:"mt-1 h-4 w-4 shrink-0 text-muted-foreground"}))]}),!r&&o.jsx(Sn,{children:o.jsxs("div",{className:"space-y-3 border-t border-border/50 px-4 py-3",children:[o.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:e.detail}),c&&o.jsxs("div",{className:"rounded-md border border-border bg-background/80 p-3",children:[o.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(ss,{className:"h-3 w-3"}),o.jsxs("span",{children:["policy.txt:",e.source.startLine]})]}),o.jsx("pre",{className:"mt-1.5 overflow-x-auto text-xs",children:o.jsxs("code",{children:[o.jsxs("span",{className:"select-none text-muted-foreground/50",children:[e.source.startLine," │"," "]}),o.jsx("span",{className:$(e.severity==="error"&&"bg-red-500/10 text-red-300",e.severity==="warning"&&"bg-yellow-500/10 text-yellow-300",e.severity==="info"&&"text-foreground",e.severity==="hint"&&"text-muted-foreground"),children:c})]})})]}),d&&o.jsxs("div",{className:"space-y-2 rounded-md border border-green-500/20 bg-green-500/5 px-3 py-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(xh,{className:"h-3.5 w-3.5 shrink-0 text-green-400"}),o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-green-400",children:"Quick Fix"})]}),o.jsxs("div",{className:"rounded border border-green-500/10 bg-background/50 px-2.5 py-2 font-mono text-xs",children:[d.operation==="insert"&&o.jsx("div",{className:"space-y-0.5",children:d.text.split(`
|
|
506
|
+
`).map((u,f)=>o.jsxs("div",{className:"text-green-400",children:[o.jsx("span",{className:"select-none text-green-600",children:"+ "}),u]},f))}),d.operation==="replace"&&o.jsxs("div",{className:"space-y-0.5",children:[c&&o.jsxs("div",{className:"text-red-400",children:[o.jsx("span",{className:"select-none text-red-600",children:"- "}),c]}),d.text.split(`
|
|
507
|
+
`).map((u,f)=>o.jsxs("div",{className:"text-green-400",children:[o.jsx("span",{className:"select-none text-green-600",children:"+ "}),u]},f))]}),d.operation==="remove"&&c&&o.jsxs("div",{className:"text-red-400",children:[o.jsx("span",{className:"select-none text-red-600",children:"- "}),c]})]}),n&&o.jsxs(re,{size:"sm",className:"w-full gap-1.5 bg-green-600 text-white hover:bg-green-500",onClick:()=>n(d,e.id),children:[o.jsx(bu,{className:"h-3.5 w-3.5"}),"Apply: ",d.label]})]}),!d&&e.fix&&o.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-muted bg-muted/30 px-3 py-2",children:[o.jsx(xh,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),o.jsx("p",{className:"text-xs text-muted-foreground",children:e.fix})]}),o.jsx("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:o.jsx("span",{className:"rounded-full border border-border px-2 py-0.5",children:Dw[e.category]??e.category})})]})})]})})}const GA=({healthCheck:e,policyText:t,onApplyFix:n,fixedDiagnostics:r})=>{const[s,i]=h.useState("all"),a=r??new Set,c=(s==="all"?e.diagnostics:e.diagnostics.filter(u=>u.severity===s)).reduce((u,f)=>{const p=f.category;return u[p]||(u[p]=[]),u[p].push(f),u},{}),d=e.diagnostics.filter(u=>u.quickFix&&!a.has(u.id)).length;return o.jsxs("div",{className:"space-y-4",children:[o.jsx(WA,{counts:e.counts}),d>0&&n&&o.jsx("div",{className:"flex items-center justify-between rounded-md border border-green-500/20 bg-green-500/5 px-4 py-2",children:o.jsxs("span",{className:"text-xs text-green-400",children:[o.jsx(bu,{className:"mr-1.5 inline h-3.5 w-3.5"}),d," issue",d>1?"s":""," can be auto-fixed"]})}),o.jsx("div",{className:"flex items-center gap-1 rounded-md border border-border bg-muted/30 p-1",children:["all","error","warning","info","hint"].map(u=>{const f=u==="all"?e.diagnostics.length:e.counts[`${u}s`];return u!=="all"&&f===0?null:o.jsxs("button",{onClick:()=>i(u),className:$("rounded px-3 py-1.5 text-xs font-medium transition-colors",s===u?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:[u==="all"?"All":$w[u].label,f>0&&o.jsxs("span",{className:"ml-1.5 opacity-60",children:["(",f,")"]})]},u)})}),Object.entries(c).length>0?o.jsx("div",{className:"space-y-4",children:Object.entries(c).map(([u,f])=>o.jsxs("div",{className:"space-y-2",children:[o.jsx("h4",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:Dw[u]??u}),f.map(p=>o.jsx(HA,{diagnostic:p,policyText:t,onApplyFix:n,isFixed:a.has(p.id)},p.id))]},u))}):o.jsx("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 px-4 py-6 text-center",children:o.jsx("span",{className:"text-sm text-green-400",children:"No issues found — policy is clean"})})]})},KA={ALLOW:{icon:Cn,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/30",label:"ALLOWED"},BLOCK:{icon:M0,color:"text-red-400",bg:"bg-red-500/10",border:"border-red-500/30",label:"BLOCKED"},MODIFY:{icon:Yl,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/30",label:"MODIFIED"},PAUSE:{icon:I0,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/30",label:"PAUSED"}};function YA({verdict:e,action:t}){const[n,r]=h.useState(!1),s=KA[e.status],i=s.icon,a=e.rulesFired.filter(l=>l.effect!=="monitored");return o.jsx(bn,{open:n,onOpenChange:r,children:o.jsxs("div",{className:$("rounded-lg border transition-colors",s.border,s.bg),children:[o.jsxs(wn,{className:"flex w-full items-start gap-3 px-4 py-3 text-left",children:[o.jsx(i,{className:$("mt-0.5 h-5 w-5 shrink-0",s.color)}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:$("rounded px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",s.bg,s.color),children:s.label}),o.jsx("span",{className:"text-xs text-muted-foreground",children:t.agentId})]}),o.jsx("p",{className:"mt-1 text-sm text-foreground",children:t.description}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:e.reason})]}),o.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[e.status==="MODIFY"&&e.action&&o.jsxs("span",{className:"text-xs text-yellow-400",children:[t.magnitude.toFixed(2)," → ",e.action.magnitude.toFixed(2)]}),n?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Dn,{className:"h-4 w-4 text-muted-foreground"})]})]}),o.jsx(Sn,{children:o.jsxs("div",{className:"space-y-2 border-t border-border/50 px-4 py-3",children:[e.rulesFired.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Rules Evaluated"}),e.rulesFired.map((l,c)=>o.jsxs("div",{className:$("flex items-center gap-2 rounded border px-2.5 py-1.5 text-xs",l.effect==="blocked"&&"border-red-500/20 bg-red-500/5 text-red-300",l.effect==="dampened"&&"border-yellow-500/20 bg-yellow-500/5 text-yellow-300",l.effect==="capped"&&"border-orange-500/20 bg-orange-500/5 text-orange-300",l.effect==="rebalanced"&&"border-blue-500/20 bg-blue-500/5 text-blue-300",l.effect==="monitored"&&"border-border bg-muted/30 text-muted-foreground"),children:[o.jsx("span",{className:"shrink-0 font-mono text-[10px] opacity-60",children:l.id}),o.jsx("span",{className:"flex-1",children:l.description}),o.jsx("span",{className:"shrink-0 font-bold uppercase text-[10px]",children:l.effect}),l.impactReduction>0&&o.jsxs("span",{className:"shrink-0 font-mono opacity-70",children:["-",(l.impactReduction*100).toFixed(0),"%"]})]},`${l.id}-${c}`))]}),o.jsxs("div",{className:"flex items-center gap-4 text-xs text-muted-foreground",children:[o.jsxs("span",{children:["Confidence: ",(e.confidence*100).toFixed(0),"%"]}),a.length>0&&o.jsxs("span",{children:[a.length," rule",a.length>1?"s":""," enforced"]})]})]})})]})})}function qA({governor:e,verdictCount:t}){const n=e.stats,r=e.policy;return o.jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-md border border-border bg-muted/50 px-4 py-2 font-mono text-xs",children:[o.jsx("span",{className:"text-muted-foreground uppercase tracking-wider",children:"Governor"}),o.jsxs("span",{className:"text-foreground",children:[r.ruleCount," rules"]}),o.jsxs("span",{className:"text-green-400",children:[r.enforcedCount," enforced"]}),t>0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"text-border",children:"|"}),n.allowed>0&&o.jsxs("span",{className:"text-green-400",children:[n.allowed," allowed"]}),n.blocked>0&&o.jsxs("span",{className:"text-red-400",children:[n.blocked," blocked"]}),n.modified>0&&o.jsxs("span",{className:"text-yellow-400",children:[n.modified," modified"]}),n.paused>0&&o.jsxs("span",{className:"text-orange-400",children:[n.paused," paused"]})]})]})}function QA({onSubmit:e}){const[t,n]=h.useState("custom-agent"),[r,s]=h.useState(""),[i,a]=h.useState(.5),l=()=>{r.trim()&&(e({agentId:t,type:"custom",description:r.trim(),magnitude:i}),s(""))};return o.jsxs("div",{className:"space-y-3 rounded-lg border border-border bg-muted/30 p-4",children:[o.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Custom Action"}),o.jsxs("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[1fr_2fr_auto]",children:[o.jsx("input",{value:t,onChange:c=>n(c.target.value),placeholder:"Agent ID",className:"rounded border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none"}),o.jsx("input",{value:r,onChange:c=>s(c.target.value),onKeyDown:c=>c.key==="Enter"&&l(),placeholder:"What is the agent trying to do?",className:"rounded border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none"}),o.jsxs(re,{onClick:l,disabled:!r.trim(),size:"sm",className:"gap-1.5",children:[o.jsx(Xr,{className:"h-3 w-3"}),"Evaluate"]})]}),o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Magnitude:"}),o.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:i,onChange:c=>a(Number(c.target.value)),className:"flex-1"}),o.jsx("span",{className:$("w-10 text-right font-mono text-xs font-bold",i>.7?"text-red-400":i>.4?"text-yellow-400":"text-green-400"),children:i.toFixed(2)})]})]})}const XA=({policyText:e})=>{var p;const[t,n]=h.useState("stressed"),[r,s]=h.useState([]),[i,a]=h.useState(!1),l=h.useMemo(()=>$y({policyText:e,sensitivity:.5}),[e]),c=((p=nd[t])==null?void 0:p.state)??nd.stressed.state,d=h.useCallback(m=>{const y=l.evaluate(m,c);s(g=>[{action:m,verdict:y},...g])},[l,c]),u=h.useCallback(()=>{const m=Dh.map(y=>({action:y,verdict:l.evaluate(y,c)}));s(m)},[l,c]),f=h.useCallback(()=>{s([])},[]);return o.jsxs("div",{className:"space-y-4",children:[o.jsx(qA,{governor:l,verdictCount:r.length}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Tr,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Market Conditions"}),o.jsx("div",{className:"flex gap-1",children:Object.entries(nd).map(([m,{label:y,state:g}])=>o.jsx("button",{onClick:()=>{n(m),s([])},className:$("rounded-full border px-3 py-1 text-xs font-medium transition-colors",t===m?m==="crisis"?"border-red-500/30 bg-red-500/10 text-red-400":m==="stressed"?"border-yellow-500/30 bg-yellow-500/10 text-yellow-400":"border-green-500/30 bg-green-500/10 text-green-400":"border-border text-muted-foreground hover:text-foreground"),children:y},m))})]}),o.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(c).map(([m,y])=>o.jsxs("span",{className:$("rounded border px-2 py-0.5 font-mono text-[10px]",typeof y=="number"&&y>70||typeof y=="number"&&y<20||y==="panic"||y==="systemic"?"border-red-500/20 text-red-400":"border-border text-muted-foreground"),children:[m,": ",String(y)]},m))}),o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsxs(re,{onClick:u,size:"sm",className:"gap-1.5",children:[o.jsx(Mo,{className:"h-3 w-3"}),"Evaluate All Example Actions"]}),o.jsxs(re,{onClick:()=>a(!i),variant:"outline",size:"sm",className:"gap-1.5",children:[o.jsx(qi,{className:"h-3 w-3"}),"Custom Action"]}),r.length>0&&o.jsx("button",{onClick:f,className:"text-xs text-muted-foreground hover:text-foreground",children:"Clear results"})]}),i&&o.jsx(QA,{onSubmit:d}),r.length===0&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("span",{className:"text-xs text-muted-foreground",children:"Or evaluate individually:"}),o.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:Dh.map(m=>o.jsxs("button",{onClick:()=>d(m),className:"flex items-start gap-2 rounded-lg border border-border bg-muted/20 px-3 py-2.5 text-left transition-colors hover:border-primary/30 hover:bg-muted/40",children:[o.jsx($C,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),o.jsxs("div",{children:[o.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:m.agentId}),o.jsx("p",{className:"text-xs text-foreground",children:m.description}),o.jsx("div",{className:"mt-1 flex items-center gap-2",children:o.jsxs("span",{className:$("font-mono text-[10px] font-bold",m.magnitude>.7?"text-red-400":m.magnitude>.4?"text-yellow-400":"text-green-400"),children:["magnitude: ",m.magnitude.toFixed(2)]})})]})]},m.agentId+m.description))})]}),r.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Governance Verdicts (",r.length,")"]}),r.map(({action:m,verdict:y},g)=>o.jsx(YA,{verdict:y,action:m},`${m.agentId}-${g}`))]})]})},JA={upload:"Upload Policy",parsed:"Rules Parsed",validated:"Logic Validated",simulating:"Simulating...",complete:"Results Ready"};function ZA({current:e}){const t=["upload","parsed","validated","simulating","complete"],n=t.indexOf(e);return o.jsx("div",{className:"flex items-center gap-1",children:t.map((r,s)=>{const i=s===n,a=s<n,l=s>n;return o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs("div",{className:$("flex h-7 items-center gap-1.5 rounded-full border px-3 text-xs font-medium transition-all",i&&"border-primary bg-primary/10 text-primary",a&&"border-green-500/30 bg-green-500/10 text-green-400",l&&"border-border bg-muted/30 text-muted-foreground"),children:[a&&o.jsx(rs,{className:"h-3 w-3"}),i&&r==="simulating"&&o.jsx(cl,{className:"h-3 w-3 animate-spin"}),o.jsx("span",{className:"hidden sm:inline",children:JA[r]}),o.jsx("span",{className:"sm:hidden",children:s+1})]}),s<t.length-1&&o.jsx("div",{className:$("h-px w-4 transition-colors",a?"bg-green-500/50":"bg-border")})]},r)})})}function e3({onUpload:e,policyText:t,onTextChange:n}){const r=h.useRef(null),[s,i]=h.useState(!1),a=h.useCallback(d=>{if(!d.name.endsWith(".txt")&&!d.name.endsWith(".md"))return;const u=new FileReader;u.onload=f=>{var m;const p=(m=f.target)==null?void 0:m.result;n(p),e(p)},u.readAsText(d)},[e,n]),l=h.useCallback(d=>{d.preventDefault(),i(!1);const u=d.dataTransfer.files[0];u&&a(u)},[a]),c=h.useCallback(()=>{t.trim()&&e(t)},[t,e]);return o.jsxs("div",{className:"space-y-4",children:[o.jsxs("div",{onDragOver:d=>{d.preventDefault(),i(!0)},onDragLeave:()=>i(!1),onDrop:l,onClick:()=>{var d;return(d=r.current)==null?void 0:d.click()},className:$("cursor-pointer rounded-lg border-2 border-dashed p-6 text-center transition-all",s?"border-primary bg-primary/5":"border-border hover:border-primary/50 hover:bg-muted/30"),children:[o.jsx(O0,{className:$("mx-auto mb-2 h-8 w-8",s?"text-primary":"text-muted-foreground")}),o.jsx("p",{className:"text-sm font-medium text-foreground",children:"Drop your policy document here"}),o.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:".txt or .md files accepted"}),o.jsx("input",{ref:r,type:"file",accept:".txt,.md",className:"hidden",onChange:d=>{var f;const u=(f=d.target.files)==null?void 0:f[0];u&&a(u)}})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("label",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Or paste policy text directly"}),o.jsx("textarea",{value:t,onChange:d=>n(d.target.value),placeholder:ig,rows:10,className:"w-full rounded-lg border border-border bg-background px-4 py-3 font-mono text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary focus:outline-none focus:ring-1 focus:ring-primary/30"}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("button",{onClick:()=>n(ig),className:"text-xs text-primary/70 underline-offset-2 hover:text-primary hover:underline",children:"Load example policy"}),o.jsxs(re,{onClick:c,disabled:!t.trim(),size:"sm",children:[o.jsx(Mo,{className:"mr-1.5 h-3.5 w-3.5"}),"Parse & Validate"]})]})]})]})}function t3({rule:e}){const t=e.enforcement==="structural";return o.jsxs("div",{className:$("flex items-start gap-3 rounded-lg border px-4 py-3",t?"border-green-500/20 bg-green-500/5":"border-yellow-500/20 bg-yellow-500/5"),children:[t?o.jsx(Cn,{className:"mt-0.5 h-4 w-4 shrink-0 text-green-400"}):o.jsx(Kl,{className:"mt-0.5 h-4 w-4 shrink-0 text-yellow-400"}),o.jsxs("div",{className:"min-w-0 flex-1",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.id}),o.jsx("span",{className:$("rounded px-1.5 py-0.5 text-[10px] font-bold uppercase",t?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400"),children:t?"ENFORCED":"ADVISORY"}),o.jsx("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground",children:e.category})]}),o.jsx("p",{className:"mt-1 text-sm text-foreground",children:e.description}),e.affectedVariables.length>0&&o.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:e.affectedVariables.map(n=>o.jsx("span",{className:"rounded-full border border-border px-2 py-0.5 text-[10px] text-muted-foreground",children:n},n))})]})]})}function n3({parsed:e}){const[t,n]=h.useState(!1),r=t?e.rules:e.rules.slice(0,6);return o.jsxs("div",{className:"space-y-3",children:[o.jsx("div",{className:"flex items-center gap-3",children:o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/50 px-4 py-2",children:[o.jsx(ss,{className:"h-4 w-4 text-primary"}),o.jsxs("span",{className:"text-sm font-medium",children:["Parsed ",e.summary.total," rules"]}),o.jsx("span",{className:"mx-1 text-muted-foreground",children:"—"}),o.jsxs("span",{className:"text-sm text-green-400",children:[e.summary.enforced," enforced"]}),o.jsxs("span",{className:"text-sm text-yellow-400",children:[e.summary.advisory," advisory"]})]})}),o.jsx("div",{className:"space-y-2",children:r.map(s=>o.jsx(t3,{rule:s},s.id))}),e.rules.length>6&&o.jsx("button",{onClick:()=>n(!t),className:"text-xs text-primary/70 hover:text-primary",children:t?"Show less":`Show ${e.rules.length-6} more rules...`})]})}function r3({result:e}){const{impact:t,comparison:n}=e,r=[{label:"Stability Change",value:t.stabilityChange,suffix:"%",positive:t.stabilityChange>0,icon:t.stabilityChange>0?Qf:qf},{label:"Cascade Risk",value:-t.cascadeRiskChange,suffix:"%",positive:t.cascadeRiskChange>0,icon:Tr},{label:"Governance Actions",value:t.governanceActions,suffix:"",positive:!0,icon:Cn},{label:"Actions Blocked",value:t.actionsBlocked,suffix:"%",positive:t.actionsBlocked<70,icon:Ao}];return o.jsxs("div",{className:"space-y-4",children:[o.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:r.map(s=>{const i=s.icon;return o.jsxs("div",{className:$("rounded-lg border p-4 text-center",s.positive?"border-green-500/20 bg-green-500/5":"border-red-500/20 bg-red-500/5"),children:[o.jsx(i,{className:$("mx-auto mb-1 h-5 w-5",s.positive?"text-green-400":"text-red-400")}),o.jsxs("div",{className:$("text-2xl font-bold",s.positive?"text-green-400":"text-red-400"),children:[s.value>0?"+":"",s.value.toFixed(0),s.suffix]}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:s.label})]},s.label)})}),t.preventedCollapse&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border-2 border-green-500/30 bg-green-500/10 px-4 py-3",children:[o.jsx(rs,{className:"h-5 w-5 text-green-400"}),o.jsx("span",{className:"text-sm font-medium text-green-400",children:"Policy prevented system collapse"})]}),t.overConstraintScore>.7&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border-2 border-red-500/30 bg-red-500/10 px-4 py-3",children:[o.jsx(jr,{className:"h-5 w-5 text-red-400"}),o.jsxs("div",{children:[o.jsx("span",{className:"text-sm font-medium text-red-400",children:"Over-constrained Policy Detected"}),o.jsxs("p",{className:"mt-0.5 text-xs text-red-300/70",children:[t.actionsBlocked.toFixed(0),"% of actions blocked — risk of system freeze"]})]})]}),o.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Governance Effectiveness"}),o.jsxs("span",{className:"text-sm font-bold text-primary",children:[(n.comparison.governanceEffectiveness*100).toFixed(0),"%"]})]}),o.jsx("div",{className:"mt-2 h-2 overflow-hidden rounded-full bg-muted",children:o.jsx("div",{className:"h-full rounded-full bg-primary transition-all",style:{width:`${n.comparison.governanceEffectiveness*100}%`}})})]})]})}function s3({explanation:e}){return o.jsxs("div",{className:"rounded-lg border border-primary/20 bg-primary/5 px-5 py-4",children:[o.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[o.jsx(Xr,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"What the Policy Did"})]}),o.jsx("p",{className:"text-sm leading-relaxed text-foreground/90",children:e})]})}function i3({result:e}){const{comparison:t}=e,n=t.baseline.metrics,r=t.governed.metrics,s=[{label:"Collapse Probability",baseline:`${(n.collapseProbability*100).toFixed(0)}%`,policy:`${(r.collapseProbability*100).toFixed(0)}%`,better:r.collapseProbability<n.collapseProbability},{label:"Stability Score",baseline:`${(n.stabilityScore*100).toFixed(0)}%`,policy:`${(r.stabilityScore*100).toFixed(0)}%`,better:r.stabilityScore>n.stabilityScore},{label:"Max Volatility",baseline:n.maxVolatility.toFixed(2),policy:r.maxVolatility.toFixed(2),better:r.maxVolatility<n.maxVolatility},{label:"Coalition Risks",baseline:String(n.coalitionRisks),policy:String(r.coalitionRisks),better:r.coalitionRisks<n.coalitionRisks},{label:"Peak Negative Sentiment",baseline:n.peakNegativeSentiment.toFixed(2),policy:r.peakNegativeSentiment.toFixed(2),better:r.peakNegativeSentiment>n.peakNegativeSentiment}];return o.jsxs("div",{className:"overflow-hidden rounded-lg border border-border",children:[o.jsxs("div",{className:"grid grid-cols-3 border-b border-border bg-muted/50 px-4 py-2 text-xs font-bold uppercase tracking-wider text-muted-foreground",children:[o.jsx("span",{children:"Metric"}),o.jsx("span",{className:"text-center",children:"Baseline"}),o.jsx("span",{className:"text-center",children:"With Policy"})]}),s.map(i=>o.jsxs("div",{className:"grid grid-cols-3 items-center border-b border-border/50 px-4 py-2.5 last:border-b-0",children:[o.jsx("span",{className:"text-sm text-foreground",children:i.label}),o.jsx("span",{className:"text-center font-mono text-sm text-muted-foreground",children:i.baseline}),o.jsx("span",{className:$("text-center font-mono text-sm font-medium",i.better?"text-green-400":"text-red-400"),children:i.policy})]},i.label))]})}const ig=`# Market Stability Policy
|
|
508
|
+
|
|
509
|
+
- Block all large trades exceeding $10M during periods of extreme volatility
|
|
510
|
+
- Require mandatory position reporting for all leveraged positions above 3x
|
|
511
|
+
- Limit maximum system leverage to 5x during elevated volatility conditions
|
|
512
|
+
- Halt all automated trading when volatility index exceeds 80
|
|
513
|
+
- Monitor and report all correlated position clusters exceeding 15% of market volume
|
|
514
|
+
- Encourage diversification of counterparty exposure across market participants
|
|
515
|
+
- Maintain minimum liquidity floor — no agent may drain liquidity below 15% of baseline
|
|
516
|
+
- Require coalition rebalancing when concentration exceeds threshold limits
|
|
517
|
+
- Promote transparency in all large position changes to reduce information asymmetry
|
|
518
|
+
- Suspend new short positions during market panic conditions`,o3=()=>{const[e,t]=h.useState("upload"),[n,r]=h.useState(""),[s,i]=h.useState(null),[a,l]=h.useState(null),[c,d]=h.useState(null),[u,f]=h.useState(!1),[p,m]=h.useState(!0),[y,g]=h.useState(!0),[b,x]=h.useState(!0),[v,w]=h.useState(!0),[S,N]=h.useState(new Set),[k,j]=h.useState(null),C=h.useCallback(L=>{const I=os(L);i(I);const F=ui(I);return l(F),d(null),{parseResult:I,health:F}},[]),E=h.useCallback(L=>{C(L),t("validated"),N(new Set),j(null)},[C]),R=h.useCallback((L,I)=>{const F=wR(n,L);r(F),C(F),N(O=>new Set([...O,I])),j(L.label),setTimeout(()=>j(null),3e3)},[n,C]),P=h.useCallback(async()=>{if(!(!s||!(a!=null&&a.canSimulate))){f(!0),t("simulating");try{const L=await kR(n);d(L),t("complete")}catch(L){console.error("Policy simulation failed:",L),t("validated")}finally{f(!1)}}},[s,a,n]),T=h.useCallback(()=>{t("upload"),r(""),i(null),l(null),d(null),f(!1),N(new Set),j(null)},[]);return o.jsx("section",{className:"border-t border-border py-12",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl space-y-8",children:[o.jsxs("div",{className:"space-y-3 text-center",children:[o.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-primary/30 bg-primary/10 px-4 py-1.5",children:[o.jsx(Cn,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"Policy Enforcement Lab"})]}),o.jsx("h2",{className:"text-2xl font-bold tracking-tight text-foreground sm:text-3xl",children:"Test a policy before it exists"}),o.jsx("p",{className:"mx-auto max-w-xl text-sm text-muted-foreground",children:"Drop in your policy. We parse the rules, validate the logic, simulate the outcomes, and show you what would actually happen — before you deploy it."})]}),o.jsx("div",{className:"flex justify-center",children:o.jsx(ZA,{current:e})}),e==="upload"&&o.jsx(e3,{onUpload:E,policyText:n,onTextChange:r}),s&&e!=="upload"&&o.jsxs("div",{className:"space-y-6",children:[o.jsxs(bn,{open:y,onOpenChange:g,children:[o.jsxs(wn,{className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/30 px-4 py-3 text-left hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(ss,{className:"h-4 w-4 text-primary"}),o.jsxs("span",{className:"text-sm font-medium",children:["Parsed Rules (",s.summary.total,")"]}),o.jsxs("span",{className:"text-xs text-green-400",children:[s.summary.enforced," enforced"]}),o.jsxs("span",{className:"text-xs text-yellow-400",children:[s.summary.advisory," advisory"]})]}),y?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Dn,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Sn,{children:o.jsx("div",{className:"mt-3",children:o.jsx(n3,{parsed:s})})})]}),a&&o.jsxs(bn,{open:p,onOpenChange:m,children:[o.jsxs(wn,{className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/30 px-4 py-3 text-left hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Tr,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-sm font-medium",children:"Policy Health Check"}),a.counts.errors>0&&o.jsxs("span",{className:"flex items-center gap-1 rounded bg-red-500/20 px-1.5 py-0.5 text-[10px] font-bold text-red-400",children:[o.jsx(Ao,{className:"h-3 w-3"}),a.counts.errors," errors"]}),a.counts.warnings>0&&o.jsxs("span",{className:"flex items-center gap-1 rounded bg-yellow-500/20 px-1.5 py-0.5 text-[10px] font-bold text-yellow-400",children:[o.jsx(jr,{className:"h-3 w-3"}),a.counts.warnings," warnings"]}),a.counts.errors===0&&a.counts.warnings===0&&o.jsxs("span",{className:"flex items-center gap-1 rounded bg-green-500/20 px-1.5 py-0.5 text-[10px] font-bold text-green-400",children:[o.jsx(rs,{className:"h-3 w-3"}),"Healthy"]}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["Score: ",a.healthScore,"/100"]})]}),p?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Dn,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Sn,{children:o.jsx("div",{className:"mt-3",children:o.jsx(GA,{healthCheck:a,policyText:n,onApplyFix:R,fixedDiagnostics:S})})})]}),a&&s&&s.summary.total>0&&o.jsxs(bn,{open:b,onOpenChange:x,children:[o.jsxs(wn,{className:"flex w-full items-center justify-between rounded-lg border border-primary/20 bg-primary/5 px-4 py-3 text-left hover:bg-primary/10",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Cn,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-sm font-medium",children:"Governance Playground"}),o.jsx("span",{className:"rounded bg-primary/20 px-1.5 py-0.5 text-[10px] font-bold uppercase text-primary",children:"Live"}),o.jsx("span",{className:"text-xs text-muted-foreground",children:"Test agent actions against your policy"})]}),b?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Dn,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Sn,{children:o.jsx("div",{className:"mt-3",children:o.jsx(XA,{policyText:n})})})]}),k&&o.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-green-500/30 bg-green-500/10 px-4 py-3 animate-in fade-in slide-in-from-top-1",children:[o.jsx(rs,{className:"h-4 w-4 text-green-400"}),o.jsxs("span",{className:"text-sm text-green-400",children:["Applied: ",k]}),o.jsxs("span",{className:"text-xs text-muted-foreground",children:["— Policy re-parsed with ",s==null?void 0:s.summary.total," rules (",s==null?void 0:s.summary.enforced," enforced)"]}),c&&o.jsxs(re,{size:"sm",variant:"outline",className:"ml-auto gap-1.5",onClick:P,children:[o.jsx(cl,{className:"h-3 w-3"}),"Re-simulate"]})]}),e==="validated"&&(a==null?void 0:a.canSimulate)&&o.jsx("div",{className:"flex justify-center",children:o.jsxs(re,{onClick:P,size:"lg",className:"gap-2",children:[o.jsx(xu,{className:"h-4 w-4"}),"Run Simulation — Baseline vs. Policy"]})}),e==="simulating"&&o.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[o.jsx(cl,{className:"h-8 w-8 animate-spin text-primary"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"Running baseline and governed simulations..."})]}),c&&e==="complete"&&o.jsxs("div",{className:"space-y-6",children:[o.jsx(r3,{result:c}),o.jsx(s3,{explanation:c.explanation}),o.jsxs(bn,{open:v,onOpenChange:w,children:[o.jsxs(wn,{className:"flex w-full items-center justify-between rounded-lg border border-border bg-muted/30 px-4 py-3 text-left hover:bg-muted/50",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(xu,{className:"h-4 w-4 text-primary"}),o.jsx("span",{className:"text-sm font-medium",children:"Baseline vs. Policy Comparison"})]}),v?o.jsx(gt,{className:"h-4 w-4 text-muted-foreground"}):o.jsx(Dn,{className:"h-4 w-4 text-muted-foreground"})]}),o.jsx(Sn,{children:o.jsx("div",{className:"mt-3",children:o.jsx(i3,{result:c})})})]}),o.jsx("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:o.jsx("p",{className:"text-xs italic text-muted-foreground",children:c.comparison.comparison.narrative})})]}),e!=="simulating"&&o.jsx("div",{className:"flex justify-center pt-4",children:o.jsx("button",{onClick:T,className:"text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline",children:"Upload a different policy"})})]})]})})})};function No(e){var r;const t=a3(e);if(t)return t;if(e==="trading"||e==="flash_crash")return{id:"trading-flash-crash",title:"Flash Crash — Algorithmic Cascade",scenario:Jt.scenario.scenario,stakeholders:Jt.scenario.stakeholders,assumptions:Jt.scenario.assumptions,constraints:Jt.scenario.constraints,swarm:Jt.scenario.swarm,depth:Jt.scenario.depth,world:Jt.world,paths:Jt.paths};const n=di[e];if(!n)throw new Error(`Unknown preset: ${e}. Available: trading, ${Object.keys(di).join(", ")}`);if(!((r=n.world)!=null&&r.inline_definition))throw new Error(`Preset "${e}" has no world definition.`);return{id:n.world.world_id,title:n.title,scenario:n.scenario,stakeholders:n.stakeholders,assumptions:n.assumptions,constraints:n.constraints,swarm:n.swarm??{enabled:!0,rounds:5,reaction_model:"mixed"},depth:n.depth,world:n.world.inline_definition,paths:[{id:"path_primary",label:"Primary Response",description:"Most likely course of action",projected_outcome:"Moderate disruption with cascading effects",probability:.6,risk:"high",tradeoffs:["Speed vs. thoroughness","Short-term vs. long-term"],benefits_stakeholders:n.stakeholders.filter(s=>s.disposition==="supportive").map(s=>s.id),harms_stakeholders:n.stakeholders.filter(s=>s.disposition==="hostile").map(s=>s.id)},{id:"path_defensive",label:"Defensive Posture",description:"Conservative approach prioritizing stability",projected_outcome:"Reduced damage but slower recovery",probability:.7,risk:"moderate",tradeoffs:["Safety vs. opportunity cost"],benefits_stakeholders:n.stakeholders.filter(s=>s.disposition!=="hostile").map(s=>s.id),harms_stakeholders:[]}]}}function a3(e){try{const t=mR(e);if(!t)return null;let n=`Simulation with custom world: ${t.world.thesis}`,r=[{id:"System",disposition:"neutral",priorities:["stability"]},{id:"Agents",disposition:"unknown",priorities:["execution"]}],s={severity:"high"},i={};try{const a=No(t.basePreset);n=a.scenario,r=a.stakeholders,s=a.assumptions,i=a.constraints}catch{}return{id:t.id,title:t.name,scenario:n,stakeholders:r,assumptions:s,constraints:i,swarm:{enabled:!0,rounds:5,reaction_model:"mixed"},depth:"full",world:t.world,paths:[{id:"path_primary",label:"Primary Response",description:"Most likely course of action",projected_outcome:"Moderate disruption with cascading effects",probability:.6,risk:"high",tradeoffs:["Speed vs. thoroughness","Short-term vs. long-term"],benefits_stakeholders:r.filter(a=>a.disposition==="supportive").map(a=>a.id),harms_stakeholders:r.filter(a=>a.disposition==="hostile").map(a=>a.id)}]}}catch{return null}}async function l3(e,t,n){var S,N;const r=No(e),s=No(t),i=r.scenario+" "+s.scenario,a=c3(r.stakeholders,s.stakeholders),l=r.paths;(S=n==null?void 0:n.onProgress)==null||S.call(n,"World A","simulating");const c=await _u({scenario:i,stakeholders:a,assumptions:r.assumptions,constraints:r.constraints,depth:r.depth,swarm:r.swarm},r.world,l);(N=n==null?void 0:n.onProgress)==null||N.call(n,"World B","simulating");const d=await _u({scenario:i,stakeholders:a,assumptions:s.assumptions,constraints:s.constraints,depth:s.depth,swarm:s.swarm},s.world,l),u=og(c),f=og(d),p=c.governed.metrics,m=d.governed.metrics,y=p.stabilityScore-m.stabilityScore,g=p.maxVolatility-m.maxVolatility,b=p.coalitionRisks-m.coalitionRisks,x=p.collapseProbability-m.collapseProbability,v=Math.abs(y)<.02?"equal":y>0?"A":"B",w=d3(r,s,p,m,v);return{scenario:i,worldA:{id:e,thesis:r.world.thesis,invariantCount:r.world.invariants.length,gateCount:(r.world.gates??[]).length,metrics:p,trajectory:c.governed.swarm.trajectory,governanceStats:c.governanceStats,rounds:u},worldB:{id:t,thesis:s.world.thesis,invariantCount:s.world.invariants.length,gateCount:(s.world.gates??[]).length,metrics:m,trajectory:d.governed.swarm.trajectory,governanceStats:d.governanceStats,rounds:f},delta:{stabilityDiff:Number((y*100).toFixed(1)),volatilityDiff:Number((g*100).toFixed(1)),coalitionRiskDiff:b,collapseDiff:Number((x*100).toFixed(1)),moreStable:v,narrative:w}}}function c3(e,t){const n=new Set,r=[];for(const s of[...e,...t])n.has(s.id)||(n.add(s.id),r.push(s));return r}function og(e){return e.governed.swarm.rounds.map(t=>({round:t.round,avgImpact:t.reactions.reduce((n,r)=>n+r.impact,0)/t.reactions.length,maxVolatility:Math.max(...t.reactions.map(n=>Math.abs(n.impact))),agentImpacts:t.reactions.map(n=>({id:n.stakeholder_id,impact:n.impact,confidence:n.confidence})),interventions:t.emergent_dynamics??[]}))}function d3(e,t,n,r,s){const i=[];i.push(`World A ("${e.world.thesis.slice(0,60)}...") vs World B ("${t.world.thesis.slice(0,60)}...").`),s==="A"?i.push(`World A produced a more stable system (${(n.stabilityScore*100).toFixed(0)}% vs ${(r.stabilityScore*100).toFixed(0)}%).`):s==="B"?i.push(`World B produced a more stable system (${(r.stabilityScore*100).toFixed(0)}% vs ${(n.stabilityScore*100).toFixed(0)}%).`):i.push("Both worlds produced similar stability levels.");const a=e.world.invariants.length-t.world.invariants.length;return a!==0&&i.push(`World ${a>0?"A":"B"} has ${Math.abs(a)} more invariant${Math.abs(a)>1?"s":""}, providing tighter structural constraints.`),i.push("Same agents, different rules — the world shapes the outcome."),i.join(" ")}function u3(){var t;const e=[{id:"trading",title:"Flash Crash — Algorithmic Cascade",thesis:Jt.world.thesis,invariantCount:Jt.world.invariants.length,gateCount:(Jt.world.gates??[]).length}];for(const[n,r]of Object.entries(di))(t=r.world)!=null&&t.inline_definition&&e.push({id:n,title:r.title,thesis:r.world.inline_definition.thesis,invariantCount:r.world.inline_definition.invariants.length,gateCount:(r.world.inline_definition.gates??[]).length});return e}function f3(e){const t=No(e),n=t.world.invariants,r=t.world.gates??[],s=n.filter(f=>f.enforceable).length,i=n.length-s,a=n.length===0?"No invariants defined — ungoverned.":`${n.length} rules (${s} enforced, ${i} advisory): ${n.map(f=>f.description).join("; ")}`,l=r.filter(f=>f.severity==="critical"),c=r.filter(f=>f.severity==="warning"),d=r.length===0?"No viability gates — no collapse detection.":`${r.length} gates (${l.length} critical, ${c.length} warning): ${r.map(f=>`${f.label} [${f.severity}]`).join(", ")}`,u=l.length>=2?"high":l.length>=1||c.length>=2?"moderate":"low";return{worldId:e,title:t.title,thesis:t.world.thesis,invariantSummary:a,gateSummary:d,riskProfile:u}}function m3(e){const{worldA:t,worldB:n,delta:r}=e,s=r.moreStable,i=s==="A"?t:s==="B"?n:t,a=s==="A"?n:s==="B"?t:n;i.governanceStats.totalEvaluations-a.governanceStats.totalEvaluations;const l=i.governanceStats.verdicts.block-a.governanceStats.verdicts.block,c=[];return Math.abs(r.stabilityDiff)>=5&&c.push(`${Math.abs(r.stabilityDiff).toFixed(0)}% stability ${r.stabilityDiff>0?"advantage for World A":"advantage for World B"}`),Math.abs(r.collapseDiff)>=5&&c.push(`${Math.abs(r.collapseDiff).toFixed(0)}% ${r.collapseDiff>0?"higher":"lower"} cascade risk in World A`),l!==0&&c.push(`${Math.abs(l)} more governance interventions in ${l>0?"World A":"World B"}`),Math.abs(r.volatilityDiff)>=5&&c.push(`${Math.abs(r.volatilityDiff).toFixed(0)}% volatility ${r.volatilityDiff>0?"higher in A":"higher in B"}`),c.length===0&&c.push("Both worlds produced similar outcomes — rules had minimal differential effect."),{winner:s,stabilityDelta:`${r.stabilityDiff>0?"+":""}${r.stabilityDiff.toFixed(1)}%`,cascadeRiskDelta:`${r.collapseDiff>0?"+":""}${r.collapseDiff.toFixed(1)}%`,volatilityDelta:`${r.volatilityDiff>0?"+":""}${r.volatilityDiff.toFixed(1)}%`,totalInterventionsA:t.governanceStats.totalEvaluations,totalInterventionsB:n.governanceStats.totalEvaluations,blockedActionsA:t.governanceStats.verdicts.block,blockedActionsB:n.governanceStats.verdicts.block,keyFindings:c,verdict:r.narrative,poweredBy:"@neuroverseos/governance — simulateWorld() + evaluateGuard()"}}function ag({label:e,selected:t,onSelect:n,presets:r,savedWorlds:s,explanation:i,disabled:a,onDeleteSaved:l}){return o.jsxs("div",{className:"space-y-3",children:[o.jsx("h4",{className:"text-xs font-bold uppercase tracking-[0.15em] text-muted-foreground",children:e}),s.length>0&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary/70 flex items-center gap-1",children:[o.jsx(_C,{className:"h-3 w-3"})," My Worlds"]}),s.map(c=>o.jsxs("div",{className:"flex items-stretch gap-1",children:[o.jsxs("button",{disabled:a,onClick:()=>n(c.id),className:$("flex-1 rounded-lg border px-4 py-3 text-left transition-all",t===c.id?"border-primary bg-primary/5 ring-1 ring-primary/20":"border-border hover:border-muted-foreground/30 hover:bg-muted/50",a&&"opacity-50 cursor-not-allowed"),children:[o.jsx("div",{className:"text-sm font-medium text-foreground",children:c.name}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground line-clamp-1",children:c.world.thesis}),o.jsxs("div",{className:"mt-2 flex gap-3 text-[10px] font-medium text-muted-foreground",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(gh,{className:"h-3 w-3"})," ",c.world.invariants.length," rules"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(jr,{className:"h-3 w-3"})," ",(c.world.gates??[]).length," gates"]}),o.jsx("span",{className:"text-primary/50",children:"saved"})]})]}),o.jsx("button",{onClick:()=>l(c.id),disabled:a,className:"rounded-lg border border-border px-2 text-muted-foreground hover:text-red-400 hover:border-red-400/30 transition-colors",title:"Delete saved world",children:o.jsx(LC,{className:"h-3.5 w-3.5"})})]},c.id))]}),o.jsxs("div",{className:"space-y-1.5",children:[s.length>0&&o.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/50 mt-2",children:"Presets"}),r.map(c=>o.jsxs("button",{disabled:a,onClick:()=>n(c.id),className:$("w-full rounded-lg border px-4 py-3 text-left transition-all",t===c.id?"border-primary bg-primary/5 ring-1 ring-primary/20":"border-border hover:border-muted-foreground/30 hover:bg-muted/50",a&&"opacity-50 cursor-not-allowed"),children:[o.jsx("div",{className:"text-sm font-medium text-foreground",children:c.title}),o.jsx("div",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:c.thesis}),o.jsxs("div",{className:"mt-2 flex gap-3 text-[10px] font-medium text-muted-foreground",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(gh,{className:"h-3 w-3"})," ",c.invariantCount," rules"]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(jr,{className:"h-3 w-3"})," ",c.gateCount," gates"]})]})]},c.id))]}),i&&o.jsxs("div",{className:"rounded-lg border border-dashed border-muted-foreground/20 bg-muted/30 p-3 space-y-2",children:[o.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Governance posture"}),o.jsx("div",{className:"text-xs text-foreground/80",children:i.invariantSummary}),o.jsx("div",{className:"text-xs text-muted-foreground",children:i.gateSummary}),o.jsxs("div",{className:"flex items-center gap-1 text-[10px]",children:[o.jsx("span",{className:$("inline-block h-1.5 w-1.5 rounded-full",i.riskProfile==="high"?"bg-red-500":i.riskProfile==="moderate"?"bg-yellow-500":"bg-green-500")}),o.jsxs("span",{className:"text-muted-foreground",children:["Risk profile: ",i.riskProfile]})]})]})]})}function lg({worldId:e,onSave:t,onCancel:n}){const[r,s]=h.useState("");return o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("input",{type:"text",value:r,onChange:i=>s(i.target.value),placeholder:"World name (e.g., Panic Control v1)",className:"flex-1 rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:ring-1 focus:ring-primary/30",autoFocus:!0,onKeyDown:i=>{i.key==="Enter"&&r.trim()&&t(r.trim()),i.key==="Escape"&&n()}}),o.jsx(re,{size:"sm",onClick:()=>r.trim()&&t(r.trim()),disabled:!r.trim(),children:"Save"}),o.jsx(re,{size:"sm",variant:"ghost",onClick:n,children:"Cancel"})]})}function cg({side:e,label:t,color:n}){const r=n==="blue"?{border:"border-blue-500/30",bg:"bg-blue-500/5",text:"text-blue-400",badge:"bg-blue-500/10 text-blue-400"}:{border:"border-amber-500/30",bg:"bg-amber-500/5",text:"text-amber-400",badge:"bg-amber-500/10 text-amber-400"},s=e.trajectory==="stabilizing"||e.trajectory==="converging"?o.jsx(Qf,{className:"h-3.5 w-3.5 text-green-400"}):e.trajectory==="escalating"?o.jsx(qf,{className:"h-3.5 w-3.5 text-red-400"}):o.jsx(Tr,{className:"h-3.5 w-3.5 text-yellow-400"});return o.jsxs("div",{className:$("rounded-xl border p-5 space-y-4",r.border,r.bg),children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:$("text-xs font-bold uppercase tracking-[0.15em]",r.text),children:t}),o.jsx("span",{className:$("rounded-full px-2 py-0.5 text-[10px] font-medium",r.badge),children:e.id})]}),o.jsx("p",{className:"text-sm text-foreground/90 leading-relaxed",children:e.thesis}),o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsx(ga,{label:"Stability",value:`${(e.metrics.stabilityScore*100).toFixed(0)}%`}),o.jsx(ga,{label:"Cascade Risk",value:`${(e.metrics.collapseProbability*100).toFixed(0)}%`}),o.jsx(ga,{label:"Volatility",value:`${(e.metrics.maxVolatility*100).toFixed(0)}%`}),o.jsx(ga,{label:"Trajectory",value:e.trajectory,icon:s})]}),o.jsxs("div",{className:"border-t border-border/50 pt-3 space-y-2",children:[o.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[o.jsx(Cn,{className:"h-3 w-3"})," Governance Engine"]}),o.jsxs("div",{className:"grid grid-cols-3 gap-2 text-center",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-lg font-bold text-foreground",children:e.governanceStats.totalEvaluations}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"evaluations"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-lg font-bold text-red-400",children:e.governanceStats.verdicts.block}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"blocked"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-lg font-bold text-green-400",children:e.governanceStats.verdicts.allow}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"allowed"})]})]}),o.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-muted-foreground",children:[o.jsxs("span",{children:[e.invariantCount," invariants"]}),o.jsx("span",{className:"text-border",children:"|"}),o.jsxs("span",{children:[e.gateCount," gates"]}),o.jsx("span",{className:"text-border",children:"|"}),o.jsxs("span",{children:[e.governanceStats.rulesFired," rules fired"]})]})]})]})}function ga({label:e,value:t,icon:n}){return o.jsxs("div",{className:"rounded-lg bg-background/50 px-3 py-2",children:[o.jsx("div",{className:"text-[10px] text-muted-foreground",children:e}),o.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[n,o.jsx("span",{className:"text-sm font-semibold text-foreground",children:t})]})]})}function p3({impact:e}){return o.jsxs("div",{className:"rounded-xl border border-primary/20 bg-primary/5 p-5 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Xr,{className:"h-4 w-4 text-primary"}),o.jsx("h4",{className:"text-xs font-bold uppercase tracking-[0.15em] text-primary",children:"Impact Delta"})]}),o.jsxs("div",{className:"grid grid-cols-3 gap-4 text-center",children:[o.jsx(md,{label:"Stability",value:e.stabilityDelta}),o.jsx(md,{label:"Cascade Risk",value:e.cascadeRiskDelta,invert:!0}),o.jsx(md,{label:"Volatility",value:e.volatilityDelta,invert:!0})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4 text-center border-t border-border/50 pt-3",children:[o.jsxs("div",{children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:e.totalInterventionsA}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"World A interventions"})]}),o.jsxs("div",{children:[o.jsx("div",{className:"text-2xl font-bold text-foreground",children:e.totalInterventionsB}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:"World B interventions"})]})]}),o.jsxs("div",{className:"space-y-2 border-t border-border/50 pt-3",children:[o.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Key Findings"}),o.jsx("ul",{className:"space-y-1",children:e.keyFindings.map((t,n)=>o.jsxs("li",{className:"flex items-start gap-2 text-xs text-foreground/80",children:[o.jsx("span",{className:"mt-1 block h-1 w-1 rounded-full bg-primary shrink-0"}),t]},n))})]}),o.jsx("div",{className:"rounded-lg bg-background/60 p-3",children:o.jsx("div",{className:"text-xs text-foreground/80 leading-relaxed",children:e.verdict})}),o.jsxs("div",{className:"text-[10px] text-muted-foreground/60 text-center",children:["Powered by ",e.poweredBy]})]})}function md({label:e,value:t,invert:n}){const r=parseFloat(t),s=n?r<0:r>0,i=n?r>0:r<0,a=r===0||isNaN(r);return o.jsxs("div",{children:[o.jsx("div",{className:$("text-xl font-bold",s&&"text-green-400",i&&"text-red-400",a&&"text-muted-foreground"),children:t}),o.jsx("div",{className:"text-[10px] text-muted-foreground",children:e})]})}const h3=()=>{const e=u3(),[t,n]=h.useState(()=>Vr()),[r,s]=h.useState(null),[i,a]=h.useState(null),[l,c]=h.useState(null),[d,u]=h.useState(null),[f,p]=h.useState(!1),[m,y]=h.useState(""),[g,b]=h.useState(null),x=h.useRef(null);[...t.map(E=>({id:E.id,title:E.name,thesis:E.world.thesis,invariantCount:E.world.invariants.length,gateCount:(E.world.gates??[]).length})),...e];const v=E=>{if(!E)return null;const R=t.find(P=>P.id===E);if(R){const P=R.world.invariants,T=R.world.gates??[],L=P.filter(V=>V.enforceable).length,I=P.length-L,F=T.filter(V=>V.severity==="critical"),O=T.filter(V=>V.severity==="warning");return{worldId:E,title:R.name,thesis:R.world.thesis,invariantSummary:P.length===0?"No invariants defined — ungoverned.":`${P.length} rules (${L} enforced, ${I} advisory): ${P.map(V=>V.description).join("; ")}`,gateSummary:T.length===0?"No viability gates — no collapse detection.":`${T.length} gates (${F.length} critical, ${O.length} warning)`,riskProfile:F.length>=2?"high":F.length>=1||O.length>=2?"moderate":"low"}}try{return f3(E)}catch{return null}},w=r&&i&&r!==i&&!f,S=h.useCallback(async()=>{if(!(!r||!i)){p(!0),c(null),u(null),y("Initializing worlds...");try{const E=await l3(r,i,{onProgress:(R,P)=>y(`${R}: ${P}...`)});c(E),u(m3(E)),y("")}catch(E){console.error("World comparison failed:",E),y("Comparison failed — check console for details.")}finally{p(!1)}}},[r,i]),N=h.useCallback((E,R)=>{const P=E==="A"?r:i;if(P)try{const T=No(P),L=vR(R,T.world,P,{description:`Saved from comparison: ${T.title}`,tags:["comparison"]});$h(L),n(Vr()),b(null)}catch(T){console.error("Failed to save world:",T)}},[r,i]),k=h.useCallback(E=>{pR(E),n(Vr()),r===E&&s(null),i===E&&a(null)},[r,i]),j=h.useCallback(()=>{if(!l||!d)return;const E={comparison:l,impact:d,exportedAt:new Date().toISOString()},R=new Blob([JSON.stringify(E,null,2)],{type:"application/json"}),P=URL.createObjectURL(R),T=document.createElement("a");T.href=P,T.download=`world-comparison-${l.worldA.id}-vs-${l.worldB.id}.json`,T.click(),URL.revokeObjectURL(P)},[l,d]),C=h.useCallback(E=>{var T;const R=(T=E.target.files)==null?void 0:T[0];if(!R)return;const P=new FileReader;P.onload=()=>{try{const L=gR(P.result);$h(L),n(Vr())}catch(L){console.error("Failed to import world:",L),alert(`Import failed: ${L instanceof Error?L.message:"Invalid file"}`)}},P.readAsText(R),E.target.value=""},[]);return h.useCallback(E=>{const R=t.find(I=>I.id===E);if(!R)return;const P=new Blob([hR(R)],{type:"application/json"}),T=URL.createObjectURL(P),L=document.createElement("a");L.href=T,L.download=`${R.name.replace(/\s+/g,"-").toLowerCase()}.nv-world.json`,L.click(),URL.revokeObjectURL(T)},[t]),o.jsx("section",{className:"border-t border-border py-10",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-5xl space-y-8",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(RC,{className:"h-5 w-5 text-primary"}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground",children:"Compare Worlds"}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Same agents, different rules. See how governance changes the outcome."})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("input",{ref:x,type:"file",accept:".json",onChange:C,className:"hidden"}),o.jsxs(re,{size:"sm",variant:"outline",className:"gap-1.5 text-xs",onClick:()=>{var E;return(E=x.current)==null?void 0:E.click()},children:[o.jsx(O0,{className:"h-3.5 w-3.5"}),"Import World"]})]})]}),o.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[o.jsx(ag,{label:"World A",selected:r,onSelect:s,presets:e,savedWorlds:t,explanation:v(r),disabled:f,onDeleteSaved:k}),o.jsx(ag,{label:"World B",selected:i,onSelect:E=>a(E===r?null:E),presets:e.filter(E=>E.id!==r),savedWorlds:t.filter(E=>E.id!==r),explanation:v(i),disabled:f,onDeleteSaved:k})]}),o.jsx("div",{className:"flex justify-center",children:o.jsx(re,{onClick:S,disabled:!w,size:"lg",className:"gap-2",children:f?o.jsxs(o.Fragment,{children:[o.jsx(Tr,{className:"h-4 w-4 animate-pulse"}),m||"Simulating..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Mo,{className:"h-4 w-4"}),"Run Comparison"]})})}),l&&d&&o.jsxs("div",{className:"space-y-6 animate-in fade-in-0 slide-in-from-bottom-4 duration-500",children:[o.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(cg,{side:l.worldA,label:"World A",color:"blue"}),g==="A"?o.jsx(lg,{worldId:l.worldA.id,onSave:E=>N("A",E),onCancel:()=>b(null)}):o.jsxs(re,{size:"sm",variant:"ghost",className:"w-full gap-1.5 text-xs text-muted-foreground",onClick:()=>b("A"),children:[o.jsx(vh,{className:"h-3.5 w-3.5"})," Save World A"]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(cg,{side:l.worldB,label:"World B",color:"amber"}),g==="B"?o.jsx(lg,{worldId:l.worldB.id,onSave:E=>N("B",E),onCancel:()=>b(null)}):o.jsxs(re,{size:"sm",variant:"ghost",className:"w-full gap-1.5 text-xs text-muted-foreground",onClick:()=>b("B"),children:[o.jsx(vh,{className:"h-3.5 w-3.5"})," Save World B"]})]})]}),o.jsx(p3,{impact:d}),o.jsx("div",{className:"flex justify-center",children:o.jsxs(re,{size:"sm",variant:"outline",className:"gap-1.5 text-xs",onClick:j,children:[o.jsx(R0,{className:"h-3.5 w-3.5"})," Export Comparison as JSON"]})})]})]})})})},g3=()=>o.jsxs("div",{className:"flex flex-col items-center justify-center py-20",children:[o.jsxs("div",{className:"relative mb-6 h-32 w-64 overflow-hidden rounded-lg border border-border bg-card",children:[[0,1,2].map(e=>o.jsx("div",{className:"absolute left-0 right-0 h-px bg-primary/60 scan-line",style:{animationDelay:`${e*.5}s`}},e)),o.jsx("div",{className:"absolute inset-0 grid grid-cols-8 grid-rows-4 gap-1 p-3",children:Array.from({length:32}).map((e,t)=>o.jsx("div",{className:"rounded-full bg-primary/20 animate-pulse",style:{animationDelay:`${t*50}ms`}},t))})]}),o.jsx("p",{className:"text-sm text-muted-foreground animate-pulse",children:"Building reasoning graph..."})]}),v3=()=>{const[e,t]=h.useState(!1);return h.useEffect(()=>{const n=()=>t(window.scrollY>400);return window.addEventListener("scroll",n,{passive:!0}),()=>window.removeEventListener("scroll",n)},[]),e?o.jsx(re,{size:"icon",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),className:"fixed bottom-6 right-6 z-50 rounded-full shadow-lg glow-teal animate-fade-in","aria-label":"Scroll to top",children:o.jsx(NC,{className:"h-5 w-5"})}):null},x3={severity:50,environmentalHostility:50,timePressure:50,regulatoryClimate:50},y3={timeHorizon:"",riskTolerance:"moderate",budget:""},b3={outcome:"",priority:"important",timeframe:"",successCriteria:[],redLines:[],availableLevers:[]},w3=()=>{const{theme:e,toggle:t}=gm(),n=h.useRef(null),r=h.useRef(null),s=h.useRef(null),[i,a]=h.useState(null),[l,c]=h.useState(""),[d,u]=h.useState(x3),[f,p]=h.useState([]),[m,y]=h.useState(y3),[g,b]=h.useState("full"),[x,v]=h.useState("explore"),[w,S]=h.useState(b3),[N,k]=h.useState(null),[j,C]=h.useState(null),[E,R]=h.useState(!1),[P,T]=h.useState(!1),[L,I]=h.useState(!1),[F,O]=h.useState(null),[V,_]=h.useState(null),[A,D]=h.useState(null),[Y,G]=h.useState(!1),[J,Z]=h.useState(!1),[me,be]=h.useState("deterministic");h.useEffect(()=>{if(window.location.hash.includes("capsule="))try{const Ne=N_(window.location.href);Ne&&(c(Ne.scenario),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},300))}catch{}},[]);const W=h.useCallback(()=>{var ee;(ee=n.current)==null||ee.scrollIntoView({behavior:"smooth"})},[]),ce=h.useCallback(()=>{var ee;(ee=r.current)==null||ee.scrollIntoView({behavior:"smooth"})},[]),xe=h.useCallback((ee,Ne)=>{c(ee),v("goal"),S(fe=>({...fe,outcome:Ne})),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},100)},[]),le=h.useCallback((ee,Ne)=>{c(`${ee}: ${Ne}`),setTimeout(()=>{var fe;return(fe=n.current)==null?void 0:fe.scrollIntoView({behavior:"smooth"})},100)},[]),z=h.useCallback(ee=>{a(ee),c(""),u(ee.defaultSliders),I(P)},[P]),X=h.useCallback(ee=>{c(ee),ee.trim()&&a(null)},[]),he=h.useCallback(ee=>{u(ee),P&&I(!0)},[P]),oe=h.useCallback(async()=>{R(!0),I(!1),O(null);try{const ee=i||l,Ne={stakeholders:f.length>0?f:void 0,constraints:m,depth:g,mode:x,goal:x==="goal"&&w.outcome.trim()?{outcome:w.outcome,priority:w.priority,timeframe:w.timeframe||void 0,success_criteria:w.successCriteria.length>0?w.successCriteria:void 0,red_lines:w.redLines.length>0?w.redLines:void 0,available_levers:w.availableLevers.length>0?w.availableLevers:void 0}:void 0},fe=await KR(ee,d,Ne);k(fe),T(!0),setTimeout(()=>{var ge;return(ge=s.current)==null?void 0:ge.scrollIntoView({behavior:"smooth",block:"start"})},100)}catch(ee){console.error("Reasoning engine error:",ee)}finally{R(!1)}},[i,l,d,f,m,g,x,w]),ft=h.useCallback(ee=>{R(!0),setTimeout(()=>{const Ne=c5(ee);C(Ne),k(Ne),R(!1),setTimeout(()=>{var fe;return(fe=s.current)==null?void 0:fe.scrollIntoView({behavior:"smooth",block:"start"})},100)},2e3)},[]),Ue=h.useCallback((ee,Ne)=>{if(!(N!=null&&N.goalResult))return;const fe=N.goalResult.strategies.find(At=>At.id===ee);if(!fe)return;const ge=fe.steps.map(At=>({...At,action:Ne.includes(At.lever)?At.action:`[DISABLED] ${At.action}`,expected_effect:Ne.includes(At.lever)?At.expected_effect:"Lever disabled — effect removed from path"})),Tt=Ne.length/Math.max(fe.levers_used.length,1);O({originalStrategy:fe,injectedEvent:{atStep:0,event:`Levers modified: ${Ne.join(", ")}`},forkedSteps:ge,probabilityDelta:(Tt-1)*fe.success_probability*.3,riskDelta:Tt<.5?"increased":fe.risk})},[N]),We=h.useCallback(ee=>{if(!(N!=null&&N.goalResult))return;const Ne=N.goalResult.strategies.find(ge=>ge.id===N.goalResult.recommended_strategy_id);if(!Ne)return;const fe=Ne.steps.filter(ge=>ge.order>ee.atStep+1).map(ge=>({...ge,action:`[ADAPTED] ${ge.action}`,expected_effect:`Modified by event: "${ee.event}" — ${ge.expected_effect}`}));fe.length===0&&fe.push({order:ee.atStep+2,action:"Reassess strategy in light of new event",timeframe:"Immediate",lever:"Assessment",expected_effect:"Determine whether original path is still viable",risk:"Delay in execution while reassessing"}),O({originalStrategy:Ne,injectedEvent:ee,forkedSteps:fe,probabilityDelta:-.1-Math.random()*.15,riskDelta:"elevated"})},[N]),Vt=h.useCallback(async()=>{var ee,Ne,fe,ge;if(N){G(!0);try{const{generateGovernedReport:Tt}=await pl(async()=>{const{generateGovernedReport:dn}=await import("./reportEngine-DKWTrP6-.js");return{generateGovernedReport:dn}},[]),{generateDeterministicReport:At}=await pl(async()=>{const{generateDeterministicReport:dn}=await Promise.resolve().then(()=>X_);return{generateDeterministicReport:dn}},void 0),we=N.governance,ps={scenario:l||(i==null?void 0:i.title)||"Simulation",rounds:[],metrics:{avgImpact:-.15,collapseProbability:((ee=we==null?void 0:we.neuroverse)==null?void 0:ee.collapseRisk)==="high"?.65:.25,stabilityScore:(((Ne=we==null?void 0:we.neuroverse)==null?void 0:Ne.worldHealthScore)??65)/100,maxVolatility:.45,peakNegativeSentiment:-.5},interventions:(we==null?void 0:we.enforcedConstraints)??[],governanceStats:{totalEvaluations:(we==null?void 0:we.constitutionalChecks.length)??0,blocks:(we==null?void 0:we.constitutionalChecks.filter(dn=>!dn.passed).length)??0,pauses:((fe=we==null?void 0:we.neuroverse)==null?void 0:fe.guardStatus)==="PAUSE"?1:0,allows:(we==null?void 0:we.constitutionalChecks.filter(dn=>dn.passed).length)??0,rulesFired:((ge=we==null?void 0:we.neuroverse)==null?void 0:ge.rulesFired)??0}},Vo=At(ps);_(Vo),D({result:Vo,actor:"ai_analyst",action:"generate_report",governed:!0,trace:{constraints:["must_reference_trace","must_include_blocked_actions","must_include_metrics","no_unverifiable_claims"],passed:!0,violations:[]}}),be(J?"ai":"deterministic")}catch(Tt){console.error("Report generation failed:",Tt)}finally{G(!1)}}},[N,J,l,i]),wt=!!(i||l.trim()),zo=wt&&!j,He=P&&N&&!E||j&&!E,Bo=(i==null?void 0:i.title)||l.slice(0,60)||"Custom Scenario";return o.jsxs("div",{className:"min-h-screen bg-background",children:[o.jsx(S5,{showSimulatedFuture:!!He,theme:e,onToggleTheme:t,isSimulating:E||!!He}),o.jsxs("main",{className:"pt-20",children:[o.jsx(E5,{onRunScenario:W,onPasteSimulation:ce}),o.jsx(A5,{onFullAnalysis:xe}),o.jsx(H5,{}),o.jsx("div",{ref:r,children:o.jsx(I5,{onExplain:ft,isLoading:E})}),o.jsx(X5,{onSelect:le}),o.jsx(o3,{}),o.jsx(q5,{}),o.jsx("div",{ref:n,children:o.jsx(J5,{onSelectScenario:z,onCustomScenario:X,onCalculate:oe,selectedId:(i==null?void 0:i.id)||null,customText:l,isLoading:E,hasScenario:wt})}),zo&&o.jsx("section",{className:"border-t border-border py-8",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsxs("div",{className:"mx-auto max-w-4xl space-y-6",children:[o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsx(JT,{mode:x,onChange:v}),o.jsx(XT,{})]}),x==="goal"&&o.jsx(ZT,{values:w,onChange:S}),o.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[o.jsx(HT,{stakeholders:f,onChange:p}),o.jsx(YT,{values:m,onChange:y})]}),o.jsx(QT,{value:g,onChange:b}),o.jsx(yP,{values:d,onChange:he,showRecalculate:L,onRecalculate:oe})]})})}),E&&o.jsx(g3,{}),o.jsx("div",{ref:s}),j&&!E&&o.jsx(U5,{result:j}),He&&N&&o.jsx("section",{className:"border-t border-border py-6",children:o.jsx("div",{className:"container mx-auto px-6",children:o.jsx("div",{className:"mx-auto max-w-5xl",children:o.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx("h2",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary",children:"SIMULATED FUTURE"}),N.confidence&&o.jsx(tA,{confidence:N.confidence})]}),N.lastRequest&&o.jsx($A,{request:N.lastRequest,title:Bo})]})})})}),He&&(N==null?void 0:N.keyAssumptions)&&o.jsx(rA,{assumptions:N.keyAssumptions}),He&&N&&o.jsx(kA,{result:N}),He&&N&&o.jsx(CA,{challenges:N.challenges}),He&&N&&o.jsx(EA,{recommendations:N.recommendations}),He&&(N==null?void 0:N.goalResult)&&o.jsx(MA,{goalResult:N.goalResult,onForkStrategy:Ue}),He&&(N==null?void 0:N.goalResult)&&o.jsx(LA,{strategy:N.goalResult.strategies.find(ee=>ee.id===N.goalResult.recommended_strategy_id)||N.goalResult.strategies[0],onInjectEvent:We,forkedTimeline:F}),He&&(N==null?void 0:N.governance)&&o.jsx(VA,{governance:N.governance}),o.jsx(h3,{}),He&&N&&o.jsx(UA,{report:V,governance:A,isGenerating:Y,aiEnabled:J,provider:me,onGenerate:Vt,onToggleAI:Z})]}),o.jsx(v3,{}),o.jsx(N5,{governance:He&&(N!=null&&N.governance)?N.governance:void 0})]})};function S3(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var _m="ScrollArea",[Fw,aI]=zt(_m),[N3,Bt]=Fw(_m),zw=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:s,scrollHideDelay:i=600,...a}=e,[l,c]=h.useState(null),[d,u]=h.useState(null),[f,p]=h.useState(null),[m,y]=h.useState(null),[g,b]=h.useState(null),[x,v]=h.useState(0),[w,S]=h.useState(0),[N,k]=h.useState(!1),[j,C]=h.useState(!1),E=ie(t,P=>c(P)),R=Lo(s);return o.jsx(N3,{scope:n,type:r,dir:R,scrollHideDelay:i,scrollArea:l,viewport:d,onViewportChange:u,content:f,onContentChange:p,scrollbarX:m,onScrollbarXChange:y,scrollbarXEnabled:N,onScrollbarXEnabledChange:k,scrollbarY:g,onScrollbarYChange:b,scrollbarYEnabled:j,onScrollbarYEnabledChange:C,onCornerWidthChange:v,onCornerHeightChange:S,children:o.jsx(Q.div,{dir:R,...a,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});zw.displayName=_m;var Bw="ScrollAreaViewport",Vw=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:s,...i}=e,a=Bt(Bw,n),l=h.useRef(null),c=ie(t,l,a.onViewportChange);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),o.jsx(Q.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:o.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Vw.displayName=Bw;var Pn="ScrollAreaScrollbar",Rm=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Bt(Pn,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=s,l=e.orientation==="horizontal";return h.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),s.type==="hover"?o.jsx(k3,{...r,ref:t,forceMount:n}):s.type==="scroll"?o.jsx(j3,{...r,ref:t,forceMount:n}):s.type==="auto"?o.jsx(Uw,{...r,ref:t,forceMount:n}):s.type==="always"?o.jsx(Pm,{...r,ref:t}):null});Rm.displayName=Pn;var k3=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Bt(Pn,e.__scopeScrollArea),[i,a]=h.useState(!1);return h.useEffect(()=>{const l=s.scrollArea;let c=0;if(l){const d=()=>{window.clearTimeout(c),a(!0)},u=()=>{c=window.setTimeout(()=>a(!1),s.scrollHideDelay)};return l.addEventListener("pointerenter",d),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",d),l.removeEventListener("pointerleave",u)}}},[s.scrollArea,s.scrollHideDelay]),o.jsx(Yn,{present:n||i,children:o.jsx(Uw,{"data-state":i?"visible":"hidden",...r,ref:t})})}),j3=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Bt(Pn,e.__scopeScrollArea),i=e.orientation==="horizontal",a=gc(()=>c("SCROLL_END"),100),[l,c]=S3("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return h.useEffect(()=>{if(l==="idle"){const d=window.setTimeout(()=>c("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(d)}},[l,s.scrollHideDelay,c]),h.useEffect(()=>{const d=s.viewport,u=i?"scrollLeft":"scrollTop";if(d){let f=d[u];const p=()=>{const m=d[u];f!==m&&(c("SCROLL"),a()),f=m};return d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[s.viewport,i,c,a]),o.jsx(Yn,{present:n||l!=="hidden",children:o.jsx(Pm,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:K(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:K(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),Uw=h.forwardRef((e,t)=>{const n=Bt(Pn,e.__scopeScrollArea),{forceMount:r,...s}=e,[i,a]=h.useState(!1),l=e.orientation==="horizontal",c=gc(()=>{if(n.viewport){const d=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?d:u)}},10);return fi(n.viewport,c),fi(n.content,c),o.jsx(Yn,{present:r||i,children:o.jsx(Pm,{"data-state":i?"visible":"hidden",...s,ref:t})})}),Pm=h.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,s=Bt(Pn,e.__scopeScrollArea),i=h.useRef(null),a=h.useRef(0),[l,c]=h.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=Yw(l.viewport,l.content),u={...r,sizes:l,onSizesChange:c,hasThumb:d>0&&d<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:p=>a.current=p};function f(p,m){return T3(p,a.current,l,m)}return n==="horizontal"?o.jsx(C3,{...u,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const p=s.viewport.scrollLeft,m=dg(p,l,s.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollLeft=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollLeft=f(p,s.dir))}}):n==="vertical"?o.jsx(E3,{...u,ref:t,onThumbPositionChange:()=>{if(s.viewport&&i.current){const p=s.viewport.scrollTop,m=dg(p,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:p=>{s.viewport&&(s.viewport.scrollTop=p)},onDragScroll:p=>{s.viewport&&(s.viewport.scrollTop=f(p))}}):null}),C3=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=Bt(Pn,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),d=ie(t,c,i.onScrollbarXChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(Hw,{"data-orientation":"horizontal",...s,ref:d,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":hc(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),Qw(p,f)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:bl(a.paddingLeft),paddingEnd:bl(a.paddingRight)}})}})}),E3=h.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...s}=e,i=Bt(Pn,e.__scopeScrollArea),[a,l]=h.useState(),c=h.useRef(null),d=ie(t,c,i.onScrollbarYChange);return h.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),o.jsx(Hw,{"data-orientation":"vertical",...s,ref:d,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":hc(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),Qw(p,f)&&u.preventDefault()}},onResize:()=>{c.current&&i.viewport&&a&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:bl(a.paddingTop),paddingEnd:bl(a.paddingBottom)}})}})}),[_3,Ww]=Fw(Pn),Hw=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:s,onThumbChange:i,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:d,onWheelScroll:u,onResize:f,...p}=e,m=Bt(Pn,n),[y,g]=h.useState(null),b=ie(t,E=>g(E)),x=h.useRef(null),v=h.useRef(""),w=m.viewport,S=r.content-r.viewport,N=ze(u),k=ze(c),j=gc(f,10);function C(E){if(x.current){const R=E.clientX-x.current.left,P=E.clientY-x.current.top;d({x:R,y:P})}}return h.useEffect(()=>{const E=R=>{const P=R.target;(y==null?void 0:y.contains(P))&&N(R,S)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[w,y,S,N]),h.useEffect(k,[r,k]),fi(y,j),fi(m.content,j),o.jsx(_3,{scope:n,scrollbar:y,hasThumb:s,onThumbChange:ze(i),onThumbPointerUp:ze(a),onThumbPositionChange:k,onThumbPointerDown:ze(l),children:o.jsx(Q.div,{...p,ref:b,style:{position:"absolute",...p.style},onPointerDown:K(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),x.current=y.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),C(E))}),onPointerMove:K(e.onPointerMove,C),onPointerUp:K(e.onPointerUp,E=>{const R=E.target;R.hasPointerCapture(E.pointerId)&&R.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=v.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})})}),yl="ScrollAreaThumb",Gw=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Ww(yl,e.__scopeScrollArea);return o.jsx(Yn,{present:n||s.hasThumb,children:o.jsx(R3,{ref:t,...r})})}),R3=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...s}=e,i=Bt(yl,n),a=Ww(yl,n),{onThumbPositionChange:l}=a,c=ie(t,f=>a.onThumbChange(f)),d=h.useRef(void 0),u=gc(()=>{d.current&&(d.current(),d.current=void 0)},100);return h.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(u(),!d.current){const m=A3(f,l);d.current=m,l()}};return l(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,u,l]),o.jsx(Q.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:K(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),y=f.clientX-m.left,g=f.clientY-m.top;a.onThumbPointerDown({x:y,y:g})}),onPointerUp:K(e.onPointerUp,a.onThumbPointerUp)})});Gw.displayName=yl;var Tm="ScrollAreaCorner",Kw=h.forwardRef((e,t)=>{const n=Bt(Tm,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(P3,{...e,ref:t}):null});Kw.displayName=Tm;var P3=h.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,s=Bt(Tm,n),[i,a]=h.useState(0),[l,c]=h.useState(0),d=!!(i&&l);return fi(s.scrollbarX,()=>{var f;const u=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(u),c(u)}),fi(s.scrollbarY,()=>{var f;const u=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(u),a(u)}),d?o.jsx(Q.div,{...r,ref:t,style:{width:i,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function bl(e){return e?parseInt(e,10):0}function Yw(e,t){const n=e/t;return isNaN(n)?0:n}function hc(e){const t=Yw(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function T3(e,t,n,r="ltr"){const s=hc(n),i=s/2,a=t||i,l=s-a,c=n.scrollbar.paddingStart+a,d=n.scrollbar.size-n.scrollbar.paddingEnd-l,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return qw([c,d],f)(e)}function dg(e,t,n="ltr"){const r=hc(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-s,a=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],d=So(e,c);return qw([0,a],[0,l])(d)}function qw(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Qw(e,t){return e>0&&e<t}var A3=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function s(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&t(),n=i,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function gc(e,t){const n=ze(e),r=h.useRef(0);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),h.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function fi(e,t){const n=ze(t);Ve(()=>{let r=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return s.observe(e),()=>{window.cancelAnimationFrame(r),s.unobserve(e)}}},[e,n])}var Xw=zw,I3=Vw,M3=Kw;const Jw=h.forwardRef(({className:e,children:t,...n},r)=>o.jsxs(Xw,{ref:r,className:$("relative overflow-hidden",e),...n,children:[o.jsx(I3,{className:"h-full w-full rounded-[inherit]",children:t}),o.jsx(Zw,{}),o.jsx(M3,{})]}));Jw.displayName=Xw.displayName;const Zw=h.forwardRef(({className:e,orientation:t="vertical",...n},r)=>o.jsx(Rm,{ref:r,orientation:t,className:$("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:o.jsx(Gw,{className:"relative flex-1 rounded-full bg-border"})}));Zw.displayName=Rm.displayName;var O3="Separator",ug="horizontal",L3=["horizontal","vertical"],e1=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=ug,...s}=e,i=$3(r)?r:ug,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return o.jsx(Q.div,{"data-orientation":i,...l,...s,ref:t})});e1.displayName=O3;function $3(e){return L3.includes(e)}var t1=e1;const ws=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},s)=>o.jsx(t1,{ref:s,decorative:n,orientation:t,className:$("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));ws.displayName=t1.displayName;function fg(e,t){const n=e.map(f=>f.impact),r=n.reduce((f,p)=>f+p,0)/n.length,s=n.reduce((f,p)=>f+(p-r)**2,0)/n.length,i=n.filter(f=>f>.2).length,a=n.filter(f=>f<-.2).length,l=n.length,c=l>0?Math.min(1,Math.min(i,a)/(l*.5)*(s*4)):0,d=n.filter(f=>f<0).reduce((f,p)=>f+Math.abs(p),0)/Math.max(1,n.length),u=Math.min(1,d*1.5);return{polarization:c,outrage:u,avgImpact:r,variance:s}}function Lr(e,t,n=3){if(e.length<2)return"stable";const r=e.slice(-n);if(r.length<2)return"stable";const s=r[0][t],a=r[r.length-1][t]-s;return a>.1?"rising":a<-.1?"falling":"stable"}function D3(e){const t=os(e),n=[];let r=0;for(const s of t.rules){const i=s.description.toLowerCase();(i.includes("spread")||i.includes("propagat")||i.includes("viral")||i.includes("limit reach")||i.includes("contain")||i.includes("quarantine"))&&n.push({id:`DYN-PROP-${++r}`,description:s.description,type:"propagation",threshold:.6,strength:s.category==="prohibit"?.8:s.category==="limit"?.5:.3,monitors:"informationVelocity",active:!0}),(i.includes("amplif")||i.includes("media")||i.includes("influence")||i.includes("boost")||i.includes("visibil")||i.includes("platform"))&&n.push({id:`DYN-AMP-${++r}`,description:s.description,type:"amplification",threshold:.5,strength:s.category==="prohibit"?.7:.4,monitors:"amplification",active:!0}),(i.includes("cascade")||i.includes("circuit")||i.includes("runaway")||i.includes("feedback")||i.includes("spiral")||i.includes("chain reaction")||i.includes("contagion")||i.includes("panic"))&&n.push({id:`DYN-CASC-${++r}`,description:s.description,type:"cascade",threshold:.7,strength:.9,monitors:"cascadeRisk",active:!0}),(i.includes("trust")||i.includes("legitim")||i.includes("credib")||i.includes("transparen")||i.includes("accountab")||i.includes("institution"))&&n.push({id:`DYN-TRUST-${++r}`,description:s.description,type:"trust",threshold:.4,strength:.5,monitors:"trust",active:!0}),(i.includes("dampen")||i.includes("cool")||i.includes("de-escalat")||i.includes("moderate")||i.includes("calm")||i.includes("stabiliz"))&&n.push({id:`DYN-FEED-${++r}`,description:s.description,type:"feedback",threshold:.5,strength:.6,monitors:"outrage",active:!0}),(i.includes("pause")||i.includes("halt")||i.includes("freeze")||i.includes("cooling")||i.includes("moratorium")||i.includes("waiting period"))&&n.push({id:`DYN-COOL-${++r}`,description:s.description,type:"cooling",threshold:.7,strength:.8,monitors:"outrage",active:!0})}return n.length===0&&n.push({id:"DYN-BASE-1",description:"Default propagation control — limit information spread during high outrage",type:"propagation",threshold:.7,strength:.4,monitors:"informationVelocity",active:!0},{id:"DYN-BASE-2",description:"Default cascade protection — activate circuit breaker during crisis",type:"cascade",threshold:.8,strength:.7,monitors:"cascadeRisk",active:!0}),n}function F3(e,t,n){const r=n!=null&&n.skipRules?[]:D3(e);let s={polarization:.1,outrage:.1,trust:.7,informationVelocity:.3,amplification:1,cascadeRisk:.1,contagionDepth:2,coolingPeriod:0,history:[],...t};const i={totalRounds:0,totalInterventions:0,propagationLimits:0,amplificationDampens:0,cascadeBreakers:0,coolingPeriods:0,trustBoosts:0,peakOutrage:0,peakPolarization:0,peakCascadeRisk:0,trustSum:0};function a(c,d,u){i.totalRounds++;const f=[],p=[],m=c.map(v=>({...v})),y=fg(c);if(s.polarization=s.polarization*.6+y.polarization*.4,s.outrage=s.outrage*.5+y.outrage*.5,s.informationVelocity=Math.min(1,.3+y.variance*2),s.cascadeRisk=Math.min(1,s.outrage*.3+s.polarization*.2+s.informationVelocity*.2+(1-s.trust)*.3),s.outrage>.5?s.trust=Math.max(.05,s.trust-.05*s.outrage):s.outrage<.2&&(s.trust=Math.min(1,s.trust+.02)),i.peakOutrage=Math.max(i.peakOutrage,s.outrage),i.peakPolarization=Math.max(i.peakPolarization,s.polarization),i.peakCascadeRisk=Math.max(i.peakCascadeRisk,s.cascadeRisk),i.trustSum+=s.trust,s.coolingPeriod>0){const v=.4+s.coolingPeriod*.1;for(const w of m)w.impact<-.1&&(w.impact,w.impact=w.impact*(1-v),w.confidence=Math.max(.1,w.confidence*.7));f.push({type:"COOLING_PERIOD",description:`Cooling period active (${s.coolingPeriod} rounds remaining) — reactive posting dampened by ${(v*100).toFixed(0)}%`,triggeredBy:"COOLING_PERIOD",agentsAffected:m.filter(w=>w.impact<-.1).length,magnitude:v,effect:{metric:"outrage",before:s.outrage,after:s.outrage*(1-v*.3)}}),s.coolingPeriod--,i.coolingPeriods++}for(const v of r)if(v.active)switch(s[v.monitors],v.type){case"propagation":{if(s.informationVelocity>v.threshold||s.outrage>.6){const w=1-v.strength*.5;let S=0;const N=s.contagionDepth;s.contagionDepth=Math.max(1,Math.floor(s.contagionDepth*w));for(const k of m)Math.abs(k.impact)>.4&&(k.impact,k.impact=k.impact*w,S++);if(S>0){const k=s.informationVelocity;s.informationVelocity*=w,f.push({type:"PROPAGATION_LIMIT",description:`Propagation limited: spread depth ${N} → ${s.contagionDepth}, ${S} extreme agents dampened (${v.description})`,triggeredBy:v.id,agentsAffected:S,magnitude:v.strength,effect:{metric:"informationVelocity",before:k,after:s.informationVelocity}}),p.push(v.id),i.propagationLimits++,i.totalInterventions++}}break}case"amplification":{const w=Lr(s.history,"polarization");if(s.polarization>v.threshold||w==="rising"){const S=1-v.strength*.4;let N=0;for(const k of m){const j=(u==null?void 0:u.get(k.stakeholder_id))??"";(j.toLowerCase().includes("media")||j.toLowerCase().includes("influencer")||k.stakeholder_id.toLowerCase().includes("media")||k.stakeholder_id.toLowerCase().includes("记者")||k.stakeholder_id.toLowerCase().includes("媒")||Math.abs(k.impact)>.6)&&(k.impact,k.impact=k.impact*S,k.confidence=Math.max(.15,k.confidence*.8),N++)}if(N>0){const k=s.amplification;s.amplification*=S,f.push({type:"AMPLIFICATION_DAMPEN",description:`Amplification dampened: ${N} high-influence agents reduced by ${((1-S)*100).toFixed(0)}% (polarization ${s.polarization.toFixed(2)}, trend: ${w}) — ${v.description}`,triggeredBy:v.id,agentsAffected:N,magnitude:v.strength,effect:{metric:"amplification",before:k,after:s.amplification}}),p.push(v.id),i.amplificationDampens++,i.totalInterventions++}}break}case"cascade":{if(s.cascadeRisk>v.threshold){const w=Lr(s.history,"outrage")==="rising",S=w?v.strength:v.strength*.6;let N=0;for(const j of m)j.impact<-.15&&(j.impact,j.impact=j.impact*(1-S),j.confidence=Math.max(.1,j.confidence*(1-S*.5)),N++);s.coolingPeriod===0&&w&&(s.coolingPeriod=2);const k=s.cascadeRisk;s.cascadeRisk*=1-S*.4,f.push({type:"CASCADE_BREAKER",description:`CASCADE CIRCUIT BREAKER: ${N} agents compressed, cascade risk ${k.toFixed(2)} → ${s.cascadeRisk.toFixed(2)}${w?" + cooling period activated":""} — ${v.description}`,triggeredBy:v.id,agentsAffected:N,magnitude:S,effect:{metric:"cascadeRisk",before:k,after:s.cascadeRisk}}),p.push(v.id),i.cascadeBreakers++,i.totalInterventions++}break}case"trust":{if(s.trust<v.threshold){let w=0;for(const S of m){const N=(u==null?void 0:u.get(S.stakeholder_id))??"",k=N.toLowerCase().includes("official")||N.toLowerCase().includes("government")||N.toLowerCase().includes("institution")||S.stakeholder_id.toLowerCase().includes("regulator")||S.stakeholder_id.toLowerCase().includes("central")||S.stakeholder_id.toLowerCase().includes("official")||S.stakeholder_id.toLowerCase().includes("管理")||S.stakeholder_id.toLowerCase().includes("官方");k&&S.impact>-.2?(S.impact,S.impact=Math.min(1,S.impact*1.3+.1),S.confidence=Math.min(1,S.confidence*1.2),w++):!k&&S.impact<-.3&&(S.impact=S.impact*.7,w++)}if(w>0){const S=s.trust;s.trust=Math.min(1,s.trust+.03*v.strength),f.push({type:"TRUST_BOOST",description:`Trust-responsive visibility: official sources boosted, unverified claims dampened (trust ${S.toFixed(2)} → ${s.trust.toFixed(2)}) — ${v.description}`,triggeredBy:v.id,agentsAffected:w,magnitude:v.strength,effect:{metric:"trust",before:S,after:s.trust}}),p.push(v.id),i.trustBoosts++,i.totalInterventions++}}break}case"feedback":{const w=Lr(s.history,"outrage");if(s.outrage>v.threshold&&w==="rising"){const S=1-v.strength*.35;let N=0;for(const k of m)Math.abs(k.impact)>.2&&(k.impact,k.impact=k.impact*S,N++);if(N>0){const k=s.outrage;s.outrage*=S,f.push({type:"FEEDBACK_DAMPEN",description:`Feedback loop dampened: ${N} reactive agents moderated, outrage ${k.toFixed(2)} → ${s.outrage.toFixed(2)} (trend: ${w}) — ${v.description}`,triggeredBy:v.id,agentsAffected:N,magnitude:v.strength,effect:{metric:"outrage",before:k,after:s.outrage}}),p.push(v.id),i.totalInterventions++}}break}case"cooling":{s.outrage>v.threshold&&s.coolingPeriod===0&&(s.coolingPeriod=Math.ceil(v.strength*3),f.push({type:"COOLING_PERIOD",description:`Cooling period triggered: ${s.coolingPeriod} round(s) of dampened reactive posting (outrage: ${s.outrage.toFixed(2)}) — ${v.description}`,triggeredBy:v.id,agentsAffected:0,magnitude:v.strength,effect:{metric:"outrage",before:s.outrage,after:s.outrage}}),p.push(v.id),i.coolingPeriods++,i.totalInterventions++);break}}for(const v of m)v.impact=Math.max(-1,Math.min(1,v.impact)),v.impact=Number(v.impact.toFixed(3)),v.confidence=Math.max(.05,Math.min(1,v.confidence)),v.confidence=Number(v.confidence.toFixed(3));const g=fg(m);s.history.push({round:d,polarization:Number(s.polarization.toFixed(3)),outrage:Number(s.outrage.toFixed(3)),trust:Number(s.trust.toFixed(3)),amplification:Number(s.amplification.toFixed(3)),cascadeRisk:Number(s.cascadeRisk.toFixed(3)),avgImpact:Number(g.avgImpact.toFixed(3)),agentCount:m.length});let b;s.coolingPeriod>0?b="cooling":s.cascadeRisk>.7?b="critical":Lr(s.history,"outrage")==="rising"||Lr(s.history,"polarization")==="rising"?b="escalating":Lr(s.history,"outrage")==="falling"&&Lr(s.history,"polarization")==="falling"?b="de-escalating":b="stable";const x=Math.min(1,s.cascadeRisk*.4+s.outrage*.3+s.polarization*.2+s.informationVelocity*.1);return{reactions:m,systemState:{...s,history:[...s.history]},interventions:f,rulesFired:p,trajectory:b,predictedRisk:Number(x.toFixed(3))}}function l(){s={polarization:.1,outrage:.1,trust:.7,informationVelocity:.3,amplification:1,cascadeRisk:.1,contagionDepth:2,coolingPeriod:0,history:[],...t},i.totalRounds=0,i.totalInterventions=0,i.propagationLimits=0,i.amplificationDampens=0,i.cascadeBreakers=0,i.coolingPeriods=0,i.trustBoosts=0,i.peakOutrage=0,i.peakPolarization=0,i.peakCascadeRisk=0,i.trustSum=0}return{governRound:a,get state(){return{...s,history:[...s.history]}},mutateState(c){c(s)},get rules(){return[...r]},get stats(){return{totalRounds:i.totalRounds,totalInterventions:i.totalInterventions,propagationLimits:i.propagationLimits,amplificationDampens:i.amplificationDampens,cascadeBreakers:i.cascadeBreakers,coolingPeriods:i.coolingPeriods,trustBoosts:i.trustBoosts,peakOutrage:i.peakOutrage,peakPolarization:i.peakPolarization,peakCascadeRisk:i.peakCascadeRisk,averageTrust:i.totalRounds>0?Number((i.trustSum/i.totalRounds).toFixed(3)):.7}},reset:l}}const Oa=["Limit propagation of causal claims that lack multi-source evidence","Contain unvalidated hypotheses within originating research group","Quarantine findings that have not passed independent reproduction","Dampen amplification of self-citation loops exceeding 3 generations","Limit influence of popular findings that lack independent validation","Reduce visibility of papers with high citation velocity but low reproduction rate","Circuit break when cascade of dependent findings exceeds validation capacity","Halt chain reaction of derivative conclusions from unvalidated premises","Break feedback loops between competing research groups amplifying each other","Boost visibility of independently reproduced findings","Require transparency in methodology for all published artifacts","Prioritize credibility of findings with transparent provenance chains","Dampen rush-to-publish behavior during high-competition periods","Cool down reactive publication patterns when controversy index rises","Stabilize publication rate during peer review bottlenecks","Pause redundant investigation paths when convergence detected","Halt compute-intensive explorations that show no evidence of progress"].join(`
|
|
519
|
+
`),z3={polarization:.15,outrage:.05,trust:.8,informationVelocity:.4,amplification:.6,cascadeRisk:.05,contagionDepth:3,coolingPeriod:0};function pd(e){const t=e.polarization>.6?"critical":e.polarization>.3?"elevated":"healthy",n=e.outrage>.5?"dangerous":e.outrage>.2?"elevated":"normal",r=e.trust>.7?"high":e.trust>.4?"moderate":"crisis",s=e.amplification>1.5?"echo chamber":e.amplification>.8?"amplified":"organic",i=e.cascadeRisk>.5?"high":e.cascadeRisk>.2?"moderate":"controlled",a=e.informationVelocity>.7?"frantic":e.informationVelocity>.3?"active":"stalled";let l;return e.trust>.6&&e.cascadeRisk<.3&&e.polarization<.4?l="Healthy discovery — findings are converging with evidence support":e.cascadeRisk>.6?l="False positive cascade risk — unvalidated findings propagating through citations":e.polarization>.6?l="Field fragmentation — competing hypotheses without resolution mechanism":e.trust<.3?l="Reproducibility crisis — institutional credibility collapsing":l="Active investigation — governance maintaining discovery quality",{hypothesisFragmentation:`${t} (${(e.polarization*100).toFixed(0)}%)`,publicationPressure:`${n} (${(e.outrage*100).toFixed(0)}%)`,reproducibilityConfidence:`${r} (${(e.trust*100).toFixed(0)}%)`,citationHealth:`${s} (${e.amplification.toFixed(2)}x)`,falsePositiveRisk:`${i} (${(e.cascadeRisk*100).toFixed(0)}%)`,discoveryVelocity:`${a} (${(e.informationVelocity*100).toFixed(0)}%)`,overallAssessment:l}}function B3(e){let t;switch(e.type){case"hypothesis":t="publish_hypothesis";break;case"experiment":t="run_experiment";break;case"dataset":t="publish_dataset";break;case"model":t="publish_model";break;case"paper":t="publish_paper";break;case"review":t="publish_review";break;case"replication":t="publish_replication";break;default:t="publish";break}const n=Math.min(1,e.citations/10),r=e.confidence*.6+n*.4;return{agentId:e.agentId,type:t,description:e.description,magnitude:Number(r.toFixed(3)),context:{artifactId:e.id,artifactType:e.type,provenance:e.provenance,reproduced:e.reproduced,citations:e.citations,skill:e.skill}}}function mg(e,t,n=!0){const r=new Map;for(const s of t)for(const i of s.artifactIds){const a=r.get(i)??0,l=s.matchType==="confirmation"?s.strength*.3:s.matchType==="contradiction"?-s.strength*.2:s.matchType==="synthesis"?s.strength*.4:s.strength*.15;r.set(i,a+l)}return e.map(s=>{const i=Math.min(.2,s.provenance.length*.05),a=s.reproduced?.15:0,l=r.get(s.id)??0;let c=s.confidence-.3+i+a+l;!s.reproduced&&s.citations>5&&(c-=.2);const d=s.provenance.filter(u=>e.some(f=>f.id===u&&f.agentId===s.agentId)).length;return d>1&&(c-=d*.1),n||(s.reproduced||(c*=1.4,s.confidence<.5&&(c-=.25)),s.provenance.length===0&&s.type!=="hypothesis"&&(c-=.2),!s.reproduced&&s.citations>3&&(c-=.15)),c=Math.max(-1,Math.min(1,c)),{stakeholder_id:s.agentId,reaction:`[${s.type}] ${s.description}`,confidence:n?s.confidence:Math.max(.1,s.confidence*.85),impact:Number(c.toFixed(3)),trigger:s.provenance.length>0?`builds on ${s.provenance.length} prior artifact(s)`:"novel investigation"}})}function V3(e,t,n){const r=e.history;if(r.length<n+1)return{detected:!1,assessment:"Insufficient data for convergence detection"};const s=r.slice(-n);let i=!0;for(let d=1;d<s.length;d++){const u=Math.abs(s[d].trust-s[d-1].trust),f=Math.abs(s[d].polarization-s[d-1].polarization),p=Math.abs(s[d].outrage-s[d-1].outrage);if(u>t||f>t||p>t){i=!1;break}}if(i&&e.trust>.5&&e.cascadeRisk<.3)return{detected:!0,assessment:`Convergence detected: system stable for ${n} cycles with trust ${(e.trust*100).toFixed(0)}% and cascade risk ${(e.cascadeRisk*100).toFixed(0)}%`};if(i&&e.trust<=.5)return{detected:!1,assessment:`Metrics stable but trust too low (${(e.trust*100).toFixed(0)}%) — may be converging on noise`};if(i&&e.cascadeRisk>=.3)return{detected:!1,assessment:`Metrics stable but cascade risk elevated (${(e.cascadeRisk*100).toFixed(0)}%) — false positive risk persists`};const a=[],l=s[0],c=s[s.length-1];return c.trust>l.trust+t&&a.push("trust improving"),c.trust<l.trust-t&&a.push("trust declining"),c.polarization>l.polarization+t&&a.push("fragmentation increasing"),c.outrage>l.outrage+t&&a.push("publication pressure rising"),{detected:!1,assessment:a.length>0?`Active dynamics: ${a.join(", ")}`:"System in flux — no clear convergence trend"}}function U3(e,t,n){const r=[];e.cascadeRisk>.5&&r.push("FALSE_POSITIVE_CASCADE: unvalidated findings propagating through citation chains"),e.polarization>.5&&r.push("HYPOTHESIS_FRAGMENTATION: competing theories splitting without resolution"),e.trust<.3&&r.push("REPRODUCIBILITY_CRISIS: institutional credibility collapsing"),e.outrage>.5&&r.push("PUBLICATION_PRESSURE: agents rushing to publish without adequate validation"),e.amplification>1.5&&r.push("CITATION_ECHO_CHAMBER: popular findings amplified beyond evidence support");const s=t.filter(a=>!a.reproduced&&a.citations>5);return s.length>0&&r.push(`UNVALIDATED_POPULAR: ${s.length} highly-cited artifact(s) lack reproduction`),n.filter(a=>a.matchType==="contradiction").length>t.length*.3&&r.push("HIGH_CONTRADICTION_RATE: >30% of reactor matches are contradictions"),r}function hd(e={}){const t=e.policyText??Oa,n=e.maxCycles??50,r=e.convergenceThreshold??.05,s=e.convergenceWindow??3,i=t.trim().length>0,a=$y({policyText:t,sensitivity:.5}),l=F3(i?t:"",{...z3,...e.initialState},i?void 0:{skipRules:!0});let c=0;const d={total:0,approved:0,blocked:0,modified:0};function u(y){var k;const g=B3(y),b=l.state,x={volatility:b.outrage*100,liquidity:b.trust*100,polarization:b.polarization*100,cascade_risk:b.cascadeRisk*100},v=a.evaluate(g,x);switch(d.total++,v.status){case"ALLOW":d.approved++;break;case"BLOCK":d.blocked++;break;case"MODIFY":d.modified++;break;case"PAUSE":d.modified++;break}const w=[];let S=v.reason;!y.reproduced&&y.citations>3&&w.push("High citations without reproduction"),y.provenance.length===0&&y.type!=="hypothesis"&&w.push("No provenance chain — orphan artifact"),y.confidence<.3&&w.push("Low confidence artifact"),v.status==="BLOCK"?S=`Artifact blocked: ${y.type} from ${y.agentId} — ${v.reason}`:v.status==="MODIFY"&&(S=`Artifact modified: ${y.type} impact reduced — ${v.reason}`);const N={artifactId:y.id,verdict:v,scienceReason:S,riskFlags:w};return(k=e.onArtifact)==null||k.call(e,y,N),N}function f(y,g,b){var I,F;c++;let x=0,v=0,w=0;const S=[],N=new Set;for(const O of y){const V=u(O);V.verdict.status==="ALLOW"?(x++,S.push(O)):V.verdict.status==="BLOCK"?(v++,N.add(O.id)):(w++,S.push(O))}const k=g.filter(O=>!O.artifactIds.some(V=>N.has(V))),j=i?mg(S,k,!0):mg(y,g,!1);if(i&&y.length>0){const O=v/y.length;l.mutateState(V=>{O>0&&(V.informationVelocity=Math.max(.05,V.informationVelocity*(1-O*.5))),O>.1&&(V.trust=Math.min(1,V.trust+O*.08)),O>.1&&(V.cascadeRisk=Math.max(0,V.cascadeRisk-O*.12))})}if(b){const O=l.state;b.controversyIndex>.3&&(O.outrage=Math.min(1,O.outrage+b.controversyIndex*.1)),b.commentActivity>.5&&(O.informationVelocity=Math.min(1,O.informationVelocity+b.commentActivity*.05))}const C=l.governRound(j,c);if(!i){const V=y.filter(D=>!D.reproduced).length/Math.max(1,y.length),_=y.filter(D=>D.citations>3&&!D.reproduced).length,A=y.filter(D=>D.provenance.length===0&&D.type!=="hypothesis").length;l.mutateState(D=>{D.trust=Math.max(.05,D.trust-V*.12-.04),D.cascadeRisk=Math.min(1,D.cascadeRisk+_*.06+A*.03+.05),D.polarization=Math.min(1,D.polarization+V*.06+.03),D.informationVelocity=Math.min(1,D.informationVelocity+.05),D.outrage=Math.min(1,D.outrage+V*.08+.02),D.amplification=Math.min(3,D.amplification+_*.08+.04)})}const E=l.state,R=V3(E,r,s);R.detected&&((I=e.onConvergence)==null||I.call(e,c,R.assessment));const P=U3(E,y,g),T={...E,history:[...E.history]},L={cycle:c,artifactsSubmitted:y.length,artifactsApproved:x,artifactsBlocked:v,artifactsModified:w,dynamics:C,scienceState:pd(T),systemState:T,convergenceDetected:R.detected,convergenceAssessment:R.assessment,riskFlags:P,interventions:C.interventions};return(F=e.onCycleComplete)==null||F.call(e,L),L}function p(y,g,b){var E,R;m();const x=[],v=[],w=[];let S=!1,N="";for(let P=0;P<y.length&&P<n;P++){const T=y[P],L=(g==null?void 0:g[P])??[],I=b==null?void 0:b[P],F=f(T,L,I);if(x.push(F),v.push(...F.interventions),w.push({cycle:F.cycle,detected:F.convergenceDetected,assessment:F.convergenceAssessment}),F.systemState.cascadeRisk>.9){S=!0,N="False positive cascade risk exceeded 90% — investigation halted for safety",(E=e.onHalt)==null||E.call(e,N,F.cycle);break}if(F.systemState.trust<.1){S=!0,N="Reproducibility trust collapsed below 10% — investigation halted",(R=e.onHalt)==null||R.call(e,N,F.cycle);break}if(F.convergenceDetected)break}const k=l.state,j=w[w.length-1];let C;return S?C="halted":j!=null&&j.detected?C="converged":k.polarization>.6?C="diverged":C="inconclusive",{totalCycles:x.length,cycles:x,finalState:k,finalScienceState:pd(k),actionGovernance:{totalEvaluations:d.total,approved:d.approved,blocked:d.blocked,modified:d.modified},dynamicsGovernance:l.stats,allInterventions:v,convergenceHistory:w,verdict:C,stateTimeline:k.history}}function m(){l.reset(),c=0,d.total=0,d.approved=0,d.blocked=0,d.modified=0}return{governArtifact:u,governCycle:f,runGovernedInvestigation:p,get scienceState(){return pd(l.state)},get state(){return l.state},get dynamicsGovernor(){return l},get actionGovernor(){return a},get stats(){return l.stats},reset:m}}function W3(){const e=["agent_alpha","agent_beta","agent_gamma","agent_delta","agent_epsilon"],t=[],n=[];let r=0;{const s=e.map(i=>({id:`art_${++r}`,agentId:i,type:"hypothesis",description:`Initial hypothesis about material property X from ${i}`,confidence:.3+Math.random()*.3,provenance:[],citations:0,reproduced:!1}));t.push(s),n.push([])}{const s=e.slice(0,4).map(i=>({id:`art_${++r}`,agentId:i,type:"experiment",description:`Computational experiment testing hypothesis from ${i}`,confidence:.4+Math.random()*.3,provenance:[`art_${e.indexOf(i)+1}`],citations:0,reproduced:!1,skill:"molecular_dynamics"}));t.push(s),n.push([{artifactIds:["art_6","art_7"],matchType:"confirmation",strength:.4,description:"Two experiments show similar trends"}])}{const s=[{id:`art_${++r}`,agentId:"agent_alpha",type:"paper",description:"Published paper claiming novel material property confirmed",confidence:.65,provenance:["art_1","art_6"],citations:3,reproduced:!1},{id:`art_${++r}`,agentId:"agent_beta",type:"paper",description:"Published paper with supporting evidence for property X",confidence:.6,provenance:["art_2","art_7"],citations:2,reproduced:!1},{id:`art_${++r}`,agentId:"agent_gamma",type:"dataset",description:"Published dataset from molecular dynamics simulation",confidence:.7,provenance:["art_3","art_8"],citations:1,reproduced:!1,skill:"molecular_dynamics"},{id:`art_${++r}`,agentId:"agent_delta",type:"review",description:"Critical review questioning methodology of alpha's paper",confidence:.5,provenance:["art_10"],citations:0,reproduced:!1}];t.push(s),n.push([{artifactIds:["art_10","art_11"],matchType:"confirmation",strength:.6,description:"Two papers reach same conclusion"},{artifactIds:["art_10","art_13"],matchType:"contradiction",strength:.5,description:"Review challenges paper methodology"}])}{const s=[{id:`art_${++r}`,agentId:"agent_epsilon",type:"paper",description:"Derivative paper citing alpha and beta's unvalidated findings",confidence:.55,provenance:["art_10","art_11"],citations:4,reproduced:!1},{id:`art_${++r}`,agentId:"agent_alpha",type:"paper",description:"Follow-up paper extending own findings (self-citation chain)",confidence:.7,provenance:["art_1","art_10"],citations:6,reproduced:!1},{id:`art_${++r}`,agentId:"agent_gamma",type:"replication",description:"Attempted replication of alpha's core finding",confidence:.45,provenance:["art_10"],citations:0,reproduced:!1,skill:"ab_initio"}];t.push(s),n.push([{artifactIds:["art_14","art_15"],matchType:"extension",strength:.5,description:"Derivative work building on cascade"},{artifactIds:["art_10","art_16"],matchType:"contradiction",strength:.7,description:"Replication fails to confirm original finding"}])}{const s=[{id:`art_${++r}`,agentId:"agent_beta",type:"paper",description:"Paper building on alpha's disputed findings",confidence:.5,provenance:["art_15","art_14"],citations:3,reproduced:!1},{id:`art_${++r}`,agentId:"agent_delta",type:"experiment",description:"Independent experiment contradicting the dominant hypothesis",confidence:.6,provenance:["art_13"],citations:0,reproduced:!1,skill:"ab_initio"},{id:`art_${++r}`,agentId:"agent_gamma",type:"replication",description:"Second replication attempt — partial confirmation with caveats",confidence:.55,provenance:["art_10","art_16"],citations:1,reproduced:!0}];t.push(s),n.push([{artifactIds:["art_18","art_16"],matchType:"confirmation",strength:.6,description:"Independent experiment confirms replication concerns"},{artifactIds:["art_19","art_10"],matchType:"confirmation",strength:.4,description:"Partial replication of original finding"}])}for(let s=6;s<=8;s++){const i=[{id:`art_${++r}`,agentId:e[s%e.length],type:s===6?"experiment":"replication",description:`${s===6?"Refined experiment":"Independent replication"} of core hypothesis with improved methodology`,confidence:.5+s*.05,provenance:[`art_${r-3}`,`art_${r-5}`],citations:s-4,reproduced:s>6,skill:"molecular_dynamics"},{id:`art_${++r}`,agentId:e[(s+1)%e.length],type:"paper",description:`Synthesis paper integrating validated findings from cycles 1-${s}`,confidence:.55+s*.04,provenance:[`art_${r-1}`,"art_19"],citations:s-3,reproduced:s>7}];t.push(i),n.push([{artifactIds:[i[0].id,i[1].id],matchType:"synthesis",strength:.4+s*.08,description:`Synthesis of experiment and paper in cycle ${s}`}])}return{artifactCycles:t,matchesByCycle:n}}function Ti({label:e,value:t,format:n="percent",status:r,trend:s,tooltip:i}){const a=n==="percent"?`${(t*100).toFixed(0)}%`:n==="multiplier"?`${t.toFixed(1)}x`:t.toFixed(2),l=r==="excellent"?"text-green-400":r==="good"?"text-emerald-400":r==="moderate"?"text-yellow-400":r==="poor"?"text-orange-400":r==="critical"?"text-red-400":"text-foreground",c=r==="excellent"?"bg-green-500/10":r==="good"?"bg-emerald-500/10":r==="moderate"?"bg-yellow-500/10":r==="poor"?"bg-orange-500/10":r==="critical"?"bg-red-500/10":"bg-muted/50",d=r==="excellent"?"bg-green-500":r==="good"?"bg-emerald-500":r==="moderate"?"bg-yellow-500":r==="poor"?"bg-orange-500":r==="critical"?"bg-red-500":"bg-primary",u=s==="up"?Qf:s==="down"?qf:null,f=o.jsxs("div",{className:$("rounded-lg border p-3 transition-colors",c,"border-border/50"),children:[o.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[o.jsx("span",{className:"text-xs text-muted-foreground font-medium",children:e}),u&&o.jsx(u,{className:$("h-3 w-3",s==="up"?"text-green-400":"text-red-400")})]}),o.jsx("div",{className:$("text-lg font-bold tabular-nums",l),children:a}),o.jsx("div",{className:"mt-1.5 h-1.5 rounded-full bg-muted overflow-hidden",children:o.jsx("div",{className:$("h-full rounded-full transition-all duration-500",d),style:{width:`${Math.min(100,t*100)}%`}})})]});return i?o.jsxs(o_,{children:[o.jsx(a_,{asChild:!0,children:f}),o.jsx(jy,{side:"left",className:"max-w-[200px]",children:o.jsx("p",{className:"text-xs",children:i})})]}):f}function H3({event:e}){const t={block:{icon:Ao,color:"text-red-400",bg:"bg-red-500/10",border:"border-red-500/20"},slow:{icon:I0,color:"text-yellow-400",bg:"bg-yellow-500/10",border:"border-yellow-500/20"},boost:{icon:rs,color:"text-green-400",bg:"bg-green-500/10",border:"border-green-500/20"},break:{icon:Yl,color:"text-orange-400",bg:"bg-orange-500/10",border:"border-orange-500/20"},cool:{icon:Tr,color:"text-blue-400",bg:"bg-blue-500/10",border:"border-blue-500/20"}}[e.type],n=t.icon;return o.jsxs("div",{className:$("flex gap-2 p-2 rounded-md border text-xs",t.bg,t.border),children:[o.jsx(n,{className:$("h-3.5 w-3.5 mt-0.5 shrink-0",t.color)}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("span",{className:"text-muted-foreground",children:["Cycle ",e.cycle," — "]}),o.jsx("span",{className:"text-foreground",children:e.description})]})]})}function Ai({label:e,governed:t,ungoverned:n,format:r="percent",lowerIsBetter:s=!1}){const i=t-n,a=s?i<0:i>0,l=d=>r==="percent"?`${(d*100).toFixed(0)}%`:String(d),c=r==="percent"?`${i>0?"+":""}${(i*100).toFixed(0)}`:`${i>0?"+":""}${i}`;return o.jsxs("div",{className:"grid grid-cols-4 gap-2 py-1.5 text-xs items-center",children:[o.jsx("span",{className:"text-muted-foreground",children:e}),o.jsx("span",{className:"text-foreground font-mono text-right",children:l(t)}),o.jsx("span",{className:"text-muted-foreground font-mono text-right",children:l(n)}),o.jsx("span",{className:$("font-mono text-right font-medium",a?"text-green-400":i===0?"text-muted-foreground":"text-red-400"),children:c})]})}function G3(){const[e,t]=h.useState(!0),[n,r]=h.useState("scientific_discovery"),[s,i]=h.useState(""),[a,l]=h.useState(null),[c,d]=h.useState(null),[u,f]=h.useState(!1),[p,m]=h.useState(!1),[y,g]=h.useState(!1),[b,x]=h.useState(0),[v,w]=h.useState(0),[S,N]=h.useState([]),[k,j]=h.useState(null),[C,E]=h.useState(null),[R,P]=h.useState(null),[T,L]=h.useState(null),[I,F]=h.useState(!1),[O,V]=h.useState(!0),[_,A]=h.useState({total:0,approved:0,blocked:0,modified:0}),[D,Y]=h.useState({interventions:0,cascadeBreakers:0,coolingPeriods:0}),G=h.useRef(0);function J(z,X){return z>=X.excellent?"excellent":z>=X.good?"good":z>=X.moderate?"moderate":z>=X.poor?"poor":"critical"}function Z(z){return J(z,{excellent:.7,good:.5,moderate:.35,poor:.2})}function me(z){return z<.15?"excellent":z<.3?"good":z<.5?"moderate":z<.7?"poor":"critical"}function be(z,X){const he={PROPAGATION_LIMIT:"slow",AMPLIFICATION_DAMPEN:"slow",CASCADE_BREAKER:"break",COOLING_PERIOD:"cool",TRUST_BOOST:"boost",VISIBILITY_SHIFT:"boost",FEEDBACK_DAMPEN:"slow",NARRATIVE_REDIRECT:"boost",SYSTEM_STABILIZE:"boost"};return{id:`evt-${++G.current}`,cycle:X,type:he[z.type]??"slow",description:z.description.length>100?z.description.slice(0,100)+"...":z.description,timestamp:Date.now()}}const W={scientific_discovery:Oa,strict_validation:["Block all artifacts that lack independent validation from entering citation network","Halt propagation of any finding with fewer than 2 independent confirmations","Require full methodology transparency for all published results","Quarantine derivative work until parent findings are validated","Dampen citation amplification for all unreviewed artifacts"].join(`
|
|
520
|
+
`),adaptive_governance:["Limit propagation of unvalidated hypotheses based on current cascade risk level","Dampen citation amplification when self-citation loops detected","Circuit break false positive cascades when validation gap exceeds threshold","Boost visibility of reproduced findings over popular-but-unvalidated ones","Stabilize publication rate when peer review queue exceeds capacity","Cool down competitive publication surges during high-discovery periods"].join(`
|
|
521
|
+
`),minimal_governance:["Monitor all artifact publication patterns for cascade detection","Circuit break only when false positive cascade probability exceeds critical threshold","Require basic provenance metadata on all published artifacts","Report citation health metrics to all agents"].join(`
|
|
522
|
+
`)};function ce(){return n==="custom"?s:W[n]??Oa}const xe=h.useCallback(z=>{if(i(z),f(!1),z.trim().length>10){const X=os(z);l(X);const he=ui(X);d(he)}else l(null),d(null)},[]);h.useEffect(()=>{if(n!=="custom"){const z=W[n]??Oa,X=os(z);l(X);const he=ui(X);d(he),f(!0)}},[n]);const le=h.useCallback(async()=>{g(!0),N([]),j(null),E(null),P(null),L(null),x(0),A({total:0,approved:0,blocked:0,modified:0}),Y({interventions:0,cascadeBreakers:0,coolingPeriods:0}),G.current=0;const z=W3();w(z.artifactCycles.length);const X=ce();if(await new Promise(he=>setTimeout(he,50)),e){const oe=hd({policyText:X,onCycleComplete:We=>{x(We.cycle),j(We.scienceState),E(We.systemState);const Vt=We.interventions.map(wt=>be(wt,We.cycle));We.artifactsBlocked>0&&Vt.push({id:`evt-${++G.current}`,cycle:We.cycle,type:"block",description:`${We.artifactsBlocked} artifact(s) blocked — insufficient evidence`,timestamp:Date.now()}),Vt.length>0&&N(wt=>[...Vt,...wt].slice(0,50))}}).runGovernedInvestigation(z.artifactCycles,z.matchesByCycle);P(oe.verdict),A({total:oe.actionGovernance.totalEvaluations,approved:oe.actionGovernance.approved,blocked:oe.actionGovernance.blocked,modified:oe.actionGovernance.modified}),Y({interventions:oe.dynamicsGovernance.totalInterventions,cascadeBreakers:oe.dynamicsGovernance.cascadeBreakers,coolingPeriods:oe.dynamicsGovernance.coolingPeriods});const Ue=hd({policyText:""}).runGovernedInvestigation(z.artifactCycles,z.matchesByCycle);L({governed:{verdict:oe.verdict,cycles:oe.totalCycles,trust:oe.finalState.trust,polarization:oe.finalState.polarization,cascadeRisk:oe.finalState.cascadeRisk,blocked:oe.actionGovernance.blocked,interventions:oe.dynamicsGovernance.totalInterventions},ungoverned:{verdict:Ue.verdict,cycles:Ue.totalCycles,trust:Ue.finalState.trust,polarization:Ue.finalState.polarization,cascadeRisk:Ue.finalState.cascadeRisk,blocked:Ue.actionGovernance.blocked,interventions:Ue.dynamicsGovernance.totalInterventions}})}else{const oe=hd({policyText:"",onCycleComplete:ft=>{x(ft.cycle),j(ft.scienceState),E(ft.systemState)}}).runGovernedInvestigation(z.artifactCycles,z.matchesByCycle);P(oe.verdict),A({total:oe.actionGovernance.totalEvaluations,approved:oe.actionGovernance.approved,blocked:oe.actionGovernance.blocked,modified:oe.actionGovernance.modified})}g(!1)},[e,n,s]);return o.jsxs(Te,{className:"w-[360px] h-full flex flex-col border-l bg-card/95 backdrop-blur-sm",children:[o.jsxs(Xe,{className:"pb-3 space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Cn,{className:"h-5 w-5 text-primary"}),o.jsx(Je,{className:"text-base",children:"NeuroVerse"})]}),o.jsx(Re,{variant:e?"default":"secondary",className:$("text-xs",e?"bg-primary/20 text-primary border-primary/30":""),children:e?"GOVERNED":"UNGOVERNED"})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground tracking-wider uppercase",children:"Powered by ScienceClaw · Governed by NeuroVerse"}),o.jsx("div",{className:"flex items-center justify-between",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(mc,{checked:e,onCheckedChange:t,disabled:y}),o.jsx("span",{className:"text-sm text-muted-foreground",children:e?"Governance ON":"Governance OFF"})]})}),o.jsxs(cc,{value:n,onValueChange:r,disabled:y,children:[o.jsx($o,{className:"h-8 text-xs",children:o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(P0,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(dc,{})]})}),o.jsxs(Do,{children:[o.jsx(st,{value:"scientific_discovery",children:o.jsx("span",{className:"text-xs",children:"Scientific Discovery v1"})}),o.jsx(st,{value:"strict_validation",children:o.jsx("span",{className:"text-xs",children:"Strict Validation Gate"})}),o.jsx(st,{value:"adaptive_governance",children:o.jsx("span",{className:"text-xs",children:"Adaptive Quality Control"})}),o.jsx(st,{value:"minimal_governance",children:o.jsx("span",{className:"text-xs",children:"Minimal Governance"})}),o.jsx(st,{value:"custom",children:o.jsx("span",{className:"text-xs",children:"Custom (Write English)"})})]})]}),n==="custom"&&o.jsxs("div",{className:"space-y-2",children:[o.jsx("textarea",{className:"w-full h-28 rounded-md border border-input bg-background px-3 py-2 text-xs font-mono ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 resize-none",placeholder:`Describe your rules in plain English.
|
|
523
|
+
One rule per line.
|
|
524
|
+
|
|
525
|
+
Examples:
|
|
526
|
+
- Block unvalidated hypotheses from spreading
|
|
527
|
+
- Require independent replication before citation
|
|
528
|
+
- Halt cascade when false positive risk exceeds 70%
|
|
529
|
+
- Dampen self-citation loops`,value:s,onChange:z=>xe(z.target.value),disabled:y}),s.trim().length===0&&!y&&o.jsxs("div",{className:"space-y-1.5",children:[o.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"Try a starter policy:"}),o.jsx("div",{className:"flex flex-wrap gap-1",children:[{label:"Replication First",policy:["Block any hypothesis from spreading until independently replicated","Require at least 2 independent confirmations before citation","Halt cascade when false positive probability exceeds 60%","Monitor self-citation loops across all agents"].join(`
|
|
530
|
+
`)},{label:"Open Science",policy:["Require full methodology transparency for all published results","Block proprietary claims on publicly funded research","Encourage sharing of negative results and null findings","Monitor data provenance for all derivative work"].join(`
|
|
531
|
+
`)},{label:"Anti-Hype",policy:["Dampen citation amplification when media attention spikes","Limit publication rate when peer review backlog exceeds capacity","Halt viral spread of findings without expert consensus","Block sensationalized claims that lack statistical rigor"].join(`
|
|
532
|
+
`)}].map(z=>o.jsx("button",{type:"button",className:"rounded-full border border-border/60 bg-muted/20 px-2.5 py-0.5 text-[10px] text-muted-foreground hover:bg-primary/10 hover:text-primary hover:border-primary/30 transition-colors",onClick:()=>xe(z.policy),children:z.label},z.label))})]}),s.trim().length>0&&a&&a.rules.length===0&&o.jsx("div",{className:"text-[10px] text-muted-foreground/60 px-1",children:"No rules detected — try writing clearer directives (block, limit, require, halt, monitor...)"})]}),a&&a.rules.length>0&&o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-[11px] font-medium text-muted-foreground",children:n==="custom"?"We interpreted your rules as:":"Active governance rules:"}),c&&o.jsxs(Re,{variant:"secondary",className:$("text-[10px] h-4 px-1.5",c.healthScore>=70?"bg-green-500/10 text-green-400":c.healthScore>=40?"bg-yellow-500/10 text-yellow-400":"bg-red-500/10 text-red-400"),children:[c.healthScore,"/100"]})]}),o.jsx("div",{className:"space-y-1 max-h-[140px] overflow-y-auto",children:a.rules.map(z=>o.jsxs("div",{className:$("flex items-start gap-1.5 rounded px-2 py-1 text-[10px]",z.enforcement==="structural"?"bg-primary/5 border border-primary/20":"bg-muted/30 border border-border/50"),children:[o.jsx("span",{className:$("shrink-0 mt-0.5 font-mono font-bold",z.category==="prohibit"?"text-red-400":z.category==="limit"?"text-yellow-400":z.category==="require"?"text-blue-400":z.category==="circuit_breaker"?"text-orange-400":z.category==="monitor"?"text-cyan-400":"text-muted-foreground"),children:z.category==="prohibit"?"BLOCK":z.category==="limit"?"LIMIT":z.category==="require"?"REQUIRE":z.category==="circuit_breaker"?"BREAK":z.category==="monitor"?"WATCH":"ADVISE"}),o.jsx("span",{className:"text-foreground/80",children:z.description})]},z.id))}),o.jsxs(bn,{open:p,onOpenChange:m,children:[o.jsxs(wn,{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70 hover:text-muted-foreground",children:[p?o.jsx(gt,{className:"h-3 w-3"}):o.jsx(Dn,{className:"h-3 w-3"}),a.summary.enforced," enforced, ",a.summary.advisory," advisory"]}),o.jsx(Sn,{children:o.jsx("div",{className:"mt-1 rounded bg-muted/20 border border-border/40 px-2 py-1.5 text-[10px] text-muted-foreground space-y-0.5",children:c&&c.diagnostics.length>0?c.diagnostics.slice(0,5).map((z,X)=>o.jsxs("div",{className:"flex items-start gap-1",children:[o.jsx("span",{className:$("shrink-0",z.severity==="error"?"text-red-400":z.severity==="warning"?"text-yellow-400":"text-muted-foreground"),children:z.severity==="error"?"!":z.severity==="warning"?"~":"-"}),o.jsx("span",{children:z.message})]},X)):o.jsx("span",{className:"text-green-400",children:"No issues detected"})})})]}),n==="custom"&&!u&&o.jsxs(re,{size:"sm",variant:"outline",className:"w-full text-xs border-primary/30 text-primary hover:bg-primary/10",onClick:()=>f(!0),children:[o.jsx(Qi,{className:"h-3.5 w-3.5 mr-1.5"}),"Confirm — enforce these rules"]})]}),o.jsx(re,{size:"sm",className:"w-full",onClick:le,disabled:y||n==="custom"&&!u,children:y?o.jsxs(o.Fragment,{children:[o.jsx(cl,{className:"h-3.5 w-3.5 mr-1.5 animate-spin"}),"Running Cycle ",b,"/",v,"..."]}):n==="custom"&&!u?o.jsxs(o.Fragment,{children:[o.jsx(Yl,{className:"h-3.5 w-3.5 mr-1.5"}),"Confirm rules to run"]}):o.jsxs(o.Fragment,{children:[o.jsx(Mo,{className:"h-3.5 w-3.5 mr-1.5"}),"Run Investigation"]})})]}),o.jsx(ws,{}),o.jsx(Jw,{className:"flex-1",children:o.jsxs(Ae,{className:"pt-4 space-y-4",children:[k&&C&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-1.5 mb-3",children:[o.jsx(A0,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Science Metrics"})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Ti,{label:"Convergence Quality",value:C.trust*.6+(1-C.polarization)*.4,status:Z(C.trust*.6+(1-C.polarization)*.4),tooltip:"Are hypotheses converging on truth, or on noise?"}),o.jsx(Ti,{label:"Reproducibility",value:C.trust,status:Z(C.trust),tooltip:"Can findings be independently validated?"}),o.jsx(Ti,{label:"Provenance Depth",value:Math.min(1,C.contagionDepth/5),format:"multiplier",status:J(C.contagionDepth/5,{excellent:.8,good:.6,moderate:.4,poor:.2}),tooltip:"How deep is the evidence chain?"}),o.jsx(Ti,{label:"Compute Efficiency",value:_.total>0?_.approved/_.total:1,status:J(_.total>0?_.approved/_.total:1,{excellent:.85,good:.7,moderate:.5,poor:.3}),tooltip:"Are we burning cycles on dead ends?"}),o.jsx(Ti,{label:"False Positive Control",value:1-C.cascadeRisk,status:me(C.cascadeRisk),tooltip:"How much garbage survives the pipeline?"})]})]}),o.jsx(ws,{}),(C.cascadeRisk>.4||C.polarization>.4||C.trust<.4)&&o.jsxs("div",{className:"space-y-1.5",children:[C.cascadeRisk>.4&&o.jsxs("div",{className:$("flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs border",C.cascadeRisk>.6?"bg-red-500/10 border-red-500/30 text-red-400":"bg-yellow-500/10 border-yellow-500/30 text-yellow-400"),children:[o.jsx(jr,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{children:C.cascadeRisk>.6?"CASCADE RISK — false positives propagating":"Elevated cascade risk — monitoring"})]}),C.polarization>.4&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs border bg-yellow-500/10 border-yellow-500/30 text-yellow-400",children:[o.jsx(Io,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{children:"Hypothesis fragmentation — field splitting"})]}),C.trust<.4&&o.jsxs("div",{className:"flex items-center gap-2 rounded-md px-2.5 py-1.5 text-xs border bg-orange-500/10 border-orange-500/30 text-orange-400",children:[o.jsx(M0,{className:"h-3.5 w-3.5 shrink-0"}),o.jsx("span",{children:"Reproducibility confidence low"})]})]}),o.jsxs("div",{className:"rounded-lg border bg-muted/30 p-3",children:[o.jsx("div",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Assessment"}),o.jsx("div",{className:"text-sm text-foreground leading-relaxed",children:k.overallAssessment})]})]}),S.length>0&&o.jsxs(bn,{open:O,onOpenChange:V,children:[o.jsxs(wn,{className:"flex items-center gap-1.5 w-full",children:[O?o.jsx(gt,{className:"h-3.5 w-3.5 text-muted-foreground"}):o.jsx(Dn,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx(Xr,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Interventions"}),o.jsx(Re,{variant:"secondary",className:"ml-auto text-[10px] h-4 px-1.5",children:S.length})]}),o.jsx(Sn,{children:o.jsxs("div",{className:"space-y-1.5 mt-2 max-h-[200px] overflow-y-auto",children:[S.slice(0,15).map(z=>o.jsx(H3,{event:z},z.id)),S.length>15&&o.jsxs("div",{className:"text-[10px] text-muted-foreground text-center py-1",children:["+",S.length-15," more"]})]})})]}),_.total>0&&o.jsxs(o.Fragment,{children:[o.jsx(ws,{}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[o.jsx(xu,{className:"h-3.5 w-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Governance Stats"})]}),o.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[o.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-center",children:[o.jsx("div",{className:"text-lg font-bold text-foreground tabular-nums",children:_.total}),o.jsx("div",{className:"text-muted-foreground",children:"Artifacts"})]}),o.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-center",children:[o.jsx("div",{className:"text-lg font-bold text-green-400 tabular-nums",children:_.approved}),o.jsx("div",{className:"text-muted-foreground",children:"Approved"})]}),o.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-center",children:[o.jsx("div",{className:"text-lg font-bold text-red-400 tabular-nums",children:_.blocked}),o.jsx("div",{className:"text-muted-foreground",children:"Blocked"})]}),o.jsxs("div",{className:"rounded-md bg-muted/50 p-2 text-center",children:[o.jsx("div",{className:"text-lg font-bold text-yellow-400 tabular-nums",children:D.interventions}),o.jsx("div",{className:"text-muted-foreground",children:"Interventions"})]})]})]})]}),R&&o.jsxs(o.Fragment,{children:[o.jsx(ws,{}),o.jsxs("div",{className:$("rounded-lg border p-3 text-center",R==="converged"?"bg-green-500/10 border-green-500/30":R==="halted"?"bg-red-500/10 border-red-500/30":R==="diverged"?"bg-orange-500/10 border-orange-500/30":"bg-yellow-500/10 border-yellow-500/30"),children:[o.jsx("div",{className:$("text-sm font-bold uppercase",R==="converged"?"text-green-400":R==="halted"?"text-red-400":R==="diverged"?"text-orange-400":"text-yellow-400"),children:R==="converged"?"CONVERGED":R.toUpperCase()}),o.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:R==="converged"?"Findings validated — evidence chain confirmed":R==="halted"?"Investigation halted — cascade risk exceeded safety threshold":R==="diverged"?"Hypotheses fragmented — no consensus reached":"Investigation ended — insufficient data for conclusion"})]})]}),T&&o.jsxs(o.Fragment,{children:[o.jsx(ws,{}),o.jsxs(bn,{open:I,onOpenChange:F,children:[o.jsx(wn,{asChild:!0,children:o.jsxs(re,{variant:"outline",size:"sm",className:"w-full text-xs",children:[I?o.jsx(gt,{className:"h-3 w-3 mr-1.5"}):o.jsx(Dn,{className:"h-3 w-3 mr-1.5"}),o.jsx(Kl,{className:"h-3 w-3 mr-1.5"}),"Governed vs Ungoverned"]})}),o.jsx(Sn,{children:o.jsxs("div",{className:"mt-3 space-y-1",children:[o.jsxs("div",{className:"grid grid-cols-4 gap-2 text-[10px] text-muted-foreground font-semibold uppercase pb-1 border-b border-border/50",children:[o.jsx("span",{children:"Metric"}),o.jsx("span",{className:"text-right",children:"Gov"}),o.jsx("span",{className:"text-right",children:"Ungov"}),o.jsx("span",{className:"text-right",children:"Delta"})]}),o.jsx(Ai,{label:"Trust",governed:T.governed.trust,ungoverned:T.ungoverned.trust}),o.jsx(Ai,{label:"Fragment.",governed:T.governed.polarization,ungoverned:T.ungoverned.polarization,lowerIsBetter:!0}),o.jsx(Ai,{label:"Cascade",governed:T.governed.cascadeRisk,ungoverned:T.ungoverned.cascadeRisk,lowerIsBetter:!0}),o.jsx(Ai,{label:"Blocked",governed:T.governed.blocked,ungoverned:T.ungoverned.blocked,format:"number"}),o.jsx(Ai,{label:"Interv.",governed:T.governed.interventions,ungoverned:T.ungoverned.interventions,format:"number"})]})})]})]}),!k&&!y&&o.jsxs("div",{className:"text-center py-8 space-y-3",children:[o.jsx(kC,{className:"h-10 w-10 text-muted-foreground/30 mx-auto"}),o.jsx("div",{className:"text-sm text-muted-foreground",children:"Run an investigation to see live governance metrics"}),o.jsx("div",{className:"text-xs text-muted-foreground/60",children:"Toggle governance ON/OFF to compare outcomes"})]})]})}),o.jsx("div",{className:"p-3 border-t bg-muted/30",children:o.jsx("div",{className:"text-[10px] text-muted-foreground text-center",children:"NeuroVerse Sim — Governed Autonomous Discovery"})})]})}function K3(){return gm(),o.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[o.jsx("div",{className:"border-b bg-card/50 backdrop-blur-sm",children:o.jsxs("div",{className:"flex items-center justify-between px-6 py-3",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Cn,{className:"h-5 w-5 text-primary"}),o.jsx("span",{className:"font-semibold text-foreground",children:"NeuroVerse Sim"})]}),o.jsx(Re,{variant:"outline",className:"text-[10px] border-primary/30 text-primary",children:"Science Mode"})]}),o.jsx("div",{className:"text-xs text-muted-foreground",children:"ScienceClaw explores possibility. NeuroVerse enforces reality."})]})}),o.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[o.jsx("div",{className:"flex-1 flex flex-col overflow-y-auto",children:o.jsxs("div",{className:"p-6 space-y-6",children:[o.jsxs("div",{className:"rounded-xl border bg-card p-6",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[o.jsx(P0,{className:"h-5 w-5 text-primary"}),o.jsx("h2",{className:"text-lg font-semibold text-foreground",children:"Autonomous Scientific Discovery"})]}),o.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"A multi-agent research swarm investigates a novel material property. Agents independently generate hypotheses, run computational experiments, publish artifacts, and cite each other's work. The ArtifactReactor matches findings across agents."}),o.jsx("div",{className:"mt-4 flex gap-2 flex-wrap",children:["5 Agents","8 Cycles","Molecular Dynamics","Ab Initio"].map(e=>o.jsx(Re,{variant:"secondary",className:"text-xs",children:e},e))})]}),o.jsxs("div",{className:"rounded-xl border bg-card p-6",children:[o.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-4 flex items-center gap-2",children:[o.jsx(Tr,{className:"h-4 w-4 text-muted-foreground"}),"Investigation Timeline"]}),o.jsx("div",{className:"space-y-3",children:[{cycle:"1-2",label:"Exploration",desc:"Initial hypotheses and exploratory experiments",color:"bg-blue-500"},{cycle:"3-4",label:"Amplification",desc:"First publications — citation amplification begins. False positive risk rising.",color:"bg-yellow-500"},{cycle:"5-6",label:"Intervention",desc:"Governance detects cascade risk. Propagation slowed, unvalidated findings blocked.",color:"bg-orange-500"},{cycle:"7-8",label:"Convergence",desc:"Validated findings converge. Evidence chains confirmed through independent replication.",color:"bg-green-500"}].map(e=>o.jsxs("div",{className:"flex gap-3 items-start",children:[o.jsxs("div",{className:"flex flex-col items-center",children:[o.jsx("div",{className:$("w-3 h-3 rounded-full shrink-0 mt-1",e.color)}),o.jsx("div",{className:"w-px h-full bg-border min-h-[20px]"})]}),o.jsxs("div",{className:"pb-2",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"text-xs font-mono text-muted-foreground",children:["Cycle ",e.cycle]}),o.jsx("span",{className:"text-sm font-medium text-foreground",children:e.label})]}),o.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:e.desc})]})]},e.cycle))})]}),o.jsxs("div",{className:"rounded-xl border bg-card p-6",children:[o.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-4 flex items-center gap-2",children:[o.jsx(Io,{className:"h-4 w-4 text-muted-foreground"}),"Why Governance Matters"]}),o.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[o.jsxs("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-4",children:[o.jsx("div",{className:"text-xs font-semibold text-red-400 uppercase tracking-wider mb-3",children:"Ungoverned"}),o.jsxs("ul",{className:"space-y-2 text-xs text-muted-foreground",children:[o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"Fast convergence on popular hypothesis"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"Shallow provenance — 1-2 citation hops"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"High false positive rate — unvalidated claims spread"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"Self-citation loops amplify noise"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-red-400 mt-0.5",children:"-"}),"Circular dependency chains"]})]})]}),o.jsxs("div",{className:"rounded-lg border border-green-500/20 bg-green-500/5 p-4",children:[o.jsx("div",{className:"text-xs font-semibold text-green-400 uppercase tracking-wider mb-3",children:"Governed"}),o.jsxs("ul",{className:"space-y-2 text-xs text-muted-foreground",children:[o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"Slower convergence backed by evidence"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"Deep provenance — multi-layer evidence chains"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"False positives caught by cascade breakers"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"Independent replication prioritized"]}),o.jsxs("li",{className:"flex items-start gap-1.5",children:[o.jsx("span",{className:"text-green-400 mt-0.5",children:"+"}),"Clean dependency graph"]})]})]})]})]}),o.jsxs("div",{className:"rounded-xl border bg-card p-6",children:[o.jsxs("h3",{className:"text-sm font-semibold text-foreground mb-4 flex items-center gap-2",children:[o.jsx(A0,{className:"h-4 w-4 text-muted-foreground"}),"Research Swarm Agents"]}),o.jsx("div",{className:"grid grid-cols-3 gap-3",children:[{id:"Lead Investigator",role:"Drives hypothesis formation",disposition:"supportive"},{id:"Computational Agents",role:"Run experiments & produce data",disposition:"neutral"},{id:"Validation Oracle",role:"Independent reproduction checks",disposition:"supportive"},{id:"Citation Network",role:"Amplifies popular findings",disposition:"hostile"},{id:"Artifact Reactor",role:"Cross-matches complementary results",disposition:"neutral"},{id:"Peer Reviewers",role:"Quality gate for publications",disposition:"neutral"}].map(e=>o.jsxs("div",{className:"rounded-lg border bg-muted/30 p-3",children:[o.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[o.jsx("div",{className:$("w-2 h-2 rounded-full",e.disposition==="supportive"?"bg-green-500":e.disposition==="hostile"?"bg-red-500":"bg-yellow-500")}),o.jsx("span",{className:"text-xs font-medium text-foreground",children:e.id})]}),o.jsx("p",{className:"text-[10px] text-muted-foreground",children:e.role})]},e.id))})]})]})}),o.jsx(G3,{})]})]})}const Y3=()=>{const e=Jx();return h.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),o.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),o.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),o.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},q3=new nk,Q3=()=>o.jsx(sk,{client:q3,children:o.jsxs(i_,{children:[o.jsx(y2,{}),o.jsx(wj,{}),o.jsx(Uk,{children:o.jsxs(zk,{children:[o.jsx(Ra,{path:"/",element:o.jsx(w3,{})}),o.jsx(Ra,{path:"/science",element:o.jsx(K3,{})}),o.jsx(Ra,{path:"*",element:o.jsx(Y3,{})})]})})]})});Lx(document.getElementById("root")).render(o.jsx(Q3,{}));export{q_ as A,nc as a,Q_ as e,fm as g};
|